Implement PluginChecker for plugin availability

This commit is contained in:
Aleix Pol 2016-06-12 22:31:09 +02:00
parent f1f0b85d3e
commit 70b6e5f804

View file

@ -60,6 +60,11 @@ Kirigami.Page
Layout.fillWidth: true
Kirigami.BasicListItem {
readonly property var fu: PluginChecker {
id: mprisChecker
pluginName: "mpriscontrol"
}
enabled: mprisChecker.available
label: i18n("Multimedia control")
onClicked: pageStack.push(
"qrc:/qml/mpris.qml",
@ -67,6 +72,11 @@ Kirigami.Page
);
}
Kirigami.BasicListItem {
readonly property var fu: PluginChecker {
id: mousepadChecker
pluginName: "mousepad"
}
enabled: mousepadChecker.available
label: i18n("Remote input")
onClicked: pageStack.push(
"qrc:/qml/mousepad.qml",
@ -74,6 +84,11 @@ Kirigami.Page
);
}
Kirigami.BasicListItem {
readonly property var fu: PluginChecker {
id: lockdeviceChecker
pluginName: "lockdevice"
}
enabled: lockdeviceChecker.available
property var lockIface: LockDeviceDbusInterfaceFactory.create(deviceView.currentDevice.id())
label: lockIface.isLocked ? i18n("Unlock") : i18n("Lock")
onClicked: {