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