Changeset View
Changeset View
Standalone View
Standalone View
kcm/src/outputconfig.h
Show All 16 Lines | |||||
17 | * You should have received a copy of the GNU General Public License | 17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | * | 19 | * | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | #ifndef OUTPUTCONFIG_H | 22 | #ifndef OUTPUTCONFIG_H | ||
23 | #define OUTPUTCONFIG_H | 23 | #define OUTPUTCONFIG_H | ||
24 | 24 | | |||
25 | #include <QGroupBox> | 25 | #include "../../common/control.h" | ||
26 | | ||||
26 | #include <QComboBox> | 27 | #include <QComboBox> | ||
27 | #include <QWidget> | 28 | #include <QWidget> | ||
29 | #include <QRadioButton> | ||||
28 | 30 | | |||
29 | #include <kscreen/output.h> | 31 | #include <kscreen/output.h> | ||
30 | 32 | | |||
31 | class QCheckBox; | 33 | class QCheckBox; | ||
34 | class QGroupBox; | ||||
32 | class ResolutionSlider; | 35 | class ResolutionSlider; | ||
33 | class QLabel; | 36 | class QLabel; | ||
34 | 37 | | |||
35 | 38 | | |||
36 | class OutputConfig : public QWidget | 39 | class OutputConfig : public QWidget | ||
37 | { | 40 | { | ||
38 | Q_OBJECT | 41 | Q_OBJECT | ||
39 | 42 | | |||
40 | public: | 43 | public: | ||
41 | explicit OutputConfig(QWidget *parent); | 44 | explicit OutputConfig(QWidget *parent); | ||
42 | explicit OutputConfig(const KScreen::OutputPtr &output, QWidget *parent = nullptr); | 45 | explicit OutputConfig(const KScreen::OutputPtr &output, QWidget *parent = nullptr); | ||
43 | ~OutputConfig() override; | 46 | ~OutputConfig() override; | ||
44 | 47 | | |||
45 | virtual void setOutput(const KScreen::OutputPtr &output); | 48 | virtual void setOutput(const KScreen::OutputPtr &output, Control::OutputRetention retention = Control::OutputRetention::Undefined); | ||
46 | KScreen::OutputPtr output() const; | 49 | KScreen::OutputPtr output() const; | ||
47 | 50 | | |||
48 | void setTitle(const QString &title); | 51 | void setTitle(const QString &title); | ||
49 | void setShowScaleOption(bool showScaleOption); | 52 | void setShowScaleOption(bool showScaleOption); | ||
50 | bool showScaleOption() const; | 53 | bool showScaleOption() const; | ||
51 | 54 | | |||
55 | bool hasChange() const; | ||||
56 | | ||||
57 | Control::OutputRetention applyRetention(); | ||||
58 | | ||||
52 | protected Q_SLOTS: | 59 | protected Q_SLOTS: | ||
53 | void slotResolutionChanged(const QSize &size); | 60 | void slotResolutionChanged(const QSize &size); | ||
54 | void slotRotationChanged(int index); | 61 | void slotRotationChanged(int index); | ||
55 | void slotRefreshRateChanged(int index); | 62 | void slotRefreshRateChanged(int index); | ||
56 | void slotScaleChanged(int index); | 63 | void slotScaleChanged(int index); | ||
57 | 64 | | |||
58 | Q_SIGNALS: | 65 | Q_SIGNALS: | ||
59 | void changed(); | 66 | void changed(); | ||
60 | 67 | | |||
61 | protected: | 68 | protected: | ||
62 | virtual void initUi(); | 69 | virtual void initUi(); | ||
63 | 70 | | |||
64 | protected: | 71 | protected: | ||
65 | QLabel *mTitle = nullptr; | 72 | QLabel *mTitle = nullptr; | ||
66 | KScreen::OutputPtr mOutput; | 73 | KScreen::OutputPtr mOutput; | ||
67 | QCheckBox *mEnabled = nullptr; | 74 | QCheckBox *mEnabled = nullptr; | ||
68 | ResolutionSlider *mResolution = nullptr; | 75 | ResolutionSlider *mResolution = nullptr; | ||
69 | QComboBox *mRotation = nullptr; | 76 | QComboBox *mRotation = nullptr; | ||
70 | QComboBox *mScale = nullptr; | 77 | QComboBox *mScale = nullptr; | ||
71 | QComboBox *mRefreshRate = nullptr; | 78 | QComboBox *mRefreshRate = nullptr; | ||
72 | bool mShowScaleOption = false; | 79 | bool mShowScaleOption = false; | ||
80 | | ||||
81 | QGroupBox *mRetentionGroupBox = nullptr; | ||||
82 | QRadioButton *mGlobalRetentionButton = nullptr; | ||||
83 | QRadioButton *mIndividualRetentionButton = nullptr; | ||||
84 | | ||||
85 | Control::OutputRetention mRetention = Control::OutputRetention::Undefined; | ||||
86 | | ||||
87 | // TODO: we should do this instead with a separate config being watched | ||||
88 | bool mChanged = false; | ||||
73 | }; | 89 | }; | ||
74 | 90 | | |||
75 | #endif // OUTPUTCONFIG_H | 91 | #endif // OUTPUTCONFIG_H |