| 1 | // For license of this file, see <project-root-folder>/LICENSE.md. |
| 2 | |
| 3 | #ifndef FORMDATABASECLEANUP_H |
| 4 | #define FORMDATABASECLEANUP_H |
| 5 | |
| 6 | #include "database/databasecleaner.h" |
| 7 | |
| 8 | #include "ui_formdatabasecleanup.h" |
| 9 | |
| 10 | #include <QDialog> |
| 11 | |
| 12 | class FormDatabaseCleanup : public QDialog { |
| 13 | Q_OBJECT |
| 14 | |
| 15 | public: |
| 16 | explicit FormDatabaseCleanup(QWidget* parent = nullptr); |
| 17 | virtual ~FormDatabaseCleanup() = default; |
| 18 | |
| 19 | protected: |
| 20 | virtual void closeEvent(QCloseEvent* event); |
| 21 | virtual void hideEvent(QHideEvent* event); |
| 22 | virtual void keyPressEvent(QKeyEvent* event); |
| 23 | |
| 24 | private slots: |
| 25 | void updateDaysSuffix(int number); |
| 26 | void startPurging(); |
| 27 | void onPurgeStarted(); |
| 28 | void onPurgeProgress(int progress, const QString& description); |
| 29 | void onPurgeFinished(bool finished); |
| 30 | |
| 31 | signals: |
| 32 | void purgeRequested(const CleanerOrders& which_data); |
| 33 | |
| 34 | private: |
| 35 | void loadDatabaseInfo(); |
| 36 | |
| 37 | private: |
| 38 | QScopedPointer<Ui::FormDatabaseCleanup> m_ui; |
| 39 | DatabaseCleaner m_cleaner; |
| 40 | }; |
| 41 | |
| 42 | #endif // FORMDATABASECLEANUP_H |