1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2003-2008 - 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.
24 * \ingroup TortoiseProc
25 * Helper dialog to configure the external tools used e.g. for diffing/merging/...
27 class CSetProgsAdvDlg
: public CDialog
29 DECLARE_DYNAMIC(CSetProgsAdvDlg
)
32 CSetProgsAdvDlg(const CString
& type
, CWnd
* pParent
= NULL
);
33 virtual ~CSetProgsAdvDlg();
35 enum { IDD
= IDD_SETTINGSPROGSADV
};
39 * Loads the tools from the registry.
45 * Saves the changed tools to the registry.
46 * returns 0 if no restart is needed for the changes to take effect
47 * \remark If the dialog is closed/dismissed without calling
48 * this method first then all settings the user made must be
54 int AddExtension(const CString
& ext
, const CString
& tool
);
55 int FindExtension(const CString
& ext
);
59 virtual void DoDataExchange(CDataExchange
* pDX
);
60 virtual BOOL
OnInitDialog();
61 afx_msg
void OnBnClickedAddtool();
62 afx_msg
void OnBnClickedEdittool();
63 afx_msg
void OnBnClickedRemovetool();
64 afx_msg
void OnNMDblclkToollistctrl(NMHDR
*pNMHDR
, LRESULT
*pResult
);
65 afx_msg
void OnLvnItemchangedToollistctrl(NMHDR
*pNMHDR
, LRESULT
*pResult
);
66 afx_msg
void OnBnClickedRestoredefaults();
71 CString m_sType
; ///< tool type ("Diff" or "Merge")
72 CRegistryKey m_regToolKey
; ///< registry key where the tools are stored
73 CListCtrl m_ToolListCtrl
; ///< list control used for viewing and editing
75 typedef std::map
<CString
,CString
> TOOL_MAP
;
76 TOOL_MAP m_Tools
; ///< internal storage of all tools
77 bool m_ToolsValid
; ///< true if m_Tools was ever read