diff options
author | Jan Mulder <jlmulder@xs4all.nl> | 2017-09-27 18:56:24 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-09-29 08:13:25 -0700 |
commit | 81eb8466b22fc1fd98a90d1630bfb203bcbaddee (patch) | |
tree | 303dff714dc3987f9013bee900d4f15acc0b71d6 /mobile-widgets | |
parent | 0af64e4986b84cc98dccfa71a85fb978247077ce (diff) | |
download | subsurface-81eb8466b22fc1fd98a90d1630bfb203bcbaddee.tar.gz |
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 <jlmulder@xs4all.nl>
Diffstat (limited to 'mobile-widgets')
-rw-r--r-- | mobile-widgets/qml/Settings.qml | 58 |
1 files changed, 52 insertions, 6 deletions
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 |