- the application now uses only the default values from the app.options dict, the app.defaults dict holds the definitive default values
- fixed some outstanding issues from the PyQt6 port - PEP8 fixes - minor fixes - updated the saving of Preferences to update the self.options too: the `Apply` action will update the self.options but the `Save` action will save the updated preferences to the file on disk
This commit is contained in:
@@ -154,12 +154,12 @@ class DblSidedTool(AppTool):
|
||||
self.ui.point_entry.set_value("")
|
||||
self.ui.alignment_holes.set_value("")
|
||||
|
||||
self.ui.mirror_axis.set_value(self.app.defaults["tools_2sided_mirror_axis"])
|
||||
self.ui.axis_location.set_value(self.app.defaults["tools_2sided_axis_loc"])
|
||||
self.ui.mirror_axis.set_value(self.app.options["tools_2sided_mirror_axis"])
|
||||
self.ui.axis_location.set_value(self.app.options["tools_2sided_axis_loc"])
|
||||
self.on_toggle_pointbox(self.ui.axis_location.get_value())
|
||||
|
||||
self.ui.drill_dia.set_value(self.app.defaults["tools_2sided_drilldia"])
|
||||
self.ui.align_type_radio.set_value(self.app.defaults["tools_2sided_align_type"])
|
||||
self.ui.drill_dia.set_value(self.app.options["tools_2sided_drilldia"])
|
||||
self.ui.align_type_radio.set_value(self.app.options["tools_2sided_align_type"])
|
||||
self.ui.on_align_type_changed(val=self.ui.align_type_radio.get_value())
|
||||
|
||||
self.ui.xmin_entry.set_value(0.0)
|
||||
@@ -202,7 +202,7 @@ class DblSidedTool(AppTool):
|
||||
self.disconnect_events()
|
||||
|
||||
# Show/Hide Advanced Options
|
||||
app_mode = self.app.defaults["global_app_level"]
|
||||
app_mode = self.app.options["global_app_level"]
|
||||
self.change_level(app_mode)
|
||||
|
||||
def change_level(self, level):
|
||||
@@ -545,7 +545,7 @@ class DblSidedTool(AppTool):
|
||||
self.app.inform.emit('[success] %s: %s' % (_("Object was mirrored"), str(fcobj.obj_options['name'])))
|
||||
|
||||
def on_point_add(self):
|
||||
val = self.app.defaults["global_point_clipboard_format"] % \
|
||||
val = self.app.options["global_point_clipboard_format"] % \
|
||||
(self.decimals, self.app.pos[0], self.decimals, self.app.pos[1])
|
||||
self.ui.point_entry.set_value(val)
|
||||
|
||||
@@ -632,9 +632,9 @@ class DblSidedTool(AppTool):
|
||||
|
||||
try:
|
||||
px, py = self.ui.point_entry.get_value()
|
||||
val = self.app.defaults["global_point_clipboard_format"] % (self.decimals, xmin, self.decimals, py)
|
||||
val = self.app.options["global_point_clipboard_format"] % (self.decimals, xmin, self.decimals, py)
|
||||
except TypeError:
|
||||
val = self.app.defaults["global_point_clipboard_format"] % (self.decimals, xmin, self.decimals, 0.0)
|
||||
val = self.app.options["global_point_clipboard_format"] % (self.decimals, xmin, self.decimals, 0.0)
|
||||
self.ui.point_entry.set_value(val)
|
||||
|
||||
def on_ymin_clicked(self):
|
||||
@@ -643,9 +643,9 @@ class DblSidedTool(AppTool):
|
||||
|
||||
try:
|
||||
px, py = self.ui.point_entry.get_value()
|
||||
val = self.app.defaults["global_point_clipboard_format"] % (self.decimals, px, self.decimals, ymin)
|
||||
val = self.app.options["global_point_clipboard_format"] % (self.decimals, px, self.decimals, ymin)
|
||||
except TypeError:
|
||||
val = self.app.defaults["global_point_clipboard_format"] % (self.decimals, 0.0, self.decimals, ymin)
|
||||
val = self.app.options["global_point_clipboard_format"] % (self.decimals, 0.0, self.decimals, ymin)
|
||||
self.ui.point_entry.set_value(val)
|
||||
|
||||
def on_xmax_clicked(self):
|
||||
@@ -654,9 +654,9 @@ class DblSidedTool(AppTool):
|
||||
|
||||
try:
|
||||
px, py = self.ui.point_entry.get_value()
|
||||
val = self.app.defaults["global_point_clipboard_format"] % (self.decimals, xmax, self.decimals, py)
|
||||
val = self.app.options["global_point_clipboard_format"] % (self.decimals, xmax, self.decimals, py)
|
||||
except TypeError:
|
||||
val = self.app.defaults["global_point_clipboard_format"] % (self.decimals, xmax, self.decimals, 0.0)
|
||||
val = self.app.options["global_point_clipboard_format"] % (self.decimals, xmax, self.decimals, 0.0)
|
||||
self.ui.point_entry.set_value(val)
|
||||
|
||||
def on_ymax_clicked(self):
|
||||
@@ -665,9 +665,9 @@ class DblSidedTool(AppTool):
|
||||
|
||||
try:
|
||||
px, py = self.ui.point_entry.get_value()
|
||||
val = self.app.defaults["global_point_clipboard_format"] % (self.decimals, px, self.decimals, ymax)
|
||||
val = self.app.options["global_point_clipboard_format"] % (self.decimals, px, self.decimals, ymax)
|
||||
except TypeError:
|
||||
val = self.app.defaults["global_point_clipboard_format"] % (self.decimals, 0.0, self.decimals, ymax)
|
||||
val = self.app.options["global_point_clipboard_format"] % (self.decimals, 0.0, self.decimals, ymax)
|
||||
self.ui.point_entry.set_value(val)
|
||||
|
||||
def reset_fields(self):
|
||||
|
||||
Reference in New Issue
Block a user