Changeset View
Changeset View
Standalone View
Standalone View
kcms/workspaceoptions/workspaceoptions.h
1 | /* | 1 | /* | ||
---|---|---|---|---|---|
2 | * Copyright (C) 2009 Marco Martin <notmart@gmail.com> | 2 | * Copyright (C) 2018 <furkantokac34@gmail.com> | ||
3 | * | 3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | 5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | 6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | 7 | * (at your option) any later version. | ||
8 | * | 8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | 9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. | ||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU General Public License | 14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | 15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
17 | * | | |||
18 | */ | 17 | */ | ||
19 | #ifndef WORKSPACEOPTIONS_H | 18 | #ifndef _KCM_WORKSPACEOPTIONS_H | ||
20 | #define WORKSPACEOPTIONS_H | 19 | #define _KCM_WORKSPACEOPTIONS_H | ||
21 | 20 | | |||
22 | #include <kcmodule.h> | 21 | #include <KQuickAddons/ConfigModule> | ||
23 | #include <ksharedconfig.h> | | |||
24 | #include <kautostart.h> | | |||
25 | | ||||
26 | namespace Ui { | | |||
27 | class MainPage; | | |||
28 | } | | |||
29 | 22 | | |||
30 | class WorkspaceOptionsModule : public KCModule | 23 | class KCMWorkspaceOptions : public KQuickAddons::ConfigModule | ||
31 | { | 24 | { | ||
32 | Q_OBJECT | 25 | Q_OBJECT | ||
26 | Q_PROPERTY(bool toolTip READ getToolTip WRITE setToolTip NOTIFY toolTipChanged) | ||||
27 | Q_PROPERTY(bool visualFeedback READ getVisualFeedback WRITE setVisualFeedback NOTIFY visualFeedbackChanged) | ||||
33 | 28 | | |||
34 | public: | 29 | public: | ||
35 | WorkspaceOptionsModule(QWidget *parent, const QVariantList &); | 30 | KCMWorkspaceOptions(QObject* parent, const QVariantList& args); | ||
36 | ~WorkspaceOptionsModule(); | 31 | ~KCMWorkspaceOptions() {} | ||
37 | void save() override; | 32 | | ||
38 | void load() override; | 33 | // QML Properties | ||
39 | void defaults() override; | 34 | bool getToolTip() const; | ||
35 | void setToolTip(bool state); | ||||
36 | | ||||
37 | bool getVisualFeedback() const; | ||||
38 | void setVisualFeedback(bool state); | ||||
39 | | ||||
40 | public Q_SLOTS: | ||||
41 | void load(); | ||||
42 | void save(); | ||||
43 | void defaults(); | ||||
44 | | ||||
45 | Q_SIGNALS: | ||||
46 | void toolTipChanged(); | ||||
47 | void visualFeedbackChanged(); | ||||
40 | 48 | | |||
41 | private: | 49 | private: | ||
42 | KSharedConfigPtr m_kwinConfig; | 50 | void handleNeedsSave(); | ||
43 | KSharedConfigPtr m_ownConfig; | 51 | | ||
44 | KAutostart m_plasmaShellAutostart; | 52 | // QML variables | ||
45 | KAutostart m_krunnerAutostart; | 53 | bool m_ostateToolTip; // Original state | ||
46 | bool m_currentlyIsDesktop; | 54 | bool m_stateToolTip; // Current state | ||
47 | bool m_currentlyFixedDashboard; | | |||
48 | 55 | | |||
49 | Ui::MainPage *m_ui; | 56 | bool m_ostateVisualFeedback; | ||
57 | bool m_stateVisualFeedback; | ||||
50 | }; | 58 | }; | ||
51 | 59 | | |||
52 | #endif // WORKSPACEOPTIONS_H | 60 | #endif // _KCM_WORKSPACEOPTIONS_H |