diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 20e54fa57c..7b588c836a 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -601,7 +601,9 @@ class CuraApplication(QtApplication): preferences.addPreference("mesh/scale_to_fit", False) preferences.addPreference("mesh/scale_tiny_meshes", True) preferences.addPreference("cura/dialog_on_project_save", True) + preferences.addPreference("cura/dialog_on_ucp_project_save", True) preferences.addPreference("cura/asked_dialog_on_project_save", False) + preferences.addPreference("cura/asked_dialog_on_ucp_project_save", False) preferences.addPreference("cura/choice_on_profile_override", "always_ask") preferences.addPreference("cura/choice_on_open_project", "always_ask") preferences.addPreference("cura/use_multi_build_plate", False) diff --git a/plugins/3MFReader/ThreeMFReader.py b/plugins/3MFReader/ThreeMFReader.py index a715d990eb..c7a15e043e 100755 --- a/plugins/3MFReader/ThreeMFReader.py +++ b/plugins/3MFReader/ThreeMFReader.py @@ -50,11 +50,11 @@ class ThreeMFReader(MeshReader): MimeType( name="application/x-ucp", comment="UCP", - suffixes=["ucp"] + suffixes=["3mf"] ) ) - self._supported_extensions = [".3mf", ".ucp"] + self._supported_extensions = [".3mf"] self._root = None self._base_name = "" self._unit = None diff --git a/plugins/3MFReader/ThreeMFWorkspaceReader.py b/plugins/3MFReader/ThreeMFWorkspaceReader.py index d96de5b324..c9692599e5 100755 --- a/plugins/3MFReader/ThreeMFWorkspaceReader.py +++ b/plugins/3MFReader/ThreeMFWorkspaceReader.py @@ -113,7 +113,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader): def __init__(self) -> None: super().__init__() - self._supported_extensions = [".3mf", ".ucp"] + self._supported_extensions = [".3mf"] self._dialog = WorkspaceDialog() self._3mf_mesh_reader = None self._container_registry = ContainerRegistry.getInstance() @@ -236,7 +236,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader): # Check whether the file is a UCP, which changes some import options #FIXME Instead of this, we should just check for the presence of the user-settings file, whatever the extension - is_ucp = file_name.endswith('.ucp') + is_ucp = file_name.endswith('.3mf') # # Read definition containers diff --git a/plugins/3MFReader/plugin.json b/plugins/3MFReader/plugin.json index 010adbb501..bf0bc05364 100644 --- a/plugins/3MFReader/plugin.json +++ b/plugins/3MFReader/plugin.json @@ -2,7 +2,7 @@ "name": "3MF Reader", "author": "Ultimaker B.V.", "version": "1.0.1", - "description": "Provides support for reading 3MF and UCP files.", + "description": "Provides support for reading 3MF files.", "api": 8, "i18n-catalog": "cura" } diff --git a/plugins/3MFWriter/ThreeMFWorkspaceWriter.py b/plugins/3MFWriter/ThreeMFWorkspaceWriter.py index d0a843af69..c67da24569 100644 --- a/plugins/3MFWriter/ThreeMFWorkspaceWriter.py +++ b/plugins/3MFWriter/ThreeMFWorkspaceWriter.py @@ -39,7 +39,7 @@ class ThreeMFWorkspaceWriter(WorkspaceWriter): is_ucp = False if hasattr(self._stream, 'name'): # This only works with local file, but we don't want remote UCP files yet - is_ucp = self._stream.name.endswith('.ucp') + is_ucp = self._stream.name.endswith('.3mf') if is_ucp: self._config_dialog = UCPDialog() diff --git a/plugins/3MFWriter/UCPDialog.qml b/plugins/3MFWriter/UCPDialog.qml index 88552cc292..7eaf57c96b 100644 --- a/plugins/3MFWriter/UCPDialog.qml +++ b/plugins/3MFWriter/UCPDialog.qml @@ -19,6 +19,21 @@ UM.Dialog minimumHeight: UM.Theme.getSize("modal_window_minimum").height backgroundColor: UM.Theme.getColor("detail_background") + property bool dontShowAgain: true + + function storeDontShowAgain() + { + UM.Preferences.setValue("cura/dialog_on_ucp_project_save", !dontShowAgainCheckbox.checked) + UM.Preferences.setValue("asked_dialog_on_ucp_project_save", true) + } + + onVisibleChanged: + { + if(visible && UM.Preferences.getValue("cura/asked_dialog_on_ucp_project_save")) + { + dontShowAgain = !UM.Preferences.getValue("cura/dialog_on_ucp_project_save") + } + } headerComponent: Rectangle { @@ -75,7 +90,15 @@ UM.Dialog delegate: SettingsSelectionGroup { Layout.margins: 0 } } } - + leftButtons: + [ + UM.CheckBox + { + id: dontShowAgainCheckbox + text: catalog.i18nc("@action:label", "Don't show project summary on save again") + checked: dontShowAgain + } + ] rightButtons: [ Cura.TertiaryButton diff --git a/plugins/3MFWriter/__init__.py b/plugins/3MFWriter/__init__.py index 40fd42b199..1cecf4c3f8 100644 --- a/plugins/3MFWriter/__init__.py +++ b/plugins/3MFWriter/__init__.py @@ -34,7 +34,7 @@ def getMetaData(): "mode": ThreeMFWriter.ThreeMFWriter.OutputMode.BinaryMode }, { - "extension": "ucp", + "extension": "3mf", "description": i18n_catalog.i18nc("@item:inlistbox", "Universal Cura Project"), "mime_type": "application/x-ucp", "mode": ThreeMFWriter.ThreeMFWriter.OutputMode.BinaryMode @@ -50,7 +50,7 @@ def getMetaData(): "mode": ThreeMFWorkspaceWriter.ThreeMFWorkspaceWriter.OutputMode.BinaryMode }, { - "extension": "ucp", + "extension": "3mf", "description": i18n_catalog.i18nc("@item:inlistbox", "Universal Cura Project"), "mime_type": "application/x-ucp", "mode": ThreeMFWorkspaceWriter.ThreeMFWorkspaceWriter.OutputMode.BinaryMode diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index 69607a3f6b..0ca905cf85 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -735,6 +735,20 @@ UM.PreferencesPage } } + UM.TooltipArea + { + width: childrenRect.width + height: childrenRect.height + text: catalog.i18nc("@info:tooltip", "Should a summary be shown when saving a UCP project file?") + + UM.CheckBox + { + text: catalog.i18nc("@option:check", "Show summary dialog when saving a UCP project") + checked: boolCheck(UM.Preferences.getValue("cura/dialog_on_ucp_project_save")) + onCheckedChanged: UM.Preferences.setValue("cura/dialog_on_ucp_project_save", checked) + } + } + UM.TooltipArea { width: childrenRect.width