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