mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-15 21:22:40 +00:00
Use StackView activation callbacks to perform init and cleanup since visibility callbacks aren't guaranteed to run in any order
This commit is contained in:
+7
-14
@@ -24,11 +24,6 @@ GridView {
|
||||
cellWidth: 350; cellHeight: 350;
|
||||
objectName: "Computers"
|
||||
|
||||
// The StackView will trigger a visibility change when
|
||||
// we're pushed onto it, causing our onVisibleChanged
|
||||
// routine to run, but only if we start as invisible
|
||||
visible: false
|
||||
|
||||
StreamingPreferences {
|
||||
id: prefs
|
||||
}
|
||||
@@ -37,16 +32,9 @@ GridView {
|
||||
id: gamepadKeyNav
|
||||
}
|
||||
|
||||
onVisibleChanged: {
|
||||
if (visible) {
|
||||
gamepadKeyNav.enable()
|
||||
}
|
||||
else {
|
||||
gamepadKeyNav.disable()
|
||||
}
|
||||
}
|
||||
StackView.onActivated: {
|
||||
gamepadKeyNav.enable()
|
||||
|
||||
Component.onCompleted: {
|
||||
// Setup signals on CM
|
||||
ComputerManager.computerAddCompleted.connect(addComplete)
|
||||
|
||||
@@ -54,6 +42,11 @@ GridView {
|
||||
currentIndex = -1
|
||||
}
|
||||
|
||||
StackView.onDeactivating: {
|
||||
gamepadKeyNav.disable()
|
||||
ComputerManager.computerAddCompleted.disconnect(addComplete)
|
||||
}
|
||||
|
||||
function pairingComplete(error)
|
||||
{
|
||||
// Close the PIN dialog
|
||||
|
||||
Reference in New Issue
Block a user