- 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:
@@ -192,7 +192,7 @@ class SolderPaste(AppTool):
|
||||
self.init_context_menu()
|
||||
|
||||
# either originally it was a string or not, xy_end will be made string
|
||||
dias_option = self.app.defaults["tools_solderpaste_tools"]
|
||||
dias_option = self.app.options["tools_solderpaste_tools"]
|
||||
dias_option = re.sub('[()\[\]]', '', str(dias_option)) if dias_option else None
|
||||
try:
|
||||
dias = [float(eval(dia)) for dia in dias_option.split(",") if dia != '']
|
||||
@@ -475,8 +475,8 @@ class SolderPaste(AppTool):
|
||||
:return:
|
||||
"""
|
||||
for key in self.form_fields:
|
||||
if key in self.app.defaults:
|
||||
self.form_fields[key].set_value(self.app.defaults[key])
|
||||
if key in self.app.options:
|
||||
self.form_fields[key].set_value(self.app.options[key])
|
||||
|
||||
def set_form(self, val):
|
||||
"""
|
||||
@@ -1000,8 +1000,8 @@ class SolderPaste(AppTool):
|
||||
tool_dia = tooluid_value['tooldia']
|
||||
tool_cnc_dict = deepcopy(tooluid_value)
|
||||
|
||||
new_obj.coords_decimals = self.app.defaults["cncjob_coords_decimals"]
|
||||
new_obj.fr_decimals = self.app.defaults["cncjob_fr_decimals"]
|
||||
new_obj.coords_decimals = self.app.options["cncjob_coords_decimals"]
|
||||
new_obj.fr_decimals = self.app.options["cncjob_fr_decimals"]
|
||||
new_obj.tool = int(tooluid_key)
|
||||
|
||||
# Propagate options
|
||||
@@ -1180,7 +1180,7 @@ class SolderPaste(AppTool):
|
||||
"Most likely another app is holding the file open and not accessible."))
|
||||
return 'fail'
|
||||
|
||||
if self.app.defaults["global_open_style"] is False:
|
||||
if self.app.options["global_open_style"] is False:
|
||||
self.app.file_opened.emit("gcode", filename)
|
||||
self.app.file_saved.emit("gcode", filename)
|
||||
self.app.inform.emit('[success] %s: %s' % (_("Solder paste dispenser GCode file saved to"), filename))
|
||||
|
||||
Reference in New Issue
Block a user