Merge branch 'restructure-tree'
[TortoiseGit.git] / src / TortoiseProc / EditPropertiesDlg.h
blob2b65a3512dc85591a40fdd8186cbd05863a442f1
1 // TortoiseSVN - 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.
19 #pragma once
20 #include "StandAloneDlg.h"
21 #include "SVNRev.h"
22 #include "ProjectProperties.h"
23 #include "Tooltip.h"
25 /**
26 * \ingroup TortoiseProc
27 * dialog showing a list of properties of the files/folders specified with SetPathList().
29 class CEditPropertiesDlg : public CResizableStandAloneDialog
31 DECLARE_DYNAMIC(CEditPropertiesDlg)
33 public:
34 CEditPropertiesDlg(CWnd* pParent = NULL); // standard constructor
35 virtual ~CEditPropertiesDlg();
37 void SetPathList(const CTSVNPathList& pathlist) {m_pathlist = pathlist;}
38 void SetRevision(const SVNRev& rev) {m_revision = rev;}
39 void Refresh();
40 bool HasChanged() {return m_bChanged;}
42 void SetProjectProperties(ProjectProperties * pProps) {m_pProjectProperties = pProps;}
43 void SetUUID(const CString& sUUID) {m_sUUID = sUUID;}
44 void RevProps(bool bRevProps = false) {m_bRevProps = bRevProps;}
46 // Dialog Data
47 enum { IDD = IDD_EDITPROPERTIES };
49 protected:
50 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
51 virtual BOOL OnInitDialog();
52 virtual void OnOK();
53 virtual void OnCancel();
54 virtual BOOL PreTranslateMessage(MSG* pMsg);
55 afx_msg void OnBnClickedHelp();
56 afx_msg void OnNMCustomdrawEditproplist(NMHDR *pNMHDR, LRESULT *pResult);
57 afx_msg void OnBnClickedRemoveProps();
58 afx_msg void OnBnClickedEditprops();
59 afx_msg void OnLvnItemchangedEditproplist(NMHDR *pNMHDR, LRESULT *pResult);
60 afx_msg void OnNMDblclkEditproplist(NMHDR *pNMHDR, LRESULT *pResult);
61 afx_msg void OnBnClickedSaveprop();
62 afx_msg void OnBnClickedAddprops();
63 afx_msg void OnBnClickedExport();
64 afx_msg void OnBnClickedImport();
66 DECLARE_MESSAGE_MAP()
67 private:
68 static UINT PropsThreadEntry(LPVOID pVoid);
69 UINT PropsThread();
70 void EditProps(bool bAdd = false);
72 protected:
73 class PropValue
75 public:
76 PropValue(void) : count(0), allthesamevalue(true), isbinary(false) {};
78 std::string value;
79 stdstring value_without_newlines;
80 int count;
81 bool allthesamevalue;
82 bool isbinary;
84 CTSVNPathList m_pathlist;
85 CListCtrl m_propList;
86 BOOL m_bRecursive;
87 bool m_bChanged;
88 bool m_bRevProps;
89 volatile LONG m_bThreadRunning;
90 std::map<stdstring, PropValue> m_properties;
91 SVNRev m_revision;
92 CToolTips m_tooltips;
94 CString m_sUUID;
95 ProjectProperties * m_pProjectProperties;