OSDN Git Service

Show Ignore Sub Menu
[tortoisegit/TortoiseGitJp.git] / TortoiseProc / Settings / SetProgsAdvDlg.h
1 // TortoiseSVN - a Windows shell extension for easy version control\r
2 \r
3 // Copyright (C) 2003-2008 - TortoiseSVN\r
4 \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
9 \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
14 \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
18 //\r
19 #pragma once\r
20 \r
21 #include "Registry.h"\r
22 \r
23 /**\r
24  * \ingroup TortoiseProc\r
25  * Helper dialog to configure the external tools used e.g. for diffing/merging/...\r
26  */\r
27 class CSetProgsAdvDlg : public CDialog\r
28 {\r
29         DECLARE_DYNAMIC(CSetProgsAdvDlg)\r
30 \r
31 public:\r
32         CSetProgsAdvDlg(const CString& type, CWnd* pParent = NULL);\r
33         virtual ~CSetProgsAdvDlg();\r
34         /**\r
35          * Loads the tools from the registry.\r
36          */\r
37         void LoadData();\r
38         /**\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
43          * discarded!\r
44          */\r
45         int SaveData();\r
46 \r
47         int AddExtension(const CString& ext, const CString& tool);\r
48         int FindExtension(const CString& ext);\r
49         void EnableBtns();\r
50 \r
51         enum { IDD = IDD_SETTINGSPROGSADV };\r
52 \r
53 protected:\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
62 \r
63         DECLARE_MESSAGE_MAP()\r
64 \r
65 private:\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
69 \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
73 };\r