Merge branch 'Beta' into separate-PreferencesUI-classes-into-individual-files

This commit is contained in:
David Robertson 2020-04-29 23:42:35 +01:00
commit 6b36667c15
26 changed files with 5672 additions and 5668 deletions

View File

@ -24,6 +24,8 @@ CHANGELOG for FlatCAM beta
- fixed units conversion issue - fixed units conversion issue
- updated the units conversion method to convert all the convertible parameters in the Preferences - updated the units conversion method to convert all the convertible parameters in the Preferences
- solved the problem with not closing all the tabs in Plot Area when creating a New Project; the issue was that once a tab was removed the indexes are remade (when tab 0 is removed then tab 1 becomes tab 0 and so on) - solved the problem with not closing all the tabs in Plot Area when creating a New Project; the issue was that once a tab was removed the indexes are remade (when tab 0 is removed then tab 1 becomes tab 0 and so on)
- some more strings changed -> updated the translations
- replaced some FormLayouts with Gridlayouts in Tool Cutout.
28.04.2020 28.04.2020

View File

@ -4530,7 +4530,8 @@ class App(QtCore.QObject):
self.preferencesUiManager.defaults_read_form() self.preferencesUiManager.defaults_read_form()
# the self.preferencesUiManager.defaults_read_form() will update all defaults values in self.defaults from the GUI elements but # the self.preferencesUiManager.defaults_read_form() will update all defaults values
# in self.defaults from the GUI elements but
# I don't want it for the grid values, so I update them here # I don't want it for the grid values, so I update them here
self.defaults['global_gridx'] = val_x self.defaults['global_gridx'] = val_x
self.defaults['global_gridy'] = val_y self.defaults['global_gridy'] = val_y
@ -4687,11 +4688,6 @@ class App(QtCore.QObject):
self.app_cursor.enabled = True self.app_cursor.enabled = True
self.app_cursor.enabled = False self.app_cursor.enabled = False
def on_update_exc_export(self, state): def on_update_exc_export(self, state):
""" """
This is handling the update of Excellon Export parameters based on the ones in the Excellon General but only This is handling the update of Excellon Export parameters based on the ones in the Excellon General but only
@ -4984,7 +4980,6 @@ class App(QtCore.QObject):
else: else:
self.app_cursor.enabled = False self.app_cursor.enabled = False
def on_tool_add_keypress(self): def on_tool_add_keypress(self):
# ## Current application units in Upper Case # ## Current application units in Upper Case
self.units = self.defaults['units'].upper() self.units = self.defaults['units'].upper()
@ -5670,8 +5665,6 @@ class App(QtCore.QObject):
except Exception as e: except Exception as e:
return "Operation failed: %s" % str(e) return "Operation failed: %s" % str(e)
def on_copy_object2(self, custom_name): def on_copy_object2(self, custom_name):
def initialize_geometry(obj_init, app): def initialize_geometry(obj_init, app):
@ -5967,7 +5960,6 @@ class App(QtCore.QObject):
except AttributeError: except AttributeError:
pass pass
def on_tools_database(self, source='app'): def on_tools_database(self, source='app'):
""" """
Adds the Tools Database in a Tab in Plot Area. Adds the Tools Database in a Tab in Plot Area.
@ -6061,7 +6053,7 @@ class App(QtCore.QObject):
""" """
Executed whenever a QTab is closed in the Plot Area. Executed whenever a QTab is closed in the Plot Area.
:param title: The objectName of the Tab that was closed. This objectName is assigned on Tab creation :param tab_obj_name: The objectName of the Tab that was closed. This objectName is assigned on Tab creation
:return: :return:
""" """
@ -8416,13 +8408,12 @@ class App(QtCore.QObject):
:return: :return:
""" """
self.report_usage("on_fileopenscript_example") self.defaults.report_usage("on_fileopenscript_example")
App.log.debug("on_fileopenscript_example()") log.debug("on_fileopenscript_example()")
_filter_ = "TCL script .FlatScript (*.FlatScript);;TCL script .tcl (*.TCL);;TCL script .txt (*.TXT);;" \ _filter_ = "TCL script .FlatScript (*.FlatScript);;TCL script .tcl (*.TCL);;TCL script .txt (*.TXT);;" \
"All Files (*.*)" "All Files (*.*)"
# test if the app was frozen and choose the path for the configuration file # test if the app was frozen and choose the path for the configuration file
if getattr(sys, "frozen", False) is True: if getattr(sys, "frozen", False) is True:
example_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) + '\\assets\\examples' example_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) + '\\assets\\examples'
@ -8619,7 +8610,7 @@ class App(QtCore.QObject):
return return
if use_thread is True: if use_thread is True:
proc = self.proc_container.new(_("Printing PDF ... Please wait.")) self.proc_container.new(_("Printing PDF ... Please wait."))
self.worker_task.emit({'fcn': self.save_pdf, 'params': [filename, obj_selection]}) self.worker_task.emit({'fcn': self.save_pdf, 'params': [filename, obj_selection]})
else: else:
self.save_pdf(filename, obj_selection) self.save_pdf(filename, obj_selection)
@ -9589,7 +9580,7 @@ class App(QtCore.QObject):
App.log.debug("open_hpgl2()") App.log.debug("open_hpgl2()")
with self.proc_container.new(_("Opening HPGL2")) as proc: with self.proc_container.new(_("Opening HPGL2")):
# Object name # Object name
name = outname or filename.split('/')[-1].split('\\')[-1] name = outname or filename.split('/')[-1].split('\\')[-1]
@ -9612,6 +9603,7 @@ class App(QtCore.QObject):
:param outname: Name of the resulting object. None causes the name to be that of the file. :param outname: Name of the resulting object. None causes the name to be that of the file.
:param filename: Script file filename :param filename: Script file filename
:param silent: If True there will be no messages printed to StatusBar
:return: None :return: None
""" """
App.log.debug("open_script()") App.log.debug("open_script()")
@ -9753,8 +9745,7 @@ class App(QtCore.QObject):
d = json.loads(file_content, object_hook=dict2obj) d = json.loads(file_content, object_hook=dict2obj)
except Exception as e: except Exception as e:
App.log.error("Failed to open project file: %s with error: %s" % (filename, str(e))) App.log.error("Failed to open project file: %s with error: %s" % (filename, str(e)))
self.inform.emit('[ERROR_NOTCL] %s: %s' % self.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Failed to open project file"), filename))
(_("Failed to open project file"), filename))
return return
# Clear the current project # Clear the current project
@ -9816,8 +9807,6 @@ class App(QtCore.QObject):
App.log.debug(" **************** Finished PROJECT loading... **************** ") App.log.debug(" **************** Finished PROJECT loading... **************** ")
def plot_all(self, fit_view=True, use_thread=True): def plot_all(self, fit_view=True, use_thread=True):
""" """
Re-generates all plots from all objects. Re-generates all plots from all objects.
@ -10203,7 +10192,7 @@ class App(QtCore.QObject):
# no_stats dict; just so it won't break things on website # no_stats dict; just so it won't break things on website
no_ststs_dict = {} no_ststs_dict = {}
no_ststs_dict["global_ststs"] = {} no_ststs_dict["global_ststs"] = {}
full_url = App.version_url + "?s=" + str(self.defaults['global_serial']) + "&v=" + str(self.version) +\ full_url = App.version_url + "?s=" + str(self.defaults['global_serial']) + "&v=" + str(self.version) + \
"&os=" + str(self.os) + "&" + urllib.parse.urlencode(no_ststs_dict["global_ststs"]) "&os=" + str(self.os) + "&" + urllib.parse.urlencode(no_ststs_dict["global_ststs"])
App.log.debug("Checking for updates @ %s" % full_url) App.log.debug("Checking for updates @ %s" % full_url)

View File

@ -26,7 +26,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
self.unitslabel = QtWidgets.QLabel('<span style="color:red;"><b>%s:</b></span>' % _('Units')) self.unitslabel = QtWidgets.QLabel('<span style="color:red;"><b>%s:</b></span>' % _('Units'))
self.unitslabel.setToolTip(_("The default value for FlatCAM units.\n" self.unitslabel.setToolTip(_("The default value for FlatCAM units.\n"
"Whatever is selected here is set every time\n" "Whatever is selected here is set every time\n"
"FLatCAM is started.")) "FlatCAM is started."))
self.units_radio = RadioSet([{'label': _('MM'), 'value': 'MM'}, self.units_radio = RadioSet([{'label': _('MM'), 'value': 'MM'},
{'label': _('IN'), 'value': 'IN'}]) {'label': _('IN'), 'value': 'IN'}])

View File

@ -605,7 +605,7 @@ class PreferencesUIManager:
:param field: the GUI element in Preferences GUI to be updated :param field: the GUI element in Preferences GUI to be updated
:param factor: factor to be applied to the field parameter :param factor: factor to be applied to the field parameter
:param units: current FLatCAM measuring units :param units: current FlatCAM measuring units
:param defaults_dict: the defaults storage :param defaults_dict: the defaults storage
:return: None, it updates GUI elements :return: None, it updates GUI elements
""" """

