mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 07:33:57 -06:00
Merge branch 'feature_single_instance_clear_before_load' of https://github.com/fieldOfView/Cura
This commit is contained in:
commit
c497e61d9d
2 changed files with 23 additions and 2 deletions
|
@ -18,6 +18,8 @@ class SingleInstance:
|
||||||
|
|
||||||
self._single_instance_server = None
|
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
|
# 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.
|
# exists. Returns True if the single instance server is found, otherwise False.
|
||||||
def startClient(self) -> bool:
|
def startClient(self) -> bool:
|
||||||
|
@ -42,6 +44,7 @@ class SingleInstance:
|
||||||
# "command" field is required and holds the name of the command to execute.
|
# "command" field is required and holds the name of the command to execute.
|
||||||
# Other fields depend on the command.
|
# Other fields depend on the command.
|
||||||
|
|
||||||
|
if self._application.getPreferences().getValue("cura/single_instance_clear_before_load"):
|
||||||
payload = {"command": "clear-all"}
|
payload = {"command": "clear-all"}
|
||||||
single_instance_socket.write(bytes(json.dumps(payload) + "\n", encoding = "ascii"))
|
single_instance_socket.write(bytes(json.dumps(payload) + "\n", encoding = "ascii"))
|
||||||
|
|
||||||
|
|
|
@ -76,6 +76,8 @@ UM.PreferencesPage
|
||||||
|
|
||||||
UM.Preferences.resetPreference("cura/single_instance")
|
UM.Preferences.resetPreference("cura/single_instance")
|
||||||
singleInstanceCheckbox.checked = boolCheck(UM.Preferences.getValue("cura/single_instance"))
|
singleInstanceCheckbox.checked = boolCheck(UM.Preferences.getValue("cura/single_instance"))
|
||||||
|
UM.Preferences.resetPreference("cura/single_instance_clear_before_load")
|
||||||
|
singleInstanceClearBeforeLoadCheckbox.checked = boolCheck(UM.Preferences.getValue("cura/single_instance_clear_before_load"))
|
||||||
|
|
||||||
UM.Preferences.resetPreference("physics/automatic_push_free")
|
UM.Preferences.resetPreference("physics/automatic_push_free")
|
||||||
pushFreeCheckbox.checked = boolCheck(UM.Preferences.getValue("physics/automatic_push_free"))
|
pushFreeCheckbox.checked = boolCheck(UM.Preferences.getValue("physics/automatic_push_free"))
|
||||||
|
@ -567,6 +569,22 @@ UM.PreferencesPage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UM.TooltipArea
|
||||||
|
{
|
||||||
|
width: childrenRect.width
|
||||||
|
height: childrenRect.height
|
||||||
|
text: catalog.i18nc("@info:tooltip","Should the build plate be cleared before loading a new model in the single instance of Cura?")
|
||||||
|
enabled: singleInstanceCheckbox.checked
|
||||||
|
|
||||||
|
CheckBox
|
||||||
|
{
|
||||||
|
id: singleInstanceClearBeforeLoadCheckbox
|
||||||
|
text: catalog.i18nc("@option:check","Clear buildplate before loading model into the single instance")
|
||||||
|
checked: boolCheck(UM.Preferences.getValue("cura/single_instance_clear_before_load"))
|
||||||
|
onCheckedChanged: UM.Preferences.setValue("cura/single_instance_clear_before_load", checked)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
UM.TooltipArea
|
UM.TooltipArea
|
||||||
{
|
{
|
||||||
width: childrenRect.width
|
width: childrenRect.width
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue