2018-08-02 05:32:21 +00:00
|
|
|
import QtQuick 2.0
|
|
|
|
import QtQuick.Controls 2.2
|
|
|
|
|
|
|
|
import ComputerManager 1.0
|
|
|
|
import Session 1.0
|
|
|
|
|
|
|
|
Item {
|
|
|
|
property string appName
|
|
|
|
property Session nextSession : null
|
|
|
|
property string nextAppName : ""
|
|
|
|
|
2020-11-21 19:15:54 +00:00
|
|
|
property string stageText : qsTr("Quitting %1...").arg(appName)
|
2018-08-02 05:32:21 +00:00
|
|
|
|
|
|
|
function quitAppCompleted(error)
|
|
|
|
{
|
|
|
|
// Display a failed dialog if we got an error
|
|
|
|
if (error !== undefined) {
|
|
|
|
errorDialog.text = error
|
|
|
|
errorDialog.open()
|
|
|
|
}
|
|
|
|
|
|
|
|
// If we're supposed to launch another game after this, do so now
|
|
|
|
if (error === undefined && nextSession !== null) {
|
|
|
|
var component = Qt.createComponent("StreamSegue.qml")
|
2018-08-17 06:29:46 +00:00
|
|
|
var segue = component.createObject(stackView, {"appName": nextAppName, "session": nextSession})
|
2019-02-10 05:15:17 +00:00
|
|
|
stackView.replace(segue)
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
// Exit this view
|
|
|
|
stackView.pop()
|
2018-08-02 05:32:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-23 06:14:06 +00:00
|
|
|
StackView.onActivated: {
|
|
|
|
// Hide the toolbar before we start loading
|
|
|
|
toolBar.visible = false
|
2019-02-10 05:15:17 +00:00
|
|
|
|
2019-02-23 06:14:06 +00:00
|
|
|
// Connect the quit completion signal
|
|
|
|
ComputerManager.quitAppCompleted.connect(quitAppCompleted)
|
|
|
|
}
|
|
|
|
|
|
|
|
StackView.onDeactivating: {
|
2019-03-02 22:13:14 +00:00
|
|
|
// Show the toolbar again
|
|
|
|
toolBar.visible = true
|
|
|
|
|
2019-02-23 06:14:06 +00:00
|
|
|
// Disconnect the signal
|
|
|
|
ComputerManager.quitAppCompleted.disconnect(quitAppCompleted)
|
2018-08-02 05:32:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Row {
|
|
|
|
anchors.centerIn: parent
|
|
|
|
spacing: 5
|
|
|
|
|
|
|
|
BusyIndicator {
|
|
|
|
id: stageSpinner
|
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
|
|
|
id: stageLabel
|
|
|
|
height: stageSpinner.height
|
|
|
|
text: stageText
|
|
|
|
font.pointSize: 20
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
|
|
|
|
wrapMode: Text.Wrap
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-23 20:51:34 +00:00
|
|
|
ErrorMessageDialog {
|
2018-08-02 05:32:21 +00:00
|
|
|
id: errorDialog
|
|
|
|
}
|
|
|
|
}
|