- fixed bug with losing the visibility of toolbars if at first startup the user tries to change something in the Preferences before doing a first save of Preferences
This commit is contained in:
@@ -812,6 +812,10 @@ class App(QtCore.QObject):
|
|||||||
for name in sorted(self.languages.values()):
|
for name in sorted(self.languages.values()):
|
||||||
self.ui.general_defaults_form.general_app_group.language_cb.addItem(name)
|
self.ui.general_defaults_form.general_app_group.language_cb.addItem(name)
|
||||||
|
|
||||||
|
# #################################################################################
|
||||||
|
# #################### DEFAULTS - PREFERENCES STORAGE #############################
|
||||||
|
# #################################################################################
|
||||||
|
|
||||||
self.defaults = LoudDict()
|
self.defaults = LoudDict()
|
||||||
self.defaults.set_change_callback(self.on_defaults_dict_change) # When the dictionary changes.
|
self.defaults.set_change_callback(self.on_defaults_dict_change) # When the dictionary changes.
|
||||||
self.defaults.update({
|
self.defaults.update({
|
||||||
@@ -1231,17 +1235,17 @@ class App(QtCore.QObject):
|
|||||||
chars = 'abcdefghijklmnopqrstuvwxyz0123456789'
|
chars = 'abcdefghijklmnopqrstuvwxyz0123456789'
|
||||||
if self.defaults['global_serial'] == 0 or len(str(self.defaults['global_serial'])) < 10:
|
if self.defaults['global_serial'] == 0 or len(str(self.defaults['global_serial'])) < 10:
|
||||||
self.defaults['global_serial'] = ''.join([random.choice(chars) for i in range(20)])
|
self.defaults['global_serial'] = ''.join([random.choice(chars) for i in range(20)])
|
||||||
self.save_defaults(silent=True)
|
self.save_defaults(silent=True, first_time=True)
|
||||||
|
|
||||||
self.propagate_defaults(silent=True)
|
self.propagate_defaults(silent=True)
|
||||||
self.restore_main_win_geom()
|
self.restore_main_win_geom()
|
||||||
|
|
||||||
def auto_save_defaults():
|
# def auto_save_defaults():
|
||||||
try:
|
# try:
|
||||||
self.save_defaults(silent=True)
|
# self.save_defaults(silent=True)
|
||||||
self.propagate_defaults(silent=True)
|
# self.propagate_defaults(silent=True)
|
||||||
finally:
|
# finally:
|
||||||
QtCore.QTimer.singleShot(self.defaults["global_defaults_save_period_ms"], auto_save_defaults)
|
# QtCore.QTimer.singleShot(self.defaults["global_defaults_save_period_ms"], auto_save_defaults)
|
||||||
|
|
||||||
# the following lines activates automatic defaults save
|
# the following lines activates automatic defaults save
|
||||||
# if user_defaults:
|
# if user_defaults:
|
||||||
@@ -1494,6 +1498,7 @@ class App(QtCore.QObject):
|
|||||||
self.cnc_form = None
|
self.cnc_form = None
|
||||||
self.tools_form = None
|
self.tools_form = None
|
||||||
self.fa_form = None
|
self.fa_form = None
|
||||||
|
|
||||||
self.on_options_combo_change(0) # Will show the initial form
|
self.on_options_combo_change(0) # Will show the initial form
|
||||||
|
|
||||||
# ################################
|
# ################################
|
||||||
@@ -3460,6 +3465,7 @@ class App(QtCore.QObject):
|
|||||||
:return: None
|
:return: None
|
||||||
"""
|
"""
|
||||||
tb = self.defaults["global_toolbar_view"]
|
tb = self.defaults["global_toolbar_view"]
|
||||||
|
|
||||||
if tb & 1:
|
if tb & 1:
|
||||||
self.ui.toolbarfile.setVisible(True)
|
self.ui.toolbarfile.setVisible(True)
|
||||||
else:
|
else:
|
||||||
@@ -4357,7 +4363,7 @@ class App(QtCore.QObject):
|
|||||||
# log.debug("Application defaults saved ... Exit event.")
|
# log.debug("Application defaults saved ... Exit event.")
|
||||||
# QtWidgets.qApp.quit()
|
# QtWidgets.qApp.quit()
|
||||||
|
|
||||||
def save_defaults(self, silent=False, data_path=None):
|
def save_defaults(self, silent=False, data_path=None, first_time=False):
|
||||||
"""
|
"""
|
||||||
Saves application default options
|
Saves application default options
|
||||||
``self.defaults`` to current_defaults.FlatConfig file.
|
``self.defaults`` to current_defaults.FlatConfig file.
|
||||||
@@ -4431,7 +4437,8 @@ class App(QtCore.QObject):
|
|||||||
if self.ui.toolbarshell.isVisible():
|
if self.ui.toolbarshell.isVisible():
|
||||||
tb_status += 256
|
tb_status += 256
|
||||||
|
|
||||||
self.defaults["global_toolbar_view"] = tb_status
|
if first_time is False:
|
||||||
|
self.defaults["global_toolbar_view"] = tb_status
|
||||||
|
|
||||||
# Save update options
|
# Save update options
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ CAD program, and create G-Code for Isolation routing.
|
|||||||
- fixed bug in Gerber Editor -> selection area handler where if some of the selected shapes did not had the 'solid' geometry will silently abort selection of further shapes
|
- fixed bug in Gerber Editor -> selection area handler where if some of the selected shapes did not had the 'solid' geometry will silently abort selection of further shapes
|
||||||
- added new control in Edit -> Preferences -> General -> Gui Preferences -> Activity Icon. Will select a GIF from a selection, the one used to show that FlatCAM is working.
|
- added new control in Edit -> Preferences -> General -> Gui Preferences -> Activity Icon. Will select a GIF from a selection, the one used to show that FlatCAM is working.
|
||||||
- changed the script icon to a smaller one in the sys tray menu
|
- changed the script icon to a smaller one in the sys tray menu
|
||||||
|
- fixed bug with losing the visibility of toolbars if at first startup the user tries to change something in the Preferences before doing a first save of Preferences
|
||||||
|
|
||||||
18.09.2019
|
18.09.2019
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user