Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/cura
diff options
context:
space:
mode:
authorJelle Spijker <j.spijker@ultimaker.com>2022-06-21 08:52:58 +0300
committerJelle Spijker <j.spijker@ultimaker.com>2022-06-21 08:52:58 +0300
commitcd12d245843eb6611d8d28e4ab6a3c8ae3f65ccf (patch)
tree2b1d9fc2466368ee521197582ad414ea2da2dde1 /cura
parentd275ad37f8447bf103090a145176ec4570a72a0d (diff)
parent8970f461540d4ae774b3f8f421af7a8a17d36de1 (diff)
Merge remote-tracking branch 'origin/5.1' into CURA-9365_fix_building_cura_main
Diffstat (limited to 'cura')
-rw-r--r--cura/Machines/Models/MaterialManagementModel.py55
-rw-r--r--cura/UltimakerCloud/CloudMaterialSync.py4
2 files changed, 2 insertions, 57 deletions
diff --git a/cura/Machines/Models/MaterialManagementModel.py b/cura/Machines/Models/MaterialManagementModel.py
index b2b888f431..7d0cf9ee54 100644
--- a/cura/Machines/Models/MaterialManagementModel.py
+++ b/cura/Machines/Models/MaterialManagementModel.py
@@ -34,61 +34,6 @@ class MaterialManagementModel(QObject):
def __init__(self, parent: Optional[QObject] = None) -> None:
super().__init__(parent = parent)
self._material_sync = CloudMaterialSync(parent=self)
- self._checkIfNewMaterialsWereInstalled()
-
- def _checkIfNewMaterialsWereInstalled(self) -> None:
- """
- Checks whether new material packages were installed in the latest startup. If there were, then it shows
- a message prompting the user to sync the materials with their printers.
- """
- application = cura.CuraApplication.CuraApplication.getInstance()
- for package_id, package_data in application.getPackageManager().getPackagesInstalledOnStartup().items():
- if package_data["package_info"]["package_type"] == "material":
- # At least one new material was installed
- self._showSyncNewMaterialsMessage()
- break
-
- def _showSyncNewMaterialsMessage(self) -> None:
- sync_materials_message = Message(
- text = catalog.i18nc("@action:button",
- "Please sync the material profiles with your printers before starting to print."),
- title = catalog.i18nc("@action:button", "New materials installed"),
- message_type = Message.MessageType.WARNING,
- lifetime = 0
- )
-
- sync_materials_message.addAction(
- "sync",
- name = catalog.i18nc("@action:button", "Sync materials"),
- icon = "",
- description = "Sync your newly installed materials with your printers.",
- button_align = Message.ActionButtonAlignment.ALIGN_RIGHT
- )
-
- sync_materials_message.addAction(
- "learn_more",
- name = catalog.i18nc("@action:button", "Learn more"),
- icon = "",
- description = "Learn more about syncing your newly installed materials with your printers.",
- button_align = Message.ActionButtonAlignment.ALIGN_LEFT,
- button_style = Message.ActionButtonStyle.LINK
- )
- sync_materials_message.actionTriggered.connect(self._onSyncMaterialsMessageActionTriggered)
-
- # Show the message only if there are printers that support material export
- container_registry = cura.CuraApplication.CuraApplication.getInstance().getContainerRegistry()
- global_stacks = container_registry.findContainerStacks(type = "machine")
- if any([stack.supportsMaterialExport for stack in global_stacks]):
- sync_materials_message.show()
-
- def _onSyncMaterialsMessageActionTriggered(self, sync_message: Message, sync_message_action: str):
- if sync_message_action == "sync":
- QDesktopServices.openUrl(QUrl("https://example.com/openSyncAllWindow"))
- # self.openSyncAllWindow()
- sync_message.hide()
- elif sync_message_action == "learn_more":
- QDesktopServices.openUrl(QUrl("https://support.ultimaker.com/hc/en-us/articles/360013137919?utm_source=cura&utm_medium=software&utm_campaign=sync-material-printer-message"))
-
@pyqtSlot("QVariant", result = bool)
def canMaterialBeRemoved(self, material_node: "MaterialNode") -> bool:
diff --git a/cura/UltimakerCloud/CloudMaterialSync.py b/cura/UltimakerCloud/CloudMaterialSync.py
index e2eb50f97e..210fc23898 100644
--- a/cura/UltimakerCloud/CloudMaterialSync.py
+++ b/cura/UltimakerCloud/CloudMaterialSync.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2021 Ultimaker B.V.
+# Copyright (c) 2022 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from PyQt6.QtCore import pyqtProperty, pyqtSignal, pyqtSlot, QObject, QUrl
@@ -18,6 +18,7 @@ if TYPE_CHECKING:
from UM.Signal import Signal
catalog = i18nCatalog("cura")
+
class CloudMaterialSync(QObject):
"""
Handles the synchronisation of material profiles with cloud accounts.
@@ -44,7 +45,6 @@ class CloudMaterialSync(QObject):
break
def openSyncAllWindow(self):
-
self.reset()
if self.sync_all_dialog is None: