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