- added a partial translation for Chinese Simplified language, by 俊霄 余

- trying to separate the Preferences settings from App init and to make them dependent on the self.defaults dictionary
- updated the language strings from the source
This commit is contained in:
Marius Stanciu
2021-08-23 14:01:28 +03:00
committed by Marius Stanciu
parent dd39657e4f
commit 7dc67e2b05
85 changed files with 40840 additions and 40672 deletions

View File

@@ -13,12 +13,13 @@ if '_' not in builtins.__dict__:
class ExcellonAdvOptPrefGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
def __init__(self, defaults, decimals=4, parent=None):
# OptionsGroupUI.__init__(self, "Excellon Advanced Options", parent=parent)
super(ExcellonAdvOptPrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("Excellon Adv. Options")))
self.decimals = decimals
self.defaults = defaults
# #######################
# ## ADVANCED OPTIONS ###

View File

@@ -13,11 +13,12 @@ if '_' not in builtins.__dict__:
class ExcellonEditorPrefGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
def __init__(self, defaults, decimals=4, parent=None):
super(ExcellonEditorPrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("Excellon Editor")))
self.decimals = decimals
self.defaults = defaults
# Excellon Editor Parameters
self.param_label = FCLabel("<b>%s:</b>" % _("Parameters"))

View File

@@ -13,11 +13,12 @@ if '_' not in builtins.__dict__:
class ExcellonExpPrefGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
def __init__(self, defaults, decimals=4, parent=None):
super(ExcellonExpPrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("Excellon Export")))
self.decimals = decimals
self.defaults = defaults
# Plot options
self.export_options_label = FCLabel("<b>%s:</b>" % _("Export Options"))

View File

@@ -15,12 +15,13 @@ if '_' not in builtins.__dict__:
class ExcellonGenPrefGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
def __init__(self, defaults, decimals=4, parent=None):
# OptionsGroupUI.__init__(self, "Excellon Options", parent=parent)
super(ExcellonGenPrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("Excellon General")))
self.decimals = decimals
self.defaults = defaults
# Plot options
self.plot_options_label = FCLabel("<b>%s:</b>" % _("Plot Options"))
@@ -325,8 +326,16 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI):
self.excellon_optimization_radio.activated_custom.connect(self.optimization_selection)
def optimization_selection(self):
if self.excellon_optimization_radio.get_value() == 'M':
def optimization_selection(self, val):
if platform.architecture()[0] != '64bit':
# set Excellon path optimizations algorithm to TSA if the app is run on a 32bit platform
# modes 'M' or 'B' are not allowed when the app is running in 32bit platform
if val in ['M', 'B']:
self.opt_algorithm_radio.blockSignals(True)
self.excellon_optimization_radio.set_value('T')
self.opt_algorithm_radio.blockSignals(False)
if val == 'M':
self.optimization_time_label.setDisabled(False)
self.optimization_time_entry.setDisabled(False)
else:

View File

@@ -13,12 +13,13 @@ if '_' not in builtins.__dict__:
class ExcellonOptPrefGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
def __init__(self, defaults, decimals=4, parent=None):
# OptionsGroupUI.__init__(self, "Excellon Options", parent=parent)
super(ExcellonOptPrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("Excellon Options")))
self.decimals = decimals
self.defaults = defaults
# ## Create CNC Job
self.cncjob_label = FCLabel('<b>%s</b>' % _('Parameters'))

View File

@@ -17,21 +17,22 @@ if '_' not in builtins.__dict__:
class ExcellonPreferencesUI(QtWidgets.QWidget):
def __init__(self, decimals, parent=None):
def __init__(self, decimals, defaults, 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)
self.excellon_gen_group = ExcellonGenPrefGroupUI(decimals=self.decimals, defaults=self.defaults)
self.excellon_gen_group.setMinimumWidth(240)
self.excellon_opt_group = ExcellonOptPrefGroupUI(decimals=self.decimals)
self.excellon_opt_group = ExcellonOptPrefGroupUI(decimals=self.decimals, defaults=self.defaults)
self.excellon_opt_group.setMinimumWidth(290)
self.excellon_exp_group = ExcellonExpPrefGroupUI(decimals=self.decimals)
self.excellon_exp_group = ExcellonExpPrefGroupUI(decimals=self.decimals, defaults=self.defaults)
self.excellon_exp_group.setMinimumWidth(250)
self.excellon_adv_opt_group = ExcellonAdvOptPrefGroupUI(decimals=self.decimals)
self.excellon_adv_opt_group = ExcellonAdvOptPrefGroupUI(decimals=self.decimals, defaults=self.defaults)
self.excellon_adv_opt_group.setMinimumWidth(250)
self.excellon_editor_group = ExcellonEditorPrefGroupUI(decimals=self.decimals)
self.excellon_editor_group = ExcellonEditorPrefGroupUI(decimals=self.decimals, defaults=self.defaults)
self.excellon_editor_group.setMinimumWidth(260)
self.vlay = QtWidgets.QVBoxLayout()