diff options
author | fieldOfView <aldo@fieldofview.com> | 2021-03-24 00:27:10 +0300 |
---|---|---|
committer | fieldOfView <aldo@fieldofview.com> | 2021-03-24 00:27:10 +0300 |
commit | 6367e0763166d7a1d4ed968811bb464cf4d2d6c3 (patch) | |
tree | e36c87e5a9b012591ab014cc7ea99ba5bb78320b /cura/SingleInstance.py | |
parent | 91fe9e8ebf6b72b33fc568545be388336b87daf0 (diff) |
Add preference to enable loading multiple objects into a single instance
Diffstat (limited to 'cura/SingleInstance.py')
-rw-r--r-- | cura/SingleInstance.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cura/SingleInstance.py b/cura/SingleInstance.py index 6fcf0da6cf..2be1f36e13 100644 --- a/cura/SingleInstance.py +++ b/cura/SingleInstance.py @@ -18,6 +18,8 @@ class SingleInstance: self._single_instance_server = None + self._application.getPreferences().addPreference("cura/single_instance_clear_before_load", True) + # Starts a client that checks for a single instance server and sends the files that need to opened if the server # exists. Returns True if the single instance server is found, otherwise False. def startClient(self) -> bool: @@ -42,8 +44,9 @@ class SingleInstance: # "command" field is required and holds the name of the command to execute. # Other fields depend on the command. - payload = {"command": "clear-all"} - single_instance_socket.write(bytes(json.dumps(payload) + "\n", encoding = "ascii")) + if self._application.getPreferences().getValue("cura/single_instance_clear_before_load"): + payload = {"command": "clear-all"} + single_instance_socket.write(bytes(json.dumps(payload) + "\n", encoding = "ascii")) payload = {"command": "focus"} single_instance_socket.write(bytes(json.dumps(payload) + "\n", encoding = "ascii")) |