Mercurial > hg > easyhg
comparison multichoicedialog.h @ 68:b918e57c7bea
* Flesh out multi-choice dialog a big
| author | Chris Cannam |
|---|---|
| date | Wed, 17 Nov 2010 22:13:34 +0000 |
| parents | be627aeceaed |
| children | 6d5a5571caec |
comparison
equal
deleted
inserted
replaced
| 67:be627aeceaed | 68:b918e57c7bea |
|---|---|
| 18 #ifndef MULTICHOICEDIALOG_H | 18 #ifndef MULTICHOICEDIALOG_H |
| 19 #define MULTICHOICEDIALOG_H | 19 #define MULTICHOICEDIALOG_H |
| 20 | 20 |
| 21 #include <QDialog> | 21 #include <QDialog> |
| 22 #include <QString> | 22 #include <QString> |
| 23 #include <QPushButton> | |
| 24 #include <QMap> | |
| 25 #include <QLabel> | |
| 26 #include <QLineEdit> | |
| 27 #include <QGridLayout> | |
| 28 #include <QStackedWidget> | |
| 23 | 29 |
| 24 class MultiChoiceDialog : public QDialog | 30 class MultiChoiceDialog : public QDialog |
| 25 { | 31 { |
| 26 Q_OBJECT | 32 Q_OBJECT |
| 27 public: | 33 public: |
| 28 explicit MultiChoiceDialog(QWidget *parent = 0); | 34 explicit MultiChoiceDialog(QString title, QString heading, QWidget *parent = 0); |
| 29 | 35 |
| 30 enum ArgType { | 36 enum ArgType { |
| 31 NoArg, | 37 NoArg, |
| 32 FileArg, | 38 FileArg, |
| 33 UrlArg, | 39 UrlArg, |
| 40 QString getSelectedIdentifier(); | 46 QString getSelectedIdentifier(); |
| 41 QString getArgument(); | 47 QString getArgument(); |
| 42 | 48 |
| 43 signals: | 49 signals: |
| 44 | 50 |
| 45 public slots: | 51 private slots: |
| 52 | |
| 53 | |
| 54 private: | |
| 55 void updateArgWidgets(); // when choice changes | |
| 56 | |
| 57 QMap<QString, QString> m_texts; | |
| 58 QMap<QString, QString> m_descriptions; | |
| 59 | |
| 60 QString m_currentChoice; | |
| 61 QMap<QString, QPushButton *> m_choiceButtons; | |
| 62 | |
| 63 QGridLayout *m_choiceLayout; | |
| 64 QLabel *m_descriptionLabel; | |
| 65 QLabel *m_argLabel; | |
| 66 QLineEdit *m_argEdit; | |
| 67 QPushButton *m_browseButton; | |
| 46 | 68 |
| 47 }; | 69 }; |
| 48 | 70 |
| 49 #endif // MULTICHOICEDIALOG_H | 71 #endif // MULTICHOICEDIALOG_H |
