- 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:
@@ -105,8 +105,8 @@ class FlatCAMObj(QtCore.QObject):
|
||||
self.deleted = False
|
||||
|
||||
try:
|
||||
self._drawing_tolerance = float(self.app.defaults["global_tolerance"]) if \
|
||||
self.app.defaults["global_tolerance"] else 0.001
|
||||
self._drawing_tolerance = float(self.app.options["global_tolerance"]) if \
|
||||
self.app.options["global_tolerance"] else 0.001
|
||||
except ValueError:
|
||||
self._drawing_tolerance = 0.001
|
||||
|
||||
@@ -493,12 +493,12 @@ class FlatCAMObj(QtCore.QObject):
|
||||
used file extension as the first one in the special string
|
||||
|
||||
:param last_ext: The file extension that was last used to save a file
|
||||
:param filter_string: A key in self.app.defaults that holds a string with the filter from QFileDialog
|
||||
:param filter_string: A key in self.app.options that holds a string with the filter from QFileDialog
|
||||
used when saving a file
|
||||
:return: None
|
||||
"""
|
||||
|
||||
filters = copy(self.app.defaults[filter_string])
|
||||
filters = copy(self.app.options[filter_string])
|
||||
filter_list = filters.split(';;')
|
||||
filter_list_enum_1 = enumerate(filter_list)
|
||||
|
||||
@@ -521,7 +521,7 @@ class FlatCAMObj(QtCore.QObject):
|
||||
# add back the element that should always be the last (All Files)
|
||||
filter_list.append(last_elem)
|
||||
|
||||
self.app.defaults[filter_string] = ';;'.join(filter_list)
|
||||
self.app.options[filter_string] = ';;'.join(filter_list)
|
||||
return
|
||||
|
||||
def add_properties_items(self, obj, treeWidget):
|
||||
@@ -536,7 +536,7 @@ class FlatCAMObj(QtCore.QObject):
|
||||
font = QtGui.QFont()
|
||||
font.setBold(True)
|
||||
|
||||
p_color = QtGui.QColor("#000000") if self.app.defaults['global_gray_icons'] is False \
|
||||
p_color = QtGui.QColor("#000000") if self.app.options['global_gray_icons'] is False \
|
||||
else QtGui.QColor("#FFFFFF")
|
||||
|
||||
# main Items categories
|
||||
|
||||
Reference in New Issue
Block a user