Skip to content

Commit

Permalink
Dialog pop should be done via accept destination
Browse files Browse the repository at this point in the history
  • Loading branch information
jmlich committed May 17, 2024
1 parent 8efe634 commit 1ca6805
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
12 changes: 7 additions & 5 deletions ui/qml/components/platform.kirigami/DialogPL.qml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ PagePL {

onAccepted: {
if (acceptDestination) {
if (acceptDestinationPop)
if (acceptDestinationPop) {
app.pages.pop(acceptDestination);
else
app.push(acceptDestination);
} //else
//app.pages.pop();
} else {
app.pages.push(acceptDestination);
}
} else {
app.pages.pop();
}
}

function accept() {
Expand Down
11 changes: 4 additions & 7 deletions ui/qml/pages/FirstPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,18 @@ PagePL {

function unpairAccepted() {
DaemonInterfaceInstance.disconnect();
app.pages.push(Qt.resolvedUrl("./PairSelectDeviceType.qml"));
}

pageMenu: PageMenuPL {
PageMenuItemPL {
text: qsTr("Pair with watch")
onClicked: {
var page = AmazfishConfig.pairedAddress
? "UnpairDeviceDialog.qml"
: "PairSelectDeviceType.qml"

var obj = app.pages.push(Qt.resolvedUrl(page));

if (AmazfishConfig.pairedAddress) {
var obj = app.pages.push(Qt.resolvedUrl("UnpairDeviceDialog.qml"));
obj.acceptDestination = Qt.resolvedUrl("PairSelectDeviceType.qml")
obj.accepted.connect(unpairAccepted);
} else {
app.pages.push(Qt.resolvedUrl("PairSelectDeviceType.qml"));
}
}
}
Expand Down

0 comments on commit 1ca6805

Please sign in to comment.