Make sounds for indicating a warning or error work
[TortoiseGit.git] / src / TortoiseProc / Settings / SetProgsAdvDlg.h
blob515cc1e67d1109e8909982ffca3d8a98133361e5
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2003-2008,2010 - TortoiseSVN
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 #pragma once
21 #include "registry.h"
22 #include "StandAloneDlg.h"
24 /**
25 * \ingroup TortoiseProc
26 * Helper dialog to configure the external tools used e.g. for diffing/merging/...
28 class CSetProgsAdvDlg : public CResizableStandAloneDialog
30 DECLARE_DYNAMIC(CSetProgsAdvDlg)
32 public:
33 CSetProgsAdvDlg(const CString& type, CWnd* pParent = NULL);
34 virtual ~CSetProgsAdvDlg();
36 enum { IDD = IDD_SETTINGSPROGSADV };
38 private:
39 /**
40 * Loads the tools from the registry.
42 void LoadData();
44 public:
45 /**
46 * Saves the changed tools to the registry.
47 * returns 0 if no restart is needed for the changes to take effect
48 * \remark If the dialog is closed/dismissed without calling
49 * this method first then all settings the user made must be
50 * discarded!
52 int SaveData();
54 private:
55 int AddExtension(const CString& ext, const CString& tool);
56 int FindExtension(const CString& ext);
57 void EnableBtns();
59 protected:
60 virtual void DoDataExchange(CDataExchange* pDX);
61 virtual BOOL OnInitDialog();
62 afx_msg void OnBnClickedAddtool();
63 afx_msg void OnBnClickedEdittool();
64 afx_msg void OnBnClickedRemovetool();
65 afx_msg void OnNMDblclkToollistctrl(NMHDR *pNMHDR, LRESULT *pResult);
66 afx_msg void OnLvnItemchangedToollistctrl(NMHDR *pNMHDR, LRESULT *pResult);
67 afx_msg void OnBnClickedRestoredefaults();
69 DECLARE_MESSAGE_MAP()
71 private:
72 CString m_sType; ///< tool type ("Diff" or "Merge")
73 CRegistryKey m_regToolKey; ///< registry key where the tools are stored
74 CListCtrl m_ToolListCtrl; ///< list control used for viewing and editing
76 typedef std::map<CString,CString> TOOL_MAP;
77 TOOL_MAP m_Tools; ///< internal storage of all tools
78 bool m_ToolsValid; ///< true if m_Tools was ever read