Changeset View
Changeset View
Standalone View
Standalone View
applets/weather/package/contents/ui/config/WeatherStationPicker.qml
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | 46 | onLocationSearchDone: { | |||
---|---|---|---|---|---|
56 | } | 56 | } | ||
57 | } | 57 | } | ||
58 | } | 58 | } | ||
59 | 59 | | |||
60 | ServiceListModel { | 60 | ServiceListModel { | ||
61 | id: serviceListModel | 61 | id: serviceListModel | ||
62 | } | 62 | } | ||
63 | 63 | | |||
64 | QQC2.Menu { | 64 | Kirigami.FormLayout { | ||
65 | id: serviceSelectionMenu | 65 | ColumnLayout { | ||
66 | Kirigami.FormData.label: i18n("Weather providers:") | ||||
broulik: Perhaps just "Weather Providers:"? | |||||
67 | Kirigami.FormData.buddyFor: calendarPluginsRepeater.itemAt(0) | ||||
broulik: How about `calendarPluginsRepeater.itemAt(0)` | |||||
66 | 68 | | |||
67 | Instantiator { | 69 | Repeater { | ||
70 | id: calendarPluginsRepeater | ||||
68 | model: serviceListModel | 71 | model: serviceListModel | ||
69 | delegate: QQC2.MenuItem { | 72 | delegate: QQC2.CheckBox { | ||
70 | text: model.display | 73 | text: model.display | ||
71 | checkable: true | | |||
72 | checked: model.checked | 74 | checked: model.checked | ||
73 | | ||||
74 | onToggled: { | 75 | onToggled: { | ||
75 | model.checked = checked; | 76 | model.checked = checked; | ||
76 | checked = Qt.binding(function() { return model.checked; }); | 77 | checked = Qt.binding(function() { return model.checked; }); | ||
77 | weatherStationConfigPage.configurationChanged(); | 78 | weatherStationConfigPage.configurationChanged(); | ||
78 | } | 79 | } | ||
79 | } | 80 | } | ||
80 | onObjectAdded: serviceSelectionMenu.insertItem(index, object) | | |||
81 | onObjectRemoved: serviceSelectionMenu.removeItem(object) | | |||
82 | } | 81 | } | ||
83 | 82 | } | |||
84 | } | 83 | } | ||
85 | 84 | | |||
86 | RowLayout { | 85 | RowLayout { | ||
87 | Layout.fillWidth: true | 86 | Layout.fillWidth: true | ||
88 | 87 | | |||
88 | enabled: selectedServices.length > 0 | ||||
89 | | ||||
89 | Kirigami.SearchField { | 90 | Kirigami.SearchField { | ||
90 | id: searchStringEdit | 91 | id: searchStringEdit | ||
91 | 92 | | |||
92 | Layout.fillWidth: true | 93 | Layout.fillWidth: true | ||
93 | Layout.minimumWidth: implicitWidth | 94 | Layout.minimumWidth: implicitWidth | ||
94 | focus: true | 95 | focus: true | ||
95 | placeholderText: i18nc("@info:placeholder", "Enter location") | 96 | placeholderText: i18nc("@info:placeholder", "Enter location") | ||
96 | onAccepted: { | 97 | onAccepted: { | ||
97 | searchLocation(); | 98 | searchLocation(); | ||
98 | } | 99 | } | ||
99 | } | 100 | } | ||
100 | 101 | | |||
101 | QQC2.Button { | 102 | QQC2.Button { | ||
102 | id: serviceSelectionButton | | |||
103 | | ||||
104 | icon.name: "services" | | |||
105 | | ||||
106 | checkable: true | | |||
107 | checked: serviceSelectionMenu.opened | | |||
108 | onClicked: serviceSelectionMenu.popup(serviceSelectionButton, serviceSelectionButton.width - serviceSelectionMenu.width, serviceSelectionButton.height) | | |||
109 | | ||||
110 | QQC2.ToolTip { | | |||
111 | text: i18nc("@info:tooltip", "Select weather services providers") | | |||
112 | visible: hovered | | |||
113 | } | | |||
114 | } | | |||
115 | | ||||
116 | QQC2.Button { | | |||
117 | id: searchButton | 103 | id: searchButton | ||
118 | 104 | | |||
119 | icon.name: "edit-find" | 105 | icon.name: "edit-find" | ||
120 | text: i18nc("@action:button", "Search") | 106 | text: i18nc("@action:button", "Search") | ||
121 | enabled: canSearch | 107 | enabled: canSearch | ||
122 | 108 | | |||
123 | onClicked: { | 109 | onClicked: { | ||
124 | searchLocation(); | 110 | searchLocation(); | ||
125 | } | 111 | } | ||
126 | } | 112 | } | ||
127 | } | 113 | } | ||
128 | 114 | | |||
129 | QQC2.ScrollView { | 115 | QQC2.ScrollView { | ||
130 | Layout.fillWidth: true | 116 | Layout.fillWidth: true | ||
131 | Layout.fillHeight: true | 117 | Layout.fillHeight: true | ||
132 | 118 | | |||
119 | enabled: selectedServices.length > 0 | ||||
120 | | ||||
133 | Component.onCompleted: { | 121 | Component.onCompleted: { | ||
134 | background.visible = true; | 122 | background.visible = true; | ||
135 | } | 123 | } | ||
136 | 124 | | |||
137 | ListView { | 125 | ListView { | ||
138 | id: locationListView | 126 | id: locationListView | ||
139 | model: locationListModel | 127 | model: locationListModel | ||
140 | clip: true | 128 | clip: true | ||
▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines |
Perhaps just "Weather Providers:"?