From 580f18431428587d914ab17e7928b855338d002f Mon Sep 17 00:00:00 2001 From: Mohsen Date: Tue, 15 Oct 2024 16:34:24 +0330 Subject: [PATCH] Show a discarding dialog. --- src/qml/qgismobileapp.qml | 46 +++++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/src/qml/qgismobileapp.qml b/src/qml/qgismobileapp.qml index d90e93b324..e009b68f22 100644 --- a/src/qml/qgismobileapp.qml +++ b/src/qml/qgismobileapp.qml @@ -2139,6 +2139,12 @@ ApplicationWindow { homeButton.waitingForDigitizingFinish = false; } + function activateMeasurementMode() { + mainMenu.close(); + dashBoard.close(); + changeMode('measure'); + } + Menu { id: mainMenu title: qsTr("Main Menu") @@ -2194,6 +2200,7 @@ ApplicationWindow { } QfToolButton { + id: measurementButton anchors.verticalCenter: parent.verticalCenter height: 48 width: 48 @@ -2203,10 +2210,12 @@ ApplicationWindow { bgcolor: hovered ? parent.hoveredColor : "#00ffffff" onClicked: { - mainMenu.close(); - dashBoard.close(); - changeMode('measure'); - highlighted = false; + if(featureForm.state === "ProcessingAlgorithmForm"){ + cancelAlgorithmDialog.visible = true; + } else { + activateMeasurementMode(); + highlighted = false; + } } } @@ -4033,6 +4042,35 @@ ApplicationWindow { standardButtons: Dialog.Yes | Dialog.No } + Dialog { + id: cancelAlgorithmDialog + parent: mainWindow.contentItem + + visible: false + modal: true + font: Theme.defaultFont + + z: 10000 // 1000s are embedded feature forms, user a higher value to insure the dialog will always show above embedded feature forms + x: (mainWindow.width - width) / 2 + y: (mainWindow.height - height) / 2 + + title: qsTr("Cancel algorithm") + Label { + width: parent.width + wrapMode: Text.WordWrap + text: qsTr("You are about to dismiss algorithm, proceed?") + } + + standardButtons: Dialog.Ok | Dialog.Cancel + onAccepted: { + featureForm.state = "FeatureList"; + activateMeasurementMode(); + } + onDiscarded: { + cancelAlgorithmDialog.visible = false; + } + } + Connections { target: pluginManager