Skip to content

Commit 32a789e

Browse files
MazhoonR1tschY
authored andcommitted
Show list headers as strings.
Previously, only the numerical value was shown. There's no existing code that would do this elsewhere, so parsing is added as a js function on the qml page.
1 parent f54e49e commit 32a789e

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

app/qml/pages/DeviceListPage.qml

+15-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ Page {
217217
id: sectionHeading
218218

219219
SectionHeader {
220-
text: section
220+
text: roleTexts(section)
221221
}
222222
}
223223

@@ -276,6 +276,20 @@ Page {
276276
onTriggered: startup = false
277277
}
278278

279+
function roleTexts(section) {
280+
switch(Number(section)) {
281+
case DeviceListModel.Connected:
282+
return i18n("Connected")
283+
case DeviceListModel.Trusted:
284+
return i18n("Paired devices")
285+
case DeviceListModel.Near:
286+
return i18n("Nearby devices")
287+
case DeviceListModel.Nothing:
288+
default:
289+
return "-"
290+
}
291+
}
292+
279293
function openDevicePage(deviceId) {
280294
if (typeof pageStack === "undefined")
281295
return; // happens when using QmlLive

0 commit comments

Comments
 (0)