Add reusable messagebox based on QML MessageDialog

Contributes to CURA-1730 and CURA-1850
This commit is contained in:
fieldOfView 2016-07-06 16:30:34 +02:00
parent 2f3ffe2a18
commit 6eb502730c
2 changed files with 45 additions and 0 deletions

View file

@ -683,6 +683,35 @@ UM.MainWindow
}
}
MessageDialog
{
id: messageDialog
modality: Qt.ApplicationModal
onAccepted: Printer.messageBoxClosed(clickedButton)
onApply: Printer.messageBoxClosed(clickedButton)
onDiscard: Printer.messageBoxClosed(clickedButton)
onHelp: Printer.messageBoxClosed(clickedButton)
onNo: Printer.messageBoxClosed(clickedButton)
onRejected: Printer.messageBoxClosed(clickedButton)
onReset: Printer.messageBoxClosed(clickedButton)
onYes: Printer.messageBoxClosed(clickedButton)
}
Connections
{
target: Printer
onShowMessageBox:
{
messageDialog.title = title
messageDialog.text = text
messageDialog.informativeText = informativeText
messageDialog.detailedText = detailedText
messageDialog.standardButtons = buttons
messageDialog.icon = icon
messageDialog.visible = true
}
}
Connections
{
target: Cura.Actions.addMachine