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