Can run cleanup without using recycle bin and add dry run option
[TortoiseGit.git] / src / TortoiseProc / PushDlg.cpp
blobdf4ebc1c2627e2a166b7a4c9eb0b7d5b672fa206
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2008-2012 - TortoiseGit
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.
20 // PushDlg.cpp : implementation file
23 #include "stdafx.h"
24 #include "TortoiseProc.h"
25 #include "PushDlg.h"
27 #include "Git.h"
28 #include "registry.h"
29 #include "AppUtils.h"
30 #include "LogDlg.h"
31 #include "BrowseRefsDlg.h"
32 #include "RefLogDlg.h"
33 #include "MessageBox.h"
35 // CPushDlg dialog
37 IMPLEMENT_DYNAMIC(CPushDlg, CHorizontalResizableStandAloneDialog)
39 CPushDlg::CPushDlg(CWnd* pParent /*=NULL*/)
40 : CHorizontalResizableStandAloneDialog(CPushDlg::IDD, pParent)
41 , m_bPushAllBranches(FALSE)
42 , m_bForce(FALSE)
43 , m_bPack(FALSE)
44 , m_bTags(FALSE)
45 , m_bAutoLoad(FALSE)
46 , m_bPushAllRemotes(FALSE)
47 , m_bSetPushBranch(FALSE)
48 , m_bSetPushRemote(FALSE)
49 , m_bSetUpstream(FALSE)
50 , m_RecurseSubmodules(0)
52 m_bAutoLoad = CAppUtils::IsSSHPutty();
55 CPushDlg::~CPushDlg()
59 void CPushDlg::DoDataExchange(CDataExchange* pDX)
61 CHorizontalResizableStandAloneDialog::DoDataExchange(pDX);
62 DDX_Control(pDX, IDC_BRANCH_REMOTE, this->m_BranchRemote);
63 DDX_Control(pDX, IDC_BRANCH_SOURCE, this->m_BranchSource);
64 DDX_Control(pDX, IDC_REMOTE, this->m_Remote);
65 DDX_Control(pDX, IDC_URL, this->m_RemoteURL);
66 DDX_Control(pDX, IDC_BUTTON_BROWSE_SOURCE_BRANCH, m_BrowseLocalRef);
67 DDX_Control(pDX, IDC_COMBOBOX_RECURSE_SUBMODULES, m_RecurseSubmodulesCombo);
68 DDX_Check(pDX,IDC_FORCE,this->m_bForce);
69 DDX_Check(pDX,IDC_PUSHALL,this->m_bPushAllBranches);
70 DDX_Check(pDX,IDC_PACK,this->m_bPack);
71 DDX_Check(pDX,IDC_TAGS,this->m_bTags);
72 DDX_Check(pDX,IDC_PUTTYKEY_AUTOLOAD,this->m_bAutoLoad);
73 DDX_Check(pDX, IDC_PROC_PUSH_SET_PUSHREMOTE, m_bSetPushRemote);
74 DDX_Check(pDX, IDC_PROC_PUSH_SET_PUSHBRANCH, m_bSetPushBranch);
75 DDX_Check(pDX, IDC_PROC_PUSH_SET_UPSTREAM, m_bSetUpstream);
78 BEGIN_MESSAGE_MAP(CPushDlg, CHorizontalResizableStandAloneDialog)
79 ON_BN_CLICKED(IDC_RD_REMOTE, &CPushDlg::OnBnClickedRd)
80 ON_BN_CLICKED(IDC_RD_URL, &CPushDlg::OnBnClickedRd)
81 ON_CBN_SELCHANGE(IDC_BRANCH_SOURCE, &CPushDlg::OnCbnSelchangeBranchSource)
82 ON_CBN_SELCHANGE(IDC_REMOTE, &CPushDlg::EnDisablePushRemoteArchiveBranch)
83 ON_BN_CLICKED(IDOK, &CPushDlg::OnBnClickedOk)
84 ON_BN_CLICKED(IDC_REMOTE_MANAGE, &CPushDlg::OnBnClickedRemoteManage)
85 ON_BN_CLICKED(IDC_BUTTON_BROWSE_SOURCE_BRANCH, &CPushDlg::OnBnClickedButtonBrowseSourceBranch)
86 ON_BN_CLICKED(IDC_BUTTON_BROWSE_DEST_BRANCH, &CPushDlg::OnBnClickedButtonBrowseDestBranch)
87 ON_BN_CLICKED(IDC_PUSHALL, &CPushDlg::OnBnClickedPushall)
88 ON_BN_CLICKED(IDC_PROC_PUSH_SET_UPSTREAM, &CPushDlg::OnBnClickedProcPushSetUpstream)
89 ON_BN_CLICKED(IDC_PROC_PUSH_SET_PUSHREMOTE, &CPushDlg::OnBnClickedProcPushSetPushremote)
90 ON_BN_CLICKED(IDC_PROC_PUSH_SET_PUSHBRANCH, &CPushDlg::OnBnClickedProcPushSetPushremote)
91 END_MESSAGE_MAP()
93 BOOL CPushDlg::OnInitDialog()
95 CHorizontalResizableStandAloneDialog::OnInitDialog();
96 CAppUtils::MarkWindowAsUnpinnable(m_hWnd);
98 AddAnchor(IDOK,BOTTOM_RIGHT);
99 AddAnchor(IDCANCEL,BOTTOM_RIGHT);
100 AddAnchor(IDC_BRANCH_GROUP, TOP_LEFT,TOP_RIGHT);
101 AddAnchor(IDC_STATIC_REMOTE, TOP_LEFT);
102 AddAnchor(IDC_STATIC_SOURCE, TOP_LEFT);
104 AddAnchor(IDC_PUSHALL, TOP_LEFT);
105 AddAnchor(IDC_BRANCH_REMOTE, TOP_LEFT, TOP_RIGHT);
106 AddAnchor(IDC_BUTTON_BROWSE_DEST_BRANCH, TOP_RIGHT);
107 AddAnchor(IDC_BRANCH_SOURCE, TOP_LEFT, TOP_RIGHT);
108 AddAnchor(IDC_BUTTON_BROWSE_SOURCE_BRANCH, TOP_RIGHT);
110 AddAnchor(IDC_URL_GROUP, TOP_LEFT,TOP_RIGHT);
111 AddAnchor(IDC_RD_REMOTE, TOP_LEFT);
112 AddAnchor(IDC_RD_URL, TOP_LEFT);
114 AddAnchor(IDC_REMOTE, TOP_LEFT, TOP_RIGHT);
116 AddAnchor(IDC_URL, TOP_LEFT,TOP_RIGHT);
118 AddAnchor(IDC_OPTION_GROUP, TOP_LEFT,TOP_RIGHT);
120 AddAnchor(IDC_FORCE, TOP_LEFT);
121 AddAnchor(IDC_PACK, TOP_LEFT);
122 AddAnchor(IDC_TAGS, TOP_LEFT);
123 AddAnchor(IDC_PUTTYKEY_AUTOLOAD,TOP_LEFT);
124 AddAnchor(IDC_PROC_PUSH_SET_PUSHBRANCH, TOP_LEFT);
125 AddAnchor(IDC_PROC_PUSH_SET_PUSHREMOTE, TOP_LEFT);
126 AddAnchor(IDC_PROC_PUSH_SET_UPSTREAM, TOP_LEFT);
127 AddAnchor(IDC_STATIC_RECURSE_SUBMODULES, TOP_LEFT);
128 AddAnchor(IDC_COMBOBOX_RECURSE_SUBMODULES, TOP_LEFT);
130 AddAnchor(IDC_REMOTE_MANAGE,TOP_RIGHT);
131 AddAnchor(IDHELP, BOTTOM_RIGHT);
133 AddOthersToAnchor();
135 AdjustControlSize(IDC_RD_REMOTE);
136 AdjustControlSize(IDC_RD_URL);
137 AdjustControlSize(IDC_PUSHALL);
138 AdjustControlSize(IDC_FORCE);
139 AdjustControlSize(IDC_PACK);
140 AdjustControlSize(IDC_TAGS);
141 AdjustControlSize(IDC_PUTTYKEY_AUTOLOAD);
142 AdjustControlSize(IDC_PROC_PUSH_SET_PUSHBRANCH);
143 AdjustControlSize(IDC_PROC_PUSH_SET_PUSHREMOTE);
144 AdjustControlSize(IDC_PROC_PUSH_SET_UPSTREAM);
145 AdjustControlSize(IDC_STATIC_RECURSE_SUBMODULES);
147 CString sWindowTitle;
148 GetWindowText(sWindowTitle);
149 CAppUtils::SetWindowTitle(m_hWnd, g_Git.m_CurrentDir, sWindowTitle);
151 this->GetDlgItem(IDC_PUTTYKEY_AUTOLOAD)->EnableWindow(CAppUtils::IsSSHPutty());
153 EnableSaveRestore(_T("PushDlg"));
155 m_RemoteURL.SetURLHistory(TRUE);
157 CString WorkingDir=g_Git.m_CurrentDir;
158 WorkingDir.Replace(_T(':'),_T('_'));
159 m_RemoteURL.LoadHistory(CString(_T("Software\\TortoiseGit\\History\\PushURLS\\"))+WorkingDir, _T("url"));
160 CString clippath=CAppUtils::GetClipboardLink();
161 if(clippath.IsEmpty())
162 m_RemoteURL.SetCurSel(0);
163 else
164 m_RemoteURL.SetWindowText(clippath);
166 m_RemoteURL.EnableWindow(FALSE);
167 CheckRadioButton(IDC_RD_REMOTE,IDC_RD_URL,IDC_RD_REMOTE);
170 this->m_regAutoLoad = CRegDWORD(CString(_T("Software\\TortoiseGit\\History\\PushDlgAutoLoad\\"))+WorkingDir,
171 m_bAutoLoad);
172 m_bAutoLoad = this->m_regAutoLoad;
173 if(!CAppUtils::IsSSHPutty())
174 m_bAutoLoad = false;
176 m_BrowseLocalRef.m_bRightArrow = TRUE;
177 m_BrowseLocalRef.m_bDefaultClick = FALSE;
178 m_BrowseLocalRef.m_bMarkDefault = FALSE;
179 m_BrowseLocalRef.AddEntry(CString(MAKEINTRESOURCE(IDS_REFBROWSE)));
180 m_BrowseLocalRef.AddEntry(CString(MAKEINTRESOURCE(IDS_LOG)));
181 m_BrowseLocalRef.AddEntry(CString(MAKEINTRESOURCE(IDS_REFLOG)));
183 m_tooltips.Create(this);
184 m_tooltips.AddTool(IDC_PROC_PUSH_SET_PUSHBRANCH, IDS_PUSHDLG_PUSHBRANCH_TT);
185 m_tooltips.AddTool(IDC_PROC_PUSH_SET_PUSHREMOTE, IDS_PUSHDLG_PUSHREMOTE_TT);
187 m_RecurseSubmodulesCombo.AddString(CString(MAKEINTRESOURCE(IDS_NONE)));
188 m_RecurseSubmodulesCombo.AddString(CString(MAKEINTRESOURCE(IDS_RECURSE_SUBMODULES_CHECK)));
189 m_RecurseSubmodulesCombo.AddString(CString(MAKEINTRESOURCE(IDS_RECURSE_SUBMODULES_ONDEMAND)));
190 m_RecurseSubmodulesCombo.SetCurSel(m_RecurseSubmodules);
192 Refresh();
194 this->UpdateData(false);
195 return TRUE;
198 void CPushDlg::Refresh()
200 CString WorkingDir=g_Git.m_CurrentDir;
201 WorkingDir.Replace(_T(':'),_T('_'));
203 CRegString remote(CString(_T("Software\\TortoiseGit\\History\\PushRemote\\")+WorkingDir));
204 m_RemoteReg = remote;
205 int sel = -1;
207 STRING_VECTOR list;
208 m_Remote.Reset();
210 list.push_back(CString(MAKEINTRESOURCE(IDS_PROC_PUSHFETCH_ALLREMOTES)));
211 if(!g_Git.GetRemoteList(list))
213 if (list.size() <= 2)
214 list.erase(list.begin());
216 for(unsigned int i=0;i<list.size();i++)
218 m_Remote.AddString(list[i]);
219 if(list[i] == remote)
220 sel = i;
223 // if the last selected remote was "- All -" and "- All -" is still in the list -> select it
224 if (list.size() > 1 && remote == CString(MAKEINTRESOURCE(IDS_PROC_PUSHFETCH_ALLREMOTES)))
225 sel = 0;
226 m_Remote.SetCurSel(sel);
228 int current=0;
229 list.clear();
230 m_BranchSource.Reset();
231 m_BranchSource.AddString(_T(" ")); // empty string does not work, for removal of remote branches/tags
232 m_BranchSource.SetMaxHistoryItems(0x7FFFFFFF);
233 if(!g_Git.GetBranchList(list,&current))
235 for(unsigned int i=0;i<list.size();i++)
236 m_BranchSource.AddString(list[i]);
237 current++; // shift for " "
239 if (wcsncmp(m_BranchSourceName, _T("refs/"), 5) == 0)
240 m_BranchSourceName = m_BranchSourceName.Mid(5);
241 if (wcsncmp(m_BranchSourceName, _T("heads/"), 6) == 0)
243 m_BranchSourceName = m_BranchSourceName.Mid(6);
244 m_BranchSource.SetCurSel(m_BranchSource.FindStringExact(-1, m_BranchSourceName));
246 else if (wcsncmp(m_BranchSourceName, _T("remotes/"), 8) == 0)
247 m_BranchSource.SetCurSel(m_BranchSource.FindStringExact(-1, m_BranchSourceName));
248 else
249 m_BranchSource.SetCurSel(current);
251 GetRemoteBranch(m_BranchSource.GetString());
253 this->GetDlgItem(IDOK)->EnableWindow(m_BranchSource.GetCount() != 0);
256 void CPushDlg::GetRemoteBranch(CString currentBranch)
258 CString WorkingDir=g_Git.m_CurrentDir;
259 WorkingDir.Replace(_T(':'), _T('_'));
261 if (currentBranch.IsEmpty())
263 EnDisablePushRemoteArchiveBranch();
264 return;
267 CString configName;
269 configName.Format(L"branch.%s.pushremote", currentBranch);
270 CString pushRemote = g_Git.GetConfigValue(configName);
271 if( pushRemote.IsEmpty() )
273 configName.Format(L"branch.%s.remote", currentBranch);
274 pushRemote = g_Git.GetConfigValue(configName);
277 CRegString remote(CString(_T("Software\\TortoiseGit\\History\\PushRemote\\")+WorkingDir));
279 if (!pushRemote.IsEmpty())
281 remote = pushRemote;
282 // if a pushRemote exists, select it
283 for (int i = 0; i < m_Remote.GetCount(); i++)
285 CString str;
286 int n = m_Remote.GetLBTextLen(i);
287 m_Remote.GetLBText(i, str.GetBuffer(n));
288 str.ReleaseBuffer();
289 if (str == pushRemote)
291 m_Remote.SetCurSel(i);
292 break;
296 // select the only remote if only one exists
297 else if (m_Remote.GetCount() == 1)
298 m_Remote.SetCurSel(0);
299 // select no remote if no push-remote is specified AND push to all remotes is not selected
300 else if (!(m_Remote.GetCount() > 1 && m_Remote.GetCurSel() == 0))
302 m_Remote.SetCurSel(-1);
305 //Select pull-branch from current branch
306 configName.Format(L"branch.%s.pushbranch", currentBranch);
307 CString pushBranch = CGit::StripRefName(g_Git.GetConfigValue(configName));
308 if( pushBranch.IsEmpty() )
310 configName.Format(L"branch.%s.merge", currentBranch);
311 pushBranch = CGit::StripRefName(g_Git.GetConfigValue(configName));
314 m_BranchRemote.LoadHistory(CString(_T("Software\\TortoiseGit\\History\\RemoteBranch\\"))+WorkingDir, _T("branch"));
315 if( !pushBranch.IsEmpty() )
316 m_BranchRemote.AddString(pushBranch);
318 EnDisablePushRemoteArchiveBranch();
321 void CPushDlg::EnDisablePushRemoteArchiveBranch()
323 if ((m_Remote.GetCount() > 1 && m_Remote.GetCurSel() == 0) || m_bPushAllBranches || GetCheckedRadioButton(IDC_RD_REMOTE,IDC_RD_URL) == IDC_RD_URL || m_BranchSource.GetString().Trim().IsEmpty())
325 DialogEnableWindow(IDC_PROC_PUSH_SET_PUSHBRANCH, FALSE);
326 DialogEnableWindow(IDC_PROC_PUSH_SET_PUSHREMOTE, FALSE);
327 bool enableUpstream = (GetCheckedRadioButton(IDC_RD_REMOTE, IDC_RD_URL) != IDC_RD_URL && (!m_BranchSource.GetString().Trim().IsEmpty() || m_bPushAllBranches));
328 DialogEnableWindow(IDC_PROC_PUSH_SET_UPSTREAM, enableUpstream);
329 if (m_bSetUpstream && !enableUpstream)
330 m_bSetUpstream = FALSE;
331 m_bSetPushRemote = FALSE;
332 m_bSetPushBranch = FALSE;
333 UpdateData(FALSE);
335 else
337 DialogEnableWindow(IDC_PROC_PUSH_SET_UPSTREAM, TRUE);
338 DialogEnableWindow(IDC_PROC_PUSH_SET_PUSHBRANCH, !m_bSetUpstream);
339 DialogEnableWindow(IDC_PROC_PUSH_SET_PUSHREMOTE, !m_bSetUpstream);
343 // CPushDlg message handlers
345 void CPushDlg::OnBnClickedRd()
347 if( GetCheckedRadioButton(IDC_RD_REMOTE,IDC_RD_URL) == IDC_RD_REMOTE)
349 m_Remote.EnableWindow(TRUE);
350 GetDlgItem(IDC_REMOTE_MANAGE)->EnableWindow(TRUE);
351 m_RemoteURL.EnableWindow(FALSE);
353 if( GetCheckedRadioButton(IDC_RD_REMOTE,IDC_RD_URL) == IDC_RD_URL)
355 m_Remote.EnableWindow(FALSE);
356 GetDlgItem(IDC_REMOTE_MANAGE)->EnableWindow(FALSE);
357 m_RemoteURL.EnableWindow(TRUE);
359 EnDisablePushRemoteArchiveBranch();
363 void CPushDlg::OnCbnSelchangeBranchSource()
365 GetRemoteBranch(m_BranchSource.GetString());
368 void CPushDlg::OnBnClickedOk()
370 CHorizontalResizableStandAloneDialog::UpdateData(TRUE);
372 if( GetCheckedRadioButton(IDC_RD_REMOTE,IDC_RD_URL) == IDC_RD_REMOTE)
374 m_URL=m_Remote.GetString();
375 if (m_URL.IsEmpty())
377 CMessageBox::Show(NULL, IDS_PROC_GITCONFIG_REMOTEEMPTY, IDS_APPNAME, MB_OK);
378 return;
380 m_bPushAllRemotes = (m_Remote.GetCurSel() == 0 && m_Remote.GetCount() > 1);
382 if( GetCheckedRadioButton(IDC_RD_REMOTE,IDC_RD_URL) == IDC_RD_URL)
384 m_URL=m_RemoteURL.GetString();
387 if (!m_bPushAllBranches)
389 this->m_BranchRemoteName=m_BranchRemote.GetString().Trim();
390 this->m_BranchSourceName=m_BranchSource.GetString().Trim();
392 if (m_BranchSourceName.IsEmpty() && m_BranchRemoteName.IsEmpty())
394 if (CMessageBox::Show(NULL, IDS_B_T_BOTHEMPTY, IDS_APPNAME, MB_ICONQUESTION | MB_YESNO) == IDNO)
395 return;
397 if (m_BranchSourceName.IsEmpty() && !m_BranchRemoteName.IsEmpty())
399 if (CMessageBox::Show(NULL, IDS_B_T_LOCALEMPTY, IDS_APPNAME, MB_ICONEXCLAMATION | MB_YESNO) == IDNO)
400 return;
402 else if (!m_BranchRemoteName.IsEmpty() && !g_Git.IsBranchNameValid(this->m_BranchRemoteName))
404 CMessageBox::Show(NULL, IDS_B_T_INVALID, IDS_APPNAME, MB_OK);
405 return;
407 else if (!m_BranchSourceName.IsEmpty() && !g_Git.IsBranchTagNameUnique(m_BranchSourceName))
409 CMessageBox::Show(NULL, IDS_B_T_NOT_UNIQUE, IDS_APPNAME, MB_OK | MB_ICONEXCLAMATION);
410 return;
412 else
414 // do not store branch names on removal
415 this->m_RemoteURL.SaveHistory();
416 this->m_BranchRemote.SaveHistory();
417 m_RemoteReg = m_Remote.GetString();
419 if (!m_BranchSourceName.IsEmpty())
421 CString configName;
422 if (m_bSetPushBranch)
424 configName.Format(L"branch.%s.pushbranch", m_BranchSourceName);
425 if (!m_BranchRemoteName.IsEmpty())
426 g_Git.SetConfigValue(configName, m_BranchRemoteName);
427 else
428 g_Git.UnsetConfigValue(configName);
430 if (m_bSetPushRemote)
432 configName.Format(L"branch.%s.pushremote", m_BranchSourceName);
433 if (!m_URL.IsEmpty())
434 g_Git.SetConfigValue(configName, m_URL);
435 else
436 g_Git.UnsetConfigValue(configName);
442 this->m_regAutoLoad = m_bAutoLoad ;
443 m_RecurseSubmodules = m_RecurseSubmodulesCombo.GetCurSel();
445 CHorizontalResizableStandAloneDialog::OnOK();
448 void CPushDlg::OnBnClickedRemoteManage()
450 CAppUtils::LaunchRemoteSetting();
451 Refresh();
454 void CPushDlg::OnBnClickedButtonBrowseSourceBranch()
456 switch (m_BrowseLocalRef.GetCurrentEntry())
458 case 0: /* Browse Refence*/
460 if(CBrowseRefsDlg::PickRefForCombo(&m_BranchSource, gPickRef_Head))
461 OnCbnSelchangeBranchSource();
463 break;
465 case 1: /* Log */
467 CLogDlg dlg;
468 dlg.SetSelect(true);
469 if(dlg.DoModal() == IDOK)
471 if (dlg.GetSelectedHash().IsEmpty())
472 return;
474 m_BranchSource.SetWindowText(dlg.GetSelectedHash());
475 OnCbnSelchangeBranchSource();
478 break;
480 case 2: /*RefLog*/
482 CRefLogDlg dlg;
483 if(dlg.DoModal() == IDOK)
485 m_BranchSource.SetWindowText(dlg.m_SelectedHash);
486 OnCbnSelchangeBranchSource();
489 break;
493 void CPushDlg::OnBnClickedButtonBrowseDestBranch()
495 CString remoteBranchName;
496 CString remoteName;
497 m_BranchRemote.GetWindowText(remoteBranchName);
498 remoteName = m_Remote.GetString();
499 remoteBranchName = remoteName + '/' + remoteBranchName;
500 remoteBranchName = CBrowseRefsDlg::PickRef(false, remoteBranchName, gPickRef_Remote);
501 if(remoteBranchName.IsEmpty())
502 return; //Canceled
503 remoteBranchName = remoteBranchName.Mid(13);//Strip 'refs/remotes/'
504 int slashPlace = remoteBranchName.Find('/');
505 remoteName = remoteBranchName.Left(slashPlace);
506 remoteBranchName = remoteBranchName.Mid(slashPlace + 1); //Strip remote name (for example 'origin/')
508 //Select remote
509 int remoteSel = m_Remote.FindStringExact(0,remoteName);
510 if(remoteSel >= 0)
511 m_Remote.SetCurSel(remoteSel);
513 //Select branch
514 m_BranchRemote.AddString(remoteBranchName, 0);
517 BOOL CPushDlg::PreTranslateMessage(MSG* pMsg)
519 m_tooltips.RelayEvent(pMsg);
521 if (pMsg->message == WM_KEYDOWN)
523 switch (pMsg->wParam)
525 case VK_F5:
527 Refresh();
529 break;
533 return CHorizontalResizableStandAloneDialog::PreTranslateMessage(pMsg);
536 void CPushDlg::OnBnClickedPushall()
538 this->UpdateData();
539 this->GetDlgItem(IDC_BRANCH_REMOTE)->EnableWindow(!m_bPushAllBranches);
540 this->GetDlgItem(IDC_BRANCH_SOURCE)->EnableWindow(!m_bPushAllBranches);
541 this->GetDlgItem(IDC_BUTTON_BROWSE_SOURCE_BRANCH)->EnableWindow(!m_bPushAllBranches);
542 this->GetDlgItem(IDC_BUTTON_BROWSE_DEST_BRANCH)->EnableWindow(!m_bPushAllBranches);
543 this->GetDlgItem(IDC_TAGS)->EnableWindow(!m_bPushAllBranches);
544 if (m_bTags && m_bPushAllBranches)
546 m_bTags = FALSE;
547 UpdateData(FALSE);
549 EnDisablePushRemoteArchiveBranch();
552 void CPushDlg::OnBnClickedProcPushSetUpstream()
554 UpdateData();
555 this->GetDlgItem(IDC_PROC_PUSH_SET_PUSHREMOTE)->EnableWindow(!m_bSetUpstream);
556 this->GetDlgItem(IDC_PROC_PUSH_SET_PUSHBRANCH)->EnableWindow(!m_bSetUpstream);
557 m_bSetPushBranch = FALSE;
558 m_bSetPushRemote = FALSE;
559 UpdateData(FALSE);
562 void CPushDlg::OnBnClickedProcPushSetPushremote()
564 UpdateData();
565 this->GetDlgItem(IDC_PROC_PUSH_SET_UPSTREAM)->EnableWindow(!(m_bSetPushBranch || m_bSetPushRemote));
566 m_bSetUpstream = FALSE;
567 UpdateData(FALSE);