Add a refresh button to the plasmoid

Summary: This adds a refresh button to the plasmoid if no device is connected.

Test Plan: Refreshing works, and the button only appears when no devices are connected.

Reviewers: #kde_connect, nicolasfella

Reviewed By: #kde_connect, nicolasfella

Subscribers: apol, nicolasfella, #kde_connect

Differential Revision: https://phabricator.kde.org/D11501
This commit is contained in:
Matthijs Tijink 2018-03-19 20:12:17 +01:00
parent 4096fc3e35
commit ca4b4227ce

View file

@ -19,6 +19,7 @@
*/
import QtQuick 2.1
import QtQuick.Layouts 1.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.extras 2.0 as PlasmaExtras
@ -28,12 +29,25 @@ Item {
id: kdeconnect
property alias devicesModel: devicesView.model
PlasmaExtras.Heading {
width: parent.width
level: 3
opacity: 0.6
text: i18n("No paired devices available")
RowLayout {
visible: devicesView.count==0
width: parent.width
PlasmaExtras.Heading {
Layout.fillWidth: true
level: 3
opacity: 0.6
text: i18n("No paired devices available")
}
PlasmaComponents.Button {
iconSource: "view-refresh"
tooltip: i18n("Search for devices")
onClicked: {
KdeConnect.DaemonDbusInterface.forceOnNetworkChange();
}
}
}
/*
@ -48,6 +62,7 @@ Item {
PlasmaExtras.ScrollArea {
id: dialogItem
anchors.fill: parent
visible: devicesView.count > 0
ListView {
id: devicesView