Provide (experimental) clang-format file
[TortoiseGit.git] / src / TortoiseProc / CreateRepoDlg.cpp
blob04d48df4b4a3f7d1a5efd2f3626c52ccc6b13b51
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2010-2014, 2016 - 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.
19 // CreateRepoDlg.cpp : implementation file
22 #include "stdafx.h"
23 #include "TortoiseProc.h"
24 #include "CreateRepoDlg.h"
25 #include "BrowseFolder.h"
26 #include "AppUtils.h"
27 #include "StringUtils.h"
29 // CCreateRepoDlg dialog
31 IMPLEMENT_DYNCREATE(CCreateRepoDlg, CStandAloneDialog)
33 CCreateRepoDlg::CCreateRepoDlg(CWnd* pParent /*=nullptr*/)
34 : CStandAloneDialog(CCreateRepoDlg::IDD, pParent)
35 , m_bBare(BST_UNCHECKED)
39 CCreateRepoDlg::~CCreateRepoDlg()
43 void CCreateRepoDlg::DoDataExchange(CDataExchange* pDX)
45 CStandAloneDialog::DoDataExchange(pDX);
47 DDX_Check(pDX,IDC_CHECK_BARE, m_bBare);
50 BOOL CCreateRepoDlg::OnInitDialog()
52 CStandAloneDialog::OnInitDialog();
53 CAppUtils::MarkWindowAsUnpinnable(m_hWnd);
55 AdjustControlSize(IDC_CHECK_BARE);
57 CString sWindowTitle;
58 GetWindowText(sWindowTitle);
59 CAppUtils::SetWindowTitle(m_hWnd, m_folder, sWindowTitle);
61 // Check if the folder ends with .git this indicates the use probably want this to be a bare repository
62 if (CStringUtils::EndsWith(m_folder, L".git"))
64 m_bBare = TRUE;
65 UpdateData(FALSE);
68 return TRUE; // return TRUE unless you set the focus to a control
71 BEGIN_MESSAGE_MAP(CCreateRepoDlg, CStandAloneDialog)
72 ON_BN_CLICKED(IDC_CHECK_BARE, &CCreateRepoDlg::OnBnClickedCheckBare)
73 ON_BN_CLICKED(IDHELP, OnHelp)
74 END_MESSAGE_MAP()
76 // CCloneDlg message handlers
78 void CCreateRepoDlg::OnOK()
80 UpdateData(TRUE);
82 CStandAloneDialog::OnOK();
85 void CCreateRepoDlg::OnCancel()
87 CStandAloneDialog::OnCancel();
90 void CCreateRepoDlg::OnBnClickedCheckBare()
92 this->UpdateData();