Add a warning when closing the dashboard

This commit is contained in:
Patrick Nicolas
2026-02-02 10:45:45 +01:00
parent 18b00fde24
commit d5e4e3cfce
3 changed files with 28 additions and 1 deletions
+19 -1
View File
@@ -36,7 +36,25 @@ Kirigami.ApplicationWindow {
}
}
onClosing: Qt.quit()
onClosing: (close) => {
if (WivrnServer.ownServer)
{
close.accepted = false;
confirm_close.open();
} else {
Qt.quit();
}
}
Kirigami.PromptDialog {
id: confirm_close
title: i18n("Quit WiVRn")
subtitle: i18n("The WiVRn server is still running.\nClosing the window will terminate it.")
iconName: "dialog-warning"
popupType: Controls.Popup.Native
standardButtons: Kirigami.Dialog.Ok | Kirigami.Dialog.Cancel
onAccepted: Qt.quit()
}
width: 900
height: 800