Show text when device is not reachable

This commit is contained in:
Nicolas Fella 2018-11-26 22:56:26 +01:00
parent 1cee137dcb
commit 793c74e89e

View file

@ -43,7 +43,22 @@ Kirigami.Page
Layout.fillHeight: true
Layout.fillWidth: true
sourceComponent: deviceView.currentDevice.hasPairingRequests ? pairDevice : deviceView.currentDevice.isTrusted ? trustedDevice : untrustedDevice
sourceComponent: {
if (deviceView.currentDevice.hasPairingRequests) {
return pairDevice;
}
if (deviceView.currentDevice.isReachable) {
if (deviceView.currentDevice.isTrusted) {
return trustedDevice;
} else {
return untrustedDevice;
}
} else {
return notReachableDevice;
}
}
Component {
id: trustedDevice
ColumnLayout {
@ -154,6 +169,18 @@ Kirigami.Page
}
}
}
Component {
id: notReachableDevice
Item {
property var actions: []
Label {
anchors.centerIn: parent
text: i18n("This device is not reachable")
}
}
}
}
FileDialog {