Fix keyboard navigation of quit app and delete PC dialogs
This commit is contained in:
parent
d5770ad8cc
commit
5f05363996
2 changed files with 14 additions and 2 deletions
|
|
@ -166,7 +166,8 @@ GridView {
|
||||||
property int nextAppIndex: 0
|
property int nextAppIndex: 0
|
||||||
text:"Are you sure you want to quit " + appName +"? Any unsaved progress will be lost."
|
text:"Are you sure you want to quit " + appName +"? Any unsaved progress will be lost."
|
||||||
standardButtons: StandardButton.Yes | StandardButton.No
|
standardButtons: StandardButton.Yes | StandardButton.No
|
||||||
onYes: {
|
|
||||||
|
function quitApp() {
|
||||||
var component = Qt.createComponent("QuitSegue.qml")
|
var component = Qt.createComponent("QuitSegue.qml")
|
||||||
var params = {"appName": appName}
|
var params = {"appName": appName}
|
||||||
if (segueToStream) {
|
if (segueToStream) {
|
||||||
|
|
@ -185,6 +186,11 @@ GridView {
|
||||||
// Trigger the quit after pushing the quit segue on screen
|
// Trigger the quit after pushing the quit segue on screen
|
||||||
appModel.quitRunningApp()
|
appModel.quitRunningApp()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onYes: quitApp()
|
||||||
|
|
||||||
|
// For keyboard/gamepad navigation
|
||||||
|
onAccepted: quitApp()
|
||||||
}
|
}
|
||||||
|
|
||||||
ScrollBar.vertical: ScrollBar {
|
ScrollBar.vertical: ScrollBar {
|
||||||
|
|
|
||||||
|
|
@ -305,10 +305,16 @@ GridView {
|
||||||
property int pcIndex : -1;
|
property int pcIndex : -1;
|
||||||
text:"Are you sure you want to remove this PC?"
|
text:"Are you sure you want to remove this PC?"
|
||||||
standardButtons: StandardButton.Yes | StandardButton.No
|
standardButtons: StandardButton.Yes | StandardButton.No
|
||||||
onYes: {
|
|
||||||
|
function deletePc() {
|
||||||
console.log("deleting PC pairing for PC at index: " + pcIndex)
|
console.log("deleting PC pairing for PC at index: " + pcIndex)
|
||||||
computerModel.deleteComputer(pcIndex);
|
computerModel.deleteComputer(pcIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onYes: deletePc()
|
||||||
|
|
||||||
|
// For keyboard/gamepad activation
|
||||||
|
onAccepted: deletePc()
|
||||||
}
|
}
|
||||||
|
|
||||||
Dialog {
|
Dialog {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue