From 81eb8466b22fc1fd98a90d1630bfb203bcbaddee Mon Sep 17 00:00:00 2001 From: Jan Mulder Date: Wed, 27 Sep 2017 18:56:24 +0200 Subject: QML UI: rework cloud credentials block Previously, we could edit the cloud credentials in basically two places. At startup of the app from a fresh install (and no previous data on the device), and from the settings. Issue #515 proposes only one way. However, we need a way to access the new credential UI pages, so that the pages at a fresh install of the app can be reused, for example for account switching. This commit replaces the settings cloud credentials block by a simple (not editable) display of the current credentials, and a button to access the initial pages, for all management tasks on the credentials. Signed-off-by: Jan Mulder --- mobile-widgets/qml/Settings.qml | 58 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 52 insertions(+), 6 deletions(-) (limited to 'mobile-widgets/qml') diff --git a/mobile-widgets/qml/Settings.qml b/mobile-widgets/qml/Settings.qml index 42c9c98ad..2dc77bbc4 100644 --- a/mobile-widgets/qml/Settings.qml +++ b/mobile-widgets/qml/Settings.qml @@ -13,16 +13,62 @@ Kirigami.ScrollablePage { title: qsTr("Settings") property real gridWidth: settingsPage.width - Kirigami.Units.gridUnit + property var describe: [qsTr("Undefined"), + qsTr("Incorrect username/password combination"), + qsTr("Credentials need to be verified"), + qsTr("Credentials verified"), + qsTr("No cloud mode")] ColumnLayout { width: gridWidth - CloudCredentials { - id: cloudCredentials - Layout.fillWidth: true - Layout.rightMargin: Kirigami.Units.smallSpacing - Layout.topMargin: - Kirigami.Units.gridUnit - property int headingLevel: 4 + GridLayout { + id: cloudSetting + columns: 3 + Layout.bottomMargin: Kirigami.Units.gridUnit + + Kirigami.Heading { + text: qsTr("Cloud status") + color: subsurfaceTheme.textColor + level: 4 + Layout.topMargin: Kirigami.Units.largeSpacing + Layout.bottomMargin: Kirigami.Units.largeSpacing / 2 + Layout.columnSpan: 3 + } + Kirigami.Label { + text: qsTr("Email") + Layout.alignment: Qt.AlignRight + Layout.preferredWidth:gridWidth * 0.15 + Layout.preferredHeight: Kirigami.Units.gridUnit * 2 + } + Kirigami.Label { + text: manager.credentialStatus === QMLManager.CS_NOCLOUD?qsTr("Not applicable"):manager.cloudUserName + Layout.alignment: Qt.AlignRight + Layout.preferredWidth:gridWidth * 0.60 + Layout.preferredHeight: Kirigami.Units.gridUnit * 2 + } + SsrfButton { + id:changeCloudSettings + Layout.alignment: Qt.AlignRight + text: qsTr("Change") + onClicked: { + manager.cancelCredentialsPinSetup() + rootItem.returnTopPage() + } + } + Kirigami.Label { + text: qsTr("Status") + Layout.alignment: Qt.AlignRight + Layout.preferredWidth:gridWidth * 0.15 + Layout.preferredHeight: Kirigami.Units.gridUnit * 2 + } + Kirigami.Label { + text: describe[manager.credentialStatus] + Layout.alignment: Qt.AlignRight + Layout.preferredWidth:gridWidth * 0.60 + Layout.preferredHeight: Kirigami.Units.gridUnit * 2 + } } + Rectangle { color: subsurfaceTheme.darkerPrimaryColor height: 1 -- cgit v1.2.3-70-g09d2