|
|
@@ -5,7 +5,7 @@ from defaults import FlatCAMDefaults
|
|
|
import logging
|
|
|
|
|
|
import gettext
|
|
|
-import AppTranslation as fcTranslate
|
|
|
+import appTranslation as fcTranslate
|
|
|
import builtins
|
|
|
|
|
|
fcTranslate.apply_language('strings')
|
|
|
@@ -18,7 +18,7 @@ if settings.contains("machinist"):
|
|
|
else:
|
|
|
machinist_setting = 0
|
|
|
|
|
|
-log = logging.getLogger('PreferencesUIManager')
|
|
|
+log = logging.getLogger('base2')
|
|
|
|
|
|
|
|
|
class PreferencesUIManager:
|
|
|
@@ -629,9 +629,9 @@ class PreferencesUIManager:
|
|
|
Will set the values for all the GUI elements in Preferences GUI based on the values found in the
|
|
|
self.defaults dictionary.
|
|
|
|
|
|
- :param factor: will apply a factor to the values that written in the GUI elements
|
|
|
- :param fl_units: current measuring units in FlatCAM: Metric or Inch
|
|
|
- :param source_dict: the repository of options, usually is the self.defaults
|
|
|
+ :param factor: will apply a factor to the values that written in the GUI elements
|
|
|
+ :param fl_units: current measuring units in FlatCAM: Metric or Inch
|
|
|
+ :param source_dict: the repository of options, usually is the self.defaults
|
|
|
:return: None
|
|
|
"""
|
|
|
|
|
|
@@ -647,18 +647,18 @@ class PreferencesUIManager:
|
|
|
"""
|
|
|
Basically it is the worker in the self.defaults_write_form()
|
|
|
|
|
|
- :param field: the GUI element in Preferences GUI to be updated
|
|
|
- :param factor: factor to be applied to the field parameter
|
|
|
- :param units: current FlatCAM measuring units
|
|
|
- :param defaults_dict: the defaults storage
|
|
|
- :return: None, it updates GUI elements
|
|
|
+ :param field: the GUI element in Preferences GUI to be updated
|
|
|
+ :param factor: factor to be applied to the field parameter
|
|
|
+ :param units: current FlatCAM measuring units
|
|
|
+ :param defaults_dict: the defaults storage
|
|
|
+ :return: None, it updates GUI elements
|
|
|
"""
|
|
|
|
|
|
def_dict = self.defaults if defaults_dict is None else defaults_dict
|
|
|
|
|
|
try:
|
|
|
value = def_dict[field]
|
|
|
- log.debug("value is " + str(value) + " and factor is "+str(factor))
|
|
|
+ # log.debug("value is " + str(value) + " and factor is "+str(factor))
|
|
|
if factor is not None:
|
|
|
value *= factor
|
|
|
|
|
|
@@ -675,7 +675,7 @@ class PreferencesUIManager:
|
|
|
|
|
|
def show_preferences_gui(self):
|
|
|
"""
|
|
|
- Called to initialize and show the Preferences AppGUI
|
|
|
+ Called to initialize and show the Preferences appGUI
|
|
|
|
|
|
:return: None
|
|
|
"""
|
|
|
@@ -906,13 +906,13 @@ class PreferencesUIManager:
|
|
|
self.ui.general_defaults_form.general_app_group.ge_radio.set_value(ge)
|
|
|
|
|
|
if save_to_file or should_restart is True:
|
|
|
+ # Re-fresh project options
|
|
|
+ self.ui.app.on_options_app2project()
|
|
|
+
|
|
|
self.save_defaults(silent=False)
|
|
|
# load the defaults so they are updated into the app
|
|
|
self.defaults.load(filename=os.path.join(self.data_path, 'current_defaults.FlatConfig'))
|
|
|
|
|
|
- # Re-fresh project options
|
|
|
- self.ui.app.on_options_app2project()
|
|
|
-
|
|
|
settgs = QSettings("Open Source", "FlatCAM")
|
|
|
|
|
|
# save the notebook font size
|
|
|
@@ -1002,7 +1002,6 @@ class PreferencesUIManager:
|
|
|
:param first_time: Boolean. If True will execute some code when the app is run first time
|
|
|
:return: None
|
|
|
"""
|
|
|
- self.defaults.report_usage("save_defaults")
|
|
|
log.debug("App.PreferencesUIManager.save_defaults()")
|
|
|
|
|
|
if data_path is None:
|