Changeset View
Changeset View
Standalone View
Standalone View
kcm/qml/main.qml
Show First 20 Lines • Show All 175 Lines • ▼ Show 20 Line(s) | 28 | Item { | |||
---|---|---|---|---|---|
176 | } | 176 | } | ||
177 | 177 | | |||
178 | MessageDialog { | 178 | MessageDialog { | ||
179 | id: deleteConfirmationDialog | 179 | id: deleteConfirmationDialog | ||
180 | 180 | | |||
181 | property string connectionName | 181 | property string connectionName | ||
182 | property string connectionPath | 182 | property string connectionPath | ||
183 | 183 | | |||
184 | /* Like QString::toHtmlEscaped */ | ||||
185 | function toHtmlEscaped(s) { | ||||
186 | return s.replace(/[&<>]/g, function (tag) { | ||||
187 | return { | ||||
188 | '&': '&', | ||||
189 | '<': '<', | ||||
190 | '>': '>' | ||||
191 | }[tag] || tag | ||||
192 | }); | ||||
193 | } | ||||
194 | | ||||
184 | icon: StandardIcon.Question | 195 | icon: StandardIcon.Question | ||
185 | standardButtons: StandardButton.Ok | StandardButton.Cancel | 196 | standardButtons: StandardButton.Ok | StandardButton.Cancel | ||
186 | title: i18nc("@title:window", "Remove Connection") | 197 | title: i18nc("@title:window", "Remove Connection") | ||
187 | text: i18n("Do you want to remove the connection '%1'?", connectionName) | 198 | text: i18n("Do you want to remove the connection '%1'?", toHtmlEscaped(connectionName)) | ||
188 | 199 | | |||
189 | onAccepted: { | 200 | onAccepted: { | ||
190 | if (connectionPath == connectionView.currentConnectionPath) { | 201 | if (connectionPath == connectionView.currentConnectionPath) { | ||
191 | // Deselect now non-existing connection | 202 | // Deselect now non-existing connection | ||
192 | deselectConnections() | 203 | deselectConnections() | ||
193 | } | 204 | } | ||
194 | handler.removeConnection(connectionPath) | 205 | handler.removeConnection(connectionPath) | ||
195 | } | 206 | } | ||
Show All 19 Lines |