annotate src/settingsdialog.h @ 472:2d57b81671de

Open the settings dialog at Paths tab when invoking it because of a failure to run hg
author Chris Cannam
date Thu, 14 Jul 2011 13:56:20 +0100
parents c567fed39559
children 7e8688784980
rev   line source
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@244 8 Copyright (c) 2011 Chris Cannam
Chris@244 9 Copyright (c) 2011 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>
Chris@175 28
Chris@175 29 class SettingsDialog : public QDialog
Chris@175 30 {
Chris@175 31 Q_OBJECT
Chris@175 32
Chris@175 33 public:
Chris@472 34 enum Tab {
Chris@472 35 PersonalDetailsTab,
Chris@472 36 PresentationTab,
Chris@472 37 PathsTab
Chris@472 38 };
Chris@472 39
Chris@175 40 SettingsDialog(QWidget *parent = 0);
Chris@230 41
Chris@472 42 void setCurrentTab(Tab tab);
Chris@472 43
Chris@230 44 bool presentationChanged() {
Chris@230 45 return m_presentationChanged;
Chris@230 46 }
Chris@239 47
Chris@239 48 static void findDefaultLocations(QString installPath = m_installPath);
Chris@240 49 static QString getUnbundledExtensionFileName();
Chris@175 50
Chris@175 51 private slots:
Chris@175 52 void hgPathBrowse();
Chris@175 53 void diffPathBrowse();
Chris@175 54 void mergePathBrowse();
chris@406 55 void sshPathBrowse();
Chris@178 56 void editPathBrowse();
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@195 73 QLineEdit *m_editPathLabel;
Chris@175 74
Chris@176 75 QCheckBox *m_useExtension;
Chris@195 76 QLineEdit *m_extensionPathLabel;
Chris@176 77
Chris@230 78 QCheckBox *m_showIconLabels;
Chris@230 79 QCheckBox *m_showExtraText;
Chris@273 80 QComboBox *m_dateFormat;
Chris@273 81 #ifdef NOT_IMPLEMENTED_YET
Chris@273 82 QComboBox *m_workHistoryArrangement;
Chris@273 83 #endif
Chris@230 84
Chris@175 85 QPushButton *m_ok;
Chris@181 86
Chris@230 87 bool m_presentationChanged;
Chris@230 88
Chris@195 89 void browseFor(QString, QLineEdit *);
Chris@239 90
Chris@239 91 static void findHgBinaryName();
Chris@239 92 static void findExtension();
Chris@239 93 static void findDiffBinaryName();
Chris@239 94 static void findMergeBinaryName();
chris@406 95 static void findSshBinaryName();
Chris@239 96 static void findEditorBinaryName();
Chris@239 97
Chris@239 98 static QString m_installPath;
Chris@175 99 };
Chris@175 100
Chris@175 101 #endif