| 1 | // For license of this file, see <project-root-folder>/LICENSE.md. |
| 2 | |
| 3 | #ifndef ADBLOCKDIALOG_H |
| 4 | #define ADBLOCKDIALOG_H |
| 5 | |
| 6 | #include "ui_adblockdialog.h" |
| 7 | |
| 8 | #include <QDialog> |
| 9 | |
| 10 | class AdBlockManager; |
| 11 | |
| 12 | class AdBlockDialog : public QDialog { |
| 13 | Q_OBJECT |
| 14 | |
| 15 | public: |
| 16 | explicit AdBlockDialog(QWidget* parent = nullptr); |
| 17 | |
| 18 | protected: |
| 19 | virtual void hideEvent(QHideEvent* event); |
| 20 | |
| 21 | private slots: |
| 22 | void saveOnClose(); |
| 23 | void enableAdBlock(bool enable); |
| 24 | void onAdBlockEnabledChanged(bool enabled, const QString& message); |
| 25 | void onAdBlockProcessTerminated(); |
| 26 | |
| 27 | private: |
| 28 | void loadDialog(); |
| 29 | |
| 30 | private: |
| 31 | AdBlockManager* m_manager; |
| 32 | bool m_loaded; |
| 33 | |
| 34 | Ui::AdBlockDialog m_ui; |
| 35 | }; |
| 36 | |
| 37 | #endif // ADBLOCKDIALOG_H |