From ca4b4227ce89e3d539b3cccf81da38ff22afcd7d Mon Sep 17 00:00:00 2001 From: Matthijs Tijink Date: Mon, 19 Mar 2018 20:12:17 +0100 Subject: [PATCH] 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 --- .../contents/ui/FullRepresentation.qml | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/plasmoid/package/contents/ui/FullRepresentation.qml b/plasmoid/package/contents/ui/FullRepresentation.qml index e09ae2dcc..2a8e7e65e 100644 --- a/plasmoid/package/contents/ui/FullRepresentation.qml +++ b/plasmoid/package/contents/ui/FullRepresentation.qml @@ -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