View File

@ -142,7 +142,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
self.ncc_order_label.setToolTip(_("This set the way that the tools in the tools table are used.\n" self.ncc_order_label.setToolTip(_("This set the way that the tools in the tools table are used.\n"
"'No' --> means that the used order is the one in the tool table\n" "'No' --> means that the used order is the one in the tool table\n"
"'Forward' --> means that the tools will be ordered from small to big\n" "'Forward' --> means that the tools will be ordered from small to big\n"
"'Reverse' --> menas that the tools will ordered from big to small\n\n" "'Reverse' --> means that the tools will ordered from big to small\n\n"
"WARNING: using rest machining will automatically set the order\n" "WARNING: using rest machining will automatically set the order\n"
"in reverse and disable this control.")) "in reverse and disable this control."))
@ -152,7 +152,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
self.ncc_order_radio.setToolTip(_("This set the way that the tools in the tools table are used.\n" self.ncc_order_radio.setToolTip(_("This set the way that the tools in the tools table are used.\n"
"'No' --> means that the used order is the one in the tool table\n" "'No' --> means that the used order is the one in the tool table\n"
"'Forward' --> means that the tools will be ordered from small to big\n" "'Forward' --> means that the tools will be ordered from small to big\n"
"'Reverse' --> menas that the tools will ordered from big to small\n\n" "'Reverse' --> means that the tools will ordered from big to small\n\n"
"WARNING: using rest machining will automatically set the order\n" "WARNING: using rest machining will automatically set the order\n"
"in reverse and disable this control.")) "in reverse and disable this control."))
grid0.addWidget(self.ncc_order_label, 8, 0) grid0.addWidget(self.ncc_order_label, 8, 0)

View File

@ -128,7 +128,7 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI):
self.paint_order_label.setToolTip(_("This set the way that the tools in the tools table are used.\n" self.paint_order_label.setToolTip(_("This set the way that the tools in the tools table are used.\n"
"'No' --> means that the used order is the one in the tool table\n" "'No' --> means that the used order is the one in the tool table\n"
"'Forward' --> means that the tools will be ordered from small to big\n" "'Forward' --> means that the tools will be ordered from small to big\n"
"'Reverse' --> menas that the tools will ordered from big to small\n\n" "'Reverse' --> means that the tools will ordered from big to small\n\n"
"WARNING: using rest machining will automatically set the order\n" "WARNING: using rest machining will automatically set the order\n"
"in reverse and disable this control.")) "in reverse and disable this control."))

View File

