Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Testing a hard exit #5103

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/qml/WelcomeScreen.qml
Expand Up @@ -766,6 +766,22 @@ Page {
}
}

QfToolButton {
id: exitButton
visible: false
anchors {
top: parent.top
right: parent.right
topMargin: mainWindow.sceneTopMargin
}
bgcolor: "red"

onClicked: {
mainWindow.closeAlreadyRequested = true
mainWindow.close()
}
}

// Sparkles & unicorns
Rectangle {
anchors.fill: parent
Expand Down Expand Up @@ -872,6 +888,7 @@ Page {
if (visible) {
const currentProjectButtonVisible = !!qgisProject.fileName;
currentProjectButton.visible = currentProjectButtonVisible
exitButton.visible = currentProjectButtonVisible

if (firstShown) {
welcomeText.text = " ";
Expand Down
8 changes: 4 additions & 4 deletions src/qml/qgismobileapp.qml
Expand Up @@ -3908,7 +3908,7 @@ ApplicationWindow {
state: iface.hasProjectOnLaunch() ? "visible" : "hidden"
}

property bool alreadyCloseRequested: false
property bool closeAlreadyRequested: false

onClosing: (close) => {
if (screenLocker.enabled) {
Expand All @@ -3917,9 +3917,9 @@ ApplicationWindow {
return
}

if (!alreadyCloseRequested) {
if (!closeAlreadyRequested) {
close.accepted = false
alreadyCloseRequested = true
closeAlreadyRequested = true
displayToast(qsTr("Press back again to close project and app"))
closingTimer.start()
} else {
Expand All @@ -3931,7 +3931,7 @@ ApplicationWindow {
id: closingTimer
interval: 2000
onTriggered: {
alreadyCloseRequested = false
closeAlreadyRequested = false
}
}

Expand Down