mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Fixed: while project loading pass call upgrade plugin for preferences
CURA-4344
This commit is contained in:
parent
bc419370d0
commit
2288997697
1 changed files with 4 additions and 2 deletions
|
@ -304,7 +304,8 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||||
num_visible_settings = 0
|
num_visible_settings = 0
|
||||||
try:
|
try:
|
||||||
temp_preferences = Preferences()
|
temp_preferences = Preferences()
|
||||||
temp_preferences.readFromFile(io.TextIOWrapper(archive.open("Cura/preferences.cfg"))) # We need to wrap it, else the archive parser breaks.
|
serialized = archive.open("Cura/preferences.cfg").read().decode("utf-8")
|
||||||
|
temp_preferences.deserialize(serialized)
|
||||||
|
|
||||||
visible_settings_string = temp_preferences.getValue("general/visible_settings")
|
visible_settings_string = temp_preferences.getValue("general/visible_settings")
|
||||||
if visible_settings_string is not None:
|
if visible_settings_string is not None:
|
||||||
|
@ -407,7 +408,8 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||||
# Create a shadow copy of the preferences (we don't want all of the preferences, but we do want to re-use its
|
# Create a shadow copy of the preferences (we don't want all of the preferences, but we do want to re-use its
|
||||||
# parsing code.
|
# parsing code.
|
||||||
temp_preferences = Preferences()
|
temp_preferences = Preferences()
|
||||||
temp_preferences.readFromFile(io.TextIOWrapper(archive.open("Cura/preferences.cfg"))) # We need to wrap it, else the archive parser breaks.
|
serialized = archive.open("Cura/preferences.cfg").read().decode("utf-8")
|
||||||
|
temp_preferences.deserialize(serialized)
|
||||||
|
|
||||||
# Copy a number of settings from the temp preferences to the global
|
# Copy a number of settings from the temp preferences to the global
|
||||||
global_preferences = Preferences.getInstance()
|
global_preferences = Preferences.getInstance()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue