Show warning when opening file without installing missing materials

CURA-6990
This commit is contained in:
c.lamboo 2022-06-02 15:36:53 +02:00
parent 9c02f6500d
commit 812b728636
2 changed files with 15 additions and 1 deletions

View file

@ -11,6 +11,7 @@ from UM.Settings.ContainerRegistry import ContainerRegistry
from cura.Settings.GlobalStack import GlobalStack
from plugins.Marketplace.InstallMissingPackagesDialog import InstallMissingPackageDialog
from .UpdatableMachinesModel import UpdatableMachinesModel
from UM.Message import Message
import os
import threading
@ -378,6 +379,16 @@ class WorkspaceDialog(QObject):
time.sleep(1 / 50)
QCoreApplication.processEvents() # Ensure that the GUI does not freeze.
@pyqtSlot()
def showMissingMaterialsWarning(self) -> None:
result_message = Message(
i18n_catalog.i18nc("@info:status", "The material used in this project relies on some material definitions not available in Cura, this might produce undesirable print results. We highly recommend installing the full material package from the Marketplace."),
lifetime=0,
title=i18n_catalog.i18nc("@info:title", "Material profiles not installed"),
message_type=Message.MessageType.WARNING
)
result_message.show()
def __show(self) -> None:
if self._view is None:
self._createViewFromQML()

View file

@ -463,7 +463,10 @@ UM.Dialog
{
visible: buttonWarning
text: catalog.i18nc("@action:button", "Open project anyway")
onClicked: reject()
onClicked: {
manager.showMissingMaterialsWarning();
accept();
}
},
Cura.PrimaryButton
{