- 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:
Marius Stanciu
2022-02-18 23:06:58 +02:00
committed by Marius
parent 14d9ea5470
commit 65d8dcc0b2
92 changed files with 1881 additions and 1882 deletions

View File

@@ -156,22 +156,22 @@ class QRCode(AppTool):
self.ui.border_size_entry.set_value(4)
self.ui.version_entry.set_value(int(self.app.defaults["tools_qrcode_version"]))
self.ui.error_radio.set_value(self.app.defaults["tools_qrcode_error"])
self.ui.bsize_entry.set_value(int(self.app.defaults["tools_qrcode_box_size"]))
self.ui.border_size_entry.set_value(int(self.app.defaults["tools_qrcode_border_size"]))
self.ui.pol_radio.set_value(self.app.defaults["tools_qrcode_polarity"])
self.ui.bb_radio.set_value(self.app.defaults["tools_qrcode_rounded"])
self.ui.version_entry.set_value(int(self.app.options["tools_qrcode_version"]))
self.ui.error_radio.set_value(self.app.options["tools_qrcode_error"])
self.ui.bsize_entry.set_value(int(self.app.options["tools_qrcode_box_size"]))
self.ui.border_size_entry.set_value(int(self.app.options["tools_qrcode_border_size"]))
self.ui.pol_radio.set_value(self.app.options["tools_qrcode_polarity"])
self.ui.bb_radio.set_value(self.app.options["tools_qrcode_rounded"])
self.ui.text_data.set_value(self.app.defaults["tools_qrcode_qrdata"])
self.ui.text_data.set_value(self.app.options["tools_qrcode_qrdata"])
self.ui.fill_color_entry.set_value(self.app.defaults['tools_qrcode_fill_color'])
self.ui.fill_color_entry.set_value(self.app.options['tools_qrcode_fill_color'])
self.ui.fill_color_button.setStyleSheet("background-color:%s" %
str(self.app.defaults['tools_qrcode_fill_color'])[:7])
str(self.app.options['tools_qrcode_fill_color'])[:7])
self.ui.back_color_entry.set_value(self.app.defaults['tools_qrcode_back_color'])
self.ui.back_color_entry.set_value(self.app.options['tools_qrcode_back_color'])
self.ui.back_color_button.setStyleSheet("background-color:%s" %
str(self.app.defaults['tools_qrcode_back_color'])[:7])
str(self.app.options['tools_qrcode_back_color'])[:7])
# SELECT THE CURRENT OBJECT
obj = self.app.collection.get_active()
@@ -180,7 +180,7 @@ class QRCode(AppTool):
self.ui.grb_object_combo.set_value(obj_name)
# 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):
@@ -418,7 +418,7 @@ class QRCode(AppTool):
# I use the len of self.qrcode_geometry instead of the utility one because the complexity of the polygons is
# better seen in this (bit what if the sel.qrcode_geometry is just one geo element? len will fail ...
if len(self.qrcode_geometry) <= self.app.defaults["tools_qrcode_sel_limit"]:
if len(self.qrcode_geometry) <= self.app.options["tools_qrcode_sel_limit"]:
try:
for poly in self.qrcode_utility_geometry:
offset_geo.append(translate(poly.exterior, xoff=pos[0], yoff=pos[1]))
@@ -511,7 +511,7 @@ class QRCode(AppTool):
# w = float(svg_root.get('width'))
h = svgparselength(svg_root.get('height'))[0] # TODO: No units support yet
units = self.app.app_units if units is None else units
res = self.app.defaults['geometry_circle_steps']
res = self.app.options['geometry_circle_steps']
factor = svgparse_viewbox(svg_root)
geos = getsvggeo(svg_root, object_type, units=units, res=res, factor=factor, app=self.app)