mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
mobile UI: add divelist context drawer action to edit trip details
For now this only shows the trip details. They can be edited on the page, but there is no way to save those edits, yet. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
028807ebc5
commit
4b4df28ecd
4 changed files with 83 additions and 1 deletions
|
@ -284,6 +284,16 @@ Kirigami.ScrollablePage {
|
|||
mapPage.centerOnDiveSite(currentItem.myData.diveSite)
|
||||
}
|
||||
}
|
||||
property QtObject tripDetailsEdit: Kirigami.Action {
|
||||
text: qsTr("Edit trip details")
|
||||
visible: currentItem && currentItem.myData && currentItem.myData.isTrip
|
||||
onTriggered: {
|
||||
tripEditWindow.tripLocation = currentItem.myData.tripLocation
|
||||
tripEditWindow.tripNotes = currentItem.myData.tripNotes
|
||||
pageStack.push(tripEditWindow)
|
||||
}
|
||||
}
|
||||
|
||||
property QtObject undoAction: Kirigami.Action {
|
||||
text: qsTr("Undo") + " " + manager.undoText
|
||||
enabled: manager.undoText !== ""
|
||||
|
@ -294,7 +304,7 @@ Kirigami.ScrollablePage {
|
|||
enabled: manager.redoText !== ""
|
||||
onTriggered: manager.redo()
|
||||
}
|
||||
property variant contextactions: [ removeDiveFromTripAction, addDiveToTripAboveAction, addDiveToTripBelowAction, deleteAction, mapAction, undoAction, redoAction ]
|
||||
property variant contextactions: [ removeDiveFromTripAction, addDiveToTripAboveAction, addDiveToTripBelowAction, deleteAction, mapAction, tripDetailsEdit, undoAction, redoAction ]
|
||||
StartPage {
|
||||
id: startPage
|
||||
anchors.fill: parent
|
||||
|
|
66
mobile-widgets/qml/TripDetails.qml
Normal file
66
mobile-widgets/qml/TripDetails.qml
Normal file
|
@ -0,0 +1,66 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
import QtQuick 2.6
|
||||
import QtQuick.Controls 2.2 as Controls
|
||||
import QtQuick.Layouts 1.2
|
||||
import org.subsurfacedivelog.mobile 1.0
|
||||
import org.kde.kirigami 2.4 as Kirigami
|
||||
|
||||
Kirigami.Page {
|
||||
id: tripEditPage
|
||||
objectName: "TripDetails"
|
||||
property string tripLocation
|
||||
property string tripNotes
|
||||
|
||||
title: "" !== tripLocation ? tripLocation : qsTr("Trip details")
|
||||
state: "view"
|
||||
padding: Kirigami.largeSpacing
|
||||
background: Rectangle { color: subsurfaceTheme.backgroundColor }
|
||||
width: rootItem.colWidth
|
||||
Flickable {
|
||||
id: tripEditFlickable
|
||||
anchors.fill: parent
|
||||
GridLayout {
|
||||
columns: 2
|
||||
width: tripEditFlickable.width
|
||||
TemplateLabel {
|
||||
Layout.columnSpan: 2
|
||||
id: title
|
||||
text: qsTr("Edit trip details")
|
||||
font.pointSize: subsurfaceTheme.titlePointSize
|
||||
font.bold: true
|
||||
}
|
||||
Rectangle {
|
||||
id: spacer
|
||||
Layout.columnSpan: 2
|
||||
color: subsurfaceTheme.backgroundColor
|
||||
height: Kirigami.Units.gridUnit
|
||||
width: 1
|
||||
}
|
||||
|
||||
TemplateLabel {
|
||||
text: qsTr("Trip location:")
|
||||
opacity: 0.6
|
||||
}
|
||||
SsrfTextField {
|
||||
Layout.fillWidth: true
|
||||
text: tripLocation
|
||||
flickable: tripEditFlickable
|
||||
}
|
||||
TemplateLabel {
|
||||
Layout.columnSpan: 2
|
||||
text: qsTr("Trip notes")
|
||||
opacity: 0.6
|
||||
}
|
||||
Controls.TextArea {
|
||||
text: tripNotes
|
||||
textFormat: TextEdit.RichText
|
||||
Layout.columnSpan: 2
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
Layout.minimumHeight: Kirigami.Units.gridUnit * 6
|
||||
selectByMouse: true
|
||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -762,6 +762,11 @@ if you have network connectivity and want to sync your data to cloud storage."),
|
|||
visible: false
|
||||
}
|
||||
|
||||
TripDetails {
|
||||
id: tripEditWindow
|
||||
visible: false
|
||||
}
|
||||
|
||||
Log {
|
||||
id: logWindow
|
||||
visible: false
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
<file>Settings.qml</file>
|
||||
<file>CopySettings.qml</file>
|
||||
<file>ThemeTest.qml</file>
|
||||
<file>TripDetails.qml</file>
|
||||
<file>StartPage.qml</file>
|
||||
<file>SsrfCheckBox.qml</file>
|
||||
<file>SsrfSwitch.qml</file>
|
||||
|
|
Loading…
Add table
Reference in a new issue