mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
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>
This commit is contained in:
parent
e80132cdef
commit
6655b37add
5 changed files with 43 additions and 51 deletions
|
@ -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 }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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")
|
|
@ -39,5 +39,6 @@ Kirigami.ScrollablePage {
|
|||
Layout.topMargin: 0
|
||||
property int headingLevel: 3
|
||||
}
|
||||
Item { width: Kirigami.Units.gridUnit; height: 3 * Kirigami.Units.gridUnit}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue