QML UI: Fix error when closing the log window

When closing the log window, do not try to save the changes. This
should only be done when closing the DiveDetails.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
This commit is contained in:
Grace Karanja 2015-08-20 11:44:01 +03:00 committed by Dirk Hohndel
parent 89c7e4cd67
commit cd28082c39
4 changed files with 6 additions and 0 deletions

View file

@ -10,6 +10,7 @@ import org.subsurfacedivelog.mobile 1.0
Item {
id: diveDetailsWindow
width: parent.width
objectName: "DiveDetails"
property string location
property string dive_id

View file

@ -7,6 +7,7 @@ import QtQuick.Layouts 1.0
Rectangle {
id: page
objectName: "DiveList"
Component {
id: diveDelegate

View file

@ -10,6 +10,7 @@ import org.subsurfacedivelog.mobile 1.0
Item {
id: logWindow
width: parent.width
objectName: "Log"
ColumnLayout {
width: parent.width

View file

@ -42,6 +42,8 @@ Rectangle {
}
}
onClicked: {
if (stackView.currentItem.objectName == "DiveDetails")
{
manager.commitChanges(
dive_id,
suit,
@ -49,6 +51,7 @@ Rectangle {
divemaster,
notes
)
}
stackView.pop();
}
}