mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Show warning when opening file without installing missing materials
CURA-6990
This commit is contained in:
parent
9c02f6500d
commit
812b728636
2 changed files with 15 additions and 1 deletions
|
@ -11,6 +11,7 @@ from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||||
from cura.Settings.GlobalStack import GlobalStack
|
from cura.Settings.GlobalStack import GlobalStack
|
||||||
from plugins.Marketplace.InstallMissingPackagesDialog import InstallMissingPackageDialog
|
from plugins.Marketplace.InstallMissingPackagesDialog import InstallMissingPackageDialog
|
||||||
from .UpdatableMachinesModel import UpdatableMachinesModel
|
from .UpdatableMachinesModel import UpdatableMachinesModel
|
||||||
|
from UM.Message import Message
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import threading
|
import threading
|
||||||
|
@ -378,6 +379,16 @@ class WorkspaceDialog(QObject):
|
||||||
time.sleep(1 / 50)
|
time.sleep(1 / 50)
|
||||||
QCoreApplication.processEvents() # Ensure that the GUI does not freeze.
|
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:
|
def __show(self) -> None:
|
||||||
if self._view is None:
|
if self._view is None:
|
||||||
self._createViewFromQML()
|
self._createViewFromQML()
|
||||||
|
|
|
@ -463,7 +463,10 @@ UM.Dialog
|
||||||
{
|
{
|
||||||
visible: buttonWarning
|
visible: buttonWarning
|
||||||
text: catalog.i18nc("@action:button", "Open project anyway")
|
text: catalog.i18nc("@action:button", "Open project anyway")
|
||||||
onClicked: reject()
|
onClicked: {
|
||||||
|
manager.showMissingMaterialsWarning();
|
||||||
|
accept();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
Cura.PrimaryButton
|
Cura.PrimaryButton
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue