summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2018-11-18 07:42:15 +0200
committerGravatar mturkia <miika.turkia@gmail.com>2018-12-21 09:13:37 +0200
commit8e7a9a4f4cdd4daba1fc1f45a38707b93dfb369d (patch)
tree5b4cd6b991a3c2eddff24ade9babe46035d8ee79 /mobile-widgets/qml
parentde813c27ce402a099f2b035235a7a27da06f649e (diff)
downloadsubsurface-8e7a9a4f4cdd4daba1fc1f45a38707b93dfb369d.tar.gz
Mobile: UI for selecting what to copy-paste
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Diffstat (limited to 'mobile-widgets/qml')
-rw-r--r--mobile-widgets/qml/CopySettings.qml168
-rw-r--r--mobile-widgets/qml/DiveList.qml4
-rw-r--r--mobile-widgets/qml/main.qml5
-rw-r--r--mobile-widgets/qml/mobile-resources.qrc1
4 files changed, 178 insertions, 0 deletions
diff --git a/mobile-widgets/qml/CopySettings.qml b/mobile-widgets/qml/CopySettings.qml
new file mode 100644
index 000000000..172a0173c
--- /dev/null
+++ b/mobile-widgets/qml/CopySettings.qml
@@ -0,0 +1,168 @@
+// SPDX-License-Identifier: GPL-2.0
+import QtQuick 2.6
+import QtQuick.Controls 2.2 as Controls
+import QtQuick.Window 2.2
+import QtQuick.Dialogs 1.2
+import QtQuick.Layouts 1.2
+import org.kde.kirigami 2.4 as Kirigami
+import org.subsurfacedivelog.mobile 1.0
+
+Kirigami.ScrollablePage {
+ objectName: "CopySettings"
+ id: settingsCopy
+
+ title: qsTr("Copy Settings")
+ background: Rectangle { color: subsurfaceTheme.backgroundColor }
+
+ property real gridWidth: settingsCopy.width - Kirigami.Units.gridUnit
+
+ ColumnLayout {
+ width: gridWidth
+
+ GridLayout {
+ id: copy_settings
+ columns: 2
+ Controls.Label {
+ text: qsTr("Selection for copy-paste")
+ font.pointSize: subsurfaceTheme.headingPointSize
+ font.weight: Font.Light
+ color: subsurfaceTheme.textColor
+ Layout.topMargin: Kirigami.Units.largeSpacing
+ Layout.bottomMargin: Kirigami.Units.largeSpacing / 2
+ Layout.columnSpan: 2
+ }
+
+ Controls.Label {
+ text: qsTr("Dive site")
+ font.pointSize: subsurfaceTheme.regularPointSize
+ Layout.preferredWidth: gridWidth * 0.75
+ }
+ SsrfSwitch {
+ checked: manager.toggleDiveSite(false)
+ Layout.preferredWidth: gridWidth * 0.25
+ onClicked: {
+ manager.toggleDiveSite(true)
+ }
+ }
+ Controls.Label {
+ text: qsTr("Notes")
+ font.pointSize: subsurfaceTheme.regularPointSize
+ Layout.preferredWidth: gridWidth * 0.75
+ }
+ SsrfSwitch {
+ checked: manager.toggleNotes(false)
+ Layout.preferredWidth: gridWidth * 0.25
+ onClicked: {
+ manager.toggleNotes(true)
+ }
+ }
+ Controls.Label {
+ text: qsTr("Dive master")
+ font.pointSize: subsurfaceTheme.regularPointSize
+ Layout.preferredWidth: gridWidth * 0.75
+ }
+ SsrfSwitch {
+ checked: manager.toggleDiveMaster(false)
+ Layout.preferredWidth: gridWidth * 0.25
+ onClicked: {
+ manager.toggleDiveMaster(true)
+ }
+ }
+ Controls.Label {
+ text: qsTr("Buddy")
+ font.pointSize: subsurfaceTheme.regularPointSize
+ Layout.preferredWidth: gridWidth * 0.75
+ }
+ SsrfSwitch {
+ checked: manager.toggleBuddy(false)
+ Layout.preferredWidth: gridWidth * 0.25
+ onClicked: {
+ manager.toggleBuddy(true)
+ }
+ }
+ Controls.Label {
+ text: qsTr("Suit")
+ font.pointSize: subsurfaceTheme.regularPointSize
+ Layout.preferredWidth: gridWidth * 0.75
+ }
+ SsrfSwitch {
+ checked: manager.toggleSuit(false)
+ Layout.preferredWidth: gridWidth * 0.25
+ onClicked: {
+ manager.toggleSuit(true)
+ }
+ }
+ Controls.Label {
+ text: qsTr("Rating")
+ font.pointSize: subsurfaceTheme.regularPointSize
+ Layout.preferredWidth: gridWidth * 0.75
+ }
+ SsrfSwitch {
+ checked: manager.toggleRating(false)
+ Layout.preferredWidth: gridWidth * 0.25
+ onClicked: {
+ manager.toggleRating(true)
+ }
+ }
+ Controls.Label {
+ text: qsTr("Visibility")
+ font.pointSize: subsurfaceTheme.regularPointSize
+ Layout.preferredWidth: gridWidth * 0.75
+ }
+ SsrfSwitch {
+ checked: manager.toggleVisibility(false)
+ Layout.preferredWidth: gridWidth * 0.25
+ onClicked: {
+ manager.toggleVisibility(true)
+ }
+ }
+ Controls.Label {
+ text: qsTr("Tags")
+ font.pointSize: subsurfaceTheme.regularPointSize
+ Layout.preferredWidth: gridWidth * 0.75
+ }
+ SsrfSwitch {
+ checked: manager.toggleTags(false)
+ Layout.preferredWidth: gridWidth * 0.25
+ onClicked: {
+ manager.toggleTags(true)
+ }
+ }
+ Controls.Label {
+ text: qsTr("Cylinders")
+ font.pointSize: subsurfaceTheme.regularPointSize
+ Layout.preferredWidth: gridWidth * 0.75
+ }
+ SsrfSwitch {
+ checked: manager.toggleCylinders(false)
+ Layout.preferredWidth: gridWidth * 0.25
+ onClicked: {
+ manager.toggleCylinders(true)
+ }
+ }
+ Controls.Label {
+ text: qsTr("Weights")
+ font.pointSize: subsurfaceTheme.regularPointSize
+ Layout.preferredWidth: gridWidth * 0.75
+ }
+ SsrfSwitch {
+ checked: manager.toggleWeights(false)
+ Layout.preferredWidth: gridWidth * 0.25
+ onClicked: {
+ manager.toggleWeights(true)
+ }
+ }
+ }
+
+ Rectangle {
+ color: subsurfaceTheme.darkerPrimaryColor
+ height: 1
+ opacity: 0.5
+ Layout.fillWidth: true
+ }
+
+ Item {
+ height: Kirigami.Units.gridUnit * 6
+ }
+ }
+}
diff --git a/mobile-widgets/qml/DiveList.qml b/mobile-widgets/qml/DiveList.qml
index 3d29a1ec4..528716c4f 100644
--- a/mobile-widgets/qml/DiveList.qml
+++ b/mobile-widgets/qml/DiveList.qml
@@ -232,6 +232,10 @@ Kirigami.ScrollablePage {
timer.stop()
manager.copyDiveData(dive.id)
}
+ onPressAndHold: {
+ globalDrawer.close()
+ pageStack.push(settingsCopyWindow)
+ }
}
}
Rectangle {
diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml
index a954dfbc4..8c67c9947 100644
--- a/mobile-widgets/qml/main.qml
+++ b/mobile-widgets/qml/main.qml
@@ -592,6 +592,11 @@ if you have network connectivity and want to sync your data to cloud storage."),
visible: false
}
+ CopySettings {
+ id: settingsCopyWindow
+ visible: false
+ }
+
About {
id: aboutWindow
visible: false
diff --git a/mobile-widgets/qml/mobile-resources.qrc b/mobile-widgets/qml/mobile-resources.qrc
index beb1d93f0..989a7e936 100644
--- a/mobile-widgets/qml/mobile-resources.qrc
+++ b/mobile-widgets/qml/mobile-resources.qrc
@@ -15,6 +15,7 @@
<file>main.qml</file>
<file>MapPage.qml</file>
<file>Settings.qml</file>
+ <file>CopySettings.qml</file>
<file>ThemeTest.qml</file>
<file>StartPage.qml</file>
<file>SsrfButton.qml</file>