diff --git a/CHANGELOG.md b/CHANGELOG.md index 08c2483c..73b26e1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,11 @@ CHANGELOG for FlatCAM beta - refactored code in Preferences section - added the wheels for a working pair of GDAL-Rasterio modules (python 3.10) - fixed an issue when trying to print an exception message +- fixed an issue due of recent changes that made the application think that is run always for the first time; fixed not applying the selected language translation +- some more code is refactored in the Preferences +- the axis will now be drawn on the canvas as they were left in the previous run (just like the HUD and the Workspace) +- for processors with less than 4 cores now the default number of workers is 1 (changed from 2) +- some graphical settings go now directly to the defaults dictionary and will not pass through the `options` app dictionary 19.02.2022 diff --git a/appGUI/MainGUI.py b/appGUI/MainGUI.py index c5012c95..8bdb0927 100644 --- a/appGUI/MainGUI.py +++ b/appGUI/MainGUI.py @@ -1867,18 +1867,18 @@ class MainGUI(QtWidgets.QMainWindow): self.infobar.addWidget(self.fcinfo, stretch=1) self.infobar.addWidget(self.delta_coords_toolbar) - self.delta_coords_toolbar.setVisible(self.app.options["global_delta_coordsbar_show"]) + self.delta_coords_toolbar.setVisible(self.app.defaults["global_delta_coordsbar_show"]) self.infobar.addWidget(self.coords_toolbar) - self.coords_toolbar.setVisible(self.app.options["global_coordsbar_show"]) + self.coords_toolbar.setVisible(self.app.defaults["global_coordsbar_show"]) self.grid_toolbar.setMaximumHeight(24) self.infobar.addWidget(self.grid_toolbar) - self.grid_toolbar.setVisible(self.app.options["global_gridbar_show"]) + self.grid_toolbar.setVisible(self.app.defaults["global_gridbar_show"]) self.status_toolbar.setMaximumHeight(24) self.infobar.addWidget(self.status_toolbar) - self.status_toolbar.setVisible(self.app.options["global_statusbar_show"]) + self.status_toolbar.setVisible(self.app.defaults["global_statusbar_show"]) self.units_label = FCLabel("[mm]") self.units_label.setToolTip(_("Application units")) @@ -1887,7 +1887,7 @@ class MainGUI(QtWidgets.QMainWindow): # this used to be done in the APP.__init__() self.activity_view = FlatCAMActivityView(icon_location=self.app.resource_location, - icon_kind=self.app.options["global_activity_icon"], + icon_kind=self.app.defaults["global_activity_icon"], replot_callback=self.app.on_toolbar_replot) self.infobar.addWidget(self.activity_view) @@ -1946,7 +1946,7 @@ class MainGUI(QtWidgets.QMainWindow): self.plugin2_pref_form = Plugins2PreferencesUI(app=self.app) self.plugin_eng_pref_form = PluginsEngravingPreferencesUI(app=self.app) - self.util_pref_form = UtilPreferencesUI(decimals=self.decimals, defaults=self.app.options) + self.util_pref_form = UtilPreferencesUI(app=self.app) QtCore.QCoreApplication.instance().installEventFilter(self) @@ -2044,7 +2044,7 @@ class MainGUI(QtWidgets.QMainWindow): self.plot_tab_area.tabBar.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.ActionsContextMenu) self.on_tab_setup_context_menu() # activate initial state - self.on_detachable_tab_rmb_click(self.app.options["global_tabs_detachable"]) + self.on_detachable_tab_rmb_click(self.app.defaults["global_tabs_detachable"]) # status bar activation/deactivation self.infobar.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.ActionsContextMenu) @@ -2164,20 +2164,20 @@ class MainGUI(QtWidgets.QMainWindow): :return: None """ - self.app.options["global_def_win_x"] = x - self.app.options["global_def_win_y"] = y - self.app.options["global_def_win_w"] = width - self.app.options["global_def_win_h"] = height - self.app.options["global_def_notebook_width"] = notebook_width + self.app.defaults["global_def_win_x"] = x + self.app.defaults["global_def_win_y"] = y + self.app.defaults["global_def_win_w"] = width + self.app.defaults["global_def_win_h"] = height + self.app.defaults["global_def_notebook_width"] = notebook_width self.app.preferencesUiManager.save_defaults() def restore_main_win_geom(self): try: - self.setGeometry(self.app.options["global_def_win_x"], - self.app.options["global_def_win_y"], - self.app.options["global_def_win_w"], - self.app.options["global_def_win_h"]) - self.splitter.setSizes([self.app.options["global_def_notebook_width"], 0]) + self.setGeometry(self.app.defaults["global_def_win_x"], + self.app.defaults["global_def_win_y"], + self.app.defaults["global_def_win_w"], + self.app.defaults["global_def_win_h"]) + self.splitter.setSizes([self.app.defaults["global_def_notebook_width"], 0]) except KeyError as e: self.app.log.debug("appGUI.MainGUI.restore_main_win_geom() --> %s" % str(e)) @@ -2188,7 +2188,7 @@ class MainGUI(QtWidgets.QMainWindow): :return: None """ - tb = self.app.options["global_toolbar_view"] + tb = self.app.defaults["global_toolbar_view"] if tb & 1: self.toolbarfile.setVisible(True) @@ -2238,7 +2238,7 @@ class MainGUI(QtWidgets.QMainWindow): self.toolbarshell.setVisible(False) def on_tab_setup_context_menu(self): - initial_checked = self.app.options["global_tabs_detachable"] + initial_checked = self.app.defaults["global_tabs_detachable"] action_name = str(_("Detachable Tabs")) action = QtGui.QAction(self) action.setCheckable(True) @@ -2256,17 +2256,17 @@ class MainGUI(QtWidgets.QMainWindow): def on_detachable_tab_rmb_click(self, checked): self.notebook.set_detachable(val=checked) - self.app.options["global_tabs_detachable"] = checked + self.app.defaults["global_tabs_detachable"] = checked self.plot_tab_area.set_detachable(val=checked) - self.app.options["global_tabs_detachable"] = checked + self.app.defaults["global_tabs_detachable"] = checked def build_infobar_context_menu(self): delta_coords_action_name = str(_("Delta Coordinates Toolbar")) delta_coords_action = QtGui.QAction(self) delta_coords_action.setCheckable(True) delta_coords_action.setText(delta_coords_action_name) - delta_coords_action.setChecked(self.app.options["global_delta_coordsbar_show"]) + delta_coords_action.setChecked(self.app.defaults["global_delta_coordsbar_show"]) self.infobar.addAction(delta_coords_action) delta_coords_action.triggered.connect(self.toggle_delta_coords) @@ -2274,7 +2274,7 @@ class MainGUI(QtWidgets.QMainWindow): coords_action = QtGui.QAction(self) coords_action.setCheckable(True) coords_action.setText(coords_action_name) - coords_action.setChecked(self.app.options["global_coordsbar_show"]) + coords_action.setChecked(self.app.defaults["global_coordsbar_show"]) self.infobar.addAction(coords_action) coords_action.triggered.connect(self.toggle_coords) @@ -2282,7 +2282,7 @@ class MainGUI(QtWidgets.QMainWindow): grid_action = QtGui.QAction(self) grid_action.setCheckable(True) grid_action.setText(grid_action_name) - grid_action.setChecked(self.app.options["global_gridbar_show"]) + grid_action.setChecked(self.app.defaults["global_gridbar_show"]) self.infobar.addAction(grid_action) grid_action.triggered.connect(self.toggle_gridbar) @@ -2290,24 +2290,24 @@ class MainGUI(QtWidgets.QMainWindow): status_action = QtGui.QAction(self) status_action.setCheckable(True) status_action.setText(status_action_name) - status_action.setChecked(self.app.options["global_statusbar_show"]) + status_action.setChecked(self.app.defaults["global_statusbar_show"]) self.infobar.addAction(status_action) status_action.triggered.connect(self.toggle_statusbar) def toggle_coords(self, checked): - self.app.options["global_coordsbar_show"] = checked + self.app.defaults["global_coordsbar_show"] = checked self.coords_toolbar.setVisible(checked) def toggle_delta_coords(self, checked): - self.app.options["global_delta_coordsbar_show"] = checked + self.app.defaults["global_delta_coordsbar_show"] = checked self.delta_coords_toolbar.setVisible(checked) def toggle_gridbar(self, checked): - self.app.options["global_gridbar_show"] = checked + self.app.defaults["global_gridbar_show"] = checked self.grid_toolbar.setVisible(checked) def toggle_statusbar(self, checked): - self.app.options["global_statusbar_show"] = checked + self.app.defaults["global_statusbar_show"] = checked self.status_toolbar.setVisible(checked) def on_preferences_open_folder(self): @@ -2770,10 +2770,10 @@ class MainGUI(QtWidgets.QMainWindow): for tb in self.findChildren(QtWidgets.QToolBar): tb.setVisible(False) - self.coords_toolbar.setVisible(self.app.options["global_coordsbar_show"]) - self.delta_coords_toolbar.setVisible(self.app.options["global_delta_coordsbar_show"]) - self.grid_toolbar.setVisible(self.app.options["global_gridbar_show"]) - self.status_toolbar.setVisible(self.app.options["global_statusbar_show"]) + self.coords_toolbar.setVisible(self.app.defaults["global_coordsbar_show"]) + self.delta_coords_toolbar.setVisible(self.app.defaults["global_delta_coordsbar_show"]) + self.grid_toolbar.setVisible(self.app.defaults["global_gridbar_show"]) + self.status_toolbar.setVisible(self.app.defaults["global_statusbar_show"]) self.splitter.setSizes([0, 1]) self.toggle_fscreen = True @@ -3381,11 +3381,11 @@ class MainGUI(QtWidgets.QMainWindow): # Zoom In if key == QtCore.Qt.Key.Key_Equal: - self.app.plotcanvas.zoom(1 / self.app.options['global_zoom_ratio'], self.app.mouse) + self.app.plotcanvas.zoom(1 / self.app.defaults['global_zoom_ratio'], self.app.mouse) # Zoom Out if key == QtCore.Qt.Key.Key_Minus: - self.app.plotcanvas.zoom(self.app.options['global_zoom_ratio'], self.app.mouse) + self.app.plotcanvas.zoom(self.app.defaults['global_zoom_ratio'], self.app.mouse) # toggle display of Notebook area if key == QtCore.Qt.Key.Key_QuoteLeft: @@ -3513,12 +3513,12 @@ class MainGUI(QtWidgets.QMainWindow): # Zoom Out if key == QtCore.Qt.Key.Key_Minus or key == '-': - self.app.plotcanvas.zoom(1 / self.app.options['global_zoom_ratio'], + self.app.plotcanvas.zoom(1 / self.app.defaults['global_zoom_ratio'], [self.app.geo_editor.snap_x, self.app.geo_editor.snap_y]) # Zoom In if key == QtCore.Qt.Key.Key_Equal or key == '=': - self.app.plotcanvas.zoom(self.app.options['global_zoom_ratio'], + self.app.plotcanvas.zoom(self.app.defaults['global_zoom_ratio'], [self.app.geo_editor.snap_x, self.app.geo_editor.snap_y]) # Switch to Project Tab @@ -3750,13 +3750,13 @@ class MainGUI(QtWidgets.QMainWindow): if key == QtCore.Qt.Key.Key_Minus or key == '-': self.app.grb_editor.launched_from_shortcuts = True - self.app.plotcanvas.zoom(1 / self.app.options['global_zoom_ratio'], + self.app.plotcanvas.zoom(1 / self.app.defaults['global_zoom_ratio'], [self.app.grb_editor.snap_x, self.app.grb_editor.snap_y]) return if key == QtCore.Qt.Key.Key_Equal or key == '=': self.app.grb_editor.launched_from_shortcuts = True - self.app.plotcanvas.zoom(self.app.options['global_zoom_ratio'], + self.app.plotcanvas.zoom(self.app.defaults['global_zoom_ratio'], [self.app.grb_editor.snap_x, self.app.grb_editor.snap_y]) return @@ -3978,13 +3978,13 @@ class MainGUI(QtWidgets.QMainWindow): if key == QtCore.Qt.Key.Key_Minus or key == '-': self.app.exc_editor.launched_from_shortcuts = True - self.app.plotcanvas.zoom(1 / self.app.options['global_zoom_ratio'], + self.app.plotcanvas.zoom(1 / self.app.defaults['global_zoom_ratio'], [self.app.exc_editor.snap_x, self.app.exc_editor.snap_y]) return if key == QtCore.Qt.Key.Key_Equal or key == '=': self.app.exc_editor.launched_from_shortcuts = True - self.app.plotcanvas.zoom(self.app.options['global_zoom_ratio'], + self.app.plotcanvas.zoom(self.app.defaults['global_zoom_ratio'], [self.app.exc_editor.snap_x, self.app.exc_editor.snap_y]) return diff --git a/appGUI/PlotCanvas.py b/appGUI/PlotCanvas.py index 4c6c4271..7f8e59f3 100644 --- a/appGUI/PlotCanvas.py +++ b/appGUI/PlotCanvas.py @@ -139,9 +139,9 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas): # parent=self.view.scene) self.v_line = InfiniteLine(pos=0, color=axis_color, vertical=True, line_width=1.5, - parent=self.view.scene) + parent=None) self.h_line = InfiniteLine(pos=0, color=axis_color, vertical=False, line_width=1.5, - parent=self.view.scene) + parent=None) self.line_parent = None if self.fcapp.options["global_cursor_color_enabled"]: @@ -179,10 +179,11 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas): self.on_toggle_hud(state=True, silent=True) # Axis Display - self.axis_enabled = True + self.axis_enabled = False # enable Axis - self.on_toggle_axis(state=True, silent=True) + if self.fcapp.options['global_axis'] is True: + self.on_toggle_axis(state=True, silent=True) # enable Grid lines self.grid_lines_enabled = True @@ -229,7 +230,7 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas): if state: self.axis_enabled = True - self.fcapp.options['global_axis'] = True + self.fcapp.defaults['global_axis'] = True self.v_line.parent = self.view.scene self.h_line.parent = self.view.scene self.fcapp.ui.axis_status_label.setStyleSheet(""" @@ -243,7 +244,7 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas): self.fcapp.inform[str, bool].emit(_("Axis enabled."), False) else: self.axis_enabled = False - self.fcapp.options['global_axis'] = False + self.fcapp.defaults['global_axis'] = False self.v_line.parent = None self.h_line.parent = None self.fcapp.ui.axis_status_label.setStyleSheet("") @@ -277,7 +278,7 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas): self.hud_enabled = True self.rect_hud.parent = self.view self.text_hud.parent = self.view - self.fcapp.options['global_hud'] = True + self.fcapp.defaults['global_hud'] = True self.fcapp.ui.hud_label.setStyleSheet(""" QLabel { @@ -292,7 +293,7 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas): self.hud_enabled = False self.rect_hud.parent = None self.text_hud.parent = None - self.fcapp.options['global_hud'] = False + self.fcapp.defaults['global_hud'] = False self.fcapp.ui.hud_label.setStyleSheet("") if silent is None: self.fcapp.inform[str, bool].emit(_("HUD disabled."), False) @@ -386,14 +387,14 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas): color = '#dededeff' if state: - self.fcapp.options['global_grid_lines'] = True + self.fcapp.defaults['global_grid_lines'] = True self.grid_lines_enabled = True # self.grid.parent = self.view.scene self.grid._grid_color_fn['color'] = Color(color).rgba if silent is None: self.fcapp.inform[str, bool].emit(_("Grid enabled."), False) else: - self.fcapp.options['global_grid_lines'] = False + self.fcapp.defaults['global_grid_lines'] = False self.grid_lines_enabled = False # self.grid.parent = None self.grid._grid_color_fn['color'] = Color('#FFFFFFFF').rgba diff --git a/appGUI/PlotCanvasLegacy.py b/appGUI/PlotCanvasLegacy.py index a5c7e0ac..15a4a2b5 100644 --- a/appGUI/PlotCanvasLegacy.py +++ b/appGUI/PlotCanvasLegacy.py @@ -248,8 +248,8 @@ class PlotCanvasLegacy(QtCore.QObject): axis_color = axis_color[0], axis_color[1], axis_color[2] # self.h_line = self.axes.axhline(color=(0.70, 0.3, 0.3), linewidth=2) - self.h_line = self.axes.axhline(color=axis_color, linewidth=2) - self.v_line = self.axes.axvline(color=axis_color, linewidth=2) + self.h_line = None + self.v_line = None self.axes.tick_params(axis='x', color=tick_color, labelcolor=tick_color) self.axes.tick_params(axis='y', color=tick_color, labelcolor=tick_color) @@ -334,17 +334,18 @@ class PlotCanvasLegacy(QtCore.QObject): self.draw_workspace(workspace_size=self.app.options["global_workspaceT"]) # Axis Display - self.axis_enabled = True + self.axis_enabled = False # enable Axis - self.on_toggle_axis(state=True, silent=True) - self.app.ui.axis_status_label.setStyleSheet(""" - QLabel - { - color: black; - background-color: orange; - } - """) + if self.app.options['global_axis'] is True: + self.on_toggle_axis(state=True, silent=True) + self.app.ui.axis_status_label.setStyleSheet(""" + QLabel + { + color: black; + background-color: orange; + } + """) # Attach to parent self.native = self.canvas # for API compatibility with 3D plotcanvas @@ -380,7 +381,7 @@ class PlotCanvasLegacy(QtCore.QObject): if state: self.axis_enabled = True - self.app.options['global_axis'] = True + self.app.defaults['global_axis'] = True if self.h_line not in self.axes.lines and self.v_line not in self.axes.lines: self.h_line = self.axes.axhline(color=(0.70, 0.3, 0.3), linewidth=2) self.v_line = self.axes.axvline(color=(0.70, 0.3, 0.3), linewidth=2) @@ -395,7 +396,7 @@ class PlotCanvasLegacy(QtCore.QObject): self.app.inform[str, bool].emit(_("Axis enabled."), False) else: self.axis_enabled = False - self.app.options['global_axis'] = False + self.app.defaults['global_axis'] = False if self.h_line in self.axes.lines and self.v_line in self.axes.lines: self.axes.lines.remove(self.h_line) self.axes.lines.remove(self.v_line) @@ -412,7 +413,7 @@ class PlotCanvasLegacy(QtCore.QObject): if state: self.hud_enabled = True self.text_hud.add_artist() - self.app.options['global_hud'] = True + self.app.defaults['global_hud'] = True self.app.ui.hud_label.setStyleSheet(""" QLabel @@ -426,7 +427,7 @@ class PlotCanvasLegacy(QtCore.QObject): else: self.hud_enabled = False self.text_hud.remove_artist() - self.app.options['global_hud'] = False + self.app.defaults['global_hud'] = False self.app.ui.hud_label.setStyleSheet("") if silent is None: self.app.inform[str, bool].emit(_("HUD disabled."), False) diff --git a/appGUI/preferences/utilities/AutoCompletePrefGroupUI.py b/appGUI/preferences/utilities/AutoCompletePrefGroupUI.py index 478e9f77..ee8f2e88 100644 --- a/appGUI/preferences/utilities/AutoCompletePrefGroupUI.py +++ b/appGUI/preferences/utilities/AutoCompletePrefGroupUI.py @@ -14,13 +14,13 @@ if '_' not in builtins.__dict__: class AutoCompletePrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): # OptionsGroupUI.__init__(self, "Gerber File associations Preferences", parent=None) super().__init__(self, parent=parent) self.setTitle(str(_("Autocompleter Keywords"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options self.restore_btn = FCButton(_("Restore")) self.restore_btn.setToolTip(_("Restore the autocompleter keywords list to the default state.")) diff --git a/appGUI/preferences/utilities/FAExcPrefGroupUI.py b/appGUI/preferences/utilities/FAExcPrefGroupUI.py index db764123..8e3c1c8e 100644 --- a/appGUI/preferences/utilities/FAExcPrefGroupUI.py +++ b/appGUI/preferences/utilities/FAExcPrefGroupUI.py @@ -14,13 +14,13 @@ if '_' not in builtins.__dict__: class FAExcPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): # OptionsGroupUI.__init__(self, "Excellon File associations Preferences", parent=None) super().__init__(self, parent=parent) self.setTitle(str(_("Excellon File associations"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options self.layout.setContentsMargins(2, 2, 2, 2) diff --git a/appGUI/preferences/utilities/FAGcoPrefGroupUI.py b/appGUI/preferences/utilities/FAGcoPrefGroupUI.py index 5a8966e9..84697c77 100644 --- a/appGUI/preferences/utilities/FAGcoPrefGroupUI.py +++ b/appGUI/preferences/utilities/FAGcoPrefGroupUI.py @@ -1,6 +1,7 @@ from PyQt6 import QtWidgets, QtGui from PyQt6.QtCore import QSettings +import appGUI.preferences.OptionsGroupUI from appGUI.GUIElements import FCButton, FCTextArea, FCEntry, FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI @@ -14,13 +15,13 @@ if '_' not in builtins.__dict__: class FAGcoPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): # OptionsGroupUI.__init__(self, "Gcode File associations Preferences", parent=None) super(FAGcoPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("GCode File associations"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options self.restore_btn = FCButton(_("Restore")) self.restore_btn.setToolTip(_("Restore the extension list to the default state.")) diff --git a/appGUI/preferences/utilities/FAGrbPrefGroupUI.py b/appGUI/preferences/utilities/FAGrbPrefGroupUI.py index b9d86f6e..fe1dbf53 100644 --- a/appGUI/preferences/utilities/FAGrbPrefGroupUI.py +++ b/appGUI/preferences/utilities/FAGrbPrefGroupUI.py @@ -14,13 +14,13 @@ if '_' not in builtins.__dict__: class FAGrbPrefGroupUI(OptionsGroupUI): - def __init__(self, defaults, decimals=4, parent=None): + def __init__(self, app, parent=None): # OptionsGroupUI.__init__(self, "Gerber File associations Preferences", parent=None) super(FAGrbPrefGroupUI, self).__init__(self, parent=parent) self.setTitle(str(_("Gerber File associations"))) - self.decimals = decimals - self.defaults = defaults + self.decimals = app.decimals + self.options = app.options self.restore_btn = FCButton(_("Restore")) self.restore_btn.setToolTip(_("Restore the extension list to the default state.")) diff --git a/appGUI/preferences/utilities/UtilPreferencesUI.py b/appGUI/preferences/utilities/UtilPreferencesUI.py index 5fff0f19..0fcea020 100644 --- a/appGUI/preferences/utilities/UtilPreferencesUI.py +++ b/appGUI/preferences/utilities/UtilPreferencesUI.py @@ -9,23 +9,21 @@ from appGUI.preferences.utilities.FAExcPrefGroupUI import FAExcPrefGroupUI class UtilPreferencesUI(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.fa_excellon_group = FAExcPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.fa_excellon_group = FAExcPrefGroupUI(app=app) self.fa_excellon_group.setMinimumWidth(260) - self.fa_gcode_group = FAGcoPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.fa_gcode_group = FAGcoPrefGroupUI(app=app) self.fa_gcode_group.setMinimumWidth(260) - self.fa_gerber_group = FAGrbPrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.fa_gerber_group = FAGrbPrefGroupUI(app=app) self.fa_gerber_group.setMinimumWidth(260) - self.kw_group = AutoCompletePrefGroupUI(decimals=self.decimals, defaults=self.defaults) + self.kw_group = AutoCompletePrefGroupUI(app=app) self.kw_group.setMinimumWidth(260) # this does not make sense in Linux and MacOs so w edo not display it for those OS's diff --git a/app_Main.py b/app_Main.py index c25cf8bb..4ffb1bbc 100644 --- a/app_Main.py +++ b/app_Main.py @@ -1358,7 +1358,7 @@ class App(QtCore.QObject): # ##################################### FIRST RUN SECTION ################################################### # ################################ It's done only once after install ##################################### # ########################################################################################################### - if self.options["first_run"] is True: + if self.defaults["first_run"] is True: # ONLY AT FIRST STARTUP INIT THE GUI LAYOUT TO 'minimal' self.log.debug("-> First Run: Setting up the first Layout") initial_lay = 'minimal' @@ -1369,7 +1369,7 @@ class App(QtCore.QObject): self.ui.general_pref_form.general_gui_group.layout_combo.setCurrentIndex(idx) # after the first run, this object should be False - self.options["first_run"] = False + self.defaults["first_run"] = False self.log.debug("-> First Run: Updating the Defaults file with Factory Defaults") self.preferencesUiManager.save_defaults(silent=True) diff --git a/defaults.py b/defaults.py index 3d72a211..1b6b2695 100644 --- a/defaults.py +++ b/defaults.py @@ -87,7 +87,7 @@ class FlatCAMDefaults: "global_log_verbose": 2, "global_portable": False, - "global_languages": ['English', 'Romanian'], + "global_languages": ['English'], "global_language_current": 'English', "global_systray_icon": True, @@ -95,7 +95,7 @@ class FlatCAMDefaults: "global_project_at_startup": False, "global_version_check": True, "global_send_stats": True, - "global_worker_number": int((os.cpu_count()) / 2) if os.cpu_count() > 4 else 2, + "global_worker_number": int((os.cpu_count()) / 2) if os.cpu_count() > 4 else 1, "global_tolerance": 0.005, "global_save_compressed": True,