Allow machine actions to reference the dialog they are shown in

This way they can respond to the onAccepted and onRejected actions of the dialog
Contributes to CURA-2019
This commit is contained in:
fieldOfView 2016-08-01 15:21:12 +02:00
parent dc6482853a
commit a9ed562a58
2 changed files with 5 additions and 0 deletions

View File

@ -3,6 +3,10 @@ import QtQuick 2.2
Item Item
{ {
id: contentItem id: contentItem
// Point to the dialog containing the displayItem
property var dialog
// Connect the finished property change to completed signal. // Connect the finished property change to completed signal.
property var finished: manager.finished property var finished: manager.finished
onFinishedChanged: if(manager.finished) {completed()} onFinishedChanged: if(manager.finished) {completed()}

View File

@ -106,6 +106,7 @@ UM.ManagementPage
{ {
contents = content; contents = content;
content.onCompleted.connect(hide) content.onCompleted.connect(hide)
content.dialog = actionDialog
} }
rightButtons: Button rightButtons: Button
{ {