diff --git a/src/qml/qgismobileapp.qml b/src/qml/qgismobileapp.qml index 1d21769e44..56823a2605 100644 --- a/src/qml/qgismobileapp.qml +++ b/src/qml/qgismobileapp.qml @@ -2147,6 +2147,12 @@ ApplicationWindow { homeButton.waitingForDigitizingFinish = false; } + function activateMeasurementMode() { + mainMenu.close(); + dashBoard.close(); + changeMode('measure'); + } + Menu { id: mainMenu title: qsTr("Main Menu") @@ -2202,6 +2208,7 @@ ApplicationWindow { } QfToolButton { + id: measurementButton anchors.verticalCenter: parent.verticalCenter height: 48 width: 48 @@ -2211,10 +2218,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; + } } } @@ -4037,6 +4046,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 operation") + Label { + width: parent.width + wrapMode: Text.WordWrap + text: qsTr("You are about to dismiss the ongoing algorithm operation, proceed?") + } + + standardButtons: Dialog.Ok | Dialog.Cancel + onAccepted: { + featureForm.state = "Hidden"; + activateMeasurementMode(); + } + onDiscarded: { + cancelAlgorithmDialog.visible = false; + } + } + Connections { target: pluginManager