1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 2 3 /* 4 Sonic Visualiser 5 An audio file viewer and annotation editor. 6 Centre for Digital Music, Queen Mary, University of London. 7 This file copyright 2006 Chris Cannam. 8 9 This program is free software; you can redistribute it and/or 10 modify it under the terms of the GNU General Public License as 11 published by the Free Software Foundation; either version 2 of the 12 License, or (at your option) any later version. See the file 13 COPYING included with this distribution for more information. 14 */ 15 16 #ifndef SV_LIST_INPUT_DIALOG_H 17 #define SV_LIST_INPUT_DIALOG_H 18 19 #include <QDialog> 20 #include <QString> 21 #include <QStringList> 22 23 #include <vector> 24 25 class QRadioButton; 26 class QLabel; 27 28 /** 29 * Like QInputDialog::getItem(), except that it offers the items as a 30 * set of radio buttons instead of in a single combo box. 31 */ 32 33 class ListInputDialog : public QDialog 34 { 35 Q_OBJECT 36 37 public: 38 ListInputDialog(QWidget *parent, const QString &title, 39 const QString &label, const QStringList &list, 40 int current = 0); 41 virtual ~ListInputDialog(); 42 43 void setItemAvailability(int item, bool available); 44 void setFootnote(QString footnote); 45 46 QString getCurrentString() const; 47 48 static QString getItem(QWidget *parent, const QString &title, 49 const QString &label, const QStringList &list, 50 int current = 0, bool *ok = 0); 51 52 protected: 53 QStringList m_strings; 54 std::vector<QRadioButton *> m_radioButtons; 55 QLabel *m_footnote; 56 }; 57 58 #endif 59