Chris@67: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@67: Chris@67: /* Chris@67: EasyMercurial Chris@67: Chris@67: Based on HgExplorer by Jari Korhonen Chris@67: Copyright (c) 2010 Jari Korhonen Chris@67: Copyright (c) 2010 Chris Cannam Chris@67: Copyright (c) 2010 Queen Mary, University of London Chris@67: Chris@67: This program is free software; you can redistribute it and/or Chris@67: modify it under the terms of the GNU General Public License as Chris@67: published by the Free Software Foundation; either version 2 of the Chris@67: License, or (at your option) any later version. See the file Chris@67: COPYING included with this distribution for more information. Chris@67: */ Chris@67: Chris@67: #ifndef MULTICHOICEDIALOG_H Chris@67: #define MULTICHOICEDIALOG_H Chris@67: Chris@69: #include "recentfiles.h" Chris@69: Chris@67: #include Chris@67: #include Chris@69: #include Chris@68: #include Chris@68: #include Chris@68: #include Chris@68: #include Chris@69: #include Chris@68: #include Chris@69: #include Chris@69: #include Chris@67: Chris@67: class MultiChoiceDialog : public QDialog Chris@67: { Chris@67: Q_OBJECT Chris@67: public: Chris@69: explicit MultiChoiceDialog(QString title, QString heading, Chris@69: QWidget *parent = 0); Chris@67: Chris@67: enum ArgType { Chris@67: NoArg, Chris@67: FileArg, Chris@69: DirectoryArg, Chris@67: UrlArg, Chris@72: UrlToDirectoryArg Chris@67: }; Chris@67: Chris@67: void addChoice(QString identifier, QString text, Chris@67: QString description, ArgType arg); Chris@67: Chris@69: void setCurrentChoice(QString); Chris@69: QString getCurrentChoice(); Chris@67: QString getArgument(); Chris@72: QString getAdditionalArgument(); Chris@67: Chris@72: static void addRecentArgument(QString identifier, QString name, Chris@72: bool additionalArgument = false); Chris@67: Chris@68: private slots: Chris@69: void choiceChanged(); Chris@72: void urlChanged(const QString &); Chris@74: void fileChanged(const QString &); Chris@69: void browse(); Chris@68: Chris@68: private: Chris@199: void updateOkButton(); Chris@199: Chris@68: QMap m_texts; Chris@68: QMap m_descriptions; Chris@69: QMap m_argTypes; Chris@69: QMap > m_recentFiles; Chris@68: Chris@68: QString m_currentChoice; Chris@69: QMap m_choiceButtons; Chris@68: Chris@69: QHBoxLayout *m_choiceLayout; Chris@68: QLabel *m_descriptionLabel; Chris@72: QLabel *m_fileLabel; Chris@72: QComboBox *m_fileCombo; Chris@69: QAbstractButton *m_browseButton; Chris@72: QLabel *m_urlLabel; Chris@72: QComboBox *m_urlCombo; Chris@74: QAbstractButton *m_okButton; Chris@67: }; Chris@67: Chris@67: #endif // MULTICHOICEDIALOG_H