Return to the PC grid if the selected PC goes offline or becomes unpaired

This commit is contained in:
Cameron Gutman
2018-08-09 18:48:40 -07:00
parent c61182bcb2
commit 3f81d055af
3 changed files with 21 additions and 0 deletions
+10
View File
@@ -28,14 +28,24 @@ GridView {
// routine to run, but only if we start as invisible
visible: false
function computerLost()
{
// Go back to the PC view on PC loss
stackView.pop()
}
onVisibleChanged: {
if (visible) {
// Start polling when this view is shown
ComputerManager.startPolling()
appModel.computerLost.connect(computerLost)
}
else {
// Stop polling when this view is not on top
ComputerManager.stopPollingAsync()
appModel.computerLost.disconnect(computerLost)
}
}