mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Show the Z seam related settings after upgrade. CURA-2953
This commit is contained in:
parent
f4fa3ac53f
commit
22012bdb1c
2 changed files with 25 additions and 2 deletions
|
@ -8,6 +8,7 @@ import io
|
|||
|
||||
from UM import Resources
|
||||
from UM.VersionUpgrade import VersionUpgrade # Superclass of the plugin.
|
||||
import UM.VersionUpgrade
|
||||
|
||||
class VersionUpgrade22to24(VersionUpgrade):
|
||||
|
||||
|
@ -120,6 +121,26 @@ class VersionUpgrade22to24(VersionUpgrade):
|
|||
config.write(output)
|
||||
return [filename], [output.getvalue()]
|
||||
|
||||
def upgradePreferences(self, serialised, filename):
|
||||
config = configparser.ConfigParser(interpolation = None)
|
||||
config.read_string(serialised)
|
||||
|
||||
if not config.has_section("general"):
|
||||
raise UM.VersionUpgrade.FormatException("No \"general\" section.")
|
||||
|
||||
# Make z_seam_x and z_seam_y options visible. In a clean 2.4 they are visible by default.
|
||||
if config.has_option("general", "visible_settings"):
|
||||
visible_settings = config.get("general", "visible_settings")
|
||||
visible_set = set(visible_settings.split(";"))
|
||||
visible_set.add("z_seam_x")
|
||||
visible_set.add("z_seam_y")
|
||||
config.set("general", "visible_settings", ";".join(visible_set))
|
||||
config.set("general", "version", value="4")
|
||||
|
||||
output = io.StringIO()
|
||||
config.write(output)
|
||||
return [filename], [output.getvalue()]
|
||||
|
||||
def getCfgVersion(self, serialised):
|
||||
parser = configparser.ConfigParser(interpolation = None)
|
||||
parser.read_string(serialised)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue