This repository has been archived on 2026-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
powersync-app/nymea-app/ui/devicelistpages/GenericDeviceListPage.qml
2018-10-01 17:37:29 +02:00

38 lines
935 B
QML

import QtQuick 2.5
import QtQuick.Controls 2.1
import QtQuick.Layouts 1.1
import Nymea 1.0
import "../components"
import "../delegates"
DeviceListPageBase {
id: root
header: GuhHeader {
text: {
if (root.shownInterfaces.length === 1) {
return qsTr("My %1").arg(app.interfaceToString(root.shownInterfaces[0]))
} else if (root.shownInterfaces.length > 1 || root.hiddenInterfaces.length > 0) {
return qsTr("My things")
}
return qsTr("All my things")
}
onBackPressed: {
pageStack.pop()
}
}
ListView {
anchors.fill: parent
model: root.devicesProxy
delegate: ThingDelegate {
width: parent.width
device: engine.deviceManager.devices.getDevice(model.id);
onClicked: {
enterPage(index, false)
}
}
}
}