@ -241,10 +241,6 @@ class CutOut(FlatCAMTool):
) )
grid0.addWidget(title_param_label, 18, 0, 1, 2) grid0.addWidget(title_param_label, 18, 0, 1, 2)
# Form Layout
form_layout_2 = QtWidgets.QFormLayout()
grid0.addLayout(form_layout_2, 19, 0, 1, 2)
# Gaps # Gaps
gaps_label = QtWidgets.QLabel('%s:' % _('Gaps')) gaps_label = QtWidgets.QLabel('%s:' % _('Gaps'))
gaps_label.setToolTip( gaps_label.setToolTip(
@ -266,7 +262,8 @@ class CutOut(FlatCAMTool):
for it in gaps_items: for it in gaps_items:
self.gaps.addItem(it) self.gaps.addItem(it)
self.gaps.setStyleSheet('background-color: rgb(255,255,255)') self.gaps.setStyleSheet('background-color: rgb(255,255,255)')
form_layout_2.addRow(gaps_label, self.gaps) grid0.addWidget(gaps_label, 19, 0)
grid0.addWidget(self.gaps, 19, 1)
# Buttons # Buttons
self.ff_cutout_object_btn = FCButton(_("Generate Freeform Geometry")) self.ff_cutout_object_btn = FCButton(_("Generate Freeform Geometry"))
@ -312,10 +309,6 @@ class CutOut(FlatCAMTool):
) )
grid0.addWidget(title_manual_label, 22, 0, 1, 2) grid0.addWidget(title_manual_label, 22, 0, 1, 2)
# Form Layout
form_layout_3 = QtWidgets.QFormLayout()
grid0.addLayout(form_layout_3, 23, 0, 1, 2)
# Manual Geo Object # Manual Geo Object
self.man_object_combo = FCComboBox() self.man_object_combo = FCComboBox()
self.man_object_combo.setModel(self.app.collection) self.man_object_combo.setModel(self.app.collection)
@ -329,10 +322,8 @@ class CutOut(FlatCAMTool):
) )
# self.man_object_label.setMinimumWidth(60) # self.man_object_label.setMinimumWidth(60)
form_layout_3.addRow(self.man_object_label) grid0.addWidget(self.man_object_label, 23, 0, 1, 2)
form_layout_3.addRow(self.man_object_combo) grid0.addWidget(self.man_object_combo, 24, 0, 1, 2)
# form_layout_3.addRow(e_lab_0)
self.man_geo_creation_btn = FCButton(_("Generate Manual Geometry")) self.man_geo_creation_btn = FCButton(_("Generate Manual Geometry"))
self.man_geo_creation_btn.setToolTip( self.man_geo_creation_btn.setToolTip(
@ -347,7 +338,7 @@ class CutOut(FlatCAMTool):
font-weight: bold; font-weight: bold;
} }
""") """)
grid0.addWidget(self.man_geo_creation_btn, 24, 0, 1, 2) grid0.addWidget(self.man_geo_creation_btn, 25, 0, 1, 2)
self.man_gaps_creation_btn = FCButton(_("Manual Add Bridge Gaps")) self.man_gaps_creation_btn = FCButton(_("Manual Add Bridge Gaps"))
self.man_gaps_creation_btn.setToolTip( self.man_gaps_creation_btn.setToolTip(

View File

@ -175,7 +175,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
self.ncc_order_label.setToolTip(_("This set the way that the tools in the tools table are used.\n" self.ncc_order_label.setToolTip(_("This set the way that the tools in the tools table are used.\n"
"'No' --> means that the used order is the one in the tool table\n" "'No' --> means that the used order is the one in the tool table\n"
"'Forward' --> means that the tools will be ordered from small to big\n" "'Forward' --> means that the tools will be ordered from small to big\n"
"'Reverse' --> menas that the tools will ordered from big to small\n\n" "'Reverse' --> means that the tools will ordered from big to small\n\n"
"WARNING: using rest machining will automatically set the order\n" "WARNING: using rest machining will automatically set the order\n"
"in reverse and disable this control.")) "in reverse and disable this control."))
@ -185,7 +185,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
self.ncc_order_radio.setToolTip(_("This set the way that the tools in the tools table are used.\n" self.ncc_order_radio.setToolTip(_("This set the way that the tools in the tools table are used.\n"
"'No' --> means that the used order is the one in the tool table\n" "'No' --> means that the used order is the one in the tool table\n"
"'Forward' --> means that the tools will be ordered from small to big\n" "'Forward' --> means that the tools will be ordered from small to big\n"
"'Reverse' --> menas that the tools will ordered from big to small\n\n" "'Reverse' --> means that the tools will ordered from big to small\n\n"
"WARNING: using rest machining will automatically set the order\n" "WARNING: using rest machining will automatically set the order\n"
"in reverse and disable this control.")) "in reverse and disable this control."))

View File

@ -159,7 +159,7 @@ class ToolPaint(FlatCAMTool, Gerber):
self.order_label.setToolTip(_("This set the way that the tools in the tools table are used.\n" self.order_label.setToolTip(_("This set the way that the tools in the tools table are used.\n"
"'No' --> means that the used order is the one in the tool table\n" "'No' --> means that the used order is the one in the tool table\n"
"'Forward' --> means that the tools will be ordered from small to big\n" "'Forward' --> means that the tools will be ordered from small to big\n"
"'Reverse' --> menas that the tools will ordered from big to small\n\n" "'Reverse' --> means that the tools will ordered from big to small\n\n"
"WARNING: using rest machining will automatically set the order\n" "WARNING: using rest machining will automatically set the order\n"
"in reverse and disable this control.")) "in reverse and disable this control."))
@ -169,7 +169,7 @@ class ToolPaint(FlatCAMTool, Gerber):
self.order_radio.setToolTip(_("This set the way that the tools in the tools table are used.\n" self.order_radio.setToolTip(_("This set the way that the tools in the tools table are used.\n"
"'No' --> means that the used order is the one in the tool table\n" "'No' --> means that the used order is the one in the tool table\n"
"'Forward' --> means that the tools will be ordered from small to big\n" "'Forward' --> means that the tools will be ordered from small to big\n"
"'Reverse' --> menas that the tools will ordered from big to small\n\n" "'Reverse' --> means that the tools will ordered from big to small\n\n"
"WARNING: using rest machining will automatically set the order\n" "WARNING: using rest machining will automatically set the order\n"
"in reverse and disable this control.")) "in reverse and disable this control."))

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -10786,7 +10786,7 @@ msgid ""
"This set the way that the tools in the tools table are used.\n" "This set the way that the tools in the tools table are used.\n"
"'No' --> means that the used order is the one in the tool table\n" "'No' --> means that the used order is the one in the tool table\n"
"'Forward' --> means that the tools will be ordered from small to big\n" "'Forward' --> means that the tools will be ordered from small to big\n"
"'Reverse' --> menas that the tools will ordered from big to small\n" "'Reverse' --> means that the tools will ordered from big to small\n"
"\n" "\n"
"WARNING: using rest machining will automatically set the order\n" "WARNING: using rest machining will automatically set the order\n"
"in reverse and disable this control." "in reverse and disable this control."
@ -10794,7 +10794,7 @@ msgstr ""
"This set the way that the tools in the tools table are used.\n" "This set the way that the tools in the tools table are used.\n"
"'No' --> means that the used order is the one in the tool table\n" "'No' --> means that the used order is the one in the tool table\n"
"'Forward' --> means that the tools will be ordered from small to big\n" "'Forward' --> means that the tools will be ordered from small to big\n"
"'Reverse' --> menas that the tools will ordered from big to small\n" "'Reverse' --> means that the tools will ordered from big to small\n"
"\n" "\n"
"WARNING: using rest machining will automatically set the order\n" "WARNING: using rest machining will automatically set the order\n"
"in reverse and disable this control." "in reverse and disable this control."

View File

@ -9575,7 +9575,7 @@ msgid ""
"This set the way that the tools in the tools table are used.\n" "This set the way that the tools in the tools table are used.\n"
"'No' --> means that the used order is the one in the tool table\n" "'No' --> means that the used order is the one in the tool table\n"
"'Forward' --> means that the tools will be ordered from small to big\n" "'Forward' --> means that the tools will be ordered from small to big\n"
"'Reverse' --> menas that the tools will ordered from big to small\n" "'Reverse' --> means that the tools will ordered from big to small\n"
"\n" "\n"
"WARNING: using rest machining will automatically set the order\n" "WARNING: using rest machining will automatically set the order\n"
"in reverse and disable this control." "in reverse and disable this control."

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -9640,7 +9640,7 @@ msgid ""
"This set the way that the tools in the tools table are used.\n" "This set the way that the tools in the tools table are used.\n"
"'No' --> means that the used order is the one in the tool table\n" "'No' --> means that the used order is the one in the tool table\n"
"'Forward' --> means that the tools will be ordered from small to big\n" "'Forward' --> means that the tools will be ordered from small to big\n"
"'Reverse' --> menas that the tools will ordered from big to small\n" "'Reverse' --> means that the tools will ordered from big to small\n"
"\n" "\n"
"WARNING: using rest machining will automatically set the order\n" "WARNING: using rest machining will automatically set the order\n"
"in reverse and disable this control." "in reverse and disable this control."