# HG changeset patch # User Chris Cannam # Date 1173958479 0 # Node ID 512ead25e8421ab9b649c18e7777133b178f4f53 # Parent e52ed907cc4258991ef95ebf0c9a98db948400de * Grey out exporting entire pane as image if it will be too wide for QImage diff -r e52ed907cc42 -r 512ead25e842 widgets/ListInputDialog.cpp --- a/widgets/ListInputDialog.cpp Thu Mar 15 11:34:20 2007 +0000 +++ b/widgets/ListInputDialog.cpp Thu Mar 15 11:34:39 2007 +0000 @@ -46,6 +46,10 @@ vbox->addStretch(1); + m_footnote = new QLabel; + vbox->addWidget(m_footnote); + m_footnote->hide(); + QHBoxLayout *hbox = new QHBoxLayout; vbox->addLayout(hbox, Qt::AlignRight); @@ -81,6 +85,19 @@ return ""; } +void +ListInputDialog::setItemAvailability(int item, bool available) +{ + m_radioButtons[item]->setEnabled(available); +} + +void +ListInputDialog::setFootnote(QString footnote) +{ + m_footnote->setText(footnote); + m_footnote->show(); +} + QString ListInputDialog::getItem(QWidget *parent, const QString &title, const QString &label, const QStringList &list, diff -r e52ed907cc42 -r 512ead25e842 widgets/ListInputDialog.h --- a/widgets/ListInputDialog.h Thu Mar 15 11:34:20 2007 +0000 +++ b/widgets/ListInputDialog.h Thu Mar 15 11:34:39 2007 +0000 @@ -23,6 +23,7 @@ #include class QRadioButton; +class QLabel; /** * Like QInputDialog::getItem(), except that it offers the items as a @@ -34,21 +35,24 @@ Q_OBJECT public: + ListInputDialog(QWidget *parent, const QString &title, + const QString &label, const QStringList &list, + int current = 0, Qt::WFlags f = 0); virtual ~ListInputDialog(); + void setItemAvailability(int item, bool available); + void setFootnote(QString footnote); + + QString getCurrentString() const; + static QString getItem(QWidget *parent, const QString &title, const QString &label, const QStringList &list, int current = 0, bool *ok = 0, Qt::WFlags f = 0); protected: - ListInputDialog(QWidget *parent, const QString &title, - const QString &label, const QStringList &list, - int current = 0, Qt::WFlags f = 0); - - QString getCurrentString() const; - QStringList m_strings; std::vector m_radioButtons; + QLabel *m_footnote; }; #endif