| | |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | #ifndef CHECKABLEMESSAGEBOX_H |
| | #define CHECKABLEMESSAGEBOX_H |
| |
|
| | #include <QDialog> |
| | #include <QDialogButtonBox> |
| | #include <QMessageBox> |
| | #include <FCGlobal.h> |
| |
|
| | namespace Gui |
| | { |
| | namespace Dialog |
| | { |
| |
|
| | struct DlgCheckableMessageBoxPrivate; |
| |
|
| | |
| | |
| | |
| |
|
| | class GuiExport DlgCheckableMessageBox: public QDialog |
| | { |
| | Q_OBJECT |
| | Q_PROPERTY(QString text READ text WRITE setText) |
| | Q_PROPERTY( |
| | QPixmap iconPixmap READ iconPixmap WRITE setIconPixmap |
| | ) |
| | Q_PROPERTY(bool isChecked READ isChecked WRITE setChecked) |
| | |
| | Q_PROPERTY( |
| | QString checkBoxText READ checkBoxText WRITE setCheckBoxText |
| | ) |
| | Q_PROPERTY( |
| | QDialogButtonBox::StandardButtons buttons READ standardButtons WRITE setStandardButtons |
| | ) |
| | Q_PROPERTY( |
| | QDialogButtonBox::StandardButton defaultButton READ defaultButton WRITE setDefaultButton |
| | ) |
| | public: |
| | explicit DlgCheckableMessageBox(QWidget* parent); |
| | ~DlgCheckableMessageBox() override; |
| |
|
| | static QDialogButtonBox::StandardButton question( |
| | QWidget* parent, |
| | const QString& title, |
| | const QString& question, |
| | const QString& checkBoxText, |
| | bool* checkBoxSetting, |
| | QDialogButtonBox::StandardButtons buttons = QDialogButtonBox::Yes | QDialogButtonBox::No, |
| | QDialogButtonBox::StandardButton defaultButton = QDialogButtonBox::No |
| | ); |
| |
|
| | QString text() const; |
| | void setText(const QString&); |
| |
|
| | void setPrefEntry(const QString& entry); |
| |
|
| | void setPrefPath(const QString& path); |
| |
|
| | void accept() override; |
| | void reject() override; |
| |
|
| | bool isChecked() const; |
| | void setChecked(bool s); |
| |
|
| | QString checkBoxText() const; |
| | void setCheckBoxText(const QString&); |
| |
|
| | QDialogButtonBox::StandardButtons standardButtons() const; |
| | void setStandardButtons(QDialogButtonBox::StandardButtons s); |
| |
|
| | QDialogButtonBox::StandardButton defaultButton() const; |
| | void setDefaultButton(QDialogButtonBox::StandardButton s); |
| |
|
| | |
| | QPixmap iconPixmap() const; |
| | void setIconPixmap(const QPixmap& p); |
| |
|
| | |
| | QAbstractButton* clickedButton() const; |
| | QDialogButtonBox::StandardButton clickedStandardButton() const; |
| |
|
| | |
| | static QMessageBox::StandardButton dialogButtonBoxToMessageBoxButton( |
| | QDialogButtonBox::StandardButton |
| | ); |
| |
|
| | |
| | |
| | |
| | |
| | |
| | static void showMessage( |
| | const QString& header, |
| | const QString& message, |
| | bool check = false, |
| | const QString& checkText = tr("Don't show me again") |
| | ); |
| |
|
| | |
| | |
| | static void showMessage( |
| | const QString& header, |
| | const QString& message, |
| | const QString& prefPath, |
| | const QString& paramEntry, |
| | bool entryDefault = false, |
| | bool check = false, |
| | const QString& checkText = QStringLiteral("Don't show me again") |
| | ); |
| |
|
| | private Q_SLOTS: |
| | void slotClicked(QAbstractButton* b); |
| |
|
| | private: |
| | DlgCheckableMessageBoxPrivate* m_d; |
| | QByteArray paramEntry; |
| | QString prefPath; |
| | }; |
| |
|
| | } |
| | } |
| |
|
| | #endif |
| |
|