[PATCH 2/2] Adding about page to Subsurface-mobile

Miika Turkia miika.turkia at gmail.com
Wed Feb 10 12:53:59 PST 2016


This isn't pretty, but having the version string available on a place
that people are likely to find does make sense when going public with
the Subsurface-mobile. Especially when we do a public release, I assume
the developer menu with App log might not be readily available for
people to identify their installed version.

Signed-off-by: Miika Turkia <miika.turkia at gmail.com>
---
 qt-mobile/qml/About.qml            | 50 ++++++++++++++++++++++++++++++++++++++
 qt-mobile/qml/main.qml             | 13 +++++++++-
 qt-mobile/qml/mobile-resources.qrc |  1 +
 3 files changed, 63 insertions(+), 1 deletion(-)
 create mode 100644 qt-mobile/qml/About.qml

diff --git a/qt-mobile/qml/About.qml b/qt-mobile/qml/About.qml
new file mode 100644
index 0000000..f8e57a7
--- /dev/null
+++ b/qt-mobile/qml/About.qml
@@ -0,0 +1,50 @@
+import QtQuick 2.3
+import QtQuick.Controls 1.2
+import QtQuick.Layouts 1.1
+import org.kde.plasma.mobilecomponents 0.2 as MobileComponents
+import org.subsurfacedivelog.mobile 1.0
+
+
+GridLayout {
+	columns: 2
+	width: parent.width - MobileComponents.Units.gridUnit
+	anchors {
+		fill: parent
+		margins: MobileComponents.Units.gridUnit / 2
+	}
+
+	MobileComponents.Heading {
+		text: "About"
+		Layout.bottomMargin: MobileComponents.Units.largeSpacing / 2
+		Layout.columnSpan: 2
+		Layout.alignment: Qt.AlignLeft
+	}
+
+	Image {
+		source:"qrc:/qml/subsurface-mobile-icon.png"
+	}
+
+	MobileComponents.Heading {
+		text: "A mobile version of Subsurface divelog software.\nView your dive logs while on the go."
+		level: 3
+		Layout.topMargin: MobileComponents.Units.largeSpacing
+		Layout.bottomMargin: MobileComponents.Units.largeSpacing / 2
+		Layout.columnSpan: 2
+	}
+
+	MobileComponents.Label {
+		text: "Version: " + manager.getVersion()
+	}
+
+	MobileComponents.Heading {
+		text: "\n\n© Subsurface developer team, 2016"
+		level: 3
+		Layout.topMargin: MobileComponents.Units.largeSpacing
+		Layout.bottomMargin: MobileComponents.Units.largeSpacing / 2
+		Layout.columnSpan: 2
+	}
+
+	Item {
+		Layout.fillHeight: true
+	}
+}
diff --git a/qt-mobile/qml/main.qml b/qt-mobile/qml/main.qml
index 6054b2f..087de26 100644
--- a/qt-mobile/qml/main.qml
+++ b/qt-mobile/qml/main.qml
@@ -161,8 +161,14 @@ MobileComponents.ApplicationWindow {
 						manager.verboseEnabled = checked;
 					}
 				}
+			},
+			Action {
+				text: "About"
+				onTriggered: {
+					stackView.push(aboutWindow)
+					detailsWindow.endEditMode()
+				}
 			}
-
 		] // end actions
 
 		MouseArea {
@@ -240,6 +246,11 @@ MobileComponents.ApplicationWindow {
 		visible: false
 	}
 
+	About {
+		id: aboutWindow
+		visible: false
+	}
+
 	CloudCredentials {
 		id: cloudCredWindow
 		visible: false
diff --git a/qt-mobile/qml/mobile-resources.qrc b/qt-mobile/qml/mobile-resources.qrc
index e57fa5e..77a78c9 100644
--- a/qt-mobile/qml/mobile-resources.qrc
+++ b/qt-mobile/qml/mobile-resources.qrc
@@ -3,6 +3,7 @@
 		<file>main.qml</file>
 		<file>TextButton.qml</file>
 		<file>Preferences.qml</file>
+		<file>About.qml</file>
 		<file>CloudCredentials.qml</file>
 		<file>DiveList.qml</file>
 		<file>DiveDetails.qml</file>
-- 
2.5.0



More information about the subsurface mailing list