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 {
id: dialogItem
anchors.fill: parent
@ -58,9 +67,12 @@ Item {
id: devicesView
anchors.fill: parent
model: KdeConnect.DevicesModel {
id: connectDeviceModel
displayFilter: 0x11
}
delegate: DeviceDelegate { }
onCountChanged: showPlasmoidBeShown()
Component.onCompleted: showPlasmoidBeShown();
}
}