mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-26 00:08:13 +00:00
Upgrade confirmation popup to be used as lambda from QML
This commit is contained in:
parent
42a00cc236
commit
5381f59bf4
1 changed files with 14 additions and 3 deletions
|
|
@ -18,12 +18,14 @@ ApplicationWindow {
|
|||
Dialog {
|
||||
property var requestDialog
|
||||
property int index
|
||||
property var callback: requestDialog?.result
|
||||
signal closePopup(int index)
|
||||
onClosed: closePopup(index)
|
||||
text: requestDialog.message
|
||||
details: requestDialog.details
|
||||
onAccepted: requestDialog.result(1)
|
||||
onRejected: requestDialog.result(0)
|
||||
// For C++, requestDialog need to be call directly
|
||||
onAccepted: requestDialog ? requestDialog.result(1) : callback(1)
|
||||
onRejected: requestDialog ? requestDialog.result(0) : callback(0)
|
||||
width: 278 * DefaultStyle.dp
|
||||
}
|
||||
}
|
||||
|
|
@ -56,7 +58,16 @@ ApplicationWindow {
|
|||
popup.open()
|
||||
popup.closePopup.connect(removeFromPopupLayout)
|
||||
}
|
||||
|
||||
|
||||
function showConfirmationLambdaPopup(title,details,callback){
|
||||
console.log("Showing confirmation popup")
|
||||
var popup = confirmPopupComp.createObject(popupLayout, {"text": title, "details":details,"callback":callback})
|
||||
popup.index = popupLayout.popupList.length
|
||||
popupLayout.popupList.push(popup)
|
||||
popup.open()
|
||||
popup.closePopup.connect(removeFromPopupLayout)
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
id: popupLayout
|
||||
anchors.fill: parent
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue