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
2019-07-04 23:45:31 +02:00

39 lines
938 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: NymeaHeader {
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)
}
}
}
}