1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2007-2009 - 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
),
40 m_pDefaultText
= _T("<Auto Generated by Git>");
47 CMergeDlg::~CMergeDlg()
51 void CMergeDlg::DoDataExchange(CDataExchange
* pDX
)
53 CDialog::DoDataExchange(pDX
);
57 DDX_Check(pDX
,IDC_CHECK_NOFF
,this->m_bNoFF
);
58 DDX_Check(pDX
,IDC_CHECK_SQUASH
,this->m_bSquash
);
59 DDX_Check(pDX
,IDC_CHECK_NOCOMMIT
,this->m_bNoCommit
);
60 DDX_Control(pDX
, IDC_LOGMESSAGE
, m_cLogMessage
);
64 BEGIN_MESSAGE_MAP(CMergeDlg
, CResizableStandAloneDialog
)
66 ON_BN_CLICKED(IDOK
, &CMergeDlg::OnBnClickedOk
)
71 BOOL
CMergeDlg::OnInitDialog()
73 CResizableStandAloneDialog::OnInitDialog();
76 CHOOSE_VERSION_ADDANCHOR
;
78 AddAnchor(IDC_GROUP_OPTION
, TOP_LEFT
, TOP_RIGHT
);
79 AddAnchor(IDC_STATIC_MERGE_MESSAGE
,TOP_LEFT
,BOTTOM_RIGHT
);
80 AddAnchor(IDC_LOGMESSAGE
,TOP_LEFT
,BOTTOM_RIGHT
);
82 AddAnchor(IDOK
,BOTTOM_RIGHT
);
83 AddAnchor(IDCANCEL
,BOTTOM_RIGHT
);
84 AddAnchor(IDHELP
, BOTTOM_RIGHT
);
86 this->AddOthersToAnchor();
88 CheckRadioButton(IDC_RADIO_BRANCH
,IDC_RADIO_VERSION
,IDC_RADIO_BRANCH
);
89 this->SetDefaultChoose(IDC_RADIO_BRANCH
);
95 m_ProjectProperties
.ReadProps(CTGitPath(g_Git
.m_CurrentDir
));
97 m_cLogMessage
.Init(m_ProjectProperties
);
98 m_cLogMessage
.SetFont((CString
)CRegString(_T("Software\\TortoiseGit\\LogFontName"), _T("Courier New")), (DWORD
)CRegDWORD(_T("Software\\TortoiseGit\\LogFontSize"), 8));
99 m_cLogMessage
.RegisterContextMenuHandler(this);
101 m_cLogMessage
.SetText(m_pDefaultText
);
103 EnableSaveRestore(_T("MergeDlg"));
108 // CMergeDlg message handlers
111 void CMergeDlg::OnBnClickedOk()
113 // TODO: Add your control notification handler code here
114 this->UpdateData(TRUE
);
116 this->UpdateRevsionName();
118 this->m_strLogMesage
= m_cLogMessage
.GetText() ;
119 if( m_strLogMesage
== CString(this->m_pDefaultText
) )
121 m_strLogMesage
.Empty();
127 void CMergeDlg::OnDestroy()
129 WaitForFinishLoading();
130 __super::OnDestroy();
132 // TODO: Add your message handler code here