diff --git a/CHANGELOG.md b/CHANGELOG.md index 82194e87..506fa325 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ CHANGELOG for FlatCAM beta - fixed a minor error in the Gerber Editor which created a graphic glitch on shape selection - making the above fix accept few possibilities - updated the Turkish translation (by (Mehmet Kaya) +- fixed an issue where the selected application translation language is not remembered as was selected and defaulting to English language +- refactored code in Preferences section 19.02.2022 diff --git a/appGUI/MainGUI.py b/appGUI/MainGUI.py index 3302fdc4..c5012c95 100644 --- a/appGUI/MainGUI.py +++ b/appGUI/MainGUI.py @@ -1937,14 +1937,14 @@ class MainGUI(QtWidgets.QMainWindow): # ######################################################################## # ######################## BUILD PREFERENCES ############################# # ######################################################################## - self.general_pref_form = GeneralPreferencesUI(decimals=self.decimals, defaults=self.app.options) - self.gerber_pref_form = GerberPreferencesUI(decimals=self.decimals, defaults=self.app.options) - self.excellon_pref_form = ExcellonPreferencesUI(decimals=self.decimals, defaults=self.app.options) - self.geo_pref_form = GeometryPreferencesUI(decimals=self.decimals, defaults=self.app.options) - self.cncjob_pref_form = CNCJobPreferencesUI(decimals=self.decimals, defaults=self.app.options) - self.plugin_pref_form = PluginsPreferencesUI(decimals=self.decimals, defaults=self.app.options) - self.plugin2_pref_form = Plugins2PreferencesUI(decimals=self.decimals, defaults=self.app.options) - self.plugin_eng_pref_form = PluginsEngravingPreferencesUI(decimals=self.decimals, defaults=self.app.options) + self.general_pref_form = GeneralPreferencesUI(app=self.app) + self.gerber_pref_form = GerberPreferencesUI(app=self.app) + self.excellon_pref_form = ExcellonPreferencesUI(app=self.app) + self.geo_pref_form = GeometryPreferencesUI(app=self.app) + self.cncjob_pref_form = CNCJobPreferencesUI(app=self.app) + self.plugin_pref_form = PluginsPreferencesUI(app=self.app) + self.plugin2_pref_form = Plugins2PreferencesUI(app=self.app) + self.plugin_eng_pref_form = PluginsEngravingPreferencesUI(app=self.app) self.util_pref_form = UtilPreferencesUI(decimals=self.decimals, defaults=self.app.options) @@ -1977,7 +1977,7 @@ class MainGUI(QtWidgets.QMainWindow): flat_settings.setValue('layout', "standard") # This will write the setting to the platform specific storage. del flat_settings - self.app.log.debug("MainGUI.__init__() --> UI layout restored from defaults. QSettings set to 'standard'") + self.app.log.debug("MainGUI.__init__() --> UI layout restored from options. QSettings set to 'standard'") # construct the Toolbar Lock menu entry to the context menu of the QMainWindow self.lock_action = QtGui.QAction() @@ -2153,7 +2153,7 @@ class MainGUI(QtWidgets.QMainWindow): def save_geometry(self, x, y, width, height, notebook_width): """ - Will save the application geometry and positions in the defaults dicitionary to be restored at the next + Will save the application geometry and positions in the options dicitionary to be restored at the next launch of the application. :param x: X position of the main window @@ -2184,7 +2184,7 @@ class MainGUI(QtWidgets.QMainWindow): def restore_toolbar_view(self): """ Some toolbars may be hidden by user and here we restore the state of the toolbars visibility that - was saved in the defaults dictionary. + was saved in the options dictionary. :return: None """ diff --git a/appGUI/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py b/appGUI/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py index 8e1291fd..40e96081 100644 --- a/appGUI/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py +++ b/appGUI/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py @@ -12,11 +12,11 @@ if '_' not in builtins.__dict__: class CNCJobAdvOptPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): # OptionsGroupUI.__init__(self, "CNC Job Advanced Options Preferences", parent=None) super(CNCJobAdvOptPrefGroupUI, self).__init__(self, parent=parent) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options self.setTitle(str(_("Adv. Options"))) diff --git a/appGUI/preferences/cncjob/CNCJobEditorPrefGroupUI.py b/appGUI/preferences/cncjob/CNCJobEditorPrefGroupUI.py index 24879f94..95a79cc7 100644 --- a/appGUI/preferences/cncjob/CNCJobEditorPrefGroupUI.py +++ b/appGUI/preferences/cncjob/CNCJobEditorPrefGroupUI.py @@ -14,13 +14,13 @@ if '_' not in builtins.__dict__: class CNCJobEditorPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): # OptionsGroupUI.__init__(self, "CNC Job Options Preferences", parent=None) super(CNCJobEditorPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Editor"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # PARAMETERS Frame diff --git a/appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py b/appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py index fde0a066..5e36c1b9 100644 --- a/appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py +++ b/appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py @@ -13,13 +13,13 @@ if '_' not in builtins.__dict__: class CNCJobGenPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): # OptionsGroupUI.__init__(self, "CNC Job General Preferences", parent=None) super(CNCJobGenPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("General"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # Plot Frame diff --git a/appGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py b/appGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py index f0bceae8..5c88905c 100644 --- a/appGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py +++ b/appGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py @@ -14,13 +14,13 @@ if '_' not in builtins.__dict__: class CNCJobOptPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): # OptionsGroupUI.__init__(self, "CNC Job Options Preferences", parent=None) super(CNCJobOptPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Options"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # GCode Frame diff --git a/appGUI/preferences/cncjob/CNCJobPPGroupUI.py b/appGUI/preferences/cncjob/CNCJobPPGroupUI.py index c958f778..8cc607ea 100644 --- a/appGUI/preferences/cncjob/CNCJobPPGroupUI.py +++ b/appGUI/preferences/cncjob/CNCJobPPGroupUI.py @@ -12,10 +12,10 @@ if '_' not in builtins.__dict__: class CNCJobPPGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): super(CNCJobPPGroupUI, self).__init__(self, parent=parent) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options self.setTitle(str(_("Pre-Processors"))) diff --git a/appGUI/preferences/cncjob/CNCJobPreferencesUI.py b/appGUI/preferences/cncjob/CNCJobPreferencesUI.py index 7e21bf38..257e8bc6 100644 --- a/appGUI/preferences/cncjob/CNCJobPreferencesUI.py +++ b/appGUI/preferences/cncjob/CNCJobPreferencesUI.py @@ -8,25 +8,23 @@ from appGUI.preferences.cncjob.CNCJobPPGroupUI import CNCJobPPGroupUI class CNCJobPreferencesUI(QtWidgets.QWidget): - def __init__(self, defaults, decimals, parent=None): + def __init__(self, app, parent=None): QtWidgets.QWidget.__init__(self, parent=parent) self.layout = QtWidgets.QHBoxLayout() self.setLayout(self.layout) - self.decimals = decimals - self.defaults = defaults - self.cncjob_gen_group = CNCJobGenPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.cncjob_gen_group = CNCJobGenPrefGroupUI(app=app) self.cncjob_gen_group.setMinimumWidth(260) - self.cncjob_opt_group = CNCJobOptPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.cncjob_opt_group = CNCJobOptPrefGroupUI(app=app) self.cncjob_opt_group.setMinimumWidth(260) - self.cncjob_adv_opt_group = CNCJobAdvOptPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.cncjob_adv_opt_group = CNCJobAdvOptPrefGroupUI(app=app) self.cncjob_adv_opt_group.setMinimumWidth(260) - self.cncjob_editor_group = CNCJobEditorPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.cncjob_editor_group = CNCJobEditorPrefGroupUI(app=app) self.cncjob_editor_group.setMinimumWidth(260) - self.cncjob_pp_group = CNCJobPPGroupUI(decimals=self.decimals, defaults=self.defaults) + self.cncjob_pp_group = CNCJobPPGroupUI(app=app) self.cncjob_pp_group.setMinimumWidth(260) vlay = QtWidgets.QVBoxLayout() diff --git a/appGUI/preferences/excellon/ExcellonAdvOptPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonAdvOptPrefGroupUI.py index d17037d6..738154d6 100644 --- a/appGUI/preferences/excellon/ExcellonAdvOptPrefGroupUI.py +++ b/appGUI/preferences/excellon/ExcellonAdvOptPrefGroupUI.py @@ -13,13 +13,13 @@ if '_' not in builtins.__dict__: class ExcellonAdvOptPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): # OptionsGroupUI.__init__(self, "Excellon Advanced Options", parent=parent) super(ExcellonAdvOptPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Adv. Options"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # PARAMETERS Frame diff --git a/appGUI/preferences/excellon/ExcellonEditorPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonEditorPrefGroupUI.py index 828e2f4c..da7b7fd0 100644 --- a/appGUI/preferences/excellon/ExcellonEditorPrefGroupUI.py +++ b/appGUI/preferences/excellon/ExcellonEditorPrefGroupUI.py @@ -13,12 +13,12 @@ if '_' not in builtins.__dict__: class ExcellonEditorPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): super(ExcellonEditorPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Editor"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # PARAMETERS Frame diff --git a/appGUI/preferences/excellon/ExcellonExpPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonExpPrefGroupUI.py index f0986e4c..4ee21165 100644 --- a/appGUI/preferences/excellon/ExcellonExpPrefGroupUI.py +++ b/appGUI/preferences/excellon/ExcellonExpPrefGroupUI.py @@ -13,12 +13,12 @@ if '_' not in builtins.__dict__: class ExcellonExpPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): super(ExcellonExpPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Export"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # Export Frame diff --git a/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py index b7946bae..d35e4913 100644 --- a/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py +++ b/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py @@ -16,13 +16,13 @@ if '_' not in builtins.__dict__: class ExcellonGenPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): # OptionsGroupUI.__init__(self, "Excellon Options", parent=parent) super(ExcellonGenPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("General"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # Plot Frame @@ -359,7 +359,7 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI): self.excellon_alpha_entry.valueChanged.connect(self.on_excellon_alpha_changed) # alpha - # Load the defaults values into the Excellon Format and Excellon Zeros fields + # Load the options values into the Excellon Format and Excellon Zeros fields self.excellon_defaults_button.clicked.connect(self.on_excellon_defaults_button) # Make sure that when the Excellon loading parameters are changed, the change is reflected in the # Export Excellon parameters. diff --git a/appGUI/preferences/excellon/ExcellonOptPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonOptPrefGroupUI.py index 0c2e6076..6b53a3df 100644 --- a/appGUI/preferences/excellon/ExcellonOptPrefGroupUI.py +++ b/appGUI/preferences/excellon/ExcellonOptPrefGroupUI.py @@ -13,13 +13,13 @@ if '_' not in builtins.__dict__: class ExcellonOptPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): # OptionsGroupUI.__init__(self, "Excellon Options", parent=parent) super(ExcellonOptPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Options"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # PARAMETERS Frame diff --git a/appGUI/preferences/excellon/ExcellonPreferencesUI.py b/appGUI/preferences/excellon/ExcellonPreferencesUI.py index 83c06ae1..6269f39e 100644 --- a/appGUI/preferences/excellon/ExcellonPreferencesUI.py +++ b/appGUI/preferences/excellon/ExcellonPreferencesUI.py @@ -17,22 +17,20 @@ if '_' not in builtins.__dict__: class ExcellonPreferencesUI(QtWidgets.QWidget): - def __init__(self, decimals, defaults, parent=None): + def __init__(self, app, parent=None): QtWidgets.QWidget.__init__(self, parent=parent) self.layout = QtWidgets.QHBoxLayout() self.setLayout(self.layout) - self.decimals = decimals - self.defaults = defaults - self.excellon_gen_group = ExcellonGenPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.excellon_gen_group = ExcellonGenPrefGroupUI(app=app) self.excellon_gen_group.setMinimumWidth(240) - self.excellon_opt_group = ExcellonOptPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.excellon_opt_group = ExcellonOptPrefGroupUI(app=app) self.excellon_opt_group.setMinimumWidth(290) - self.excellon_exp_group = ExcellonExpPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.excellon_exp_group = ExcellonExpPrefGroupUI(app=app) self.excellon_exp_group.setMinimumWidth(250) - self.excellon_adv_opt_group = ExcellonAdvOptPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.excellon_adv_opt_group = ExcellonAdvOptPrefGroupUI(app=app) self.excellon_adv_opt_group.setMinimumWidth(250) - self.excellon_editor_group = ExcellonEditorPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.excellon_editor_group = ExcellonEditorPrefGroupUI(app=app) self.excellon_editor_group.setMinimumWidth(260) self.vlay = QtWidgets.QVBoxLayout() diff --git a/appGUI/preferences/general/GeneralAPPSetGroupUI.py b/appGUI/preferences/general/GeneralAPPSetGroupUI.py index ef91ae27..3a3aa5db 100644 --- a/appGUI/preferences/general/GeneralAPPSetGroupUI.py +++ b/appGUI/preferences/general/GeneralAPPSetGroupUI.py @@ -15,12 +15,12 @@ if '_' not in builtins.__dict__: class GeneralAPPSetGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): super(GeneralAPPSetGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("App Settings"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options theme_settings = QtCore.QSettings("Open Source", "FlatCAM") if theme_settings.contains("theme"): diff --git a/appGUI/preferences/general/GeneralAppPrefGroupUI.py b/appGUI/preferences/general/GeneralAppPrefGroupUI.py index 60d378ea..8e2a3de9 100644 --- a/appGUI/preferences/general/GeneralAppPrefGroupUI.py +++ b/appGUI/preferences/general/GeneralAppPrefGroupUI.py @@ -18,12 +18,12 @@ if '_' not in builtins.__dict__: # https://www.w3schools.com/colors/colors_names.asp # Colors names class GeneralAppPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): super(GeneralAppPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(_("App Preferences")) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # Grid0 Frame @@ -200,7 +200,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): grid3_frame.setLayout(grid3) self.language_combo = FCComboBox() - self.language_combo.addItems(self.defaults["global_languages"]) + self.language_combo.addItems(self.app.options["global_languages"]) grid3.addWidget(self.language_combo, 0, 0, 1, 2) self.language_apply_btn = FCButton(_("Apply Language")) diff --git a/appGUI/preferences/general/GeneralGUIPrefGroupUI.py b/appGUI/preferences/general/GeneralGUIPrefGroupUI.py index bb7399cd..c99c5715 100644 --- a/appGUI/preferences/general/GeneralGUIPrefGroupUI.py +++ b/appGUI/preferences/general/GeneralGUIPrefGroupUI.py @@ -15,12 +15,12 @@ if '_' not in builtins.__dict__: class GeneralGUIPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): super(GeneralGUIPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("GUI Preferences"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options self.param_lbl = FCLabel('%s' % _("Parameters")) self.layout.addWidget(self.param_lbl) diff --git a/appGUI/preferences/general/GeneralPreferencesUI.py b/appGUI/preferences/general/GeneralPreferencesUI.py index 766643dc..b68252a7 100644 --- a/appGUI/preferences/general/GeneralPreferencesUI.py +++ b/appGUI/preferences/general/GeneralPreferencesUI.py @@ -14,20 +14,18 @@ if '_' not in builtins.__dict__: class GeneralPreferencesUI(QtWidgets.QWidget): - def __init__(self, decimals, defaults, parent=None): + def __init__(self, app, parent=None): QtWidgets.QWidget.__init__(self, parent=parent) self.layout = QtWidgets.QHBoxLayout() self.setLayout(self.layout) - self.decimals = decimals - self.defaults = defaults - self.general_app_group = GeneralAppPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.general_app_group = GeneralAppPrefGroupUI(app=app) self.general_app_group.setMinimumWidth(250) - self.general_gui_group = GeneralGUIPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.general_gui_group = GeneralGUIPrefGroupUI(app=app) self.general_gui_group.setMinimumWidth(250) - self.general_app_set_group = GeneralAPPSetGroupUI(decimals=self.decimals, defaults=self.defaults) + self.general_app_set_group = GeneralAPPSetGroupUI(app=app) self.general_app_set_group.setMinimumWidth(250) self.layout.addWidget(self.general_app_group) diff --git a/appGUI/preferences/geometry/GeometryAdvOptPrefGroupUI.py b/appGUI/preferences/geometry/GeometryAdvOptPrefGroupUI.py index 65c2516f..2ff51221 100644 --- a/appGUI/preferences/geometry/GeometryAdvOptPrefGroupUI.py +++ b/appGUI/preferences/geometry/GeometryAdvOptPrefGroupUI.py @@ -13,13 +13,13 @@ if '_' not in builtins.__dict__: class GeometryAdvOptPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): # OptionsGroupUI.__init__(self, "Geometry Advanced Options Preferences", parent=parent) super(GeometryAdvOptPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Adv. Options"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # Advanced Options Frame diff --git a/appGUI/preferences/geometry/GeometryEditorPrefGroupUI.py b/appGUI/preferences/geometry/GeometryEditorPrefGroupUI.py index 57e2fdc8..4ef22b98 100644 --- a/appGUI/preferences/geometry/GeometryEditorPrefGroupUI.py +++ b/appGUI/preferences/geometry/GeometryEditorPrefGroupUI.py @@ -13,13 +13,13 @@ if '_' not in builtins.__dict__: class GeometryEditorPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): # OptionsGroupUI.__init__(self, "Gerber Adv. Options Preferences", parent=parent) super(GeometryEditorPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Editor"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # PARAMETERS Frame diff --git a/appGUI/preferences/geometry/GeometryExpPrefGroupUI.py b/appGUI/preferences/geometry/GeometryExpPrefGroupUI.py index 8b988562..8d28717c 100644 --- a/appGUI/preferences/geometry/GeometryExpPrefGroupUI.py +++ b/appGUI/preferences/geometry/GeometryExpPrefGroupUI.py @@ -13,12 +13,12 @@ if '_' not in builtins.__dict__: class GeometryExpPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): super(GeometryExpPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Export"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # Export Frame diff --git a/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py b/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py index 7de4be1d..98947b98 100644 --- a/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py +++ b/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py @@ -15,13 +15,13 @@ if '_' not in builtins.__dict__: class GeometryGenPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): # OptionsGroupUI.__init__(self, "Geometry General Preferences", parent=parent) super(GeometryGenPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("General"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # Plot Frame diff --git a/appGUI/preferences/geometry/GeometryOptPrefGroupUI.py b/appGUI/preferences/geometry/GeometryOptPrefGroupUI.py index 7454b323..40eee469 100644 --- a/appGUI/preferences/geometry/GeometryOptPrefGroupUI.py +++ b/appGUI/preferences/geometry/GeometryOptPrefGroupUI.py @@ -14,13 +14,13 @@ if '_' not in builtins.__dict__: class GeometryOptPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): # OptionsGroupUI.__init__(self, "Geometry Options Preferences", parent=parent) super(GeometryOptPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Options"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # PARAMETERS Frame diff --git a/appGUI/preferences/geometry/GeometryPreferencesUI.py b/appGUI/preferences/geometry/GeometryPreferencesUI.py index 50d8428d..ad351bce 100644 --- a/appGUI/preferences/geometry/GeometryPreferencesUI.py +++ b/appGUI/preferences/geometry/GeometryPreferencesUI.py @@ -17,22 +17,20 @@ if '_' not in builtins.__dict__: class GeometryPreferencesUI(QtWidgets.QWidget): - def __init__(self, decimals, defaults, parent=None): + def __init__(self, app, parent=None): QtWidgets.QWidget.__init__(self, parent=parent) self.layout = QtWidgets.QHBoxLayout() self.setLayout(self.layout) - self.decimals = decimals - self.defaults = defaults - self.geometry_gen_group = GeometryGenPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.geometry_gen_group = GeometryGenPrefGroupUI(app=app) self.geometry_gen_group.setMinimumWidth(220) - self.geometry_exp_group = GeometryExpPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.geometry_exp_group = GeometryExpPrefGroupUI(app=app) self.geometry_exp_group.setMinimumWidth(220) - self.geometry_opt_group = GeometryOptPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.geometry_opt_group = GeometryOptPrefGroupUI(app=app) self.geometry_opt_group.setMinimumWidth(300) - self.geometry_adv_opt_group = GeometryAdvOptPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.geometry_adv_opt_group = GeometryAdvOptPrefGroupUI(app=app) self.geometry_adv_opt_group.setMinimumWidth(270) - self.geometry_editor_group = GeometryEditorPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.geometry_editor_group = GeometryEditorPrefGroupUI(app=app) self.geometry_editor_group.setMinimumWidth(250) self.layout.addWidget(self.geometry_gen_group) diff --git a/appGUI/preferences/gerber/GerberAdvOptPrefGroupUI.py b/appGUI/preferences/gerber/GerberAdvOptPrefGroupUI.py index f1dae662..517fed24 100644 --- a/appGUI/preferences/gerber/GerberAdvOptPrefGroupUI.py +++ b/appGUI/preferences/gerber/GerberAdvOptPrefGroupUI.py @@ -14,13 +14,13 @@ if '_' not in builtins.__dict__: class GerberAdvOptPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): # OptionsGroupUI.__init__(self, "Gerber Adv. Options Preferences", parent=parent) super(GerberAdvOptPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Adv. Options"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # Advanced Gerber Frame diff --git a/appGUI/preferences/gerber/GerberEditorPrefGroupUI.py b/appGUI/preferences/gerber/GerberEditorPrefGroupUI.py index 398dfe29..d021d1ec 100644 --- a/appGUI/preferences/gerber/GerberEditorPrefGroupUI.py +++ b/appGUI/preferences/gerber/GerberEditorPrefGroupUI.py @@ -14,13 +14,13 @@ if '_' not in builtins.__dict__: class GerberEditorPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): # OptionsGroupUI.__init__(self, "Gerber Adv. Options Preferences", parent=parent) super(GerberEditorPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Editor"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # Gerber Editor Parameters Frame diff --git a/appGUI/preferences/gerber/GerberExpPrefGroupUI.py b/appGUI/preferences/gerber/GerberExpPrefGroupUI.py index 39ae72c1..dd236ad3 100644 --- a/appGUI/preferences/gerber/GerberExpPrefGroupUI.py +++ b/appGUI/preferences/gerber/GerberExpPrefGroupUI.py @@ -14,12 +14,12 @@ if '_' not in builtins.__dict__: class GerberExpPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): super(GerberExpPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Export"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # Export Frame diff --git a/appGUI/preferences/gerber/GerberGenPrefGroupUI.py b/appGUI/preferences/gerber/GerberGenPrefGroupUI.py index a2fa8a19..979da744 100644 --- a/appGUI/preferences/gerber/GerberGenPrefGroupUI.py +++ b/appGUI/preferences/gerber/GerberGenPrefGroupUI.py @@ -16,13 +16,13 @@ if '_' not in builtins.__dict__: class GerberGenPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): # OptionsGroupUI.__init__(self, "Gerber General Preferences", parent=parent) super(GerberGenPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("General"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ## Plot options self.plot_options_label = FCLabel('%s' % _("Plot Options")) @@ -333,7 +333,7 @@ class GerberGenPrefGroupUI(OptionsGroupUI): if color_box.ok is True: color_box.update_color_list() - self.defaults["gerber_color_list"] = color_box.color_list + self.options["gerber_color_list"] = color_box.color_list class ColorsManager(QtWidgets.QDialog): diff --git a/appGUI/preferences/gerber/GerberOptPrefGroupUI.py b/appGUI/preferences/gerber/GerberOptPrefGroupUI.py index 9d60f2cd..bdfd6666 100644 --- a/appGUI/preferences/gerber/GerberOptPrefGroupUI.py +++ b/appGUI/preferences/gerber/GerberOptPrefGroupUI.py @@ -13,12 +13,12 @@ if '_' not in builtins.__dict__: class GerberOptPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): # OptionsGroupUI.__init__(self, "Gerber Options Preferences", parent=parent) super(GerberOptPrefGroupUI, self).__init__(self, parent=parent) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options self.setTitle(str(_("Options"))) diff --git a/appGUI/preferences/gerber/GerberPreferencesUI.py b/appGUI/preferences/gerber/GerberPreferencesUI.py index 1b710c4b..3e39f6e3 100644 --- a/appGUI/preferences/gerber/GerberPreferencesUI.py +++ b/appGUI/preferences/gerber/GerberPreferencesUI.py @@ -17,22 +17,20 @@ if '_' not in builtins.__dict__: class GerberPreferencesUI(QtWidgets.QWidget): - def __init__(self, decimals, defaults, parent=None): + def __init__(self, app, parent=None): QtWidgets.QWidget.__init__(self, parent=parent) self.layout = QtWidgets.QHBoxLayout() self.setLayout(self.layout) - self.decimals = decimals - self.defaults = defaults - self.gerber_gen_group = GerberGenPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.gerber_gen_group = GerberGenPrefGroupUI(app=app) self.gerber_gen_group.setMinimumWidth(200) - self.gerber_opt_group = GerberOptPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.gerber_opt_group = GerberOptPrefGroupUI(app=app) self.gerber_opt_group.setMinimumWidth(250) - self.gerber_exp_group = GerberExpPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.gerber_exp_group = GerberExpPrefGroupUI(app=app) self.gerber_exp_group.setMinimumWidth(230) - self.gerber_adv_opt_group = GerberAdvOptPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.gerber_adv_opt_group = GerberAdvOptPrefGroupUI(app=app) self.gerber_adv_opt_group.setMinimumWidth(200) - self.gerber_editor_group = GerberEditorPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.gerber_editor_group = GerberEditorPrefGroupUI(app=app) self.gerber_editor_group.setMinimumWidth(200) self.vlay = QtWidgets.QVBoxLayout() diff --git a/appGUI/preferences/tools/Plugins2PreferencesUI.py b/appGUI/preferences/tools/Plugins2PreferencesUI.py index fccf0ecd..ba016d24 100644 --- a/appGUI/preferences/tools/Plugins2PreferencesUI.py +++ b/appGUI/preferences/tools/Plugins2PreferencesUI.py @@ -20,38 +20,36 @@ if '_' not in builtins.__dict__: class Plugins2PreferencesUI(QtWidgets.QWidget): - def __init__(self, defaults, decimals, parent=None): + def __init__(self,app, parent=None): QtWidgets.QWidget.__init__(self, parent=parent) self.layout = QtWidgets.QHBoxLayout() self.setLayout(self.layout) - self.decimals = decimals - self.defaults = defaults - self.tools2_checkrules_group = Tools2RulesCheckPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.tools2_checkrules_group = Tools2RulesCheckPrefGroupUI(app=app) self.tools2_checkrules_group.setMinimumWidth(150) - self.tools2_optimal_group = Tools2OptimalPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.tools2_optimal_group = Tools2OptimalPrefGroupUI(app=app) self.tools2_optimal_group.setMinimumWidth(220) - self.tools2_qrcode_group = Tools2QRCodePrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.tools2_qrcode_group = Tools2QRCodePrefGroupUI(app=app) self.tools2_qrcode_group.setMinimumWidth(220) - self.tools2_cfill_group = Tools2CThievingPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.tools2_cfill_group = Tools2CThievingPrefGroupUI(app=app) self.tools2_cfill_group.setMinimumWidth(220) - self.tools2_fiducials_group = Tools2FiducialsPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.tools2_fiducials_group = Tools2FiducialsPrefGroupUI(app=app) self.tools2_fiducials_group.setMinimumWidth(220) - self.tools2_cal_group = Tools2CalPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.tools2_cal_group = Tools2CalPrefGroupUI(app=app) self.tools2_cal_group.setMinimumWidth(220) - self.tools2_edrills_group = Tools2EDrillsPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.tools2_edrills_group = Tools2EDrillsPrefGroupUI(app=app) self.tools2_edrills_group.setMinimumWidth(220) - self.tools2_punch_group = Tools2PunchGerberPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.tools2_punch_group = Tools2PunchGerberPrefGroupUI(app=app) self.tools2_punch_group.setMinimumWidth(220) - self.tools2_invert_group = Tools2InvertPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.tools2_invert_group = Tools2InvertPrefGroupUI(app=app) self.tools2_invert_group.setMinimumWidth(220) self.vlay = QtWidgets.QVBoxLayout() diff --git a/appGUI/preferences/tools/PluginsEngravingPreferencesUI.py b/appGUI/preferences/tools/PluginsEngravingPreferencesUI.py index a3453056..7bba2893 100644 --- a/appGUI/preferences/tools/PluginsEngravingPreferencesUI.py +++ b/appGUI/preferences/tools/PluginsEngravingPreferencesUI.py @@ -18,26 +18,24 @@ if '_' not in builtins.__dict__: class PluginsEngravingPreferencesUI(QtWidgets.QWidget): - def __init__(self, defaults, decimals, parent=None): + def __init__(self, app, parent=None): QtWidgets.QWidget.__init__(self, parent=parent) self.layout = QtWidgets.QHBoxLayout() self.setLayout(self.layout) - self.decimals = decimals - self.defaults = defaults - self.tools_iso_group = ToolsISOPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.tools_iso_group = ToolsISOPrefGroupUI(app=app) self.tools_iso_group.setMinimumWidth(220) - self.tools_ncc_group = ToolsNCCPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.tools_ncc_group = ToolsNCCPrefGroupUI(app=app) self.tools_ncc_group.setMinimumWidth(220) - self.tools_paint_group = ToolsPaintPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.tools_paint_group = ToolsPaintPrefGroupUI(app=app) self.tools_paint_group.setMinimumWidth(220) - self.tools_2sided_group = Tools2sidedPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.tools_2sided_group = Tools2sidedPrefGroupUI(app=app) self.tools_2sided_group.setMinimumWidth(220) - self.tools_level_group = ToolsLevelPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.tools_level_group = ToolsLevelPrefGroupUI(app=app) self.tools_level_group.setMinimumWidth(220) self.vlay = QtWidgets.QVBoxLayout() diff --git a/appGUI/preferences/tools/PluginsPreferencesUI.py b/appGUI/preferences/tools/PluginsPreferencesUI.py index 38f27097..fcd01eb1 100644 --- a/appGUI/preferences/tools/PluginsPreferencesUI.py +++ b/appGUI/preferences/tools/PluginsPreferencesUI.py @@ -24,41 +24,39 @@ if '_' not in builtins.__dict__: class PluginsPreferencesUI(QtWidgets.QWidget): - def __init__(self, defaults, decimals, parent=None): + def __init__(self, app, parent=None): QtWidgets.QWidget.__init__(self, parent=parent) self.layout = QtWidgets.QHBoxLayout() self.setLayout(self.layout) - self.decimals = decimals - self.defaults = defaults - self.tools_drill_group = ToolsDrillPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.tools_drill_group = ToolsDrillPrefGroupUI(app=app) self.tools_drill_group.setMinimumWidth(180) - self.tools_mill_group = ToolsMillPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.tools_mill_group = ToolsMillPrefGroupUI(app=app) self.tools_mill_group.setMinimumWidth(180) - self.tools_cutout_group = ToolsCutoutPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.tools_cutout_group = ToolsCutoutPrefGroupUI(app=app) self.tools_cutout_group.setMinimumWidth(220) - self.tools_film_group = ToolsFilmPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.tools_film_group = ToolsFilmPrefGroupUI(app=app) self.tools_film_group.setMinimumWidth(220) - self.tools_panelize_group = ToolsPanelizePrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.tools_panelize_group = ToolsPanelizePrefGroupUI(app=app) self.tools_panelize_group.setMinimumWidth(220) - self.tools_calculators_group = ToolsCalculatorsPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.tools_calculators_group = ToolsCalculatorsPrefGroupUI(app=app) self.tools_calculators_group.setMinimumWidth(220) - self.tools_transform_group = ToolsTransformPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.tools_transform_group = ToolsTransformPrefGroupUI(app=app) self.tools_transform_group.setMinimumWidth(200) - self.tools_solderpaste_group = ToolsSolderpastePrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.tools_solderpaste_group = ToolsSolderpastePrefGroupUI(app=app) self.tools_solderpaste_group.setMinimumWidth(200) - self.tools_markers_group = ToolsMarkersPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.tools_markers_group = ToolsMarkersPrefGroupUI(app=app) self.tools_markers_group.setMinimumWidth(200) - self.tools_sub_group = ToolsSubPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.tools_sub_group = ToolsSubPrefGroupUI(app=app) self.tools_sub_group.setMinimumWidth(200) self.vlay = QtWidgets.QVBoxLayout() diff --git a/appGUI/preferences/tools/Tools2CThievingPrefGroupUI.py b/appGUI/preferences/tools/Tools2CThievingPrefGroupUI.py index d0c35bf4..9b69296a 100644 --- a/appGUI/preferences/tools/Tools2CThievingPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2CThievingPrefGroupUI.py @@ -14,13 +14,13 @@ if '_' not in builtins.__dict__: class Tools2CThievingPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): super(Tools2CThievingPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Copper Thieving Plugin"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # Parameters Frame diff --git a/appGUI/preferences/tools/Tools2CalPrefGroupUI.py b/appGUI/preferences/tools/Tools2CalPrefGroupUI.py index 91f4d06e..e3e642de 100644 --- a/appGUI/preferences/tools/Tools2CalPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2CalPrefGroupUI.py @@ -14,13 +14,13 @@ if '_' not in builtins.__dict__: class Tools2CalPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): super(Tools2CalPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Calibration Plugin"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # Parameters Frame diff --git a/appGUI/preferences/tools/Tools2ExtractPrefGroupUI.py b/appGUI/preferences/tools/Tools2ExtractPrefGroupUI.py index 62eee520..f30da307 100644 --- a/appGUI/preferences/tools/Tools2ExtractPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2ExtractPrefGroupUI.py @@ -13,13 +13,13 @@ if '_' not in builtins.__dict__: class Tools2EDrillsPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): super(Tools2EDrillsPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Extract Drills Options"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # PARAMETERS Frame diff --git a/appGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py b/appGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py index 8fc263f9..c5cff4df 100644 --- a/appGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py @@ -13,13 +13,13 @@ if '_' not in builtins.__dict__: class Tools2FiducialsPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): super(Tools2FiducialsPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Fiducials Plugin"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # Parameters Frame diff --git a/appGUI/preferences/tools/Tools2InvertPrefGroupUI.py b/appGUI/preferences/tools/Tools2InvertPrefGroupUI.py index bc5246b1..7afd2331 100644 --- a/appGUI/preferences/tools/Tools2InvertPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2InvertPrefGroupUI.py @@ -13,13 +13,13 @@ if '_' not in builtins.__dict__: class Tools2InvertPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): super(Tools2InvertPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Invert Gerber Plugin"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # PARAMETERS Frame diff --git a/appGUI/preferences/tools/Tools2OptimalPrefGroupUI.py b/appGUI/preferences/tools/Tools2OptimalPrefGroupUI.py index ee0bc095..658517a0 100644 --- a/appGUI/preferences/tools/Tools2OptimalPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2OptimalPrefGroupUI.py @@ -13,13 +13,13 @@ if '_' not in builtins.__dict__: class Tools2OptimalPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): super(Tools2OptimalPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Optimal Plugin"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # Parameters Frame diff --git a/appGUI/preferences/tools/Tools2PunchGerberPrefGroupUI.py b/appGUI/preferences/tools/Tools2PunchGerberPrefGroupUI.py index fff4c1fe..1f81c2e2 100644 --- a/appGUI/preferences/tools/Tools2PunchGerberPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2PunchGerberPrefGroupUI.py @@ -13,13 +13,13 @@ if '_' not in builtins.__dict__: class Tools2PunchGerberPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): super(Tools2PunchGerberPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Punch Gerber Options"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # Processed Pads Frame diff --git a/appGUI/preferences/tools/Tools2QRCodePrefGroupUI.py b/appGUI/preferences/tools/Tools2QRCodePrefGroupUI.py index 46d9f0ec..4273ef66 100644 --- a/appGUI/preferences/tools/Tools2QRCodePrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2QRCodePrefGroupUI.py @@ -13,13 +13,13 @@ if '_' not in builtins.__dict__: class Tools2QRCodePrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): super(Tools2QRCodePrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("QRCode Plugin"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # Parameters Frame diff --git a/appGUI/preferences/tools/Tools2RulesCheckPrefGroupUI.py b/appGUI/preferences/tools/Tools2RulesCheckPrefGroupUI.py index 8d891672..50680a19 100644 --- a/appGUI/preferences/tools/Tools2RulesCheckPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2RulesCheckPrefGroupUI.py @@ -13,7 +13,7 @@ if '_' not in builtins.__dict__: class Tools2RulesCheckPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): super(Tools2RulesCheckPrefGroupUI, self).__init__(self, parent=parent) @@ -22,8 +22,8 @@ class Tools2RulesCheckPrefGroupUI(OptionsGroupUI): _("A tool to check if Gerber files are within a set\n" "of Manufacturing Rules.") ) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # Rules Frame diff --git a/appGUI/preferences/tools/Tools2sidedPrefGroupUI.py b/appGUI/preferences/tools/Tools2sidedPrefGroupUI.py index f3f62dc8..08192cbd 100644 --- a/appGUI/preferences/tools/Tools2sidedPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2sidedPrefGroupUI.py @@ -13,13 +13,13 @@ if '_' not in builtins.__dict__: class Tools2sidedPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): # OptionsGroupUI.__init__(self, "2sided Plugin", parent=parent) super(Tools2sidedPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("2-Sided Plugin"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ## Board cuttout self.dblsided_label = FCLabel('%s' % _("PCB Alignment")) diff --git a/appGUI/preferences/tools/ToolsCalculatorsPrefGroupUI.py b/appGUI/preferences/tools/ToolsCalculatorsPrefGroupUI.py index b1c73ad1..b2f662a6 100644 --- a/appGUI/preferences/tools/ToolsCalculatorsPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsCalculatorsPrefGroupUI.py @@ -13,13 +13,13 @@ if '_' not in builtins.__dict__: class ToolsCalculatorsPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): # OptionsGroupUI.__init__(self, "Calculators Plugin", parent=parent) super(ToolsCalculatorsPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Calculators Plugin"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # V-Shape Tool Frame diff --git a/appGUI/preferences/tools/ToolsCutoutPrefGroupUI.py b/appGUI/preferences/tools/ToolsCutoutPrefGroupUI.py index b5eca6fb..21da24a6 100644 --- a/appGUI/preferences/tools/ToolsCutoutPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsCutoutPrefGroupUI.py @@ -14,13 +14,13 @@ if '_' not in builtins.__dict__: class ToolsCutoutPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): # OptionsGroupUI.__init__(self, "Cutout Plugin", parent=parent) super(ToolsCutoutPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Cutout Plugin"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ## Board cutout self.board_cutout_label = FCLabel('%s' % _("Parameters")) diff --git a/appGUI/preferences/tools/ToolsDrillPrefGroupUI.py b/appGUI/preferences/tools/ToolsDrillPrefGroupUI.py index c46a4252..912609e9 100644 --- a/appGUI/preferences/tools/ToolsDrillPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsDrillPrefGroupUI.py @@ -15,12 +15,12 @@ if '_' not in builtins.__dict__: class ToolsDrillPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): super(ToolsDrillPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Drilling Plugin"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # PARAMETERS Frame @@ -209,7 +209,7 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI): self.pp_excellon_name_cb.setFocusPolicy(Qt.FocusPolicy.StrongFocus) self.pp_excellon_name_cb.setSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.Preferred) - self.pp_excellon_name_cb.addItems(self.defaults["tools_drill_preprocessor_list"]) + self.pp_excellon_name_cb.addItems(self.options["tools_drill_preprocessor_list"]) for it in range(self.pp_excellon_name_cb.count()): self.pp_excellon_name_cb.setItemData(it, self.pp_excellon_name_cb.itemText(it), diff --git a/appGUI/preferences/tools/ToolsFilmPrefGroupUI.py b/appGUI/preferences/tools/ToolsFilmPrefGroupUI.py index 4c208718..c7b6fd63 100644 --- a/appGUI/preferences/tools/ToolsFilmPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsFilmPrefGroupUI.py @@ -14,13 +14,13 @@ if '_' not in builtins.__dict__: class ToolsFilmPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): # OptionsGroupUI.__init__(self, "Cutout Plugin", parent=parent) super(ToolsFilmPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Film Plugin"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # Adjustments Frame diff --git a/appGUI/preferences/tools/ToolsISOPrefGroupUI.py b/appGUI/preferences/tools/ToolsISOPrefGroupUI.py index 0937d1e2..caa30428 100644 --- a/appGUI/preferences/tools/ToolsISOPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsISOPrefGroupUI.py @@ -14,12 +14,12 @@ if '_' not in builtins.__dict__: class ToolsISOPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): super(ToolsISOPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Isolation Plugin"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ## Clear non-copper regions self.iso_label = FCLabel('%s' % _("Parameters")) diff --git a/appGUI/preferences/tools/ToolsLevelPrefGroupUI.py b/appGUI/preferences/tools/ToolsLevelPrefGroupUI.py index 441737d0..add3e5f0 100644 --- a/appGUI/preferences/tools/ToolsLevelPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsLevelPrefGroupUI.py @@ -13,13 +13,13 @@ if '_' not in builtins.__dict__: class ToolsLevelPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): # OptionsGroupUI.__init__(self, "Cutout Plugin", parent=parent) super(ToolsLevelPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Levelling Plugin"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ## Board cuttout self.levelling_label = FCLabel('%s' % _("Parameters")) diff --git a/appGUI/preferences/tools/ToolsMarkersPrefGroupUI.py b/appGUI/preferences/tools/ToolsMarkersPrefGroupUI.py index c185072f..72aef399 100644 --- a/appGUI/preferences/tools/ToolsMarkersPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsMarkersPrefGroupUI.py @@ -13,13 +13,13 @@ if '_' not in builtins.__dict__: class ToolsMarkersPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): # OptionsGroupUI.__init__(self, "Calculators Plugin", parent=parent) super(ToolsMarkersPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Markers Options"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # PARAMETERS Frame diff --git a/appGUI/preferences/tools/ToolsMillPrefGroupUI.py b/appGUI/preferences/tools/ToolsMillPrefGroupUI.py index 315fc2c6..56db1b45 100644 --- a/appGUI/preferences/tools/ToolsMillPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsMillPrefGroupUI.py @@ -15,12 +15,12 @@ if '_' not in builtins.__dict__: class ToolsMillPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): super(ToolsMillPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Milling Plugin"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # PARAMETERS Frame @@ -272,7 +272,7 @@ class ToolsMillPrefGroupUI(OptionsGroupUI): self.pp_geometry_name_cb.setFocusPolicy(Qt.FocusPolicy.StrongFocus) self.pp_geometry_name_cb.setSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.Preferred) - self.pp_geometry_name_cb.addItems(self.defaults["tools_mill_preprocessor_list"]) + self.pp_geometry_name_cb.addItems(self.options["tools_mill_preprocessor_list"]) for it in range(self.pp_geometry_name_cb.count()): self.pp_geometry_name_cb.setItemData(it, self.pp_geometry_name_cb.itemText(it), diff --git a/appGUI/preferences/tools/ToolsNCCPrefGroupUI.py b/appGUI/preferences/tools/ToolsNCCPrefGroupUI.py index 9964d1fc..e0d697c9 100644 --- a/appGUI/preferences/tools/ToolsNCCPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsNCCPrefGroupUI.py @@ -14,13 +14,13 @@ if '_' not in builtins.__dict__: class ToolsNCCPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): # OptionsGroupUI.__init__(self, "NCC Plugin", parent=parent) super(ToolsNCCPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("NCC Plugin"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ## Clear non-copper regions self.clearcopper_label = FCLabel('%s' % _("Parameters")) diff --git a/appGUI/preferences/tools/ToolsPaintPrefGroupUI.py b/appGUI/preferences/tools/ToolsPaintPrefGroupUI.py index 527f6d96..9a5a5b13 100644 --- a/appGUI/preferences/tools/ToolsPaintPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsPaintPrefGroupUI.py @@ -14,13 +14,13 @@ if '_' not in builtins.__dict__: class ToolsPaintPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): # OptionsGroupUI.__init__(self, "Paint Area Plugin", parent=parent) super(ToolsPaintPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Paint Plugin"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ------------------------------ # ## Paint area diff --git a/appGUI/preferences/tools/ToolsPanelizePrefGroupUI.py b/appGUI/preferences/tools/ToolsPanelizePrefGroupUI.py index ed690185..c749d855 100644 --- a/appGUI/preferences/tools/ToolsPanelizePrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsPanelizePrefGroupUI.py @@ -13,13 +13,13 @@ if '_' not in builtins.__dict__: class ToolsPanelizePrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): # OptionsGroupUI.__init__(self, "Cutout Plugin", parent=parent) super(ToolsPanelizePrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Panelize Plugin"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # PARAMETERS Frame diff --git a/appGUI/preferences/tools/ToolsSolderpastePrefGroupUI.py b/appGUI/preferences/tools/ToolsSolderpastePrefGroupUI.py index 41ca0897..358d30d2 100644 --- a/appGUI/preferences/tools/ToolsSolderpastePrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsSolderpastePrefGroupUI.py @@ -14,13 +14,13 @@ if '_' not in builtins.__dict__: class ToolsSolderpastePrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): super(ToolsSolderpastePrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("SolderPaste Plugin"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # PARAMETERS Frame @@ -240,7 +240,7 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): ) self.pp_combo = FCComboBox() - self.pp_combo.addItems(self.defaults["tools_solderpaste_preprocessor_list"]) + self.pp_combo.addItems(self.options["tools_solderpaste_preprocessor_list"]) # add ToolTips for the Preprocessor ComboBoxes in Preferences for it in range(self.pp_combo.count()): diff --git a/appGUI/preferences/tools/ToolsSubPrefGroupUI.py b/appGUI/preferences/tools/ToolsSubPrefGroupUI.py index b3d35dff..1373ca19 100644 --- a/appGUI/preferences/tools/ToolsSubPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsSubPrefGroupUI.py @@ -10,13 +10,13 @@ if '_' not in builtins.__dict__: _ = gettext.gettext class ToolsSubPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): super(ToolsSubPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Substractor Plugin"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # PARAMETERS Frame diff --git a/appGUI/preferences/tools/ToolsTransformPrefGroupUI.py b/appGUI/preferences/tools/ToolsTransformPrefGroupUI.py index 76d36420..3c0702c3 100644 --- a/appGUI/preferences/tools/ToolsTransformPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsTransformPrefGroupUI.py @@ -14,13 +14,13 @@ if '_' not in builtins.__dict__: class ToolsTransformPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): super(ToolsTransformPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Transform Plugin"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options # ############################################################################################################# # PARAMETERS Frame diff --git a/app_Main.py b/app_Main.py index 35b3c210..6a774085 100644 --- a/app_Main.py +++ b/app_Main.py @@ -1040,7 +1040,7 @@ class App(QtCore.QObject): else: self.cursor_color_3D = 'gray' - # update the defaults dict with the setting in QSetting + # update the options dict with the setting in QSetting self.options['global_theme'] = theme # ######################## @@ -1420,7 +1420,7 @@ class App(QtCore.QObject): self.file_opened.connect(lambda kind, filename: self.register_folder(filename)) self.file_saved.connect(lambda kind, filename: self.register_save_folder(filename)) - # when the defaults dictionary values change + # when the options dictionary values change self.options.set_change_callback(callback=self.on_options_value_changed) # ########################################################################################################### @@ -3909,7 +3909,7 @@ class App(QtCore.QObject): # the JSON is first making the keys as strings (therefore I have to use strings too # or do the conversion :( # ) - # and it is ordering them (actually I want that to make the defaults easy to search within) but making + # and it is ordering them (actually I want that to make the options easy to search within) but making # the '10' entry just after '1' therefore ordering as strings sorted_bookmarks = sorted(list(self.options["global_bookmarks"].items())[:bm_limit], @@ -9252,7 +9252,7 @@ class App(QtCore.QObject): def on_defaults2options(self): """ Callback for Options->Transfer Options->App=>Project. Copy options - from application defaults to project defaults. + from application defaults to project options. :return: None """ @@ -10256,7 +10256,7 @@ class MenuFileHandlers(QtCore.QObject): self.app.project_filename = None default_file = self.app.options_path() - # Load the application defaults + # Load the application options self.options.load(filename=default_file, inform=self.inform) # Re-fresh project options @@ -10873,7 +10873,7 @@ class MenuFileHandlers(QtCore.QObject): self.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled.")) return - # Load in the defaults from the chosen file + # Load in the options from the chosen file self.options.load(filename=filename, inform=self.inform) self.app.preferencesUiManager.on_preferences_edited() @@ -10881,7 +10881,7 @@ class MenuFileHandlers(QtCore.QObject): def on_export_preferences(self): """ - Save the defaults dictionary to a file. + Save the options dictionary to a file. :return: None """