From cd28082c395002e027f682500670e79b934b9cf8 Mon Sep 17 00:00:00 2001 From: Grace Karanja Date: Thu, 20 Aug 2015 11:44:01 +0300 Subject: 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 --- qt-mobile/DiveDetails.qml | 1 + qt-mobile/DiveList.qml | 1 + qt-mobile/Log.qml | 1 + qt-mobile/TopBar.qml | 3 +++ 4 files changed, 6 insertions(+) diff --git a/qt-mobile/DiveDetails.qml b/qt-mobile/DiveDetails.qml index 6f42f20d0..afb62104a 100644 --- a/qt-mobile/DiveDetails.qml +++ b/qt-mobile/DiveDetails.qml @@ -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 diff --git a/qt-mobile/DiveList.qml b/qt-mobile/DiveList.qml index acf123011..d244c5bec 100644 --- a/qt-mobile/DiveList.qml +++ b/qt-mobile/DiveList.qml @@ -7,6 +7,7 @@ import QtQuick.Layouts 1.0 Rectangle { id: page + objectName: "DiveList" Component { id: diveDelegate diff --git a/qt-mobile/Log.qml b/qt-mobile/Log.qml index f51b4ac94..0bd812f3f 100644 --- a/qt-mobile/Log.qml +++ b/qt-mobile/Log.qml @@ -10,6 +10,7 @@ import org.subsurfacedivelog.mobile 1.0 Item { id: logWindow width: parent.width + objectName: "Log" ColumnLayout { width: parent.width diff --git a/qt-mobile/TopBar.qml b/qt-mobile/TopBar.qml index 1e34fcebc..1edd868c2 100644 --- a/qt-mobile/TopBar.qml +++ b/qt-mobile/TopBar.qml @@ -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(); } } -- cgit v1.2.3-70-g09d2