1 // TortoiseSVN - a Windows shell extension for easy version control
\r
3 // Copyright (C) 2003-2008 - TortoiseSVN
\r
5 // This program is free software; you can redistribute it and/or
\r
6 // modify it under the terms of the GNU General Public License
\r
7 // as published by the Free Software Foundation; either version 2
\r
8 // of the License, or (at your option) any later version.
\r
10 // This program is distributed in the hope that it will be useful,
\r
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 // GNU General Public License for more details.
\r
15 // You should have received a copy of the GNU General Public License
\r
16 // along with this program; if not, write to the Free Software Foundation,
\r
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
\r
21 #include "Registry.h"
\r
24 * \ingroup TortoiseProc
\r
25 * Helper dialog to configure the external tools used e.g. for diffing/merging/...
\r
27 class CSetProgsAdvDlg : public CDialog
\r
29 DECLARE_DYNAMIC(CSetProgsAdvDlg)
\r
32 CSetProgsAdvDlg(const CString& type, CWnd* pParent = NULL);
\r
33 virtual ~CSetProgsAdvDlg();
\r
35 * Loads the tools from the registry.
\r
39 * Saves the changed tools to the registry.
\r
40 * returns 0 if no restart is needed for the changes to take effect
\r
41 * \remark If the dialog is closed/dismissed without calling
\r
42 * this method first then all settings the user made must be
\r
47 int AddExtension(const CString& ext, const CString& tool);
\r
48 int FindExtension(const CString& ext);
\r
51 enum { IDD = IDD_SETTINGSPROGSADV };
\r
54 virtual void DoDataExchange(CDataExchange* pDX);
\r
55 virtual BOOL OnInitDialog();
\r
56 afx_msg void OnBnClickedAddtool();
\r
57 afx_msg void OnBnClickedEdittool();
\r
58 afx_msg void OnBnClickedRemovetool();
\r
59 afx_msg void OnNMDblclkToollistctrl(NMHDR *pNMHDR, LRESULT *pResult);
\r
60 afx_msg void OnLvnItemchangedToollistctrl(NMHDR *pNMHDR, LRESULT *pResult);
\r
61 afx_msg void OnBnClickedRestoredefaults();
\r
63 DECLARE_MESSAGE_MAP()
\r
66 CString m_sType; ///< tool type ("Diff" or "Merge")
\r
67 CRegistryKey m_regToolKey; ///< registry key where the tools are stored
\r
68 CListCtrl m_ToolListCtrl; ///< list control used for viewing and editing
\r
70 typedef std::map<CString,CString> TOOL_MAP;
\r
71 TOOL_MAP m_Tools; ///< internal storage of all tools
\r
72 bool m_ToolsValid; ///< true if m_Tools was ever read
\r