Use processdlg to format patch.
[TortoiseGit.git] / src / TortoiseProc / Commands / UnLockCommand.cpp
blob1099eeae86ed50aa2f13079abdcec8b0c4a67d03
1 // TortoiseSVN - a Windows shell extension for easy version control
3 // Copyright (C) 2007-2008 - TortoiseSVN
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 #include "StdAfx.h"
20 #include "UnLockCommand.h"
22 #include "UnlockDlg.h"
23 #include "SVNProgressDlg.h"
25 bool UnLockCommand::Execute()
27 bool bRet = false;
28 CUnlockDlg unlockDlg;
29 unlockDlg.m_pathList = pathList;
30 if (unlockDlg.DoModal()==IDOK)
32 if (unlockDlg.m_pathList.GetCount() != 0)
34 CSVNProgressDlg progDlg;
35 progDlg.SetCommand(CSVNProgressDlg::SVNProgress_Unlock);
36 progDlg.SetOptions(parser.HasKey(_T("force")) ? ProgOptLockForce : ProgOptNone);
37 progDlg.SetPathList(unlockDlg.m_pathList);
38 if (parser.HasVal(_T("closeonend")))
39 progDlg.SetAutoClose(parser.GetLongVal(_T("closeonend")));
40 progDlg.DoModal();
41 bRet = !progDlg.DidErrorsOccur();
44 return bRet;