Differential D12433 Diff 33503 plasmacalendarplugins/astronomical/config/qml/AstronomicalEventsConfig.qml
Changeset View
Changeset View
Standalone View
Standalone View
plasmacalendarplugins/astronomical/config/qml/AstronomicalEventsConfig.qml
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | Copyright 2018 Friedrich W. H. Kossebau <kossebau@kde.org> | ||||
3 | | ||||
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 | ||||
6 | the Free Software Foundation; either version 2 of the License, or | ||||
7 | (at your option) any later version. | ||||
8 | | ||||
9 | This program is distributed in the hope that it will be useful, | ||||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
12 | GNU General Public License for more details. | ||||
13 | | ||||
14 | You should have received a copy of the GNU General Public License | ||||
15 | along with this program. If not, see <http://www.gnu.org/licenses/> | ||||
16 | */ | ||||
17 | | ||||
18 | import QtQuick 2.0 | ||||
19 | | ||||
20 | import QtQuick.Controls 1.2 as QtControls | ||||
21 | import QtQuick.Layouts 1.0 | ||||
22 | | ||||
23 | import org.kde.plasmacalendar.astronomicaleventsconfig 1.0 | ||||
24 | | ||||
25 | ColumnLayout { | ||||
26 | id: configPage | ||||
27 | | ||||
28 | // expected API | ||||
29 | signal configurationChanged | ||||
30 | | ||||
31 | // expected API | ||||
32 | function saveConfig() | ||||
33 | { | ||||
34 | configStorage.isLunarPhaseShown = showLunarPhasesCheckBox.checked; | ||||
35 | configStorage.isSeasonShown = showSeasonsCheckBox.checked; | ||||
36 | | ||||
37 | configStorage.save(); | ||||
38 | } | ||||
39 | | ||||
40 | ConfigStorage { | ||||
41 | id: configStorage | ||||
42 | } | ||||
43 | | ||||
44 | QtControls.CheckBox { | ||||
45 | id: showLunarPhasesCheckBox | ||||
46 | | ||||
47 | checked: configStorage.isLunarPhaseShown | ||||
48 | text: i18ndc("plasma_calendar_astronomicalevents", "@option:check", "Show lunar phases") | ||||
49 | onCheckedChanged: configPage.configurationChanged(); | ||||
50 | } | ||||
51 | | ||||
52 | QtControls.CheckBox { | ||||
53 | id: showSeasonsCheckBox | ||||
54 | | ||||
55 | checked: configStorage.isSeasonShown | ||||
56 | text: i18ndc("plasma_calendar_astronomicalevents", "@option:check", "Show astronomical seasons (solstices and equinoxes)") | ||||
57 | onCheckedChanged: configPage.configurationChanged(); | ||||
58 | } | ||||
59 | | ||||
60 | Item { // tighten layout | ||||
61 | Layout.fillHeight: true | ||||
62 | } | ||||
63 | } |