File indexing completed on 2024-12-01 11:10:36

0001 /*
0002     SPDX-FileCopyrightText: 2021 Michail Vourlakos <mvourlakos@gmail.com>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #ifndef VIEWSDIALOG_H
0007 #define VIEWSDIALOG_H
0008 
0009 // local
0010 #include "../generic/genericdialog.h"
0011 #include "../settingsdialog/settingsdialog.h"
0012 
0013 // Qt
0014 #include <QDialog>
0015 #include <QObject>
0016 #include <QPushButton>
0017 
0018 namespace Ui {
0019 class ViewsDialog;
0020 }
0021 
0022 namespace Latte {
0023 namespace Settings {
0024 namespace Controller {
0025 class Layouts;
0026 }
0027 namespace Handler {
0028 class ViewsHandler;
0029 }
0030 }
0031 }
0032 
0033 namespace Latte {
0034 namespace Settings {
0035 namespace Dialog {
0036 
0037 class ViewsDialog : public GenericDialog
0038 {
0039     Q_OBJECT
0040 
0041 public:
0042     ViewsDialog(SettingsDialog *parent, Controller::Layouts *controller);
0043     ~ViewsDialog();
0044 
0045     Latte::Corona *corona() const;
0046 
0047     Ui::ViewsDialog *ui() const;
0048     Controller::Layouts *layoutsController() const;
0049 
0050 protected:
0051     void accept() override;
0052 
0053 private slots:
0054     void loadConfig();
0055     void saveConfig();
0056 
0057     void onOk();
0058     void onApply();
0059     void onCancel();
0060     void onReset();
0061 
0062     void updateApplyButtonsState();
0063 
0064 private:
0065     SettingsDialog *m_parentDlg{nullptr};
0066     Ui::ViewsDialog *m_ui;
0067     Controller::Layouts *m_layoutsController{nullptr};
0068 
0069     QPushButton *m_applyNowBtn{nullptr};
0070 
0071     Handler::ViewsHandler *m_handler;   
0072 
0073     //! properties
0074     QSize m_windowSize;
0075 
0076     //! storage
0077     KConfigGroup m_storage;
0078 };
0079 
0080 }
0081 }
0082 }
0083 
0084 #endif