| #pragma once |
| |
| #ifndef VALIDATEDCHOICEDIALOG_H |
| #define VALIDATEDCHOICEDIALOG_H |
| |
| |
| #include "tcommon.h" |
| |
| |
| #include "toonzqt/dvdialog.h" |
| |
| #undef DVAPI |
| #undef DVVAR |
| #ifdef TOONZQT_EXPORTS |
| #define DVAPI DV_EXPORT_API |
| #define DVVAR DV_EXPORT_VAR |
| #else |
| #define DVAPI DV_IMPORT_API |
| #define DVVAR DV_IMPORT_VAR |
| #endif |
| |
| |
| |
| |
| |
| class QButtonGroup; |
| |
| |
| |
| |
| |
| |
| |
| namespace DVGui { |
| |
| |
| |
| |
| |
| |
| |
| |
| class DVAPI ValidatedChoiceDialog : public DVGui::Dialog { |
| Q_OBJECT |
| |
| public: |
| enum Options |
| { NO_OPTIONS = 0x0, |
| APPLY_TO_ALL = |
| 0x1 |
| |
| |
| }; |
| |
| enum DefaultResolution |
| { NO_REQUIRED_RESOLUTION = |
| 0, |
| |
| CANCEL = 1, |
| |
| DEFAULT_RESOLUTIONS_COUNT }; |
| |
| public: |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| ValidatedChoiceDialog(QWidget *parent, |
| Options opts = NO_OPTIONS); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| int execute( |
| void *obj); |
| |
| |
| virtual void |
| reset(); |
| |
| protected: |
| QButtonGroup *m_buttonGroup; |
| |
| protected: |
| |
| |
| |
| |
| |
| |
| virtual QString acceptResolution( |
| void *obj, |
| int resolution, |
| |
| bool applyToAll |
| |
| ) = 0; |
| |
| |
| |
| |
| |
| virtual void initializeUserInteraction(const void *obj) { |
| } |
| |
| bool appliedToAll() const { |
| return m_appliedToAll; |
| } |
| int appliedToAllResolution() const { |
| return m_appliedToAllRes; |
| } |
| |
| private: |
| QLabel *m_label; |
| |
| int m_appliedToAllRes; |
| bool m_appliedToAll, |
| |
| m_applyToAll; |
| |
| |
| private slots: |
| |
| void onApplyToAll(); |
| }; |
| |
| } |
| |
| #endif |