From 8e0cfd3899bd5a1276c52475b53e36e2ea38c16c Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Wed, 4 Mar 2020 10:21:06 -0700 Subject: [PATCH] [applet] Standardize presentation on the "devices unavailable" view Summary: This patch makes the "devilces unavailable" page follow the general style used in other similar views throughout Plasma and other KDE software. It also improves the wording of various buttons and headers to make them more context-sensitive and thus more relevant to what the user needs to do to solve the problem. Test Plan: {F8149680} {F8149679} Reviewers: #VDG, #kde-connect Subscribers: --- .../contents/ui/FullRepresentation.qml | 40 +++++++++---------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/plasmoid/package/contents/ui/FullRepresentation.qml b/plasmoid/package/contents/ui/FullRepresentation.qml index 588119c80..506ff117e 100644 --- a/plasmoid/package/contents/ui/FullRepresentation.qml +++ b/plasmoid/package/contents/ui/FullRepresentation.qml @@ -33,30 +33,35 @@ Item { KdeConnect.DevicesModel { id: allDevicesModel } + KdeConnect.DevicesModel { + id: pairedDevicesModel + displayFilter: KdeConnect.DevicesModel.Paired + } ColumnLayout { - spacing: 5 + spacing: units.smallSpacing visible: devicesView.count == 0 anchors.fill: parent - PlasmaExtras.Heading { - id: heading - Layout.fillWidth: true - level: 3 - opacity: 0.6 - text: i18n("No paired devices available") - } - Item { Layout.fillHeight: true } - PlasmaComponents.Label { + PlasmaExtras.Heading { + id: heading Layout.fillWidth: true - Layout.bottomMargin: units.largeSpacing + visible: pairedDevicesModel.count >= 0 + level: 3 + enabled: false + text: pairedDevicesModel.count == 0 ? i18n("No paired devices") : i18np("Paired device is unavailable", "All paired devices are unavailable", pairedDevicesModel.count) + horizontalAlignment: Text.AlignHCenter + wrapMode: Text.WordWrap + } + PlasmaExtras.Heading { + Layout.fillWidth: true visible: allDevicesModel.count == 0 - + level: 3 text: i18n("Install KDE Connect on your Android device to integrate it with Plasma!") horizontalAlignment: Text.AlignHCenter wrapMode: Text.WordWrap @@ -83,12 +88,9 @@ Item { } PlasmaComponents.Button { - Layout.leftMargin: units.largeSpacing - Layout.rightMargin: units.largeSpacing - Layout.topMargin: units.largeSpacing Layout.alignment: Qt.AlignHCenter - Layout.fillWidth: true - text: i18n("KDE Connect Settings...") + text: pairedDevicesModel.count == 0 ? i18n("Pair a Device...") : i18n("Configure...") + iconName: pairedDevicesModel.count == 0 ? "list-add" : "configure" onClicked: KCMShell.open("kcm_kdeconnect") visible: KCMShell.authorize("kcm_kdeconnect.desktop").length > 0 } @@ -97,10 +99,6 @@ Item { Item { Layout.fillHeight: true } - - Item { - height: heading.height - } } /*