- 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:
committed by
Marius Stanciu
parent
a5c1b348fe
commit
7acabdfa0f
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user