Changeset View
Changeset View
Standalone View
Standalone View
applets/weather/package/contents/ui/config/ConfigWeatherStation.qml
Context not available. | |||||
28 | ColumnLayout { | 28 | ColumnLayout { | ||
---|---|---|---|---|---|
29 | id: weatherStationConfigPage | 29 | id: weatherStationConfigPage | ||
30 | 30 | | |||
31 | property string source | 31 | property alias cfg_services: stationPicker.selectedServices | ||
32 | 32 | property alias cfg_source: stationPicker.source | |||
33 | signal configurationChanged | 33 | property alias cfg_updateInterval: updateIntervalSpin.value | ||
34 | | ||||
35 | function saveConfig() { | | |||
36 | var config = { | | |||
37 | services: stationPicker.selectedServices, | | |||
38 | source: source, | | |||
39 | updateInterval: updateIntervalSpin.value | | |||
40 | }; | | |||
41 | | ||||
42 | plasmoid.nativeInterface.saveConfig(config); | | |||
43 | plasmoid.nativeInterface.configChanged(); | | |||
44 | } | | |||
45 | | ||||
46 | | ||||
47 | Component.onCompleted: { | | |||
48 | var config = plasmoid.nativeInterface.configValues(); | | |||
49 | | ||||
50 | stationPicker.selectedServices = config.services; | | |||
51 | | ||||
52 | source = config.source; | | |||
53 | | ||||
54 | updateIntervalSpin.value = config.updateInterval; | | |||
55 | } | | |||
56 | 34 | | |||
57 | WeatherStationPickerDialog { | 35 | WeatherStationPickerDialog { | ||
58 | id: stationPicker | 36 | id: stationPicker | ||
59 | | ||||
60 | onAccepted: { | | |||
61 | weatherStationConfigPage.source = source; | | |||
62 | weatherStationConfigPage.configurationChanged(); | | |||
63 | } | | |||
64 | } | 37 | } | ||
65 | 38 | | |||
66 | GridLayout { | 39 | GridLayout { | ||
Context not available. | |||||
84 | elide: Text.ElideRight | 57 | elide: Text.ElideRight | ||
85 | 58 | | |||
86 | text: { | 59 | text: { | ||
87 | var sourceDetails = source.split('|'); | 60 | var sourceDetails = cfg_source.split('|'); | ||
88 | if (sourceDetails.length > 2) { | 61 | if (sourceDetails.length > 2) { | ||
89 | return i18nc("A weather station location and the weather service it comes from", | 62 | return i18nc("A weather station location and the weather service it comes from", | ||
90 | "%1 (%2)", sourceDetails[2], sourceDetails[0]); | 63 | "%1 (%2)", sourceDetails[2], sourceDetails[0]); | ||
Context not available. | |||||
117 | stepSize: 5 | 90 | stepSize: 5 | ||
118 | minimumValue: 30 | 91 | minimumValue: 30 | ||
119 | maximumValue: 3600 | 92 | maximumValue: 3600 | ||
120 | onValueChanged: weatherStationConfigPage.configurationChanged(); | | |||
121 | } | 93 | } | ||
122 | } | 94 | } | ||
123 | 95 | | |||
Context not available. |