Skip to content

Commit

Permalink
Merge pull request piggz#380 from jmlich/dialog-via-acceptdestination
Browse files Browse the repository at this point in the history
[kirigami] DatePicker dialog doesn't pop() when accepted
  • Loading branch information
piggz authored Nov 22, 2024
2 parents 5d07488 + 886829f commit dbd7a48
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 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
2 changes: 1 addition & 1 deletion ui/qml/components/platform.qtcontrols/DialogPL.qml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ PagePL {
if (acceptDestinationPop)
app.pages.pop(acceptDestination);
else
app.push(acceptDestination);
app.pages.push(acceptDestination);
} else
app.pages.pop();
}
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 dbd7a48

Please sign in to comment.