mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2025-07-03 00:06:09 +00:00
* Add command line parameters. Fixes #30 * Fixed compile errors * Fixed code review findings * Fixed code review findings, take 2
79 lines
1.9 KiB
QML
79 lines
1.9 KiB
QML
import QtQuick 2.0
|
|
import QtQuick.Controls 2.2
|
|
import QtQuick.Dialogs 1.2
|
|
|
|
import ComputerManager 1.0
|
|
|
|
Item {
|
|
visible: false
|
|
|
|
function onSearchingComputer() {
|
|
stageLabel.text = "Establishing connection to PC..."
|
|
}
|
|
|
|
function onSearchingApp() {
|
|
stageLabel.text = "Loading app list..."
|
|
}
|
|
|
|
function onSessionCreated(appName, session) {
|
|
var component = Qt.createComponent("StreamSegue.qml")
|
|
var segue = component.createObject(stackView, {
|
|
"appName": appName,
|
|
"session": session,
|
|
"quitAfter": true
|
|
})
|
|
stackView.push(segue)
|
|
}
|
|
|
|
function onLaunchFailed(message) {
|
|
errorDialog.text = message
|
|
errorDialog.open()
|
|
}
|
|
|
|
onVisibleChanged: {
|
|
if (visible) {
|
|
toolBar.visible = false
|
|
launcher.searchingComputer.connect(onSearchingComputer)
|
|
launcher.searchingApp.connect(onSearchingApp)
|
|
launcher.sessionCreated.connect(onSessionCreated)
|
|
launcher.failed.connect(onLaunchFailed)
|
|
launcher.execute(ComputerManager)
|
|
}
|
|
}
|
|
|
|
Row {
|
|
anchors.centerIn: parent
|
|
spacing: 5
|
|
|
|
BusyIndicator {
|
|
id: stageSpinner
|
|
}
|
|
|
|
Label {
|
|
id: stageLabel
|
|
height: stageSpinner.height
|
|
font.pointSize: 20
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
wrapMode: Text.Wrap
|
|
color: "white"
|
|
}
|
|
}
|
|
|
|
MessageDialog {
|
|
id: errorDialog
|
|
modality:Qt.WindowModal
|
|
icon: StandardIcon.Critical
|
|
standardButtons: StandardButton.Ok | StandardButton.Help
|
|
onHelp: {
|
|
Qt.openUrlExternally("https://github.com/moonlight-stream/moonlight-docs/wiki/Troubleshooting");
|
|
}
|
|
onVisibleChanged: {
|
|
if (!visible) {
|
|
Qt.quit();
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|