Make sounds for indicating a warning or error work
[TortoiseGit.git] / src / TortoiseProc / CreateRepoDlg.cpp
blob903bdaeafb426e99b9bcb4bec18321863887f09d
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2010-2013 - 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 "MessageBox.h"
27 #include "AppUtils.h"
29 // CCreateRepoDlg dialog
31 IMPLEMENT_DYNCREATE(CCreateRepoDlg, CStandAloneDialog)
33 CCreateRepoDlg::CCreateRepoDlg(CWnd* pParent /*=NULL*/)
34 : CStandAloneDialog(CCreateRepoDlg::IDD, pParent)
36 m_bBare = FALSE;
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 m_tooltips.Create(this);
62 CString tt;
63 tt.LoadString(IDS_CLONE_DEPTH_TT);
64 m_tooltips.AddTool(IDC_EDIT_DEPTH,tt);
65 m_tooltips.AddTool(IDC_CHECK_DEPTH,tt);
67 // Check if the folder ends with .git this indicates the use probably want this to be a bare repository
68 if (m_folder.Right(4) == _T(".git"))
70 m_bBare = TRUE;
71 UpdateData(FALSE);
74 return TRUE; // return TRUE unless you set the focus to a control
77 BEGIN_MESSAGE_MAP(CCreateRepoDlg, CStandAloneDialog)
78 ON_BN_CLICKED(IDC_CHECK_BARE, &CCreateRepoDlg::OnBnClickedCheckBare)
79 END_MESSAGE_MAP()
81 // CCloneDlg message handlers
83 void CCreateRepoDlg::OnOK()
85 UpdateData(TRUE);
87 CStandAloneDialog::OnOK();
90 void CCreateRepoDlg::OnCancel()
92 CStandAloneDialog::OnCancel();
95 void CCreateRepoDlg::OnBnClickedCheckBare()
97 this->UpdateData();
99 BOOL CCreateRepoDlg::PreTranslateMessage(MSG* pMsg)
101 m_tooltips.RelayEvent(pMsg);
103 return CStandAloneDialog::PreTranslateMessage(pMsg);