summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Joakim Bygdell <j.bygdell@gmail.com>2017-07-20 19:39:55 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-23 03:20:58 +0900
commit6655b37add8c1dbee23d734fa6eb8f4c0bec9aae (patch)
tree2d94e6de766b5a3b24f45114e342673b574d0c88
parente80132cdef038fdff253f59979fbb8789e325315 (diff)
downloadsubsurface-6655b37add8c1dbee23d734fa6eb8f4c0bec9aae.tar.gz
Mobile: consolidate settings to one page and menu entry
Addresses: #492 Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Had a bit of rebase issue with this one. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
-rw-r--r--mobile-widgets/qml/CloudCredentials.qml6
-rw-r--r--mobile-widgets/qml/Settings.qml (renamed from mobile-widgets/qml/Preferences.qml)59
-rw-r--r--mobile-widgets/qml/StartPage.qml1
-rw-r--r--mobile-widgets/qml/main.qml26
-rw-r--r--mobile-widgets/qml/mobile-resources.qrc2
5 files changed, 43 insertions, 51 deletions
diff --git a/mobile-widgets/qml/CloudCredentials.qml b/mobile-widgets/qml/CloudCredentials.qml
index d69f0476c..9a7a8c2bd 100644
--- a/mobile-widgets/qml/CloudCredentials.qml
+++ b/mobile-widgets/qml/CloudCredentials.qml
@@ -9,7 +9,7 @@ import org.subsurfacedivelog.mobile 1.0
Item {
id: loginWindow
- height: outerLayout.height + 2 * Kirigami.Units.gridUnit
+ height: outerLayout.height
property string username: login.text;
property string password: password.text;
@@ -82,7 +82,7 @@ Item {
GridLayout {
columns: 2
- CheckBox {
+ Switch {
checked: false
id: showPassword
onCheckedChanged: {
@@ -104,7 +104,5 @@ Item {
Layout.fillWidth: true
visible: rootItem.showPin
}
-
- Item { width: Kirigami.Units.gridUnit; height: width }
}
}
diff --git a/mobile-widgets/qml/Preferences.qml b/mobile-widgets/qml/Settings.qml
index 7335b0a31..3a0e36478 100644
--- a/mobile-widgets/qml/Preferences.qml
+++ b/mobile-widgets/qml/Settings.qml
@@ -8,8 +8,8 @@ import org.kde.kirigami 2.0 as Kirigami
import org.subsurfacedivelog.mobile 1.0
Kirigami.ScrollablePage {
- objectName: "Preferences"
- title: qsTr("Preferences")
+ objectName: "Settings"
+ title: qsTr("Settings")
anchors.margins: Kirigami.Units.gridUnit / 2
actions {
@@ -27,9 +27,24 @@ Kirigami.ScrollablePage {
}
ColumnLayout {
width: parent.width - Kirigami.Units.gridUnit
+ CloudCredentials {
+ id: cloudCredentials
+ Layout.fillWidth: true
+ Layout.margins: Kirigami.Units.gridUnit
+ Layout.topMargin: 0
+ property int headingLevel: 4
+ }
+ Rectangle {
+ color: subsurfaceTheme.darkerPrimaryColor
+ height: 1
+ opacity: 0.5
+ Layout.columnSpan: 3
+ Layout.fillWidth: true
+ }
GridLayout {
- id: themePrefs
+ id: themeSettings
columns: 2
+ Layout.bottomMargin: Kirigami.Units.gridUnit
Kirigami.Heading {
text: qsTr("Theme")
@@ -39,7 +54,6 @@ Kirigami.ScrollablePage {
Layout.bottomMargin: Kirigami.Units.largeSpacing / 2
Layout.columnSpan: 2
}
-
RadioButton {
id: bluebutton
checked: subsurfaceTheme.currentTheme === "Blue"
@@ -238,6 +252,13 @@ Kirigami.ScrollablePage {
}
}
}
+ Rectangle {
+ color: subsurfaceTheme.darkerPrimaryColor
+ height: 1
+ opacity: 0.5
+ Layout.columnSpan: 3
+ Layout.fillWidth: true
+ }
GridLayout {
id: gpsPrefs
columns: 2
@@ -278,6 +299,13 @@ Kirigami.ScrollablePage {
Layout.fillHeight: true
}
}
+ Rectangle {
+ color: subsurfaceTheme.darkerPrimaryColor
+ height: 1
+ opacity: 0.5
+ Layout.columnSpan: 3
+ Layout.fillWidth: true
+ }
GridLayout {
id: locationService
columns: 2
@@ -318,7 +346,7 @@ Kirigami.ScrollablePage {
columns: 2
width: parent.width
Kirigami.Heading {
- text: qsTr("Debug log for download from divecomputer")
+ text: qsTr("Dive computer")
color: subsurfaceTheme.textColor
level: 4
Layout.topMargin: Kirigami.Units.largeSpacing
@@ -326,31 +354,12 @@ Kirigami.ScrollablePage {
Layout.columnSpan: 2
}
- CheckBox {
+ Switch {
id: libdclogButton
checked: manager.libdcLog
onClicked: {
manager.libdcLog = checked
}
- indicator: Rectangle {
- implicitWidth: 20
- implicitHeight: 20
- x: libdclogButton.leftPadding
- y: parent.height / 2 - height / 2
- radius: 4
- border.color: libdclogButton.down ? subsurfaceTheme.primaryColor : subsurfaceTheme.darkerPrimaryColor
- color: subsurfaceTheme.backgroundColor
-
- Rectangle {
- width: 12
- height: 12
- x: 4
- y: 4
- radius: 3
- color: libdclogButton.down ? subsurfaceTheme.primaryColor : subsurfaceTheme.darkerPrimaryColor
- visible: libdclogButton.checked
- }
- }
}
Kirigami.Label {
text: qsTr("Save detailed log of interaction with the dive computer")
diff --git a/mobile-widgets/qml/StartPage.qml b/mobile-widgets/qml/StartPage.qml
index abc1acc09..e988fb9e9 100644
--- a/mobile-widgets/qml/StartPage.qml
+++ b/mobile-widgets/qml/StartPage.qml
@@ -39,5 +39,6 @@ Kirigami.ScrollablePage {
Layout.topMargin: 0
property int headingLevel: 3
}
+ Item { width: Kirigami.Units.gridUnit; height: 3 * Kirigami.Units.gridUnit}
}
}
diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml
index 0ba47743e..6ff17bc41 100644
--- a/mobile-widgets/qml/main.qml
+++ b/mobile-widgets/qml/main.qml
@@ -242,25 +242,9 @@ if you have network connectivity and want to sync your data to cloud storage."),
Kirigami.Action {
iconName: "icons/ic_settings.svg"
text: qsTr("Settings")
- Kirigami.Action {
- text: qsTr("Cloud credentials")
- onTriggered: {
- returnTopPage()
- oldStatus = manager.credentialStatus
- if (diveList.numDives > 0) {
- manager.startPageText = "Enter different credentials or return to dive list"
- } else {
- manager.startPageText = "Enter valid cloud storage credentials"
- }
- manager.credentialStatus = QMLManager.UNKNOWN
- }
- }
- Kirigami.Action {
- text: qsTr("Preferences")
- onTriggered: {
- stackView.push(prefsWindow)
- detailsWindow.endEditMode()
- }
+ onTriggered: {
+ stackView.push(settingsWindow)
+ detailsWindow.endEditMode()
}
},
Kirigami.Action {
@@ -438,8 +422,8 @@ if you have network connectivity and want to sync your data to cloud storage."),
id: manager
}
- Preferences {
- id: prefsWindow
+ Settings {
+ id: settingsWindow
visible: false
}
diff --git a/mobile-widgets/qml/mobile-resources.qrc b/mobile-widgets/qml/mobile-resources.qrc
index d135a84cd..66a3ee646 100644
--- a/mobile-widgets/qml/mobile-resources.qrc
+++ b/mobile-widgets/qml/mobile-resources.qrc
@@ -1,7 +1,6 @@
<RCC>
<qresource prefix="/qml">
<file>main.qml</file>
- <file>Preferences.qml</file>
<file>About.qml</file>
<file>CloudCredentials.qml</file>
<file>DiveList.qml</file>
@@ -13,6 +12,7 @@
<file>GpsList.qml</file>
<file>HintsTextEdit.qml</file>
<file>Log.qml</file>
+ <file>Settings.qml</file>
<file>ThemeTest.qml</file>
<file>StartPage.qml</file>
<file>dive.jpg</file>