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 Jun 3, 2024
1 parent 21e3ddc commit cc6deb5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
6 changes: 3 additions & 3 deletions ui/qml/components/platform.kirigami/DialogPL.qml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ PagePL {
if (acceptDestinationPop)
app.pages.pop(acceptDestination);
else
app.push(acceptDestination);
} //else
//app.pages.pop();
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 cc6deb5

Please sign in to comment.