- 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
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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")))
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user