mirror of
https://github.com/Qsgs-Fans/FreeKill.git
synced 2024-11-16 11:42:45 +08:00
添加退出确认 (#174)
This commit is contained in:
parent
bbaa8a0235
commit
81440000b3
19
Fk/main.qml
19
Fk/main.qml
|
@ -1,6 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Dialogs
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Window
|
||||
import "Logic.js" as Logic
|
||||
|
@ -66,6 +67,7 @@ Item {
|
|||
property bool busy: false
|
||||
property string busyText: ""
|
||||
onBusyChanged: busyText = "";
|
||||
property bool closing: false
|
||||
|
||||
BusyIndicator {
|
||||
id: busyIndicator
|
||||
|
@ -217,10 +219,25 @@ Item {
|
|||
tipList = tips.trim().split("\n");
|
||||
}
|
||||
|
||||
onClosing: {
|
||||
MessageDialog {
|
||||
id: exitMessageDialog
|
||||
title: realMainWin.title
|
||||
informativeText: qsTr("Are you sure to exit?")
|
||||
buttons: MessageDialog.Ok | MessageDialog.Cancel
|
||||
onAccepted: {
|
||||
mainWindow.closing = true;
|
||||
config.winWidth = width;
|
||||
config.winHeight = height;
|
||||
config.saveConf();
|
||||
Backend.quitLobby(false);
|
||||
realMainWin.close();
|
||||
}
|
||||
}
|
||||
|
||||
onClosing: (closeEvent) => {
|
||||
if (!mainWindow.closing) {
|
||||
closeEvent.accepted = false;
|
||||
exitMessageDialog.open();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -167,6 +167,10 @@
|
|||
<source>updated packages for md5</source>
|
||||
<translation>已为您与服务器同步拓展包,请尝试再次连入</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Are you sure to exit?</source>
|
||||
<translation>是否确认退出?</translation>
|
||||
</message>
|
||||
</context>
|
||||
|
||||
<context>
|
||||
|
|
Loading…
Reference in New Issue
Block a user