diff --git a/app/gui/CliQuitStreamSegue.qml b/app/gui/CliQuitStreamSegue.qml index f5b36f26..27e03974 100644 --- a/app/gui/CliQuitStreamSegue.qml +++ b/app/gui/CliQuitStreamSegue.qml @@ -50,10 +50,8 @@ Item { ErrorMessageDialog { id: errorDialog - onVisibleChanged: { - if (!visible) { - Qt.quit() - } + onClosed: { + Qt.quit() } } } diff --git a/app/gui/CliStartStreamSegue.qml b/app/gui/CliStartStreamSegue.qml index 54d8bf0f..2bca9797 100644 --- a/app/gui/CliStartStreamSegue.qml +++ b/app/gui/CliStartStreamSegue.qml @@ -1,4 +1,3 @@ -import QtQml 2.2 import QtQuick 2.0 import QtQuick.Controls 2.2 @@ -66,10 +65,8 @@ Item { ErrorMessageDialog { id: errorDialog - onVisibleChanged: { - if (!visible) { - Qt.quit(); - } + onClosed: { + Qt.quit(); } } @@ -88,25 +85,6 @@ Item { } onAccepted: quitApp() - - // 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() + onRejected: Qt.quit() } } diff --git a/app/gui/NavigableDialog.qml b/app/gui/NavigableDialog.qml index bbfe4c6a..e633acaf 100644 --- a/app/gui/NavigableDialog.qml +++ b/app/gui/NavigableDialog.qml @@ -4,8 +4,10 @@ import QtQuick.Controls 2.2 Dialog { property Item originalFocusItem - x: Math.round((window.width - width) / 2) - y: Math.round((window.height - height) / 2) + parent: overlay + + x: Math.round((parent.width - width) / 2) + y: Math.round((parent.height - height) / 2) onAboutToShow: { originalFocusItem = window.activeFocusItem diff --git a/app/gui/PcView.qml b/app/gui/PcView.qml index 146289d4..c4aa8e4b 100644 --- a/app/gui/PcView.qml +++ b/app/gui/PcView.qml @@ -1,7 +1,5 @@ import QtQuick 2.9 import QtQuick.Controls 2.2 -import QtQuick.Layouts 1.3 -import QtQuick.Window 2.2 import ComputerModel 1.0 diff --git a/app/gui/StreamSegue.qml b/app/gui/StreamSegue.qml index 6350290a..12e357f4 100644 --- a/app/gui/StreamSegue.qml +++ b/app/gui/StreamSegue.qml @@ -2,7 +2,6 @@ import QtQuick 2.0 import QtQuick.Controls 2.2 import QtQuick.Window 2.2 -import ComputerManager 1.0 import SdlGamepadKeyNavigation 1.0 import Session 1.0 @@ -176,8 +175,8 @@ Item { ErrorMessageDialog { id: errorDialog - onVisibleChanged: { - if (!visible && quitAfter) { + onClosed: { + if (quitAfter) { Qt.quit() } }