- 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

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