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
),
39 m_pDefaultText
= _T("<Auto Generated by Git>");
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 CheckRadioButton(IDC_RADIO_BRANCH
,IDC_RADIO_VERSION
,IDC_RADIO_BRANCH
);
87 this->SetDefaultChoose(IDC_RADIO_BRANCH
);
90 GetWindowText(sWindowTitle
);
91 CAppUtils::SetWindowTitle(m_hWnd
, g_Git
.m_CurrentDir
, sWindowTitle
);
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 this->UpdateData(TRUE
);
115 this->UpdateRevsionName();
117 this->m_strLogMesage
= m_cLogMessage
.GetText() ;
118 if( m_strLogMesage
== CString(this->m_pDefaultText
) )
120 m_strLogMesage
.Empty();
126 void CMergeDlg::OnDestroy()
128 WaitForFinishLoading();
129 __super::OnDestroy();