- 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
This commit is contained in:
Marius Stanciu
2022-02-20 20:37:31 +02:00
committed by Marius Stanciu
parent a5c1b348fe
commit 7acabdfa0f
58 changed files with 222 additions and 236 deletions

View File

@@ -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")))

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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")))

View File

@@ -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()

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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.

View File

@@ -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

View File

@@ -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()

View File

@@ -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"):

View File

@@ -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"))

View File

@@ -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('<span style="color:blue;"><b>%s</b></span>' % _("Parameters"))
self.layout.addWidget(self.param_lbl)

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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('<span style="color:blue;"><b>%s</b></span>' % _("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):

View File

@@ -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")))

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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('<span style="color:indigo;"><b>%s</b></span>' % _("PCB Alignment"))

View File

@@ -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

View File

@@ -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('<span style="color:blue;"><b>%s</b></span>' % _("Parameters"))

View File

@@ -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),

View File

@@ -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

View File

@@ -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('<span style="color:blue;"><b>%s</b></span>' % _("Parameters"))

View File

@@ -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('<span style="color:blue;"><b>%s</b></span>' % _("Parameters"))

View File

@@ -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

View File

@@ -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),

View File

@@ -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('<span style="color:blue;"><b>%s</b></span>' % _("Parameters"))

View File

@@ -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

View File

@@ -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

View File

@@ -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()):

View File

@@ -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

View File

@@ -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