mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-15 21:22:40 +00:00
Clean up code for new QC2 dialogs and remove some unused imports
This commit is contained in:
@@ -50,10 +50,8 @@ Item {
|
|||||||
ErrorMessageDialog {
|
ErrorMessageDialog {
|
||||||
id: errorDialog
|
id: errorDialog
|
||||||
|
|
||||||
onVisibleChanged: {
|
onClosed: {
|
||||||
if (!visible) {
|
Qt.quit()
|
||||||
Qt.quit()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import QtQml 2.2
|
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
import QtQuick.Controls 2.2
|
import QtQuick.Controls 2.2
|
||||||
|
|
||||||
@@ -66,10 +65,8 @@ Item {
|
|||||||
ErrorMessageDialog {
|
ErrorMessageDialog {
|
||||||
id: errorDialog
|
id: errorDialog
|
||||||
|
|
||||||
onVisibleChanged: {
|
onClosed: {
|
||||||
if (!visible) {
|
Qt.quit();
|
||||||
Qt.quit();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,25 +85,6 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onAccepted: quitApp()
|
onAccepted: quitApp()
|
||||||
|
onRejected: Qt.quit()
|
||||||
// Exit process if app quit is rejected (reacts also to closing of the
|
|
||||||
// dialog from title bar's close button).
|
|
||||||
// Note: this depends on undocumented behavior of visibleChanged()
|
|
||||||
// signal being emitted before yes() or accepted() has been emitted.
|
|
||||||
onVisibleChanged: {
|
|
||||||
if (!visible) {
|
|
||||||
quitTimer.start()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Component.onCompleted: {
|
|
||||||
yes.connect(quitTimer.stop)
|
|
||||||
accepted.connect(quitTimer.stop)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Timer {
|
|
||||||
id: quitTimer
|
|
||||||
interval: 100
|
|
||||||
onTriggered: Qt.quit()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,10 @@ import QtQuick.Controls 2.2
|
|||||||
Dialog {
|
Dialog {
|
||||||
property Item originalFocusItem
|
property Item originalFocusItem
|
||||||
|
|
||||||
x: Math.round((window.width - width) / 2)
|
parent: overlay
|
||||||
y: Math.round((window.height - height) / 2)
|
|
||||||
|
x: Math.round((parent.width - width) / 2)
|
||||||
|
y: Math.round((parent.height - height) / 2)
|
||||||
|
|
||||||
onAboutToShow: {
|
onAboutToShow: {
|
||||||
originalFocusItem = window.activeFocusItem
|
originalFocusItem = window.activeFocusItem
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import QtQuick 2.9
|
import QtQuick 2.9
|
||||||
import QtQuick.Controls 2.2
|
import QtQuick.Controls 2.2
|
||||||
import QtQuick.Layouts 1.3
|
|
||||||
import QtQuick.Window 2.2
|
|
||||||
|
|
||||||
import ComputerModel 1.0
|
import ComputerModel 1.0
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import QtQuick 2.0
|
|||||||
import QtQuick.Controls 2.2
|
import QtQuick.Controls 2.2
|
||||||
import QtQuick.Window 2.2
|
import QtQuick.Window 2.2
|
||||||
|
|
||||||
import ComputerManager 1.0
|
|
||||||
import SdlGamepadKeyNavigation 1.0
|
import SdlGamepadKeyNavigation 1.0
|
||||||
import Session 1.0
|
import Session 1.0
|
||||||
|
|
||||||
@@ -176,8 +175,8 @@ Item {
|
|||||||
ErrorMessageDialog {
|
ErrorMessageDialog {
|
||||||
id: errorDialog
|
id: errorDialog
|
||||||
|
|
||||||
onVisibleChanged: {
|
onClosed: {
|
||||||
if (!visible && quitAfter) {
|
if (quitAfter) {
|
||||||
Qt.quit()
|
Qt.quit()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user