Hide the plasmoid when no device is connected

Reviewed by albertvaka@gmail.com
This commit is contained in:
Àlex Fiestas 2014-04-12 21:52:25 +02:00
parent 2a235f6496
commit 0029c62a2d

View file

@ -50,6 +50,15 @@ Item {
} }
*/ */
function showPlasmoidBeShown()
{
if (devicesView.count > 0) {
plasmoid.status = ActiveStatus;
} else {
plasmoid.status = PassiveStatus;
}
}
PlasmaExtras.ScrollArea { PlasmaExtras.ScrollArea {
id: dialogItem id: dialogItem
anchors.fill: parent anchors.fill: parent
@ -58,9 +67,12 @@ Item {
id: devicesView id: devicesView
anchors.fill: parent anchors.fill: parent
model: KdeConnect.DevicesModel { model: KdeConnect.DevicesModel {
id: connectDeviceModel
displayFilter: 0x11 displayFilter: 0x11
} }
delegate: DeviceDelegate { } delegate: DeviceDelegate { }
onCountChanged: showPlasmoidBeShown()
Component.onCompleted: showPlasmoidBeShown();
} }
} }