- 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

@@ -15,11 +15,12 @@ if '_' not in builtins.__dict__:
class GeneralAPPSetGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
def __init__(self, defaults, decimals=4, parent=None):
super(GeneralAPPSetGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("App Settings")))
self.decimals = decimals
self.defaults = defaults
theme_settings = QtCore.QSettings("Open Source", "FlatCAM")
if theme_settings.contains("theme"):

View File

@@ -17,11 +17,12 @@ if '_' not in builtins.__dict__:
class GeneralAppPrefGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
def __init__(self, defaults, decimals=4, parent=None):
super(GeneralAppPrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(_("App Preferences"))
self.decimals = decimals
self.defaults = defaults
# Create a form layout for the Application general settings
grid0 = FCGridLayout(v_spacing=5, h_spacing=3)
@@ -127,8 +128,9 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
self.languagelabel.setToolTip(_("Set the language used throughout FlatCAM."))
grid0.addWidget(self.languagelabel, 20, 0, 1, 2)
self.language_cb = FCComboBox()
grid0.addWidget(self.language_cb, 22, 0, 1, 2)
self.language_combo = FCComboBox()
grid0.addWidget(self.language_combo, 22, 0, 1, 2)
self.language_combo.addItems(self.defaults["global_languages"])
self.language_apply_btn = FCButton(_("Apply Language"))
self.language_apply_btn.setToolTip(_("Set the language used throughout FlatCAM.\n"

View File

@@ -15,11 +15,12 @@ if '_' not in builtins.__dict__:
class GeneralGUIPrefGroupUI(OptionsGroupUI):
def __init__(self, decimals=4, parent=None):
def __init__(self, defaults, decimals=4, parent=None):
super(GeneralGUIPrefGroupUI, self).__init__(self, parent=parent)
self.setTitle(str(_("GUI Preferences")))
self.decimals = decimals
self.defaults = defaults
# Create a grid layout for the Application general settings
grid0 = FCGridLayout(v_spacing=5, h_spacing=3)

View File

@@ -14,19 +14,20 @@ if '_' not in builtins.__dict__:
class GeneralPreferencesUI(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.general_app_group = GeneralAppPrefGroupUI(decimals=self.decimals)
self.general_app_group = GeneralAppPrefGroupUI(decimals=self.decimals, defaults=self.defaults)
self.general_app_group.setMinimumWidth(250)
self.general_gui_group = GeneralGUIPrefGroupUI(decimals=self.decimals)
self.general_gui_group = GeneralGUIPrefGroupUI(decimals=self.decimals, defaults=self.defaults)
self.general_gui_group.setMinimumWidth(250)
self.general_app_set_group = GeneralAPPSetGroupUI(decimals=self.decimals)
self.general_app_set_group = GeneralAPPSetGroupUI(decimals=self.decimals, defaults=self.defaults)
self.general_app_set_group.setMinimumWidth(250)
self.layout.addWidget(self.general_app_group)