diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 6132d8ab36..680baefdb3 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -1085,9 +1085,9 @@ class CuraApplication(QtApplication): def getTextManager(self, *args) -> "TextManager": return self._text_manager - @pyqtSlot(bool) - def getWorkplaceDropToBuildplate(self, drop_to_build_plate: bool) ->None: - return self._physics.setAppPerModelDropDown(drop_to_build_plate) + @pyqtSlot() + def setWorkplaceDropToBuildplate(self): + return self._physics.setAppPerModelDropDown() def getCuraFormulaFunctions(self, *args) -> "CuraFormulaFunctions": if self._cura_formula_functions is None: diff --git a/cura/PlatformPhysics.py b/cura/PlatformPhysics.py index 74fe05927d..1f86258b42 100755 --- a/cura/PlatformPhysics.py +++ b/cura/PlatformPhysics.py @@ -41,11 +41,9 @@ class PlatformPhysics: Application.getInstance().getPreferences().addPreference("physics/automatic_drop_down", True) self._app_per_model_drop = None - def getAppPerModelDropDown(self): - return self._app_per_model_drop - - def setAppPerModelDropDown(self, drop_to_buildplate): - self._app_per_model_drop = drop_to_buildplate + def setAppPerModelDropDown(self): + self._app_per_model_drop = True + self._onChangeTimerFinished() def _onSceneChanged(self, source): if not source.callDecoration("isSliceable"): @@ -79,13 +77,7 @@ class PlatformPhysics: # By shuffling the order of the nodes, this might happen a few times, but at some point it will resolve. random.shuffle(nodes) drop_down = False - # drop down in case nodes are asked to drop down from the user from workspaceDialog while opening 3mf - if self._app_per_model_drop and (self._app_per_model_drop != app_automatic_drop_down): - drop_down = True - # drop down in case the user has selected automated drop down preference for 3mf opening - if self._app_per_model_drop and app_automatic_drop_down: - drop_down= True - + if self._app_per_model_drop == True: drop_down = True for node in nodes: if node is root or not isinstance(node, SceneNode) or node.getBoundingBox() is None: diff --git a/plugins/3MFReader/WorkspaceDialog.py b/plugins/3MFReader/WorkspaceDialog.py index c0ea950915..1fafcf59f5 100644 --- a/plugins/3MFReader/WorkspaceDialog.py +++ b/plugins/3MFReader/WorkspaceDialog.py @@ -353,11 +353,6 @@ class WorkspaceDialog(QObject): Application.getInstance().getBackend().close() - @pyqtSlot(bool) - def setDropToBuildPlateForModel(self, drop_to_buildplate: bool) -> None: - CuraApplication.getInstance().getWorkplaceDropToBuildplate(drop_to_buildplate) - - def setMaterialConflict(self, material_conflict: bool) -> None: if self._has_material_conflict != material_conflict: self._has_material_conflict = material_conflict diff --git a/plugins/3MFReader/WorkspaceDialog.qml b/plugins/3MFReader/WorkspaceDialog.qml index dbd6356e94..8d06b32e14 100644 --- a/plugins/3MFReader/WorkspaceDialog.qml +++ b/plugins/3MFReader/WorkspaceDialog.qml @@ -351,26 +351,6 @@ UM.Dialog } } - Row - { - id: dropToBuildPlate - width: parent.width - height: childrenRect.height - spacing: UM.Theme.getSize("default_margin").width - UM.CheckBox - { - id: checkDropModels - text: catalog.i18nc("@text:window", "Drop models to buildplate") - checked: UM.Preferences.getValue("physics/automatic_drop_down") - onCheckedChanged: manager.setDropToBuildPlateForModel(checked) - } - function reloadValue() - { - manager.setDropToBuildPlateForModel(checkDropModels.checked) - checkDropModels.checked = UM.Preferences.getValue("physics/automatic_drop_down") - } - } - Row { id: clearBuildPlateWarning @@ -493,7 +473,6 @@ UM.Dialog materialSection.reloadValues() profileSection.reloadValues() printerSection.reloadValues() - dropToBuildPlate.reloadValue() } } } diff --git a/resources/qml/Actions.qml b/resources/qml/Actions.qml index 8fe4a11847..7acf39ecb2 100644 --- a/resources/qml/Actions.qml +++ b/resources/qml/Actions.qml @@ -39,7 +39,7 @@ Item property alias printObjectAfterNext: printObjectAfterNextAction property alias multiplyObject: multiplyObjectAction - + property alias dropAll: dropAllAction property alias selectAll: selectAllAction property alias deleteAll: deleteAllAction property alias reloadAll: reloadAllAction @@ -490,6 +490,14 @@ Item shortcut: "Shift+Ctrl+R" } + Action + { + id: dropAllAction + text: catalog.i18nc("@action:inmenu menubar:edit","Drop All Models to buildplate") + shortcut: "Ctrl+B" + onTriggered: CuraApplication.setWorkplaceDropToBuildplate() + } + Action { id: resetAllTranslationAction diff --git a/resources/qml/Menus/ContextMenu.qml b/resources/qml/Menus/ContextMenu.qml index 1b32c24254..1ab0a1332e 100644 --- a/resources/qml/Menus/ContextMenu.qml +++ b/resources/qml/Menus/ContextMenu.qml @@ -71,6 +71,7 @@ Cura.Menu Cura.MenuItem { action: Cura.Actions.reloadAll } Cura.MenuItem { action: Cura.Actions.resetAllTranslation } Cura.MenuItem { action: Cura.Actions.resetAll } + Cura.MenuItem { action: Cura.Actions.dropAll } // Group actions Cura.MenuSeparator {} diff --git a/resources/qml/Menus/EditMenu.qml b/resources/qml/Menus/EditMenu.qml index 728b3b212b..fdab70360e 100644 --- a/resources/qml/Menus/EditMenu.qml +++ b/resources/qml/Menus/EditMenu.qml @@ -21,6 +21,7 @@ Cura.Menu Cura.MenuItem { action: Cura.Actions.deleteAll } Cura.MenuItem { action: Cura.Actions.resetAllTranslation } Cura.MenuItem { action: Cura.Actions.resetAll } + Cura.MenuItem { action: Cura.Actions.dropAll } Cura.MenuSeparator { } Cura.MenuItem { action: Cura.Actions.groupObjects } Cura.MenuItem { action: Cura.Actions.mergeObjects } diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index d87ecac0b3..0f50f169ef 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -513,7 +513,6 @@ UM.PreferencesPage onCheckedChanged: { UM.Preferences.setValue("physics/automatic_drop_down", checked) - CuraApplication.getWorkplaceDropToBuildplate(checked) } } }