Create MaterialsSyncDialog from a Python function

Rather than from the QML.
This allows creating this dialogue from a message button without needing to put it in the base application.

Contributes to issue CURA-8609.
This commit is contained in:
Ghostkeeper 2021-10-04 16:23:28 +02:00
parent 1c78452d39
commit 9ec731eaf6
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A
3 changed files with 20 additions and 6 deletions

View file

@ -201,7 +201,7 @@ Item
onClicked:
{
forceActiveFocus();
materialsSyncDialog.show();
base.materialManagementModel.openSyncAllWindow();
}
visible: Cura.MachineManager.activeMachine.supportsMaterialExport
}
@ -399,9 +399,4 @@ Item
{
id: messageDialog
}
MaterialsSyncDialog
{
id: materialsSyncDialog
}
}

View file

@ -9,6 +9,8 @@ import UM 1.2 as UM
Window
{
id: materialsSyncDialog
property variant catalog: UM.I18nCatalog { name: "cura" }
title: catalog.i18nc("@title:window", "Sync materials with printers")
minimumWidth: UM.Theme.getSize("modal_window_minimum").width
minimumHeight: UM.Theme.getSize("modal_window_minimum").height