diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 14b09c4902..056b6eaeb2 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -311,6 +311,7 @@ class CuraApplication(QtApplication): preferences.addPreference("cura/choice_on_profile_override", "always_ask") preferences.addPreference("cura/choice_on_open_project", "always_ask") preferences.addPreference("cura/arrange_objects_on_load", True) + preferences.addPreference("cura/use_multi_build_plate", False) preferences.addPreference("cura/currency", "€") preferences.addPreference("cura/material_settings", "{}") @@ -1427,7 +1428,9 @@ class CuraApplication(QtApplication): min_offset = 8 self.fileLoaded.emit(filename) - arrange_objects_on_load = Preferences.getInstance().getValue("cura/arrange_objects_on_load") + arrange_objects_on_load = ( + not Preferences.getInstance().getValue("cura/use_multi_build_plate") or + Preferences.getInstance().getValue("cura/arrange_objects_on_load")) target_build_plate = self.getBuildPlateModel().activeBuildPlate if arrange_objects_on_load else -1 for original_node in nodes: diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 1db6e2a511..254679ec53 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -324,10 +324,10 @@ UM.MainWindow } } - /* Button { id: openFileButton; + visible: !UM.Preferences.getValue("cura/use_multi_build_plate") text: catalog.i18nc("@action:button","Open File"); iconSource: UM.Theme.getIcon("load") style: UM.Theme.styles.tool_button @@ -340,12 +340,13 @@ UM.MainWindow } action: Cura.Actions.open; } - */ Button { id: objectsButton; - text: catalog.i18nc("@action:button","Objects"); + visible: UM.Preferences.getValue("cura/use_multi_build_plate") + + text: catalog.i18nc("@action:button","Objects list"); iconSource: UM.Theme.getIcon("plus") style: UM.Theme.styles.tool_button tooltip: ''; diff --git a/resources/qml/Menus/ContextMenu.qml b/resources/qml/Menus/ContextMenu.qml index 2aa3bd6bdb..a52a2d46a3 100644 --- a/resources/qml/Menus/ContextMenu.qml +++ b/resources/qml/Menus/ContextMenu.qml @@ -39,7 +39,9 @@ Menu onObjectRemoved: base.removeItem(object) } - MenuSeparator {} + MenuSeparator { + visible: UM.Preferences.getValue("cura/use_multi_build_plate") + } Instantiator { model: Cura.BuildPlateModel @@ -48,15 +50,17 @@ Menu onTriggered: CuraActions.setBuildPlateForSelection(Cura.BuildPlateModel.getItem(index).buildPlateNumber); checkable: true checked: Cura.BuildPlateModel.getItem(index).buildPlateNumber == Cura.BuildPlateModel.activeBuildPlate + visible: UM.Preferences.getValue("cura/use_multi_build_plate") } onObjectAdded: base.insertItem(index, object); - onObjectRemoved: base.removeItem(object) + onObjectRemoved: base.removeItem(object); } MenuItem { text: "New build plate"; onTriggered: CuraActions.setBuildPlateForSelection(Cura.BuildPlateModel.maxBuildPlate + 1); checkable: true checked: false + visible: UM.Preferences.getValue("cura/use_multi_build_plate") } // Global actions diff --git a/resources/qml/Menus/ViewMenu.qml b/resources/qml/Menus/ViewMenu.qml index a78e465c85..7c7060b1f0 100644 --- a/resources/qml/Menus/ViewMenu.qml +++ b/resources/qml/Menus/ViewMenu.qml @@ -31,7 +31,9 @@ Menu MenuSeparator {} MenuItem { action: Cura.Actions.homeCamera; } - MenuSeparator {} + MenuSeparator { + visible: UM.Preferences.getValue("cura/use_multi_build_plate") + } Instantiator { model: Cura.BuildPlateModel @@ -41,6 +43,7 @@ Menu checkable: true; checked: Cura.BuildPlateModel.getItem(index).buildPlateNumber == Cura.BuildPlateModel.activeBuildPlate; exclusiveGroup: buildPlateGroup; + visible: UM.Preferences.getValue("cura/use_multi_build_plate") } onObjectAdded: base.insertItem(index, object); onObjectRemoved: base.removeItem(object) diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index c74fb5720d..197e22fb53 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -454,12 +454,26 @@ UM.PreferencesPage UM.TooltipArea { width: childrenRect.width height: childrenRect.height - text: catalog.i18nc("@info:tooltip","Should newly loaded models be arranged on the build palte?") + text: catalog.i18nc("@info:tooltip","Use multi build plate functionality (EXPERIMENTAL)") + + CheckBox + { + id: useMultiBuildPlateCheckbox + text: catalog.i18nc("@option:check","Use multi build plate functionality (EXPERIMENTAL, restart)") + checked: boolCheck(UM.Preferences.getValue("cura/use_multi_build_plate")) + onCheckedChanged: UM.Preferences.setValue("cura/use_multi_build_plate", checked) + } + } + + UM.TooltipArea { + width: childrenRect.width + height: childrenRect.height + text: catalog.i18nc("@info:tooltip","Should newly loaded models be arranged on the build plate? Used in conjunction with multi build plate (EXPERIMENTAL)") CheckBox { id: arrangeOnLoadCheckbox - text: catalog.i18nc("@option:check","Arrange objects on load") + text: catalog.i18nc("@option:check","Arrange objects on load (EXPERIMENTAL)") checked: boolCheck(UM.Preferences.getValue("cura/arrange_objects_on_load")) onCheckedChanged: UM.Preferences.setValue("cura/arrange_objects_on_load", checked) }