Fixed issue #1499: Allow to show log if current HEAD and selected ref is orphan branc...
[TortoiseGit.git] / src / TortoiseProc / PushDlg.cpp
blob7a936dbf17df49cb15882cffe4722980dd1b3984
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)
51 m_bAutoLoad = CAppUtils::IsSSHPutty();
54 CPushDlg::~CPushDlg()
58 void CPushDlg::DoDataExchange(CDataExchange* pDX)
60 CHorizontalResizableStandAloneDialog::DoDataExchange(pDX);
61 DDX_Control(pDX, IDC_BRANCH_REMOTE, this->m_BranchRemote);
62 DDX_Control(pDX, IDC_BRANCH_SOURCE, this->m_BranchSource);
63 DDX_Control(pDX, IDC_REMOTE, this->m_Remote);
64 DDX_Control(pDX, IDC_URL, this->m_RemoteURL);
65 DDX_Control(pDX, IDC_BUTTON_BROWSE_SOURCE_BRANCH, m_BrowseLocalRef);
66 DDX_Check(pDX,IDC_FORCE,this->m_bForce);
67 DDX_Check(pDX,IDC_PUSHALL,this->m_bPushAllBranches);
68 DDX_Check(pDX,IDC_PACK,this->m_bPack);
69 DDX_Check(pDX,IDC_TAGS,this->m_bTags);
70 DDX_Check(pDX,IDC_PUTTYKEY_AUTOLOAD,this->m_bAutoLoad);
71 DDX_Check(pDX, IDC_PROC_PUSH_SET_PUSHREMOTE, m_bSetPushRemote);
72 DDX_Check(pDX, IDC_PROC_PUSH_SET_PUSHBRANCH, m_bSetPushBranch);
73 DDX_Check(pDX, IDC_PROC_PUSH_SET_UPSTREAM, m_bSetUpstream);
76 BEGIN_MESSAGE_MAP(CPushDlg, CHorizontalResizableStandAloneDialog)
77 ON_BN_CLICKED(IDC_RD_REMOTE, &CPushDlg::OnBnClickedRd)
78 ON_BN_CLICKED(IDC_RD_URL, &CPushDlg::OnBnClickedRd)
79 ON_CBN_SELCHANGE(IDC_BRANCH_SOURCE, &CPushDlg::OnCbnSelchangeBranchSource)
80 ON_CBN_SELCHANGE(IDC_REMOTE, &CPushDlg::EnDisablePushRemoteArchiveBranch)
81 ON_BN_CLICKED(IDOK, &CPushDlg::OnBnClickedOk)
82 ON_BN_CLICKED(IDC_REMOTE_MANAGE, &CPushDlg::OnBnClickedRemoteManage)
83 ON_BN_CLICKED(IDC_BUTTON_BROWSE_SOURCE_BRANCH, &CPushDlg::OnBnClickedButtonBrowseSourceBranch)
84 ON_BN_CLICKED(IDC_BUTTON_BROWSE_DEST_BRANCH, &CPushDlg::OnBnClickedButtonBrowseDestBranch)
85 ON_BN_CLICKED(IDC_PUSHALL, &CPushDlg::OnBnClickedPushall)
86 ON_BN_CLICKED(IDC_PROC_PUSH_SET_UPSTREAM, &CPushDlg::OnBnClickedProcPushSetUpstream)
87 ON_BN_CLICKED(IDC_PROC_PUSH_SET_PUSHREMOTE, &CPushDlg::OnBnClickedProcPushSetPushremote)
88 ON_BN_CLICKED(IDC_PROC_PUSH_SET_PUSHBRANCH, &CPushDlg::OnBnClickedProcPushSetPushremote)
89 END_MESSAGE_MAP()
91 BOOL CPushDlg::OnInitDialog()
93 CHorizontalResizableStandAloneDialog::OnInitDialog();
94 CAppUtils::MarkWindowAsUnpinnable(m_hWnd);
96 AddAnchor(IDOK,BOTTOM_RIGHT);
97 AddAnchor(IDCANCEL,BOTTOM_RIGHT);
98 AddAnchor(IDC_BRANCH_GROUP, TOP_LEFT,TOP_RIGHT);
99 AddAnchor(IDC_STATIC_REMOTE, TOP_LEFT);
100 AddAnchor(IDC_STATIC_SOURCE, TOP_LEFT);
102 AddAnchor(IDC_PUSHALL, TOP_LEFT);
103 AddAnchor(IDC_BRANCH_REMOTE, TOP_LEFT, TOP_RIGHT);
104 AddAnchor(IDC_BUTTON_BROWSE_DEST_BRANCH, TOP_RIGHT);
105 AddAnchor(IDC_BRANCH_SOURCE, TOP_LEFT, TOP_RIGHT);
106 AddAnchor(IDC_BUTTON_BROWSE_SOURCE_BRANCH, TOP_RIGHT);
108 AddAnchor(IDC_URL_GROUP, TOP_LEFT,TOP_RIGHT);
109 AddAnchor(IDC_RD_REMOTE, TOP_LEFT);
110 AddAnchor(IDC_RD_URL, TOP_LEFT);
112 AddAnchor(IDC_REMOTE, TOP_LEFT, TOP_RIGHT);
114 AddAnchor(IDC_URL, TOP_LEFT,TOP_RIGHT);
116 AddAnchor(IDC_OPTION_GROUP, TOP_LEFT,TOP_RIGHT);
118 AddAnchor(IDC_FORCE, TOP_LEFT);
119 AddAnchor(IDC_PACK, TOP_LEFT);
120 AddAnchor(IDC_TAGS, TOP_LEFT);
121 AddAnchor(IDC_PUTTYKEY_AUTOLOAD,TOP_LEFT);
122 AddAnchor(IDC_PROC_PUSH_SET_PUSHBRANCH, TOP_LEFT);
123 AddAnchor(IDC_PROC_PUSH_SET_PUSHREMOTE, TOP_LEFT);
124 AddAnchor(IDC_PROC_PUSH_SET_UPSTREAM, TOP_LEFT);
126 AddAnchor(IDC_REMOTE_MANAGE,TOP_RIGHT);
127 AddAnchor(IDHELP, BOTTOM_RIGHT);
129 AddOthersToAnchor();
131 AdjustControlSize(IDC_RD_REMOTE);
132 AdjustControlSize(IDC_RD_URL);
133 AdjustControlSize(IDC_PUSHALL);
134 AdjustControlSize(IDC_FORCE);
135 AdjustControlSize(IDC_PACK);
136 AdjustControlSize(IDC_TAGS);
137 AdjustControlSize(IDC_PUTTYKEY_AUTOLOAD);
138 AdjustControlSize(IDC_PROC_PUSH_SET_PUSHBRANCH);
139 AdjustControlSize(IDC_PROC_PUSH_SET_PUSHREMOTE);
140 AdjustControlSize(IDC_PROC_PUSH_SET_UPSTREAM);
142 CString sWindowTitle;
143 GetWindowText(sWindowTitle);
144 CAppUtils::SetWindowTitle(m_hWnd, g_Git.m_CurrentDir, sWindowTitle);
146 this->GetDlgItem(IDC_PUTTYKEY_AUTOLOAD)->EnableWindow(CAppUtils::IsSSHPutty());
148 EnableSaveRestore(_T("PushDlg"));
150 m_RemoteURL.SetURLHistory(TRUE);
152 CString WorkingDir=g_Git.m_CurrentDir;
153 WorkingDir.Replace(_T(':'),_T('_'));
154 m_RemoteURL.LoadHistory(CString(_T("Software\\TortoiseGit\\History\\PushURLS\\"))+WorkingDir, _T("url"));
155 CString clippath=CAppUtils::GetClipboardLink();
156 if(clippath.IsEmpty())
157 m_RemoteURL.SetCurSel(0);
158 else
159 m_RemoteURL.SetWindowText(clippath);
161 m_RemoteURL.EnableWindow(FALSE);
162 CheckRadioButton(IDC_RD_REMOTE,IDC_RD_URL,IDC_RD_REMOTE);
165 this->m_regAutoLoad = CRegDWORD(CString(_T("Software\\TortoiseGit\\History\\PushDlgAutoLoad\\"))+WorkingDir,
166 m_bAutoLoad);
167 m_bAutoLoad = this->m_regAutoLoad;
168 if(!CAppUtils::IsSSHPutty())
169 m_bAutoLoad = false;
171 m_BrowseLocalRef.m_bRightArrow = TRUE;
172 m_BrowseLocalRef.m_bDefaultClick = FALSE;
173 m_BrowseLocalRef.m_bMarkDefault = FALSE;
174 m_BrowseLocalRef.AddEntry(CString(MAKEINTRESOURCE(IDS_REFBROWSE)));
175 m_BrowseLocalRef.AddEntry(CString(MAKEINTRESOURCE(IDS_LOG)));
176 m_BrowseLocalRef.AddEntry(CString(MAKEINTRESOURCE(IDS_REFLOG)));
178 m_tooltips.Create(this);
179 m_tooltips.AddTool(IDC_PROC_PUSH_SET_PUSHBRANCH, IDS_PUSHDLG_PUSHBRANCH_TT);
180 m_tooltips.AddTool(IDC_PROC_PUSH_SET_PUSHREMOTE, IDS_PUSHDLG_PUSHREMOTE_TT);
182 Refresh();
184 this->UpdateData(false);
185 return TRUE;
188 void CPushDlg::Refresh()
190 CString WorkingDir=g_Git.m_CurrentDir;
191 WorkingDir.Replace(_T(':'),_T('_'));
193 CRegString remote(CString(_T("Software\\TortoiseGit\\History\\PushRemote\\")+WorkingDir));
194 m_RemoteReg = remote;
195 int sel = -1;
197 STRING_VECTOR list;
198 m_Remote.Reset();
200 list.push_back(CString(MAKEINTRESOURCE(IDS_PROC_PUSHFETCH_ALLREMOTES)));
201 if(!g_Git.GetRemoteList(list))
203 if (list.size() <= 2)
204 list.erase(list.begin());
206 for(unsigned int i=0;i<list.size();i++)
208 m_Remote.AddString(list[i]);
209 if(list[i] == remote)
210 sel = i;
213 // if the last selected remote was "- All -" and "- All -" is still in the list -> select it
214 if (list.size() > 1 && remote == CString(MAKEINTRESOURCE(IDS_PROC_PUSHFETCH_ALLREMOTES)))
215 sel = 0;
216 m_Remote.SetCurSel(sel);
218 int current=0;
219 list.clear();
220 m_BranchSource.Reset();
221 m_BranchSource.AddString(_T(" ")); // empty string does not work, for removal of remote branches/tags
222 m_BranchSource.SetMaxHistoryItems(0x7FFFFFFF);
223 if(!g_Git.GetBranchList(list,&current))
225 for(unsigned int i=0;i<list.size();i++)
226 m_BranchSource.AddString(list[i]);
227 current++; // shift for " "
229 if (wcsncmp(m_BranchSourceName, _T("refs/"), 5) == 0)
230 m_BranchSourceName = m_BranchSourceName.Mid(5);
231 if (wcsncmp(m_BranchSourceName, _T("heads/"), 6) == 0)
233 m_BranchSourceName = m_BranchSourceName.Mid(6);
234 m_BranchSource.SetCurSel(m_BranchSource.FindStringExact(-1, m_BranchSourceName));
236 else if (wcsncmp(m_BranchSourceName, _T("remotes/"), 8) == 0)
237 m_BranchSource.SetCurSel(m_BranchSource.FindStringExact(-1, m_BranchSourceName));
238 else
239 m_BranchSource.SetCurSel(current);
241 GetRemoteBranch(m_BranchSource.GetString());
243 this->GetDlgItem(IDOK)->EnableWindow(m_BranchSource.GetCount() != 0);
246 void CPushDlg::GetRemoteBranch(CString currentBranch)
248 CString WorkingDir=g_Git.m_CurrentDir;
249 WorkingDir.Replace(_T(':'), _T('_'));
251 if (currentBranch.IsEmpty())
253 EnDisablePushRemoteArchiveBranch();
254 return;
257 CString configName;
259 configName.Format(L"branch.%s.pushremote", currentBranch);
260 CString pushRemote = g_Git.GetConfigValue(configName);
261 if( pushRemote.IsEmpty() )
263 configName.Format(L"branch.%s.remote", currentBranch);
264 pushRemote = g_Git.GetConfigValue(configName);
267 CRegString remote(CString(_T("Software\\TortoiseGit\\History\\PushRemote\\")+WorkingDir));
269 if (!pushRemote.IsEmpty())
271 remote = pushRemote;
272 // if a pushRemote exists, select it
273 for (int i = 0; i < m_Remote.GetCount(); i++)
275 CString str;
276 int n = m_Remote.GetLBTextLen(i);
277 m_Remote.GetLBText(i, str.GetBuffer(n));
278 str.ReleaseBuffer();
279 if (str == pushRemote)
281 m_Remote.SetCurSel(i);
282 break;
286 // select the only remote if only one exists
287 else if (m_Remote.GetCount() == 1)
288 m_Remote.SetCurSel(0);
289 // select no remote if no push-remote is specified AND push to all remotes is not selected
290 else if (!(m_Remote.GetCount() > 1 && m_Remote.GetCurSel() == 0))
292 m_Remote.SetCurSel(-1);
295 //Select pull-branch from current branch
296 configName.Format(L"branch.%s.pushbranch", currentBranch);
297 CString pushBranch = CGit::StripRefName(g_Git.GetConfigValue(configName));
298 if( pushBranch.IsEmpty() )
300 configName.Format(L"branch.%s.merge", currentBranch);
301 pushBranch = CGit::StripRefName(g_Git.GetConfigValue(configName));
304 m_BranchRemote.LoadHistory(CString(_T("Software\\TortoiseGit\\History\\RemoteBranch\\"))+WorkingDir, _T("branch"));
305 if( !pushBranch.IsEmpty() )
306 m_BranchRemote.AddString(pushBranch);
308 EnDisablePushRemoteArchiveBranch();
311 void CPushDlg::EnDisablePushRemoteArchiveBranch()
313 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())
315 DialogEnableWindow(IDC_PROC_PUSH_SET_PUSHBRANCH, FALSE);
316 DialogEnableWindow(IDC_PROC_PUSH_SET_PUSHREMOTE, FALSE);
317 bool enableUpstream = (GetCheckedRadioButton(IDC_RD_REMOTE, IDC_RD_URL) != IDC_RD_URL && (!m_BranchSource.GetString().Trim().IsEmpty() || m_bPushAllBranches));
318 DialogEnableWindow(IDC_PROC_PUSH_SET_UPSTREAM, enableUpstream);
319 if (m_bSetUpstream && !enableUpstream)
320 m_bSetUpstream = FALSE;
321 m_bSetPushRemote = FALSE;
322 m_bSetPushBranch = FALSE;
323 UpdateData(FALSE);
325 else
327 DialogEnableWindow(IDC_PROC_PUSH_SET_UPSTREAM, TRUE);
328 DialogEnableWindow(IDC_PROC_PUSH_SET_PUSHBRANCH, !m_bSetUpstream);
329 DialogEnableWindow(IDC_PROC_PUSH_SET_PUSHREMOTE, !m_bSetUpstream);
333 // CPushDlg message handlers
335 void CPushDlg::OnBnClickedRd()
337 if( GetCheckedRadioButton(IDC_RD_REMOTE,IDC_RD_URL) == IDC_RD_REMOTE)
339 m_Remote.EnableWindow(TRUE);
340 GetDlgItem(IDC_REMOTE_MANAGE)->EnableWindow(TRUE);
341 m_RemoteURL.EnableWindow(FALSE);
343 if( GetCheckedRadioButton(IDC_RD_REMOTE,IDC_RD_URL) == IDC_RD_URL)
345 m_Remote.EnableWindow(FALSE);
346 GetDlgItem(IDC_REMOTE_MANAGE)->EnableWindow(FALSE);
347 m_RemoteURL.EnableWindow(TRUE);
349 EnDisablePushRemoteArchiveBranch();
353 void CPushDlg::OnCbnSelchangeBranchSource()
355 GetRemoteBranch(m_BranchSource.GetString());
358 void CPushDlg::OnBnClickedOk()
360 CHorizontalResizableStandAloneDialog::UpdateData(TRUE);
362 if( GetCheckedRadioButton(IDC_RD_REMOTE,IDC_RD_URL) == IDC_RD_REMOTE)
364 m_URL=m_Remote.GetString();
365 if (m_URL.IsEmpty())
367 CMessageBox::Show(NULL, IDS_PROC_GITCONFIG_REMOTEEMPTY, IDS_APPNAME, MB_OK);
368 return;
370 m_bPushAllRemotes = (m_Remote.GetCurSel() == 0 && m_Remote.GetCount() > 1);
372 if( GetCheckedRadioButton(IDC_RD_REMOTE,IDC_RD_URL) == IDC_RD_URL)
374 m_URL=m_RemoteURL.GetString();
377 if (!m_bPushAllBranches)
379 this->m_BranchRemoteName=m_BranchRemote.GetString().Trim();
380 this->m_BranchSourceName=m_BranchSource.GetString().Trim();
382 if (m_BranchSourceName.IsEmpty() && m_BranchRemoteName.IsEmpty())
384 if (CMessageBox::Show(NULL, IDS_B_T_BOTHEMPTY, IDS_APPNAME, MB_ICONQUESTION | MB_YESNO) == IDNO)
385 return;
387 if (m_BranchSourceName.IsEmpty() && !m_BranchRemoteName.IsEmpty())
389 if (CMessageBox::Show(NULL, IDS_B_T_LOCALEMPTY, IDS_APPNAME, MB_ICONEXCLAMATION | MB_YESNO) == IDNO)
390 return;
392 else if (!m_BranchRemoteName.IsEmpty() && !g_Git.IsBranchNameValid(this->m_BranchRemoteName))
394 CMessageBox::Show(NULL, IDS_B_T_INVALID, IDS_APPNAME, MB_OK);
395 return;
397 else if (!m_BranchSourceName.IsEmpty() && !g_Git.IsBranchTagNameUnique(m_BranchSourceName))
399 CMessageBox::Show(NULL, IDS_B_T_NOT_UNIQUE, IDS_APPNAME, MB_OK | MB_ICONEXCLAMATION);
400 return;
402 else
404 // do not store branch names on removal
405 this->m_RemoteURL.SaveHistory();
406 this->m_BranchRemote.SaveHistory();
407 m_RemoteReg = m_Remote.GetString();
409 if (!m_BranchSourceName.IsEmpty())
411 CString configName;
412 if (m_bSetPushBranch)
414 configName.Format(L"branch.%s.pushbranch", m_BranchSourceName);
415 if (!m_BranchRemoteName.IsEmpty())
416 g_Git.SetConfigValue(configName, m_BranchRemoteName);
417 else
418 g_Git.UnsetConfigValue(configName);
420 if (m_bSetPushRemote)
422 configName.Format(L"branch.%s.pushremote", m_BranchSourceName);
423 if (!m_URL.IsEmpty())
424 g_Git.SetConfigValue(configName, m_URL);
425 else
426 g_Git.UnsetConfigValue(configName);
432 this->m_regAutoLoad = m_bAutoLoad ;
434 CHorizontalResizableStandAloneDialog::OnOK();
437 void CPushDlg::OnBnClickedRemoteManage()
439 CAppUtils::LaunchRemoteSetting();
440 Refresh();
443 void CPushDlg::OnBnClickedButtonBrowseSourceBranch()
445 switch (m_BrowseLocalRef.GetCurrentEntry())
447 case 0: /* Browse Refence*/
449 if(CBrowseRefsDlg::PickRefForCombo(&m_BranchSource, gPickRef_Head))
450 OnCbnSelchangeBranchSource();
452 break;
454 case 1: /* Log */
456 CLogDlg dlg;
457 dlg.SetSelect(true);
458 if(dlg.DoModal() == IDOK)
460 if (dlg.GetSelectedHash().IsEmpty())
461 return;
463 m_BranchSource.SetWindowText(dlg.GetSelectedHash());
464 OnCbnSelchangeBranchSource();
467 break;
469 case 2: /*RefLog*/
471 CRefLogDlg dlg;
472 if(dlg.DoModal() == IDOK)
474 m_BranchSource.SetWindowText(dlg.m_SelectedHash);
475 OnCbnSelchangeBranchSource();
478 break;
482 void CPushDlg::OnBnClickedButtonBrowseDestBranch()
484 CString remoteBranchName;
485 CString remoteName;
486 m_BranchRemote.GetWindowText(remoteBranchName);
487 remoteName = m_Remote.GetString();
488 remoteBranchName = remoteName + '/' + remoteBranchName;
489 remoteBranchName = CBrowseRefsDlg::PickRef(false, remoteBranchName, gPickRef_Remote);
490 if(remoteBranchName.IsEmpty())
491 return; //Canceled
492 remoteBranchName = remoteBranchName.Mid(13);//Strip 'refs/remotes/'
493 int slashPlace = remoteBranchName.Find('/');
494 remoteName = remoteBranchName.Left(slashPlace);
495 remoteBranchName = remoteBranchName.Mid(slashPlace + 1); //Strip remote name (for example 'origin/')
497 //Select remote
498 int remoteSel = m_Remote.FindStringExact(0,remoteName);
499 if(remoteSel >= 0)
500 m_Remote.SetCurSel(remoteSel);
502 //Select branch
503 m_BranchRemote.AddString(remoteBranchName, 0);
506 BOOL CPushDlg::PreTranslateMessage(MSG* pMsg)
508 m_tooltips.RelayEvent(pMsg);
510 if (pMsg->message == WM_KEYDOWN)
512 switch (pMsg->wParam)
514 case VK_F5:
516 Refresh();
518 break;
522 return CHorizontalResizableStandAloneDialog::PreTranslateMessage(pMsg);
525 void CPushDlg::OnBnClickedPushall()
527 this->UpdateData();
528 this->GetDlgItem(IDC_BRANCH_REMOTE)->EnableWindow(!m_bPushAllBranches);
529 this->GetDlgItem(IDC_BRANCH_SOURCE)->EnableWindow(!m_bPushAllBranches);
530 this->GetDlgItem(IDC_BUTTON_BROWSE_SOURCE_BRANCH)->EnableWindow(!m_bPushAllBranches);
531 this->GetDlgItem(IDC_BUTTON_BROWSE_DEST_BRANCH)->EnableWindow(!m_bPushAllBranches);
532 this->GetDlgItem(IDC_TAGS)->EnableWindow(!m_bPushAllBranches);
533 if (m_bTags && m_bPushAllBranches)
535 m_bTags = FALSE;
536 UpdateData(FALSE);
538 EnDisablePushRemoteArchiveBranch();
541 void CPushDlg::OnBnClickedProcPushSetUpstream()
543 UpdateData();
544 this->GetDlgItem(IDC_PROC_PUSH_SET_PUSHREMOTE)->EnableWindow(!m_bSetUpstream);
545 this->GetDlgItem(IDC_PROC_PUSH_SET_PUSHBRANCH)->EnableWindow(!m_bSetUpstream);
546 m_bSetPushBranch = FALSE;
547 m_bSetPushRemote = FALSE;
548 UpdateData(FALSE);
551 void CPushDlg::OnBnClickedProcPushSetPushremote()
553 UpdateData();
554 this->GetDlgItem(IDC_PROC_PUSH_SET_UPSTREAM)->EnableWindow(!(m_bSetPushBranch || m_bSetPushRemote));
555 m_bSetUpstream = FALSE;
556 UpdateData(FALSE);