Chris@175
|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
|
Chris@175
|
2
|
Chris@175
|
3 /*
|
Chris@175
|
4 EasyMercurial
|
Chris@175
|
5
|
Chris@175
|
6 Based on HgExplorer by Jari Korhonen
|
Chris@175
|
7 Copyright (c) 2010 Jari Korhonen
|
Chris@560
|
8 Copyright (c) 2012 Chris Cannam
|
Chris@560
|
9 Copyright (c) 2012 Queen Mary, University of London
|
Chris@175
|
10
|
Chris@175
|
11 This program is free software; you can redistribute it and/or
|
Chris@175
|
12 modify it under the terms of the GNU General Public License as
|
Chris@175
|
13 published by the Free Software Foundation; either version 2 of the
|
Chris@175
|
14 License, or (at your option) any later version. See the file
|
Chris@175
|
15 COPYING included with this distribution for more information.
|
Chris@175
|
16 */
|
Chris@175
|
17
|
Chris@175
|
18 #ifndef SETTINGS_DIALOG_H
|
Chris@175
|
19 #define SETTINGS_DIALOG_H
|
Chris@175
|
20
|
Chris@175
|
21 #include <QDialog>
|
Chris@175
|
22 #include <QLineEdit>
|
Chris@175
|
23 #include <QLabel>
|
Chris@175
|
24 #include <QPushButton>
|
Chris@176
|
25 #include <QCheckBox>
|
Chris@273
|
26 #include <QComboBox>
|
Chris@472
|
27 #include <QTabWidget>
|
mikel@617
|
28 #include <QDateEdit>
|
Chris@175
|
29
|
Chris@175
|
30 class SettingsDialog : public QDialog
|
Chris@175
|
31 {
|
Chris@175
|
32 Q_OBJECT
|
Chris@175
|
33
|
Chris@175
|
34 public:
|
Chris@472
|
35 enum Tab {
|
Chris@472
|
36 PersonalDetailsTab,
|
Chris@472
|
37 PresentationTab,
|
Chris@472
|
38 PathsTab
|
Chris@472
|
39 };
|
Chris@472
|
40
|
Chris@175
|
41 SettingsDialog(QWidget *parent = 0);
|
Chris@230
|
42
|
Chris@472
|
43 void setCurrentTab(Tab tab);
|
Chris@472
|
44
|
Chris@230
|
45 bool presentationChanged() {
|
Chris@230
|
46 return m_presentationChanged;
|
Chris@230
|
47 }
|
Chris@239
|
48
|
Chris@239
|
49 static void findDefaultLocations(QString installPath = m_installPath);
|
Chris@240
|
50 static QString getUnbundledExtensionFileName();
|
Chris@175
|
51
|
Chris@175
|
52 private slots:
|
Chris@175
|
53 void hgPathBrowse();
|
Chris@175
|
54 void diffPathBrowse();
|
Chris@175
|
55 void mergePathBrowse();
|
chris@406
|
56 void sshPathBrowse();
|
Chris@176
|
57 void extensionPathBrowse();
|
Chris@175
|
58
|
Chris@175
|
59 void accept();
|
Chris@239
|
60 void reset();
|
Chris@239
|
61 void clear();
|
Chris@239
|
62 void restoreDefaults();
|
Chris@175
|
63
|
Chris@175
|
64 private:
|
Chris@472
|
65 QTabWidget *m_tabs;
|
Chris@472
|
66
|
Chris@175
|
67 QLineEdit *m_nameEdit;
|
Chris@175
|
68 QLineEdit *m_emailEdit;
|
Chris@195
|
69 QLineEdit *m_hgPathLabel;
|
Chris@195
|
70 QLineEdit *m_diffPathLabel;
|
Chris@195
|
71 QLineEdit *m_mergePathLabel;
|
chris@406
|
72 QLineEdit *m_sshPathLabel;
|
Chris@175
|
73
|
Chris@176
|
74 QCheckBox *m_useExtension;
|
Chris@195
|
75 QLineEdit *m_extensionPathLabel;
|
Chris@176
|
76
|
Chris@230
|
77 QCheckBox *m_showIconLabels;
|
Chris@230
|
78 QCheckBox *m_showExtraText;
|
Chris@273
|
79 QComboBox *m_dateFormat;
|
mikel@617
|
80
|
mikel@617
|
81 QDateEdit *m_dateFrom;
|
mikel@617
|
82
|
Chris@273
|
83 #ifdef NOT_IMPLEMENTED_YET
|
Chris@273
|
84 QComboBox *m_workHistoryArrangement;
|
Chris@273
|
85 #endif
|
Chris@230
|
86
|
Chris@175
|
87 QPushButton *m_ok;
|
Chris@181
|
88
|
Chris@230
|
89 bool m_presentationChanged;
|
Chris@230
|
90
|
Chris@195
|
91 void browseFor(QString, QLineEdit *);
|
Chris@239
|
92
|
Chris@239
|
93 static void findHgBinaryName();
|
Chris@239
|
94 static void findExtension();
|
Chris@239
|
95 static void findDiffBinaryName();
|
Chris@239
|
96 static void findMergeBinaryName();
|
chris@406
|
97 static void findSshBinaryName();
|
Chris@239
|
98
|
Chris@239
|
99 static QString m_installPath;
|
Chris@175
|
100 };
|
Chris@175
|
101
|
Chris@175
|
102 #endif
|