Skip to content

Commit

Permalink
Show a discarding dialog.
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsenD98 committed Oct 15, 2024
1 parent bf41979 commit 580f184
Showing 1 changed file with 42 additions and 4 deletions.
46 changes: 42 additions & 4 deletions src/qml/qgismobileapp.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2139,6 +2139,12 @@ ApplicationWindow {
homeButton.waitingForDigitizingFinish = false;
}

function activateMeasurementMode() {
mainMenu.close();
dashBoard.close();
changeMode('measure');
}

Menu {
id: mainMenu
title: qsTr("Main Menu")
Expand Down Expand Up @@ -2194,6 +2200,7 @@ ApplicationWindow {
}

QfToolButton {
id: measurementButton
anchors.verticalCenter: parent.verticalCenter
height: 48
width: 48
Expand All @@ -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;
}
}
}

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 580f184

Please sign in to comment.