Rename Orthogonal to Orthographic everywhere

This commit is contained in:
Ghostkeeper 2019-07-30 17:35:40 +02:00
parent 2ce567ccfe
commit 846cbe79a3
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276
5 changed files with 24 additions and 6 deletions

View file

@ -127,6 +127,8 @@ class SliceInfo(QObject, Extension):
data["active_mode"] = "custom"
data["camera_view"] = application.getPreferences().getValue("general/camera_perspective_mode")
if data["camera_view"] == "orthographic":
data["camera_view"] = "orthogonal" #The database still only recognises the old name "orthogonal".
definition_changes = global_stack.definitionChanges
machine_settings_changed_by_user = False

View file

@ -39,6 +39,17 @@ class VersionUpgrade42to43(VersionUpgrade):
setting_version = int(parser.get("metadata", "setting_version", fallback = "0"))
return format_version * 1000000 + setting_version
def upgradePreferences(self, serialized: str, filename: str):
parser = configparser.ConfigParser(interpolation = None)
parser.read_string(serialized)
if "camera_perspective_mode" in parser["general"] and parser["general"]["camera_perspective_mode"] == "orthogonal":
parser["general"]["camera_perspective_mode"] = "orthographic"
result = io.StringIO()
parser.write(result)
return [filename], [result.getvalue()]
## Upgrades instance containers to have the new version
# number.
#

View file

@ -14,6 +14,7 @@ def getMetaData() -> Dict[str, Any]:
return {
"version_upgrade": {
# From To Upgrade function
("preferences", 6000008): ("preferences", 6000009, upgrade.upgradePreferences),
("machine_stack", 4000008): ("machine_stack", 4000009, upgrade.upgradeStack),
("extruder_train", 4000008): ("extruder_train", 4000009, upgrade.upgradeStack),
("definition_changes", 4000008): ("definition_changes", 4000009, upgrade.upgradeInstanceContainer),
@ -22,6 +23,10 @@ def getMetaData() -> Dict[str, Any]:
("user", 4000008): ("user", 4000009, upgrade.upgradeInstanceContainer),
},
"sources": {
"preferences": {
"get_version": upgrade.getCfgVersion,
"location": {"."}
},
"machine_stack": {
"get_version": upgrade.getCfgVersion,
"location": {"./machine_instances"}

View file

@ -58,11 +58,11 @@ Menu
{
text: catalog.i18nc("@action:inmenu menubar:view", "Orthographic")
checkable: true
checked: cameraViewMenu.cameraMode == "orthogonal"
checked: cameraViewMenu.cameraMode == "orthographic"
onTriggered:
{
UM.Preferences.setValue("general/camera_perspective_mode", "orthogonal")
checked = cameraViewMenu.cameraMode == "orthogonal"
UM.Preferences.setValue("general/camera_perspective_mode", "orthographic")
checked = cameraViewMenu.cameraMode == "orthographic"
}
exclusiveGroup: group
}

View file

@ -368,7 +368,7 @@ UM.PreferencesPage
{
width: childrenRect.width;
height: childrenRect.height;
text: zoomToMouseCheckbox.enabled ? catalog.i18nc("@info:tooltip", "Should zooming move in the direction of the mouse?") : catalog.i18nc("@info:tooltip", "Zooming towards the mouse is not supported in the orthogonal perspective.")
text: zoomToMouseCheckbox.enabled ? catalog.i18nc("@info:tooltip", "Should zooming move in the direction of the mouse?") : catalog.i18nc("@info:tooltip", "Zooming towards the mouse is not supported in the orthographic perspective.")
CheckBox
{
@ -389,7 +389,7 @@ UM.PreferencesPage
{
return;
}
zoomToMouseCheckbox.enabled = UM.Preferences.getValue("general/camera_perspective_mode") !== "orthogonal";
zoomToMouseCheckbox.enabled = UM.Preferences.getValue("general/camera_perspective_mode") !== "orthographic";
zoomToMouseCheckbox.checked = boolCheck(UM.Preferences.getValue("view/zoom_to_mouse")) && zoomToMouseCheckbox.enabled;
}
}
@ -481,7 +481,7 @@ UM.PreferencesPage
Component.onCompleted: {
append({ text: catalog.i18n("Perspective"), code: "perspective" })
append({ text: catalog.i18n("Orthogonal"), code: "orthogonal" })
append({ text: catalog.i18n("Orthographic"), code: "orthographic" })
}
}