1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2007-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 // MergeDlg.cpp : implementation file
26 #include "TortoiseProc.h"
30 #include "Messagebox.h"
33 IMPLEMENT_DYNAMIC(CMergeDlg
, CResizableStandAloneDialog
)
35 CMergeDlg::CMergeDlg(CWnd
* pParent
/*=NULL*/)
36 : CResizableStandAloneDialog(CMergeDlg::IDD
, pParent
),
39 m_pDefaultText
= MAKEINTRESOURCE(IDS_PROC_AUTOGENERATEDBYGIT
);
45 CMergeDlg::~CMergeDlg()
49 void CMergeDlg::DoDataExchange(CDataExchange
* pDX
)
51 CDialog::DoDataExchange(pDX
);
55 DDX_Check(pDX
,IDC_CHECK_NOFF
,this->m_bNoFF
);
56 DDX_Check(pDX
,IDC_CHECK_SQUASH
,this->m_bSquash
);
57 DDX_Check(pDX
,IDC_CHECK_NOCOMMIT
,this->m_bNoCommit
);
58 DDX_Control(pDX
, IDC_LOGMESSAGE
, m_cLogMessage
);
62 BEGIN_MESSAGE_MAP(CMergeDlg
, CResizableStandAloneDialog
)
64 ON_BN_CLICKED(IDOK
, &CMergeDlg::OnBnClickedOk
)
69 BOOL
CMergeDlg::OnInitDialog()
71 CResizableStandAloneDialog::OnInitDialog();
72 CAppUtils::MarkWindowAsUnpinnable(m_hWnd
);
74 CHOOSE_VERSION_ADDANCHOR
;
76 AddAnchor(IDC_GROUP_OPTION
, TOP_LEFT
, TOP_RIGHT
);
77 AddAnchor(IDC_STATIC_MERGE_MESSAGE
,TOP_LEFT
,BOTTOM_RIGHT
);
78 AddAnchor(IDC_LOGMESSAGE
,TOP_LEFT
,BOTTOM_RIGHT
);
80 AddAnchor(IDOK
,BOTTOM_RIGHT
);
81 AddAnchor(IDCANCEL
,BOTTOM_RIGHT
);
82 AddAnchor(IDHELP
, BOTTOM_RIGHT
);
84 this->AddOthersToAnchor();
86 AdjustControlSize(IDC_RADIO_BRANCH
);
87 AdjustControlSize(IDC_RADIO_TAGS
);
88 AdjustControlSize(IDC_RADIO_VERSION
);
89 AdjustControlSize(IDC_CHECK_SQUASH
);
90 AdjustControlSize(IDC_CHECK_NOFF
);
91 AdjustControlSize(IDC_CHECK_NOCOMMIT
);
93 CheckRadioButton(IDC_RADIO_BRANCH
,IDC_RADIO_VERSION
,IDC_RADIO_BRANCH
);
94 this->SetDefaultChoose(IDC_RADIO_BRANCH
);
97 GetWindowText(sWindowTitle
);
98 CAppUtils::SetWindowTitle(m_hWnd
, g_Git
.m_CurrentDir
, sWindowTitle
);
102 m_ProjectProperties
.ReadProps(CTGitPath(g_Git
.m_CurrentDir
));
104 m_cLogMessage
.Init(m_ProjectProperties
);
105 m_cLogMessage
.SetFont((CString
)CRegString(_T("Software\\TortoiseGit\\LogFontName"), _T("Courier New")), (DWORD
)CRegDWORD(_T("Software\\TortoiseGit\\LogFontSize"), 8));
106 m_cLogMessage
.RegisterContextMenuHandler(this);
108 m_cLogMessage
.SetText(m_pDefaultText
);
110 EnableSaveRestore(_T("MergeDlg"));
115 // CMergeDlg message handlers
118 void CMergeDlg::OnBnClickedOk()
120 this->UpdateData(TRUE
);
122 this->UpdateRevsionName();
124 this->m_strLogMesage
= m_cLogMessage
.GetText() ;
125 if( m_strLogMesage
== CString(this->m_pDefaultText
) )
127 m_strLogMesage
.Empty();
133 void CMergeDlg::OnDestroy()
135 WaitForFinishLoading();
136 __super::OnDestroy();