From dea7ce30287efb1bee7e4a042cca05cbaddce286 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Thu, 12 Nov 2020 20:47:43 +0200 Subject: [PATCH] - PEP8 changes and PyCharm suggestions --- CHANGELOG.md | 1 + appEditors/AppExcEditor.py | 12 +- appEditors/AppGeoEditor.py | 15 ++- appEditors/AppGerberEditor.py | 99 +++++++-------- appGUI/ColumnarFlowLayout.py | 4 +- appGUI/VisPyPatches.py | 2 +- appGUI/preferences/OptionUI.py | 10 +- appGUI/preferences/PreferencesSectionUI.py | 2 +- .../cncjob/CNCJobAdvOptPrefGroupUI.py | 22 ++-- .../cncjob/CNCJobEditorPrefGroupUI.py | 10 +- .../cncjob/CNCJobGenPrefGroupUI.py | 33 ++--- .../cncjob/CNCJobOptPrefGroupUI.py | 8 +- .../excellon/ExcellonAdvOptPrefGroupUI.py | 4 +- .../excellon/ExcellonEditorPrefGroupUI.py | 48 +++---- .../excellon/ExcellonExpPrefGroupUI.py | 16 +-- .../excellon/ExcellonGenPrefGroupUI.py | 34 ++--- .../excellon/ExcellonOptPrefGroupUI.py | 21 ++- .../general/GeneralAPPSetGroupUI.py | 44 +++---- .../general/GeneralAppPrefGroupUI.py | 36 +++--- .../general/GeneralAppSettingsGroupUI.py | 2 - .../general/GeneralGUIPrefGroupUI.py | 42 +++--- .../geometry/GeometryEditorPrefGroupUI.py | 8 +- .../geometry/GeometryGenPrefGroupUI.py | 22 ++-- .../geometry/GeometryOptPrefGroupUI.py | 26 ++-- .../gerber/GerberAdvOptPrefGroupUI.py | 10 +- .../gerber/GerberEditorPrefGroupUI.py | 44 +++---- .../gerber/GerberExpPrefGroupUI.py | 12 +- .../gerber/GerberGenPrefGroupUI.py | 22 ++-- .../gerber/GerberOptPrefGroupUI.py | 10 +- .../preferences/tools/Tools2CalPrefGroupUI.py | 16 +-- .../tools/Tools2FiducialsPrefGroupUI.py | 16 +-- .../tools/Tools2InvertPrefGroupUI.py | 8 +- .../tools/Tools2OptimalPrefGroupUI.py | 6 +- .../tools/Tools2PunchGerberPrefGroupUI.py | 30 ++--- .../tools/Tools2QRCodePrefGroupUI.py | 28 ++-- .../tools/Tools2RulesCheckPrefGroupUI.py | 26 ++-- .../tools/Tools2sidedPrefGroupUI.py | 12 +- .../preferences/tools/ToolsISOPrefGroupUI.py | 33 ++--- .../preferences/tools/ToolsNCCPrefGroupUI.py | 34 ++--- .../tools/ToolsPaintPrefGroupUI.py | 30 ++--- .../tools/ToolsPanelizePrefGroupUI.py | 18 +-- .../tools/ToolsSolderpastePrefGroupUI.py | 36 +++--- .../preferences/tools/ToolsSubPrefGroupUI.py | 4 +- .../tools/ToolsTransformPrefGroupUI.py | 38 +++--- .../utilities/AutoCompletePrefGroupUI.py | 6 +- .../preferences/utilities/FAExcPrefGroupUI.py | 6 +- .../preferences/utilities/FAGcoPrefGroupUI.py | 6 +- .../preferences/utilities/FAGrbPrefGroupUI.py | 6 +- appObjects/FlatCAMCNCJob.py | 8 +- appObjects/FlatCAMExcellon.py | 8 +- appObjects/FlatCAMGeometry.py | 2 +- appObjects/FlatCAMGerber.py | 26 ++-- appParsers/ParseDXF.py | 2 +- appParsers/ParseGerber.py | 1 - appParsers/ParseSVG.py | 7 +- appPreProcessor.py | 1 - appTools/ToolQRCode.py | 2 +- appTranslation.py | 2 +- appWorkerStack.py | 1 - app_Main.py | 7 +- camlib.py | 16 ++- make_freezed.py | 120 ------------------ tclCommands/TclCommandIsolate.py | 5 - 63 files changed, 527 insertions(+), 659 deletions(-) delete mode 100644 make_freezed.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a4a326a..569665a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ CHANGELOG for FlatCAM beta - added the "follow" functionality in the Follow Tool and added the new feature of allowing to perform "follow" on an area selection - fixed bug that inversed mouse cursor movement versus the real movement on Y axis when Grid lines are Off - updated the language strings +- PEP8 changes and PyCharm suggestions 11.11.2020 diff --git a/appEditors/AppExcEditor.py b/appEditors/AppExcEditor.py index 381bc6f5..6b64a867 100644 --- a/appEditors/AppExcEditor.py +++ b/appEditors/AppExcEditor.py @@ -9,7 +9,7 @@ from PyQt5 import QtGui, QtCore, QtWidgets from PyQt5.QtCore import Qt from camlib import distance, arc, FlatCAMRTreeStorage -from appGUI.GUIElements import FCEntry, FCComboBox2, FCTable, FCDoubleSpinner, RadioSet, FCSpinner, FCButton, FCLabel +from appGUI.GUIElements import FCEntry, FCTable, FCDoubleSpinner, RadioSet, FCSpinner, FCButton, FCLabel from appEditors.AppGeoEditor import FCShapeTool, DrawTool, DrawToolShape, DrawToolUtilityShape, AppGeoEditor from shapely.geometry import LineString, LinearRing, MultiLineString, Polygon, MultiPolygon, Point @@ -3575,8 +3575,8 @@ class AppExcEditor(QtCore.QObject): self.tool_shape.clear(update=True) self.draw_utility_geometry(geo=geo) - def on_canvas_key_release(self, event): - self.key = None + # def on_canvas_key_release(self, event): + # self.key = None def draw_utility_geometry(self, geo): # Add the new utility shape @@ -3671,11 +3671,11 @@ class AppExcEditor(QtCore.QObject): plot_elements += self.plot_shape(geometry=geometry.geo, color=color, linewidth=linewidth) # ## Polygon: Descend into exterior and each interior. - if type(geometry) == Polygon: + if isinstance(geometry, Polygon): plot_elements += self.plot_shape(geometry=geometry.exterior, color=color, linewidth=linewidth) plot_elements += self.plot_shape(geometry=geometry.interiors, color=color, linewidth=linewidth) - if type(geometry) == LineString or type(geometry) == LinearRing: + if isinstance(geometry, (LineString, LinearRing)): plot_elements.append(self.shapes.add(shape=geometry, color=color, layer=0, tolerance=self.tolerance)) if type(geometry) == Point: @@ -4211,7 +4211,7 @@ class AppExcEditorUI: # Array Direction self.drill_array_dir_lbl = FCLabel('%s:' % _('Direction')) self.drill_array_dir_lbl.setToolTip(_("Direction for circular array.\n" - "Can be CW = clockwise or CCW = counter clockwise.")) + "Can be CW = clockwise or CCW = counter clockwise.")) self.drill_array_dir_radio = RadioSet([{'label': _('CW'), 'value': 'CW'}, {'label': _('CCW'), 'value': 'CCW'}]) diff --git a/appEditors/AppGeoEditor.py b/appEditors/AppGeoEditor.py index 4d0335a6..1801b730 100644 --- a/appEditors/AppGeoEditor.py +++ b/appEditors/AppGeoEditor.py @@ -24,6 +24,7 @@ from shapely.geometry import LineString, LinearRing, MultiLineString, Polygon, M from shapely.ops import unary_union, linemerge import shapely.affinity as affinity from shapely.geometry.polygon import orient +from shapely.geometry.base import BaseGeometry import numpy as np from numpy.linalg import norm as numpy_norm @@ -84,7 +85,7 @@ class BufferSelectionTool(AppTool): self.buffer_distance_entry = FCDoubleSpinner() self.buffer_distance_entry.set_precision(self.decimals) self.buffer_distance_entry.set_range(0.0000, 9910000.0000) - form_layout.addRow('%S:' % _("Buffer distance"), self.buffer_distance_entry) + form_layout.addRow('%s:' % _("Buffer distance"), self.buffer_distance_entry) self.buffer_corner_lbl = FCLabel('%s:' % _("Buffer corner")) self.buffer_corner_lbl.setToolTip( _("There are 3 types of corners:\n" @@ -1605,7 +1606,7 @@ class DrawToolShape(object): return return pts - def __init__(self, geo=[]): + def __init__(self, geo: (BaseGeometry, list)): # Shapely type or list of such self.geo = geo @@ -1854,7 +1855,7 @@ class DrawToolUtilityShape(DrawToolShape): point is clicked and the final geometry is created. """ - def __init__(self, geo=[]): + def __init__(self, geo: (BaseGeometry, list)): super(DrawToolUtilityShape, self).__init__(geo=geo) self.utility = True @@ -2439,7 +2440,7 @@ class FCPath(FCPolygon): try: QtGui.QGuiApplication.restoreOverrideCursor() - except Exception as e: + except Exception: pass self.draw_app.in_action = False @@ -3040,7 +3041,7 @@ class FCBuffer(FCShapeTool): self.buff_tool.buffer_distance_entry.set_value(buffer_distance) except ValueError: self.draw_app.app.inform.emit('[WARNING_NOTCL] %s' % - _("Buffer distance value is missing or wrong format. Add it and retry.")) + _("Buffer distance value is missing or wrong format. Add it and retry.")) return # the cb index start from 0 but the join styles for the buffer start from 1 therefore the adjustment # I populated the combobox such that the index coincide with the join styles value (whcih is really an INT) @@ -4456,11 +4457,11 @@ class AppGeoEditor(QtCore.QObject): plot_elements += self.plot_shape(geometry=geometry.geo, color=color, linewidth=linewidth) # Polygon: Descend into exterior and each interior. - if type(geometry) == Polygon: + if isinstance(geometry, Polygon): plot_elements += self.plot_shape(geometry=geometry.exterior, color=color, linewidth=linewidth) plot_elements += self.plot_shape(geometry=geometry.interiors, color=color, linewidth=linewidth) - if type(geometry) == LineString or type(geometry) == LinearRing: + if isinstance(geometry, (LineString, LinearRing)): plot_elements.append(self.shapes.add(shape=geometry, color=color, layer=0, tolerance=self.fcgeometry.drawing_tolerance, linewidth=linewidth)) diff --git a/appEditors/AppGerberEditor.py b/appEditors/AppGerberEditor.py index 331004ea..a9637d61 100644 --- a/appEditors/AppGerberEditor.py +++ b/appEditors/AppGerberEditor.py @@ -19,7 +19,7 @@ import logging from camlib import distance, arc, three_point_circle from appGUI.GUIElements import FCEntry, FCComboBox, FCTable, FCDoubleSpinner, FCSpinner, RadioSet, EvalEntry2, \ - FCInputDoubleSpinner, FCButton, OptionalInputSection, FCCheckBox, NumericalEvalTupleEntry, FCComboBox2, FCLabel + FCInputDoubleSpinner, FCButton, OptionalInputSection, FCCheckBox, NumericalEvalTupleEntry, FCLabel from appTool import AppTool import numpy as np @@ -54,7 +54,7 @@ class DrawToolShape(object): the object can be a Polygon, Not a polygon, or a list of such. Search is done recursively. - :param: geometric object + :param o: geometric object :return: List of points :rtype: list """ @@ -64,7 +64,6 @@ class DrawToolShape(object): try: for sub_o in o: pts += DrawToolShape.get_pts(sub_o) - # Non-iterable except TypeError: if o is not None: @@ -487,7 +486,7 @@ class PadArrayEditorGrb(ShapeToolEditorGrb): def click(self, point): - if self.draw_app.ui.array_type_radio.get_value() == 0: # 'Linear' + if self.draw_app.ui.array_type_radio.get_value() == 0: # 'Linear' self.make() return else: @@ -538,7 +537,7 @@ class PadArrayEditorGrb(ShapeToolEditorGrb): self.draw_app.app.inform.emit('[ERROR_NOTCL] %s' % _("The value is mistyped. Check the value.")) return - if self.pad_array == 'linear': # 'Linear' + if self.pad_array == 'linear': # 'Linear' if data[0] is None and data[1] is None: dx = self.draw_app.x dy = self.draw_app.y @@ -582,7 +581,7 @@ class PadArrayEditorGrb(ShapeToolEditorGrb): self.last_dx = dx self.last_dy = dy return DrawToolUtilityShape(geo_el_list) - elif self.pad_array == 'circular': # 'Circular' + elif self.pad_array == 'circular': # 'Circular' if data[0] is None and data[1] is None: cdx = self.draw_app.x cdy = self.draw_app.y @@ -776,7 +775,7 @@ class PadArrayEditorGrb(ShapeToolEditorGrb): self.draw_app.current_storage = self.storage_obj - if self.pad_array == 'linear': # 'Linear' + if self.pad_array == 'linear': # 'Linear' for item in range(self.pad_array_size): if self.pad_axis == 'X': geo = self.util_shape(((self.points[0] + (self.pad_pitch * item)), self.points[1])) @@ -790,7 +789,7 @@ class PadArrayEditorGrb(ShapeToolEditorGrb): ) self.geometry.append(DrawToolShape(geo)) - else: # 'Circular' + else: # 'Circular' if (self.pad_angle * self.pad_array_size) > 360: self.draw_app.app.inform.emit('[WARNING_NOTCL] %s' % _("Too many items for the selected spacing angle.")) @@ -1331,6 +1330,7 @@ class TrackEditorGrb(ShapeToolEditorGrb): """ Resulting type: Polygon """ + def __init__(self, draw_app): DrawTool.__init__(self, draw_app) self.name = 'track' @@ -1441,24 +1441,24 @@ class TrackEditorGrb(ShapeToolEditorGrb): if self.draw_app.bend_mode == 1: if x > old_x: if mx > my: - self.temp_points.append((old_x + self.gridx_size*(mx-my), old_y)) + self.temp_points.append((old_x + self.gridx_size * (mx - my), old_y)) if mx < my: if y < old_y: - self.temp_points.append((old_x, old_y - self.gridy_size * (my-mx))) + self.temp_points.append((old_x, old_y - self.gridy_size * (my - mx))) else: - self.temp_points.append((old_x, old_y - self.gridy_size * (mx-my))) + self.temp_points.append((old_x, old_y - self.gridy_size * (mx - my))) if x < old_x: if mx > my: - self.temp_points.append((old_x - self.gridx_size*(mx-my), old_y)) + self.temp_points.append((old_x - self.gridx_size * (mx - my), old_y)) if mx < my: if y < old_y: - self.temp_points.append((old_x, old_y - self.gridy_size * (my-mx))) + self.temp_points.append((old_x, old_y - self.gridy_size * (my - mx))) else: - self.temp_points.append((old_x, old_y - self.gridy_size * (mx-my))) + self.temp_points.append((old_x, old_y - self.gridy_size * (mx - my))) elif self.draw_app.bend_mode == 2: if x > old_x: if mx > my: - self.temp_points.append((old_x + self.gridx_size*my, y)) + self.temp_points.append((old_x + self.gridx_size * my, y)) if mx < my: if y < old_y: self.temp_points.append((x, old_y - self.gridy_size * mx)) @@ -1499,7 +1499,7 @@ class TrackEditorGrb(ShapeToolEditorGrb): else: follow_geo = LineString(self.temp_points) solid_geo = follow_geo.buffer(self.buf_val, int(self.steps_per_circle)) - solid_geo = solid_geo.buffer(0) # try to clean the geometry + solid_geo = solid_geo.buffer(0) # try to clean the geometry new_geo_el = { 'solid': solid_geo, @@ -2739,7 +2739,6 @@ class TransformEditorGrb(ShapeToolEditorGrb): class AppGerberEditor(QtCore.QObject): - draw_shape_idx = -1 # plot_finished = QtCore.pyqtSignal() mp_finished = QtCore.pyqtSignal(list) @@ -2852,16 +2851,16 @@ class AppGerberEditor(QtCore.QObject): self.launched_from_shortcuts = False def_tol_val = float(self.app.defaults["global_tolerance"]) - self.tolerance = def_tol_val if self.units == 'MM'else def_tol_val / 20 + self.tolerance = def_tol_val if self.units == 'MM' else def_tol_val / 20 # options of this widget (AppGerberEditor class is a widget) self.options = { - "global_gridx": 0.1, - "global_gridy": 0.1, - "snap_max": 0.05, - "grid_snap": True, - "corner_snap": False, - "grid_gap_link": True + "global_gridx": 0.1, + "global_gridy": 0.1, + "snap_max": 0.05, + "grid_snap": True, + "corner_snap": False, + "grid_gap_link": True } # fill it with the application options (application preferences) self.options.update(self.app.options) @@ -2959,21 +2958,21 @@ class AppGerberEditor(QtCore.QObject): def connect_grb_toolbar_signals(self): self.tools_gerber.update({ - "select": {"button": self.app.ui.grb_select_btn, "constructor": SelectEditorGrb}, - "pad": {"button": self.app.ui.grb_add_pad_btn, "constructor": PadEditorGrb}, - "array": {"button": self.app.ui.add_pad_ar_btn, "constructor": PadArrayEditorGrb}, - "track": {"button": self.app.ui.grb_add_track_btn, "constructor": TrackEditorGrb}, - "region": {"button": self.app.ui.grb_add_region_btn, "constructor": RegionEditorGrb}, - "poligonize": {"button": self.app.ui.grb_convert_poly_btn, "constructor": PoligonizeEditorGrb}, - "semidisc": {"button": self.app.ui.grb_add_semidisc_btn, "constructor": DiscSemiEditorGrb}, - "disc": {"button": self.app.ui.grb_add_disc_btn, "constructor": DiscEditorGrb}, - "buffer": {"button": self.app.ui.aperture_buffer_btn, "constructor": BufferEditorGrb}, - "scale": {"button": self.app.ui.aperture_scale_btn, "constructor": ScaleEditorGrb}, - "markarea": {"button": self.app.ui.aperture_markarea_btn, "constructor": MarkEditorGrb}, - "eraser": {"button": self.app.ui.aperture_eraser_btn, "constructor": EraserEditorGrb}, - "copy": {"button": self.app.ui.aperture_copy_btn, "constructor": CopyEditorGrb}, - "transform": {"button": self.app.ui.grb_transform_btn, "constructor": TransformEditorGrb}, - "move": {"button": self.app.ui.aperture_move_btn, "constructor": MoveEditorGrb}, + "select": {"button": self.app.ui.grb_select_btn, "constructor": SelectEditorGrb}, + "pad": {"button": self.app.ui.grb_add_pad_btn, "constructor": PadEditorGrb}, + "array": {"button": self.app.ui.add_pad_ar_btn, "constructor": PadArrayEditorGrb}, + "track": {"button": self.app.ui.grb_add_track_btn, "constructor": TrackEditorGrb}, + "region": {"button": self.app.ui.grb_add_region_btn, "constructor": RegionEditorGrb}, + "poligonize": {"button": self.app.ui.grb_convert_poly_btn, "constructor": PoligonizeEditorGrb}, + "semidisc": {"button": self.app.ui.grb_add_semidisc_btn, "constructor": DiscSemiEditorGrb}, + "disc": {"button": self.app.ui.grb_add_disc_btn, "constructor": DiscEditorGrb}, + "buffer": {"button": self.app.ui.aperture_buffer_btn, "constructor": BufferEditorGrb}, + "scale": {"button": self.app.ui.aperture_scale_btn, "constructor": ScaleEditorGrb}, + "markarea": {"button": self.app.ui.aperture_markarea_btn, "constructor": MarkEditorGrb}, + "eraser": {"button": self.app.ui.aperture_eraser_btn, "constructor": EraserEditorGrb}, + "copy": {"button": self.app.ui.aperture_copy_btn, "constructor": CopyEditorGrb}, + "transform": {"button": self.app.ui.grb_transform_btn, "constructor": TransformEditorGrb}, + "move": {"button": self.app.ui.aperture_move_btn, "constructor": MoveEditorGrb}, }) for tool in self.tools_gerber: @@ -3020,7 +3019,7 @@ class AppGerberEditor(QtCore.QObject): self.ui.apdim_entry.set_value(self.app.defaults["gerber_editor_newdim"]) # PAD Array - self.ui.array_type_radio.set_value('linear') # Linear + self.ui.array_type_radio.set_value('linear') # Linear self.on_array_type_radio(val=self.ui.array_type_radio.get_value()) self.ui.pad_array_size_entry.set_value(int(self.app.defaults["gerber_editor_array_size"])) @@ -3290,7 +3289,7 @@ class AppGerberEditor(QtCore.QObject): break self.ui.apertures_table.selectRow(row_to_be_selected) - def on_aperture_delete(self, ap_code=None): + def on_aperture_delete(self, ap_code: str = None): """ Called for aperture deletion. @@ -3316,7 +3315,7 @@ class AppGerberEditor(QtCore.QObject): row = index.row() deleted_apcode_list.append(self.ui.apertures_table.item(row, 1).text()) except Exception as exc: - self.app.inform.emit('[WARNING_NOTCL] %s %s' % (_("Select an aperture in Aperture Table -->", str(exc)))) + self.app.inform.emit('[WARNING_NOTCL] %s %s' % (_("Select an aperture in Aperture Table -->"), str(exc))) return if deleted_apcode_list: @@ -3446,7 +3445,7 @@ class AppGerberEditor(QtCore.QObject): self.add_gerber_shape(geometry, self.storage_dict[val_edited]) - self.on_aperture_delete(apcode=ap_code_old) + self.on_aperture_delete(ap_code=ap_code_old) # In case we edited the Size of the Aperture therefore the val_edited holds the new Aperture Size # It will happen only for the Aperture Type == 'C' - I make sure of that in the self.build_ui() @@ -4354,7 +4353,7 @@ class AppGerberEditor(QtCore.QObject): assert shape_element.geo is not None, \ "Shape object has empty geometry (None)" - assert(isinstance(shape_element.geo, list) and len(shape_element.geo) > 0) or not \ + assert (isinstance(shape_element.geo, list) and len(shape_element.geo) > 0) or not \ isinstance(shape_element.geo, list), "Shape objects has empty geometry ([])" if isinstance(shape_element, DrawToolUtilityShape): @@ -6187,7 +6186,7 @@ class TransformEditorTool(AppTool): self.point_entry.hide() self.point_button.hide() - elif index == 2: # "Point" reference + elif index == 2: # "Point" reference self.point_label.show() self.point_entry.show() self.point_button.show() @@ -6198,7 +6197,7 @@ class TransformEditorTool(AppTool): else: ref_val = self.ref_combo.currentIndex() - if ref_val == 0: # "Origin" reference + if ref_val == 0: # "Origin" reference return 0, 0 elif ref_val == 1: # "Selection" reference sel_list = self.draw_app.selected @@ -6223,13 +6222,13 @@ class TransformEditorTool(AppTool): if sel_list: xmin, ymin, xmax, ymax = self.alt_bounds(sel_list) if ref_val == 3: - return xmin, ymin # lower left corner + return xmin, ymin # lower left corner elif ref_val == 4: - return xmax, ymin # lower right corner + return xmax, ymin # lower right corner elif ref_val == 5: - return xmax, ymax # upper right corner + return xmax, ymax # upper right corner else: - return xmin, ymax # upper left corner + return xmin, ymax # upper left corner else: self.app.inform.emit('[ERROR_NOTCL] %s' % _("No shape selected.")) return "fail" diff --git a/appGUI/ColumnarFlowLayout.py b/appGUI/ColumnarFlowLayout.py index 3c92efd0..2fcdff5a 100644 --- a/appGUI/ColumnarFlowLayout.py +++ b/appGUI/ColumnarFlowLayout.py @@ -7,8 +7,8 @@ import sys -from PyQt5.QtCore import QPoint, QRect, QSize, Qt -from PyQt5.QtWidgets import QLayout, QSizePolicy +from PyQt5.QtCore import QRect, QSize, Qt +from PyQt5.QtWidgets import QLayout import math diff --git a/appGUI/VisPyPatches.py b/appGUI/VisPyPatches.py index 28ee9801..36881e0c 100644 --- a/appGUI/VisPyPatches.py +++ b/appGUI/VisPyPatches.py @@ -6,7 +6,7 @@ # MIT Licence # # ########################################################## -from vispy.visuals import markers, LineVisual, InfiniteLineVisual +from vispy.visuals import markers, InfiniteLineVisual from vispy.visuals.axis import Ticker, _get_ticks_talbot from vispy.scene.widgets import Grid import numpy as np diff --git a/appGUI/preferences/OptionUI.py b/appGUI/preferences/OptionUI.py index c1b680ce..325ea78f 100644 --- a/appGUI/preferences/OptionUI.py +++ b/appGUI/preferences/OptionUI.py @@ -4,7 +4,7 @@ from PyQt5 import QtWidgets, QtGui from PyQt5.QtCore import QSettings from appGUI.GUIElements import RadioSet, FCCheckBox, FCButton, FCComboBox, FCEntry, FCSpinner, FCColorEntry, \ - FCSliderWithSpinner, FCDoubleSpinner, FloatEntry, FCTextArea + FCSliderWithSpinner, FCDoubleSpinner, FloatEntry, FCTextArea, FCLabel import gettext import appTranslation as fcTranslate @@ -43,13 +43,13 @@ class BasicOptionUI(OptionUI): self.label_widget = self.build_label_widget() self.entry_widget = self.build_entry_widget() - def build_label_widget(self) -> QtWidgets.QLabel: + def build_label_widget(self) -> FCLabel: fmt = "%s:" if self.label_bold: fmt = "%s" % fmt if self.label_color: fmt = "%s" % (self.label_color, fmt) - label_widget = QtWidgets.QLabel(fmt % _(self.label_text)) + label_widget = FCLabel(fmt % _(self.label_text)) if self.label_tooltip is not None: label_widget.setToolTip(_(self.label_tooltip)) return label_widget @@ -98,7 +98,7 @@ class TextAreaOptionUI(OptionUI): self.textarea_widget = self.build_textarea_widget() def build_label_widget(self): - label = QtWidgets.QLabel("%s:" % _(self.label_text)) + label = FCLabel("%s:" % _(self.label_text)) label.setToolTip(_(self.label_tooltip)) return label @@ -274,7 +274,7 @@ class HeadingOptionUI(OptionUI): self.label_tooltip = label_tooltip def build_heading_widget(self): - heading = QtWidgets.QLabel('%s' % _(self.label_text)) + heading = FCLabel('%s' % _(self.label_text)) heading.setToolTip(_(self.label_tooltip)) return heading diff --git a/appGUI/preferences/PreferencesSectionUI.py b/appGUI/preferences/PreferencesSectionUI.py index 968bef75..1ce11ae8 100644 --- a/appGUI/preferences/PreferencesSectionUI.py +++ b/appGUI/preferences/PreferencesSectionUI.py @@ -1,5 +1,5 @@ from typing import Dict -from PyQt5 import QtWidgets, QtCore +from PyQt5 import QtWidgets from appGUI.ColumnarFlowLayout import ColumnarFlowLayout from appGUI.preferences.OptionUI import OptionUI diff --git a/appGUI/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py b/appGUI/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py index fb10bcbb..482076d5 100644 --- a/appGUI/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py +++ b/appGUI/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py @@ -1,5 +1,5 @@ -from PyQt5 import QtWidgets, QtGui -from PyQt5.QtCore import QSettings, Qt +from PyQt5 import QtWidgets +from PyQt5.QtCore import QSettings from appGUI.GUIElements import FCComboBox, FCSpinner, FCColorEntry, FCLabel, FCDoubleSpinner, RadioSet from appGUI.preferences.OptionsGroupUI import OptionsGroupUI @@ -32,7 +32,7 @@ class CNCJobAdvOptPrefGroupUI(OptionsGroupUI): self.layout.addLayout(grid0) # ## Export G-Code - self.export_gcode_label = QtWidgets.QLabel("%s:" % _("Parameters")) + self.export_gcode_label = FCLabel("%s:" % _("Parameters")) self.export_gcode_label.setToolTip( _("Export and save G-Code to\n" "make this object to a file.") @@ -40,7 +40,7 @@ class CNCJobAdvOptPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.export_gcode_label, 0, 0, 1, 2) # Annotation Font Size - self.annotation_fontsize_label = QtWidgets.QLabel('%s:' % _("Annotation Size")) + self.annotation_fontsize_label = FCLabel('%s:' % _("Annotation Size")) self.annotation_fontsize_label.setToolTip( _("The font size of the annotation text. In pixels.") ) @@ -51,7 +51,7 @@ class CNCJobAdvOptPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.annotation_fontsize_sp, 2, 1) # Annotation Font Color - self.annotation_color_label = QtWidgets.QLabel('%s:' % _('Annotation Color')) + self.annotation_color_label = FCLabel('%s:' % _('Annotation Color')) self.annotation_color_label.setToolTip( _("Set the font color for the annotation texts.") ) @@ -61,7 +61,7 @@ class CNCJobAdvOptPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.annotation_fontcolor_entry, 4, 1) # ## Autolevelling - self.autolevelling_gcode_label = QtWidgets.QLabel("%s" % _("Autolevelling")) + self.autolevelling_gcode_label = FCLabel("%s" % _("Autolevelling")) self.autolevelling_gcode_label.setToolTip( _("Parameters for the autolevelling.") ) @@ -98,7 +98,7 @@ class CNCJobAdvOptPrefGroupUI(OptionsGroupUI): # ## Columns self.al_columns_entry = FCSpinner() - self.al_columns_label = QtWidgets.QLabel('%s:' % _("Columns")) + self.al_columns_label = FCLabel('%s:' % _("Columns")) self.al_columns_label.setToolTip( _("The number of grid columns.") ) @@ -108,7 +108,7 @@ class CNCJobAdvOptPrefGroupUI(OptionsGroupUI): # ## Rows self.al_rows_entry = FCSpinner() - self.al_rows_label = QtWidgets.QLabel('%s:' % _("Rows")) + self.al_rows_label = FCLabel('%s:' % _("Rows")) self.al_rows_label.setToolTip( _("The number of grid rows.") ) @@ -116,7 +116,7 @@ class CNCJobAdvOptPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.al_rows_entry, 12, 1) # Travel Z Probe - self.ptravelz_label = QtWidgets.QLabel('%s:' % _("Probe Z travel")) + self.ptravelz_label = FCLabel('%s:' % _("Probe Z travel")) self.ptravelz_label.setToolTip( _("The safe Z for probe travelling between probe points.") ) @@ -128,7 +128,7 @@ class CNCJobAdvOptPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.ptravelz_entry, 14, 1) # Probe depth - self.pdepth_label = QtWidgets.QLabel('%s:' % _("Probe Z depth")) + self.pdepth_label = FCLabel('%s:' % _("Probe Z depth")) self.pdepth_label.setToolTip( _("The maximum depth that the probe is allowed\n" "to probe. Negative value, in current units.") @@ -141,7 +141,7 @@ class CNCJobAdvOptPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.pdepth_entry, 16, 1) # Probe feedrate - self.feedrate_probe_label = QtWidgets.QLabel('%s:' % _("Probe Feedrate")) + self.feedrate_probe_label = FCLabel('%s:' % _("Probe Feedrate")) self.feedrate_probe_label.setToolTip( _("The feedrate used while the probe is probing.") ) diff --git a/appGUI/preferences/cncjob/CNCJobEditorPrefGroupUI.py b/appGUI/preferences/cncjob/CNCJobEditorPrefGroupUI.py index e329b436..df9cfcf2 100644 --- a/appGUI/preferences/cncjob/CNCJobEditorPrefGroupUI.py +++ b/appGUI/preferences/cncjob/CNCJobEditorPrefGroupUI.py @@ -1,7 +1,7 @@ -from PyQt5 import QtWidgets, QtGui +from PyQt5 import QtGui from PyQt5.QtCore import QSettings -from appGUI.GUIElements import FCTextArea +from appGUI.GUIElements import FCTextArea, FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -28,7 +28,7 @@ class CNCJobEditorPrefGroupUI(OptionsGroupUI): self.decimals = decimals # Editor Parameters - self.param_label = QtWidgets.QLabel("%s:" % _("Parameters")) + self.param_label = FCLabel("%s:" % _("Parameters")) self.param_label.setToolTip( _("A list of Editor parameters.") ) @@ -43,7 +43,7 @@ class CNCJobEditorPrefGroupUI(OptionsGroupUI): font.setPointSize(tb_fsize) # Prepend to G-Code - prependlabel = QtWidgets.QLabel('%s:' % _('Prepend to G-Code')) + prependlabel = FCLabel('%s:' % _('Prepend to G-Code')) prependlabel.setToolTip( _("Type here any G-Code commands you would\n" "like to add at the beginning of the G-Code file.") @@ -59,7 +59,7 @@ class CNCJobEditorPrefGroupUI(OptionsGroupUI): self.prepend_text.setFont(font) # Append text to G-Code - appendlabel = QtWidgets.QLabel('%s:' % _('Append to G-Code')) + appendlabel = FCLabel('%s:' % _('Append to G-Code')) appendlabel.setToolTip( _("Type here any G-Code commands you would\n" "like to append to the generated file.\n" diff --git a/appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py b/appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py index ac9053c3..8bb25364 100644 --- a/appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py +++ b/appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py @@ -1,7 +1,8 @@ -from PyQt5 import QtWidgets, QtCore, QtGui +from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from appGUI.GUIElements import FCCheckBox, RadioSet, FCSpinner, FCDoubleSpinner, FCSliderWithSpinner, FCColorEntry +from appGUI.GUIElements import FCCheckBox, RadioSet, FCSpinner, FCDoubleSpinner, FCSliderWithSpinner, FCColorEntry, \ + FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext import appTranslation as fcTranslate @@ -27,7 +28,7 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI): self.decimals = decimals # ## Plot options - self.plot_options_label = QtWidgets.QLabel("%s:" % _("Plot Options")) + self.plot_options_label = FCLabel("%s:" % _("Plot Options")) self.layout.addWidget(self.plot_options_label) grid0 = QtWidgets.QGridLayout() @@ -44,7 +45,7 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI): # ################################################################### # Number of circle steps for circular aperture linear approximation # # ################################################################### - self.steps_per_circle_label = QtWidgets.QLabel('%s:' % _("Circle Steps")) + self.steps_per_circle_label = FCLabel('%s:' % _("Circle Steps")) self.steps_per_circle_label.setToolTip( _("The number of circle steps for GCode \n" "circle and arc shapes linear approximation.") @@ -55,7 +56,7 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.steps_per_circle_entry, 3, 1) # Tool dia for plot - tdlabel = QtWidgets.QLabel('%s:' % _('Travel dia')) + tdlabel = FCLabel('%s:' % _('Travel dia')) tdlabel.setToolTip( _("The width of the travel lines to be\n" "rendered in the plot.") @@ -70,10 +71,10 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.tooldia_entry, 4, 1) # add a space - grid0.addWidget(QtWidgets.QLabel('%s:' % _("G-code Decimals")), 5, 0, 1, 2) + grid0.addWidget(FCLabel('%s:' % _("G-code Decimals")), 5, 0, 1, 2) # Number of decimals to use in GCODE coordinates - cdeclabel = QtWidgets.QLabel('%s:' % _('Coordinates')) + cdeclabel = FCLabel('%s:' % _('Coordinates')) cdeclabel.setToolTip( _("The number of decimals to be used for \n" "the X, Y, Z coordinates in CNC code (GCODE, etc.)") @@ -86,7 +87,7 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.coords_dec_entry, 6, 1) # Number of decimals to use in GCODE feedrate - frdeclabel = QtWidgets.QLabel('%s:' % _('Feedrate')) + frdeclabel = FCLabel('%s:' % _('Feedrate')) frdeclabel.setToolTip( _("The number of decimals to be used for \n" "the Feedrate parameter in CNC code (GCODE, etc.)") @@ -99,7 +100,7 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.fr_dec_entry, 7, 1) # The type of coordinates used in the Gcode: Absolute or Incremental - coords_type_label = QtWidgets.QLabel('%s:' % _('Coordinates type')) + coords_type_label = FCLabel('%s:' % _('Coordinates type')) coords_type_label.setToolTip( _("The type of coordinates to be used in Gcode.\n" "Can be:\n" @@ -132,11 +133,11 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI): grid0.addWidget(separator_line, 12, 0, 1, 2) # Travel Line Color - self.travel_color_label = QtWidgets.QLabel('%s' % _('Travel Line Color')) + self.travel_color_label = FCLabel('%s' % _('Travel Line Color')) grid0.addWidget(self.travel_color_label, 13, 0, 1, 2) # Plot Line Color - self.tline_color_label = QtWidgets.QLabel('%s:' % _('Outline')) + self.tline_color_label = FCLabel('%s:' % _('Outline')) self.tline_color_label.setToolTip( _("Set the travel line color for plotted objects.") ) @@ -146,7 +147,7 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.tline_color_entry, 14, 1) # Plot Fill Color - self.tfill_color_label = QtWidgets.QLabel('%s:' % _('Fill')) + self.tfill_color_label = FCLabel('%s:' % _('Fill')) self.tfill_color_label.setToolTip( _("Set the fill color for plotted objects.\n" "First 6 digits are the color and the last 2\n" @@ -158,7 +159,7 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.tfill_color_entry, 15, 1) # Plot Fill Transparency Level - self.cncjob_alpha_label = QtWidgets.QLabel('%s:' % _('Alpha')) + self.cncjob_alpha_label = FCLabel('%s:' % _('Alpha')) self.cncjob_alpha_label.setToolTip( _("Set the fill transparency for plotted objects.") ) @@ -173,11 +174,11 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI): grid0.addWidget(separator_line, 17, 0, 1, 2) # CNCJob Object Color - self.cnc_color_label = QtWidgets.QLabel('%s' % _('Object Color')) + self.cnc_color_label = FCLabel('%s' % _('Object Color')) grid0.addWidget(self.cnc_color_label, 18, 0, 1, 2) # Plot Line Color - self.line_color_label = QtWidgets.QLabel('%s:' % _('Outline')) + self.line_color_label = FCLabel('%s:' % _('Outline')) self.line_color_label.setToolTip( _("Set the color for plotted objects.") ) @@ -187,7 +188,7 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.line_color_entry, 19, 1) # Plot Fill Color - self.fill_color_label = QtWidgets.QLabel('%s:' % _('Fill')) + self.fill_color_label = FCLabel('%s:' % _('Fill')) self.fill_color_label.setToolTip( _("Set the fill color for plotted objects.\n" "First 6 digits are the color and the last 2\n" diff --git a/appGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py b/appGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py index 8f74df65..4ee63a9e 100644 --- a/appGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py +++ b/appGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt5 import QtWidgets, QtGui from PyQt5.QtCore import QSettings -from appGUI.GUIElements import RadioSet, FCCheckBox +from appGUI.GUIElements import RadioSet, FCCheckBox, FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -28,7 +28,7 @@ class CNCJobOptPrefGroupUI(OptionsGroupUI): self.decimals = decimals # ## Export G-Code - self.export_gcode_label = QtWidgets.QLabel("%s:" % _("Export G-Code")) + self.export_gcode_label = FCLabel("%s:" % _("Export G-Code")) self.export_gcode_label.setToolTip( _("Export and save G-Code to\n" "make this object to a file.") @@ -49,7 +49,7 @@ class CNCJobOptPrefGroupUI(OptionsGroupUI): grid0.setColumnStretch(1, 1) # Plot Kind - self.cncplot_method_label = QtWidgets.QLabel('%s:' % _("Plot kind")) + self.cncplot_method_label = FCLabel('%s:' % _("Plot kind")) self.cncplot_method_label.setToolTip( _("This selects the kind of geometries on the canvas to plot.\n" "Those can be either of type 'Travel' which means the moves\n" @@ -65,7 +65,7 @@ class CNCJobOptPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.cncplot_method_label, 1, 0) grid0.addWidget(self.cncplot_method_radio, 1, 1) - grid0.addWidget(QtWidgets.QLabel(''), 1, 2) + grid0.addWidget(FCLabel(''), 1, 2) # Display Annotation self.annotation_cb = FCCheckBox(_("Display Annotation")) diff --git a/appGUI/preferences/excellon/ExcellonAdvOptPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonAdvOptPrefGroupUI.py index 440fd150..48b77176 100644 --- a/appGUI/preferences/excellon/ExcellonAdvOptPrefGroupUI.py +++ b/appGUI/preferences/excellon/ExcellonAdvOptPrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from appGUI.GUIElements import FCDoubleSpinner, RadioSet, FCCheckBox, NumericalEvalTupleEntry, NumericalEvalEntry +from appGUI.GUIElements import FCCheckBox, FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext import appTranslation as fcTranslate @@ -31,7 +31,7 @@ class ExcellonAdvOptPrefGroupUI(OptionsGroupUI): # ## ADVANCED OPTIONS ### # ####################### - self.exc_label = QtWidgets.QLabel('%s:' % _('Advanced Options')) + self.exc_label = FCLabel('%s:' % _('Advanced Options')) self.exc_label.setToolTip( _("A list of advanced parameters.\n" "Those parameters are available only for\n" diff --git a/appGUI/preferences/excellon/ExcellonEditorPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonEditorPrefGroupUI.py index 8b6a0f62..0ee7d0bf 100644 --- a/appGUI/preferences/excellon/ExcellonEditorPrefGroupUI.py +++ b/appGUI/preferences/excellon/ExcellonEditorPrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from appGUI.GUIElements import FCSpinner, FCDoubleSpinner, RadioSet +from appGUI.GUIElements import FCSpinner, FCDoubleSpinner, RadioSet, FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -27,7 +27,7 @@ class ExcellonEditorPrefGroupUI(OptionsGroupUI): self.decimals = decimals # Excellon Editor Parameters - self.param_label = QtWidgets.QLabel("%s:" % _("Parameters")) + self.param_label = FCLabel("%s:" % _("Parameters")) self.param_label.setToolTip( _("A list of Excellon Editor parameters.") ) @@ -37,7 +37,7 @@ class ExcellonEditorPrefGroupUI(OptionsGroupUI): self.layout.addLayout(grid0) # Selection Limit - self.sel_limit_label = QtWidgets.QLabel('%s:' % _("Selection limit")) + self.sel_limit_label = FCLabel('%s:' % _("Selection limit")) self.sel_limit_label.setToolTip( _("Set the number of selected Excellon geometry\n" "items above which the utility geometry\n" @@ -52,7 +52,7 @@ class ExcellonEditorPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.sel_limit_entry, 0, 1) # New Diameter - self.addtool_entry_lbl = QtWidgets.QLabel('%s:' % _('New Dia')) + self.addtool_entry_lbl = FCLabel('%s:' % _('New Dia')) self.addtool_entry_lbl.setToolTip( _("Diameter for the new tool") ) @@ -65,7 +65,7 @@ class ExcellonEditorPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.addtool_entry, 1, 1) # Number of drill holes in a drill array - self.drill_array_size_label = QtWidgets.QLabel('%s:' % _('Nr of drills')) + self.drill_array_size_label = FCLabel('%s:' % _('Nr of drills')) self.drill_array_size_label.setToolTip( _("Specify how many drills to be in the array.") ) @@ -77,11 +77,11 @@ class ExcellonEditorPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.drill_array_size_label, 2, 0) grid0.addWidget(self.drill_array_size_entry, 2, 1) - self.drill_array_linear_label = QtWidgets.QLabel('%s:' % _('Linear Drill Array')) + self.drill_array_linear_label = FCLabel('%s:' % _('Linear Drill Array')) grid0.addWidget(self.drill_array_linear_label, 3, 0, 1, 2) # Linear Drill Array direction - self.drill_axis_label = QtWidgets.QLabel('%s:' % _('Linear Direction')) + self.drill_axis_label = FCLabel('%s:' % _('Linear Direction')) self.drill_axis_label.setToolTip( _("Direction on which the linear array is oriented:\n" "- 'X' - horizontal axis \n" @@ -97,7 +97,7 @@ class ExcellonEditorPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.drill_axis_radio, 4, 1) # Linear Drill Array pitch distance - self.drill_pitch_label = QtWidgets.QLabel('%s:' % _('Pitch')) + self.drill_pitch_label = FCLabel('%s:' % _('Pitch')) self.drill_pitch_label.setToolTip( _("Pitch = Distance between elements of the array.") ) @@ -110,7 +110,7 @@ class ExcellonEditorPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.drill_pitch_entry, 5, 1) # Linear Drill Array custom angle - self.drill_angle_label = QtWidgets.QLabel('%s:' % _('Angle')) + self.drill_angle_label = FCLabel('%s:' % _('Angle')) self.drill_angle_label.setToolTip( _("Angle at which each element in circular array is placed.") ) @@ -123,11 +123,11 @@ class ExcellonEditorPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.drill_angle_label, 6, 0) grid0.addWidget(self.drill_angle_entry, 6, 1) - self.drill_array_circ_label = QtWidgets.QLabel('%s:' % _('Circular Drill Array')) + self.drill_array_circ_label = FCLabel('%s:' % _('Circular Drill Array')) grid0.addWidget(self.drill_array_circ_label, 7, 0, 1, 2) # Circular Drill Array direction - self.drill_circular_direction_label = QtWidgets.QLabel('%s:' % _('Circular Direction')) + self.drill_circular_direction_label = FCLabel('%s:' % _('Circular Direction')) self.drill_circular_direction_label.setToolTip( _("Direction for circular array.\n" "Can be CW = clockwise or CCW = counter clockwise.") @@ -140,7 +140,7 @@ class ExcellonEditorPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.drill_circular_dir_radio, 8, 1) # Circular Drill Array Angle - self.drill_circular_angle_label = QtWidgets.QLabel('%s:' % _('Circular Angle')) + self.drill_circular_angle_label = FCLabel('%s:' % _('Circular Angle')) self.drill_circular_angle_label.setToolTip( _("Angle at which each element in circular array is placed.") ) @@ -155,11 +155,11 @@ class ExcellonEditorPrefGroupUI(OptionsGroupUI): # ##### SLOTS ##### # ################# - self.drill_array_circ_label = QtWidgets.QLabel('%s:' % _('Slots')) + self.drill_array_circ_label = FCLabel('%s:' % _('Slots')) grid0.addWidget(self.drill_array_circ_label, 10, 0, 1, 2) # Slot length - self.slot_length_label = QtWidgets.QLabel('%s:' % _('Length')) + self.slot_length_label = FCLabel('%s:' % _('Length')) self.slot_length_label.setToolTip( _("Length. The length of the slot.") ) @@ -175,7 +175,7 @@ class ExcellonEditorPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.slot_length_entry, 11, 1) # Slot direction - self.slot_axis_label = QtWidgets.QLabel('%s:' % _('Direction')) + self.slot_axis_label = FCLabel('%s:' % _('Direction')) self.slot_axis_label.setToolTip( _("Direction on which the slot is oriented:\n" "- 'X' - horizontal axis \n" @@ -191,7 +191,7 @@ class ExcellonEditorPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.slot_axis_radio, 12, 1) # Slot custom angle - self.slot_angle_label = QtWidgets.QLabel('%s:' % _('Angle')) + self.slot_angle_label = FCLabel('%s:' % _('Angle')) self.slot_angle_label.setToolTip( _("Angle at which the slot is placed.\n" "The precision is of max 2 decimals.\n" @@ -212,11 +212,11 @@ class ExcellonEditorPrefGroupUI(OptionsGroupUI): # #### SLOTS ARRAY ####### # ######################## - self.slot_array_linear_label = QtWidgets.QLabel('%s:' % _('Linear Slot Array')) + self.slot_array_linear_label = FCLabel('%s:' % _('Linear Slot Array')) grid0.addWidget(self.slot_array_linear_label, 14, 0, 1, 2) # Number of slot holes in a drill array - self.slot_array_size_label = QtWidgets.QLabel('%s:' % _('Nr of slots')) + self.slot_array_size_label = FCLabel('%s:' % _('Nr of slots')) self.drill_array_size_label.setToolTip( _("Specify how many slots to be in the array.") ) @@ -229,7 +229,7 @@ class ExcellonEditorPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.slot_array_size_entry, 15, 1) # Linear Slot Array direction - self.slot_array_axis_label = QtWidgets.QLabel('%s:' % _('Linear Direction')) + self.slot_array_axis_label = FCLabel('%s:' % _('Linear Direction')) self.slot_array_axis_label.setToolTip( _("Direction on which the linear array is oriented:\n" "- 'X' - horizontal axis \n" @@ -245,7 +245,7 @@ class ExcellonEditorPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.slot_array_axis_radio, 16, 1) # Linear Slot Array pitch distance - self.slot_array_pitch_label = QtWidgets.QLabel('%s:' % _('Pitch')) + self.slot_array_pitch_label = FCLabel('%s:' % _('Pitch')) self.slot_array_pitch_label.setToolTip( _("Pitch = Distance between elements of the array.") ) @@ -260,7 +260,7 @@ class ExcellonEditorPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.slot_array_pitch_entry, 17, 1) # Linear Slot Array custom angle - self.slot_array_angle_label = QtWidgets.QLabel('%s:' % _('Angle')) + self.slot_array_angle_label = FCLabel('%s:' % _('Angle')) self.slot_array_angle_label.setToolTip( _("Angle at which each element in circular array is placed.") ) @@ -273,11 +273,11 @@ class ExcellonEditorPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.slot_array_angle_label, 18, 0) grid0.addWidget(self.slot_array_angle_entry, 18, 1) - self.slot_array_circ_label = QtWidgets.QLabel('%s:' % _('Circular Slot Array')) + self.slot_array_circ_label = FCLabel('%s:' % _('Circular Slot Array')) grid0.addWidget(self.slot_array_circ_label, 19, 0, 1, 2) # Circular Slot Array direction - self.slot_array_circular_direction_label = QtWidgets.QLabel('%s:' % _('Circular Direction')) + self.slot_array_circular_direction_label = FCLabel('%s:' % _('Circular Direction')) self.slot_array_circular_direction_label.setToolTip( _("Direction for circular array.\n" "Can be CW = clockwise or CCW = counter clockwise.") @@ -290,7 +290,7 @@ class ExcellonEditorPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.slot_array_circular_dir_radio, 20, 1) # Circular Slot Array Angle - self.slot_array_circular_angle_label = QtWidgets.QLabel('%s:' % _('Circular Angle')) + self.slot_array_circular_angle_label = FCLabel('%s:' % _('Circular Angle')) self.slot_array_circular_angle_label.setToolTip( _("Angle at which each element in circular array is placed.") ) diff --git a/appGUI/preferences/excellon/ExcellonExpPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonExpPrefGroupUI.py index c2cbe54d..38a44159 100644 --- a/appGUI/preferences/excellon/ExcellonExpPrefGroupUI.py +++ b/appGUI/preferences/excellon/ExcellonExpPrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt5 import QtWidgets, QtCore from PyQt5.QtCore import QSettings -from appGUI.GUIElements import RadioSet, FCSpinner +from appGUI.GUIElements import RadioSet, FCSpinner, FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext import appTranslation as fcTranslate @@ -27,7 +27,7 @@ class ExcellonExpPrefGroupUI(OptionsGroupUI): self.decimals = decimals # Plot options - self.export_options_label = QtWidgets.QLabel("%s:" % _("Export Options")) + self.export_options_label = FCLabel("%s:" % _("Export Options")) self.export_options_label.setToolTip( _("The parameters set here are used in the file exported\n" "when using the File -> Export -> Export Excellon menu entry.") @@ -38,7 +38,7 @@ class ExcellonExpPrefGroupUI(OptionsGroupUI): self.layout.addLayout(form) # Excellon Units - self.excellon_units_label = QtWidgets.QLabel('%s:' % _('Units')) + self.excellon_units_label = FCLabel('%s:' % _('Units')) self.excellon_units_label.setToolTip( _("The units used in the Excellon file.") ) @@ -52,7 +52,7 @@ class ExcellonExpPrefGroupUI(OptionsGroupUI): form.addRow(self.excellon_units_label, self.excellon_units_radio) # Excellon non-decimal format - self.digits_label = QtWidgets.QLabel("%s:" % _("Int/Decimals")) + self.digits_label = FCLabel("%s:" % _("Int/Decimals")) self.digits_label.setToolTip( _("The NC drill files, usually named Excellon files\n" "are files that can be found in different formats.\n" @@ -71,7 +71,7 @@ class ExcellonExpPrefGroupUI(OptionsGroupUI): ) hlay1.addWidget(self.format_whole_entry, QtCore.Qt.AlignLeft) - excellon_separator_label = QtWidgets.QLabel(':') + excellon_separator_label = FCLabel(':') excellon_separator_label.setFixedWidth(5) hlay1.addWidget(excellon_separator_label, QtCore.Qt.AlignLeft) @@ -88,7 +88,7 @@ class ExcellonExpPrefGroupUI(OptionsGroupUI): form.addRow(self.digits_label, hlay1) # Select the Excellon Format - self.format_label = QtWidgets.QLabel("%s:" % _("Format")) + self.format_label = FCLabel("%s:" % _("Format")) self.format_label.setToolTip( _("Select the kind of coordinates format used.\n" "Coordinates can be saved with decimal point or without.\n" @@ -111,7 +111,7 @@ class ExcellonExpPrefGroupUI(OptionsGroupUI): form.addRow(self.format_label, self.format_radio) # Excellon Zeros - self.zeros_label = QtWidgets.QLabel('%s:' % _('Zeros')) + self.zeros_label = FCLabel('%s:' % _('Zeros')) self.zeros_label.setAlignment(QtCore.Qt.AlignLeft) self.zeros_label.setToolTip( _("This sets the type of Excellon zeros.\n" @@ -134,7 +134,7 @@ class ExcellonExpPrefGroupUI(OptionsGroupUI): form.addRow(self.zeros_label, self.zeros_radio) # Slot type - self.slot_type_label = QtWidgets.QLabel('%s:' % _('Slot type')) + self.slot_type_label = FCLabel('%s:' % _('Slot type')) self.slot_type_label.setAlignment(QtCore.Qt.AlignLeft) self.slot_type_label.setToolTip( _("This sets how the slots will be exported.\n" diff --git a/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py index 10710cc5..f6eb9a93 100644 --- a/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py +++ b/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py @@ -3,7 +3,7 @@ import platform from PyQt5 import QtWidgets, QtCore from PyQt5.QtCore import QSettings -from appGUI.GUIElements import FCCheckBox, FCSpinner, RadioSet, FCSliderWithSpinner, FCColorEntry +from appGUI.GUIElements import FCCheckBox, FCSpinner, RadioSet, FCSliderWithSpinner, FCColorEntry, FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext import appTranslation as fcTranslate @@ -30,7 +30,7 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI): self.decimals = decimals # Plot options - self.plot_options_label = QtWidgets.QLabel("%s:" % _("Plot Options")) + self.plot_options_label = FCLabel("%s:" % _("Plot Options")) self.layout.addWidget(self.plot_options_label) grid1 = QtWidgets.QGridLayout() @@ -68,7 +68,7 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI): grid2.setColumnStretch(1, 1) # Excellon format - self.excellon_format_label = QtWidgets.QLabel("%s:" % _("Excellon Format")) + self.excellon_format_label = FCLabel("%s:" % _("Excellon Format")) self.excellon_format_label.setToolTip( _("The NC drill files, usually named Excellon files\n" "are files that can be found in different formats.\n" @@ -93,7 +93,7 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI): ) grid2.addWidget(self.excellon_format_label, 0, 0, 1, 2) - self.excellon_format_in_label = QtWidgets.QLabel('%s:' % _("INCH")) + self.excellon_format_in_label = FCLabel('%s:' % _("INCH")) self.excellon_format_in_label.setToolTip(_("Default values for INCH are 2:4")) hlay1 = QtWidgets.QHBoxLayout() @@ -106,7 +106,7 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI): ) hlay1.addWidget(self.excellon_format_upper_in_entry) - excellon_separator_in_label = QtWidgets.QLabel(':') + excellon_separator_in_label = FCLabel(':') excellon_separator_in_label.setFixedWidth(5) hlay1.addWidget(excellon_separator_in_label) @@ -122,7 +122,7 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI): grid2.addWidget(self.excellon_format_in_label, 1, 0) grid2.addLayout(hlay1, 1, 1) - self.excellon_format_mm_label = QtWidgets.QLabel('%s:' % _("METRIC")) + self.excellon_format_mm_label = FCLabel('%s:' % _("METRIC")) self.excellon_format_mm_label.setToolTip(_("Default values for METRIC are 3:3")) hlay2 = QtWidgets.QHBoxLayout() @@ -135,7 +135,7 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI): ) hlay2.addWidget(self.excellon_format_upper_mm_entry) - excellon_separator_mm_label = QtWidgets.QLabel(':') + excellon_separator_mm_label = FCLabel(':') excellon_separator_mm_label.setFixedWidth(5) hlay2.addWidget(excellon_separator_mm_label, QtCore.Qt.AlignLeft) @@ -151,7 +151,7 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI): grid2.addWidget(self.excellon_format_mm_label, 2, 0) grid2.addLayout(hlay2, 2, 1) - self.excellon_zeros_label = QtWidgets.QLabel('%s:' % _('Zeros')) + self.excellon_zeros_label = FCLabel('%s:' % _('Zeros')) self.excellon_zeros_label.setAlignment(QtCore.Qt.AlignLeft) self.excellon_zeros_label.setToolTip( _("This sets the type of Excellon zeros.\n" @@ -169,7 +169,7 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI): grid2.addWidget(self.excellon_zeros_radio, 3, 1) - self.excellon_units_label = QtWidgets.QLabel('%s:' % _('Units')) + self.excellon_units_label = FCLabel('%s:' % _('Units')) self.excellon_units_label.setAlignment(QtCore.Qt.AlignLeft) self.excellon_units_label.setToolTip( _("This sets the default units of Excellon files.\n" @@ -207,10 +207,10 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI): separator_line.setFrameShadow(QtWidgets.QFrame.Sunken) grid2.addWidget(separator_line, 7, 0, 1, 2) - self.excellon_general_label = QtWidgets.QLabel("%s:" % _("Path Optimization")) + self.excellon_general_label = FCLabel("%s:" % _("Path Optimization")) grid2.addWidget(self.excellon_general_label, 8, 0, 1, 2) - self.excellon_optimization_label = QtWidgets.QLabel(_('Algorithm:')) + self.excellon_optimization_label = FCLabel(_('Algorithm:')) self.excellon_optimization_label.setToolTip( _("This sets the optimization type for the Excellon drill path.\n" "If <> is checked then Google OR-Tools algorithm with\n" @@ -230,7 +230,7 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI): grid2.addWidget(self.excellon_optimization_label, 9, 0) grid2.addWidget(self.excellon_optimization_radio, 9, 1) - self.optimization_time_label = QtWidgets.QLabel('%s:' % _('Duration')) + self.optimization_time_label = FCLabel('%s:' % _('Duration')) self.optimization_time_label.setAlignment(QtCore.Qt.AlignLeft) self.optimization_time_label.setToolTip( _("When OR-Tools Metaheuristic (MH) is enabled there is a\n" @@ -252,7 +252,7 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI): grid2.addWidget(separator_line, 11, 0, 1, 2) # Fuse Tools - self.join_geo_label = QtWidgets.QLabel('%s:' % _('Join Option')) + self.join_geo_label = FCLabel('%s:' % _('Join Option')) grid2.addWidget(self.join_geo_label, 12, 0, 1, 2) self.fuse_tools_cb = FCCheckBox(_("Fuse Tools")) @@ -268,11 +268,11 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI): grid2.addWidget(separator_line, 14, 0, 1, 2) # Excellon Object Color - self.gerber_color_label = QtWidgets.QLabel('%s' % _('Object Color')) + self.gerber_color_label = FCLabel('%s' % _('Object Color')) grid2.addWidget(self.gerber_color_label, 17, 0, 1, 2) # Plot Line Color - self.line_color_label = QtWidgets.QLabel('%s:' % _('Outline')) + self.line_color_label = FCLabel('%s:' % _('Outline')) self.line_color_label.setToolTip( _("Set the line color for plotted objects.") ) @@ -282,7 +282,7 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI): grid2.addWidget(self.line_color_entry, 19, 1) # Plot Fill Color - self.fill_color_label = QtWidgets.QLabel('%s:' % _('Fill')) + self.fill_color_label = FCLabel('%s:' % _('Fill')) self.fill_color_label.setToolTip( _("Set the fill color for plotted objects.\n" "First 6 digits are the color and the last 2\n" @@ -294,7 +294,7 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI): grid2.addWidget(self.fill_color_entry, 22, 1) # Plot Fill Transparency Level - self.excellon_alpha_label = QtWidgets.QLabel('%s:' % _('Alpha')) + self.excellon_alpha_label = FCLabel('%s:' % _('Alpha')) self.excellon_alpha_label.setToolTip( _("Set the fill transparency for plotted objects.") ) diff --git a/appGUI/preferences/excellon/ExcellonOptPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonOptPrefGroupUI.py index 7d9e7b14..68ab9907 100644 --- a/appGUI/preferences/excellon/ExcellonOptPrefGroupUI.py +++ b/appGUI/preferences/excellon/ExcellonOptPrefGroupUI.py @@ -1,9 +1,8 @@ from PyQt5 import QtWidgets -from PyQt5.QtCore import Qt, QSettings +from PyQt5.QtCore import QSettings -from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCCheckBox, FCEntry, FCSpinner, OptionalInputSection, \ - FCComboBox, NumericalEvalTupleEntry -from appGUI.preferences import machinist_setting +from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCLabel +# from appGUI.preferences import machinist_setting from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext import appTranslation as fcTranslate @@ -30,7 +29,7 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI): self.decimals = decimals # ## Create CNC Job - self.cncjob_label = QtWidgets.QLabel('%s' % _('Create CNCJob')) + self.cncjob_label = FCLabel('%s' % _('Create CNCJob')) self.cncjob_label.setToolTip( _("Parameters used to create a CNC Job object\n" "for this drill object.") @@ -43,7 +42,7 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI): grid2.setColumnStretch(1, 1) # Operation Type - self.operation_label = QtWidgets.QLabel('%s:' % _('Operation')) + self.operation_label = FCLabel('%s:' % _('Operation')) self.operation_label.setToolTip( _("Operation type:\n" "- Drilling -> will drill the drills/slots associated with this tool\n" @@ -59,7 +58,7 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI): grid2.addWidget(self.operation_label, 0, 0) grid2.addWidget(self.operation_radio, 0, 1) - self.mill_type_label = QtWidgets.QLabel('%s:' % _('Milling Type')) + self.mill_type_label = FCLabel('%s:' % _('Milling Type')) self.mill_type_label.setToolTip( _("Milling type:\n" "- Drills -> will mill the drills associated with this tool\n" @@ -77,7 +76,7 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI): grid2.addWidget(self.mill_type_label, 1, 0) grid2.addWidget(self.milling_type_radio, 1, 1) - self.mill_dia_label = QtWidgets.QLabel('%s:' % _('Milling Diameter')) + self.mill_dia_label = FCLabel('%s:' % _('Milling Diameter')) self.mill_dia_label.setToolTip( _("The diameter of the tool who will do the milling") ) @@ -90,13 +89,13 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI): grid2.addWidget(self.mill_dia_entry, 2, 1) # ### Milling Holes ## ## - self.mill_hole_label = QtWidgets.QLabel('%s' % _('Mill Holes')) + self.mill_hole_label = FCLabel('%s' % _('Mill Holes')) self.mill_hole_label.setToolTip( _("Create Geometry for milling holes.") ) grid2.addWidget(self.mill_hole_label, 16, 0, 1, 2) - tdlabel = QtWidgets.QLabel('%s:' % _('Drill Tool dia')) + tdlabel = FCLabel('%s:' % _('Drill Tool dia')) tdlabel.setToolTip( _("Diameter of the cutting tool.") ) @@ -107,7 +106,7 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI): grid2.addWidget(tdlabel, 18, 0) grid2.addWidget(self.tooldia_entry, 18, 1) - stdlabel = QtWidgets.QLabel('%s:' % _('Slot Tool dia')) + stdlabel = FCLabel('%s:' % _('Slot Tool dia')) stdlabel.setToolTip( _("Diameter of the cutting tool\n" "when milling slots.") diff --git a/appGUI/preferences/general/GeneralAPPSetGroupUI.py b/appGUI/preferences/general/GeneralAPPSetGroupUI.py index fc485b2b..bdc1dbd6 100644 --- a/appGUI/preferences/general/GeneralAPPSetGroupUI.py +++ b/appGUI/preferences/general/GeneralAPPSetGroupUI.py @@ -2,7 +2,7 @@ from PyQt5 import QtCore, QtWidgets from PyQt5.QtCore import QSettings from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, FCComboBox, RadioSet, OptionalInputSection, FCSpinner, \ - FCColorEntry + FCColorEntry, FCLabel from appGUI.preferences import settings from appGUI.preferences.OptionsGroupUI import OptionsGroupUI @@ -46,11 +46,11 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): grid0.setColumnStretch(1, 1) # GRID Settings - self.grid_label = QtWidgets.QLabel('%s' % _('Grid Settings')) + self.grid_label = FCLabel('%s' % _('Grid Settings')) grid0.addWidget(self.grid_label, 0, 0, 1, 2) # Grid X Entry - self.gridx_label = QtWidgets.QLabel('%s:' % _('X value')) + self.gridx_label = FCLabel('%s:' % _('X value')) self.gridx_label.setToolTip( _("This is the Grid snap value on X axis.") ) @@ -62,7 +62,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): grid0.addWidget(self.gridx_entry, 1, 1) # Grid Y Entry - self.gridy_label = QtWidgets.QLabel('%s:' % _('Y value')) + self.gridy_label = FCLabel('%s:' % _('Y value')) self.gridy_label.setToolTip( _("This is the Grid snap value on Y axis.") ) @@ -74,7 +74,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): grid0.addWidget(self.gridy_entry, 2, 1) # Snap Max Entry - self.snap_max_label = QtWidgets.QLabel('%s:' % _('Snap Max')) + self.snap_max_label = FCLabel('%s:' % _('Snap Max')) self.snap_max_label.setToolTip(_("Max. magnet distance")) self.snap_max_dist_entry = FCDoubleSpinner() self.snap_max_dist_entry.set_precision(self.decimals) @@ -89,7 +89,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): grid0.addWidget(separator_line, 4, 0, 1, 2) # Workspace - self.workspace_label = QtWidgets.QLabel('%s' % _('Workspace Settings')) + self.workspace_label = FCLabel('%s' % _('Workspace Settings')) grid0.addWidget(self.workspace_label, 5, 0, 1, 2) self.workspace_cb = FCCheckBox('%s' % _('Active')) @@ -100,7 +100,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): grid0.addWidget(self.workspace_cb, 6, 0, 1, 2) - self.workspace_type_lbl = QtWidgets.QLabel('%s:' % _('Size')) + self.workspace_type_lbl = FCLabel('%s:' % _('Size')) self.workspace_type_lbl.setToolTip( _("Select the type of rectangle to be used on canvas,\n" "as valid workspace.") @@ -168,7 +168,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): self.wk_cb.addItems(page_size_list) # Page orientation - self.wk_orientation_label = QtWidgets.QLabel('%s:' % _("Orientation")) + self.wk_orientation_label = FCLabel('%s:' % _("Orientation")) self.wk_orientation_label.setToolTip(_("Can be:\n" "- Portrait\n" "- Landscape")) @@ -186,11 +186,11 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): grid0.addWidget(separator_line, 9, 0, 1, 2) # Font Size - self.font_size_label = QtWidgets.QLabel('%s' % _('Font Size')) + self.font_size_label = FCLabel('%s' % _('Font Size')) grid0.addWidget(self.font_size_label, 10, 0, 1, 2) # Notebook Font Size - self.notebook_font_size_label = QtWidgets.QLabel('%s:' % _('Notebook')) + self.notebook_font_size_label = FCLabel('%s:' % _('Notebook')) self.notebook_font_size_label.setToolTip( _("This sets the font size for the elements found in the Notebook.\n" "The notebook is the collapsible area in the left side of the GUI,\n" @@ -211,7 +211,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): grid0.addWidget(self.notebook_font_size_spinner, 11, 1) # Axis Font Size - self.axis_font_size_label = QtWidgets.QLabel('%s:' % _('Axis')) + self.axis_font_size_label = FCLabel('%s:' % _('Axis')) self.axis_font_size_label.setToolTip( _("This sets the font size for canvas axis.") ) @@ -230,7 +230,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): grid0.addWidget(self.axis_font_size_spinner, 12, 1) # TextBox Font Size - self.textbox_font_size_label = QtWidgets.QLabel('%s:' % _('Textbox')) + self.textbox_font_size_label = FCLabel('%s:' % _('Textbox')) self.textbox_font_size_label.setToolTip( _("This sets the font size for the Textbox GUI\n" "elements that are used in the application.") @@ -250,7 +250,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): grid0.addWidget(self.textbox_font_size_spinner, 13, 1) # HUD Font Size - self.hud_font_size_label = QtWidgets.QLabel('%s:' % _('HUD')) + self.hud_font_size_label = FCLabel('%s:' % _('HUD')) self.hud_font_size_label.setToolTip( _("This sets the font size for the Heads Up Display.") ) @@ -277,11 +277,11 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): # -------------- MOUSE SETTINGS ----------------------------- # ----------------------------------------------------------- - self.mouse_lbl = QtWidgets.QLabel('%s' % _('Mouse Settings')) + self.mouse_lbl = FCLabel('%s' % _('Mouse Settings')) grid0.addWidget(self.mouse_lbl, 21, 0, 1, 2) # Mouse Cursor Shape - self.cursor_lbl = QtWidgets.QLabel('%s:' % _('Cursor Shape')) + self.cursor_lbl = FCLabel('%s:' % _('Cursor Shape')) self.cursor_lbl.setToolTip( _("Choose a mouse cursor shape.\n" "- Small -> with a customizable size.\n" @@ -297,7 +297,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): grid0.addWidget(self.cursor_radio, 22, 1) # Mouse Cursor Size - self.cursor_size_lbl = QtWidgets.QLabel('%s:' % _('Cursor Size')) + self.cursor_size_lbl = FCLabel('%s:' % _('Cursor Size')) self.cursor_size_lbl.setToolTip( _("Set the size of the mouse cursor, in pixels.") ) @@ -310,7 +310,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): grid0.addWidget(self.cursor_size_entry, 23, 1) # Cursor Width - self.cursor_width_lbl = QtWidgets.QLabel('%s:' % _('Cursor Width')) + self.cursor_width_lbl = FCLabel('%s:' % _('Cursor Width')) self.cursor_width_lbl.setToolTip( _("Set the line width of the mouse cursor, in pixels.") ) @@ -330,7 +330,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): grid0.addWidget(self.mouse_cursor_color_cb, 25, 0, 1, 2) # Cursor Color - self.mouse_color_label = QtWidgets.QLabel('%s:' % _('Cursor Color')) + self.mouse_color_label = FCLabel('%s:' % _('Cursor Color')) self.mouse_color_label.setToolTip( _("Set the color of the mouse cursor.") ) @@ -347,7 +347,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): ] ) # Select mouse pan button - self.panbuttonlabel = QtWidgets.QLabel('%s:' % _('Pan Button')) + self.panbuttonlabel = FCLabel('%s:' % _('Pan Button')) self.panbuttonlabel.setToolTip( _("Select the mouse button to use for panning:\n" "- MMB --> Middle Mouse Button\n" @@ -360,7 +360,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): grid0.addWidget(self.pan_button_radio, 27, 1) # Multiple Selection Modifier Key - self.mselectlabel = QtWidgets.QLabel('%s:' % _('Multiple Selection')) + self.mselectlabel = FCLabel('%s:' % _('Multiple Selection')) self.mselectlabel.setToolTip( _("Select the key used for multiple selection.") ) @@ -426,7 +426,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): # Bookmarks Limit in the Help Menu self.bm_limit_spinner = FCSpinner() self.bm_limit_spinner.set_range(0, 9999) - self.bm_limit_label = QtWidgets.QLabel('%s:' % _('Bookmarks limit')) + self.bm_limit_label = FCLabel('%s:' % _('Bookmarks limit')) self.bm_limit_label.setToolTip( _("The maximum number of bookmarks that may be installed in the menu.\n" "The number of bookmarks in the bookmark manager may be greater\n" @@ -437,7 +437,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): grid0.addWidget(self.bm_limit_spinner, 35, 1) # Activity monitor icon - self.activity_label = QtWidgets.QLabel('%s:' % _("Activity Icon")) + self.activity_label = FCLabel('%s:' % _("Activity Icon")) self.activity_label.setToolTip( _("Select the GIF that show activity when FlatCAM is active.") ) diff --git a/appGUI/preferences/general/GeneralAppPrefGroupUI.py b/appGUI/preferences/general/GeneralAppPrefGroupUI.py index c5b54976..eeb78728 100644 --- a/appGUI/preferences/general/GeneralAppPrefGroupUI.py +++ b/appGUI/preferences/general/GeneralAppPrefGroupUI.py @@ -4,7 +4,7 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings from appGUI.GUIElements import RadioSet, FCSpinner, FCCheckBox, FCComboBox, FCButton, OptionalInputSection, \ - FCDoubleSpinner + FCDoubleSpinner, FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -36,7 +36,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): grid0.setColumnStretch(1, 1) # Units for FlatCAM - self.unitslabel = QtWidgets.QLabel('%s:' % _('Units')) + self.unitslabel = FCLabel('%s:' % _('Units')) self.unitslabel.setToolTip(_("The default value for FlatCAM units.\n" "Whatever is selected here is set every time\n" "FlatCAM is started.")) @@ -47,7 +47,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.units_radio, 0, 1) # Precision Metric - self.precision_metric_label = QtWidgets.QLabel('%s:' % _('Precision MM')) + self.precision_metric_label = FCLabel('%s:' % _('Precision MM')) self.precision_metric_label.setToolTip( _("The number of decimals used throughout the application\n" "when the set units are in METRIC system.\n" @@ -61,7 +61,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.precision_metric_entry, 1, 1) # Precision Inch - self.precision_inch_label = QtWidgets.QLabel('%s:' % _('Precision Inch')) + self.precision_inch_label = FCLabel('%s:' % _('Precision Inch')) self.precision_inch_label.setToolTip( _("The number of decimals used throughout the application\n" "when the set units are in INCH system.\n" @@ -75,7 +75,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.precision_inch_entry, 2, 1) # Graphic Engine for FlatCAM - self.ge_label = QtWidgets.QLabel('%s:' % _('Graphic Engine')) + self.ge_label = FCLabel('%s:' % _('Graphic Engine')) self.ge_label.setToolTip(_("Choose what graphic engine to use in FlatCAM.\n" "Legacy(2D) -> reduced functionality, slow performance but enhanced compatibility.\n" "OpenGL(3D) -> full functionality, high performance\n" @@ -95,7 +95,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): grid0.addWidget(separator_line, 4, 0, 1, 2) # Application Level for FlatCAM - self.app_level_label = QtWidgets.QLabel('%s:' % _('APPLICATION LEVEL')) + self.app_level_label = FCLabel('%s:' % _('APPLICATION LEVEL')) self.app_level_label.setToolTip(_("Choose the default level of usage for FlatCAM.\n" "BASIC level -> reduced functionality, best for beginner's.\n" "ADVANCED level -> full functionality.\n\n" @@ -122,7 +122,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): grid0.addWidget(separator_line, 8, 0, 1, 2) # Languages for FlatCAM - self.languagelabel = QtWidgets.QLabel('%s' % _('Languages')) + self.languagelabel = FCLabel('%s' % _('Languages')) self.languagelabel.setToolTip(_("Set the language used throughout FlatCAM.")) self.language_cb = FCComboBox() @@ -144,7 +144,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): # ----------- APPLICATION STARTUP SETTINGS ------------------ # ----------------------------------------------------------- - self.startup_label = QtWidgets.QLabel('%s' % _('Startup Settings')) + self.startup_label = FCLabel('%s' % _('Startup Settings')) grid0.addWidget(self.startup_label, 17, 0, 1, 2) # Splash Screen @@ -211,7 +211,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): grid0.addWidget(separator_line, 24, 0, 1, 2) # Worker Numbers - self.worker_number_label = QtWidgets.QLabel('%s:' % _('Workers number')) + self.worker_number_label = FCLabel('%s:' % _('Workers number')) self.worker_number_label.setToolTip( _("The number of Qthreads made available to the App.\n" "A bigger number may finish the jobs more quickly but\n" @@ -227,7 +227,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.worker_number_sb, 25, 1) # Geometric tolerance - tol_label = QtWidgets.QLabel('%s:' % _("Geo Tolerance")) + tol_label = FCLabel('%s:' % _("Geo Tolerance")) tol_label.setToolTip(_( "This value can counter the effect of the Circle Steps\n" "parameter. Default value is 0.005.\n" @@ -249,7 +249,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): grid0.addWidget(separator_line, 27, 0, 1, 2) # Save Settings - self.save_label = QtWidgets.QLabel('%s' % _("Save Settings")) + self.save_label = FCLabel('%s' % _("Save Settings")) grid0.addWidget(self.save_label, 28, 0, 1, 2) # Save compressed project CB @@ -264,7 +264,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): # Project LZMA Comppression Level self.compress_spinner = FCSpinner() self.compress_spinner.set_range(0, 9) - self.compress_label = QtWidgets.QLabel('%s:' % _('Compression')) + self.compress_label = FCLabel('%s:' % _('Compression')) self.compress_label.setToolTip( _("The level of compression used when saving\n" "a FlatCAM project. Higher value means better compression\n" @@ -289,7 +289,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): # Auto Save Timeout Interval self.autosave_entry = FCSpinner() self.autosave_entry.set_range(0, 9999999) - self.autosave_label = QtWidgets.QLabel('%s:' % _('Interval')) + self.autosave_label = FCLabel('%s:' % _('Interval')) self.autosave_label.setToolTip( _("Time interval for autosaving. In milliseconds.\n" "The application will try to save periodically but only\n" @@ -307,7 +307,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): separator_line.setFrameShadow(QtWidgets.QFrame.Sunken) grid0.addWidget(separator_line, 33, 0, 1, 2) - self.pdf_param_label = QtWidgets.QLabel('%s:' % _("Text to PDF parameters")) + self.pdf_param_label = FCLabel('%s:' % _("Text to PDF parameters")) self.pdf_param_label.setToolTip( _("Used when saving text in Code Editor or in FlatCAM Document objects.") ) @@ -318,7 +318,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): self.tmargin_entry.set_precision(self.decimals) self.tmargin_entry.set_range(0.0000, 10000.0000) - self.tmargin_label = QtWidgets.QLabel('%s:' % _("Top Margin")) + self.tmargin_label = FCLabel('%s:' % _("Top Margin")) self.tmargin_label.setToolTip( _("Distance between text body and the top of the PDF file.") ) @@ -331,7 +331,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): self.bmargin_entry.set_precision(self.decimals) self.bmargin_entry.set_range(0.0000, 10000.0000) - self.bmargin_label = QtWidgets.QLabel('%s:' % _("Bottom Margin")) + self.bmargin_label = FCLabel('%s:' % _("Bottom Margin")) self.bmargin_label.setToolTip( _("Distance between text body and the bottom of the PDF file.") ) @@ -344,7 +344,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): self.lmargin_entry.set_precision(self.decimals) self.lmargin_entry.set_range(0.0000, 10000.0000) - self.lmargin_label = QtWidgets.QLabel('%s:' % _("Left Margin")) + self.lmargin_label = FCLabel('%s:' % _("Left Margin")) self.lmargin_label.setToolTip( _("Distance between text body and the left of the PDF file.") ) @@ -357,7 +357,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): self.rmargin_entry.set_precision(self.decimals) self.rmargin_entry.set_range(0.0000, 10000.0000) - self.rmargin_label = QtWidgets.QLabel('%s:' % _("Right Margin")) + self.rmargin_label = FCLabel('%s:' % _("Right Margin")) self.rmargin_label.setToolTip( _("Distance between text body and the right of the PDF file.") ) diff --git a/appGUI/preferences/general/GeneralAppSettingsGroupUI.py b/appGUI/preferences/general/GeneralAppSettingsGroupUI.py index c2e4aab4..51f10faa 100644 --- a/appGUI/preferences/general/GeneralAppSettingsGroupUI.py +++ b/appGUI/preferences/general/GeneralAppSettingsGroupUI.py @@ -1,6 +1,4 @@ - from PyQt5 import QtCore -from PyQt5.QtCore import QSettings from appGUI.GUIElements import OptionalInputSection from appGUI.preferences import settings from appGUI.preferences.OptionUI import * diff --git a/appGUI/preferences/general/GeneralGUIPrefGroupUI.py b/appGUI/preferences/general/GeneralGUIPrefGroupUI.py index 524ce314..f527a458 100644 --- a/appGUI/preferences/general/GeneralGUIPrefGroupUI.py +++ b/appGUI/preferences/general/GeneralGUIPrefGroupUI.py @@ -1,7 +1,7 @@ -from PyQt5 import QtWidgets, QtCore, QtGui -from PyQt5.QtCore import QSettings, Qt +from PyQt5 import QtWidgets, QtCore +from PyQt5.QtCore import QSettings -from appGUI.GUIElements import RadioSet, FCCheckBox, FCComboBox, FCSliderWithSpinner, FCColorEntry +from appGUI.GUIElements import RadioSet, FCCheckBox, FCComboBox, FCSliderWithSpinner, FCColorEntry, FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -33,7 +33,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): grid0.setColumnStretch(1, 1) # Theme selection - self.theme_label = QtWidgets.QLabel('%s:' % _('Theme')) + self.theme_label = FCLabel('%s:' % _('Theme')) self.theme_label.setToolTip( _("Select a theme for the application.\n" "It will theme the plot area.") @@ -70,7 +70,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): grid0.addWidget(separator_line, 3, 0, 1, 2) # Layout selection - self.layout_label = QtWidgets.QLabel('%s:' % _('Layout')) + self.layout_label = FCLabel('%s:' % _('Layout')) self.layout_label.setToolTip( _("Select a layout for the application.\n" "It is applied immediately.") @@ -92,7 +92,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): self.layout_combo.setCurrentIndex(idx) # Style selection - self.style_label = QtWidgets.QLabel('%s:' % _('Style')) + self.style_label = FCLabel('%s:' % _('Style')) self.style_label.setToolTip( _("Select a style for the application.\n" "It will be applied at the next app start.") @@ -148,10 +148,10 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): grid0.addWidget(separator_line, 14, 0, 1, 2) # Plot Selection (left - right) Color - self.sel_lr_label = QtWidgets.QLabel('%s' % _('Left-Right Selection Color')) + self.sel_lr_label = FCLabel('%s' % _('Left-Right Selection Color')) grid0.addWidget(self.sel_lr_label, 15, 0, 1, 2) - self.sl_color_label = QtWidgets.QLabel('%s:' % _('Outline')) + self.sl_color_label = FCLabel('%s:' % _('Outline')) self.sl_color_label.setToolTip( _("Set the line color for the 'left to right' selection box.") ) @@ -160,7 +160,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.sl_color_label, 16, 0) grid0.addWidget(self.sl_color_entry, 16, 1) - self.sf_color_label = QtWidgets.QLabel('%s:' % _('Fill')) + self.sf_color_label = FCLabel('%s:' % _('Fill')) self.sf_color_label.setToolTip( _("Set the fill color for the selection box\n" "in case that the selection is done from left to right.\n" @@ -173,7 +173,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.sf_color_entry, 17, 1) # Plot Selection (left - right) Fill Transparency Level - self.left_right_alpha_label = QtWidgets.QLabel('%s:' % _('Alpha')) + self.left_right_alpha_label = FCLabel('%s:' % _('Alpha')) self.left_right_alpha_label.setToolTip( _("Set the fill transparency for the 'left to right' selection box.") ) @@ -188,11 +188,11 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): grid0.addWidget(separator_line, 19, 0, 1, 2) # Plot Selection (left - right) Color - self.sel_rl_label = QtWidgets.QLabel('%s' % _('Right-Left Selection Color')) + self.sel_rl_label = FCLabel('%s' % _('Right-Left Selection Color')) grid0.addWidget(self.sel_rl_label, 20, 0, 1, 2) # Plot Selection (right - left) Line Color - self.alt_sl_color_label = QtWidgets.QLabel('%s:' % _('Outline')) + self.alt_sl_color_label = FCLabel('%s:' % _('Outline')) self.alt_sl_color_label.setToolTip( _("Set the line color for the 'right to left' selection box.") ) @@ -202,7 +202,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.alt_sl_color_entry, 21, 1) # Plot Selection (right - left) Fill Color - self.alt_sf_color_label = QtWidgets.QLabel('%s:' % _('Fill')) + self.alt_sf_color_label = FCLabel('%s:' % _('Fill')) self.alt_sf_color_label.setToolTip( _("Set the fill color for the selection box\n" "in case that the selection is done from right to left.\n" @@ -215,7 +215,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.alt_sf_color_entry, 22, 1) # Plot Selection (right - left) Fill Transparency Level - self.right_left_alpha_label = QtWidgets.QLabel('%s:' % _('Alpha')) + self.right_left_alpha_label = FCLabel('%s:' % _('Alpha')) self.right_left_alpha_label.setToolTip( _("Set the fill transparency for selection 'right to left' box.") ) @@ -233,11 +233,11 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): # ----------------------- Editor Color ----------------------------- # ------------------------------------------------------------------ - self.editor_color_label = QtWidgets.QLabel('%s' % _('Editor Color')) + self.editor_color_label = FCLabel('%s' % _('Editor Color')) grid0.addWidget(self.editor_color_label, 25, 0, 1, 2) # Editor Draw Color - self.draw_color_label = QtWidgets.QLabel('%s:' % _('Drawing')) + self.draw_color_label = FCLabel('%s:' % _('Drawing')) self.alt_sf_color_label.setToolTip( _("Set the color for the shape.") ) @@ -247,7 +247,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.draw_color_entry, 26, 1) # Editor Draw Selection Color - self.sel_draw_color_label = QtWidgets.QLabel('%s:' % _('Selection')) + self.sel_draw_color_label = FCLabel('%s:' % _('Selection')) self.sel_draw_color_label.setToolTip( _("Set the color of the shape when selected.") ) @@ -265,11 +265,11 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): # ----------------------- Project Settings ----------------------------- # ------------------------------------------------------------------ - self.proj_settings_label = QtWidgets.QLabel('%s' % _('Project Items Color')) + self.proj_settings_label = FCLabel('%s' % _('Project Items Color')) grid0.addWidget(self.proj_settings_label, 29, 0, 1, 2) # Project Tab items color - self.proj_color_label = QtWidgets.QLabel('%s:' % _('Enabled')) + self.proj_color_label = FCLabel('%s:' % _('Enabled')) self.proj_color_label.setToolTip( _("Set the color of the items in Project Tab Tree.") ) @@ -278,7 +278,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.proj_color_label, 30, 0) grid0.addWidget(self.proj_color_entry, 30, 1) - self.proj_color_dis_label = QtWidgets.QLabel('%s:' % _('Disabled')) + self.proj_color_dis_label = FCLabel('%s:' % _('Disabled')) self.proj_color_dis_label.setToolTip( _("Set the color of the items in Project Tab Tree,\n" "for the case when the items are disabled.") @@ -299,7 +299,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.project_autohide_cb, 32, 0, 1, 2) # Just to add empty rows - grid0.addWidget(QtWidgets.QLabel(''), 33, 0, 1, 2) + grid0.addWidget(FCLabel(''), 33, 0, 1, 2) self.layout.addStretch() diff --git a/appGUI/preferences/geometry/GeometryEditorPrefGroupUI.py b/appGUI/preferences/geometry/GeometryEditorPrefGroupUI.py index a083bb1f..69b609cc 100644 --- a/appGUI/preferences/geometry/GeometryEditorPrefGroupUI.py +++ b/appGUI/preferences/geometry/GeometryEditorPrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from appGUI.GUIElements import FCSpinner, RadioSet +from appGUI.GUIElements import FCSpinner, RadioSet, FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -28,7 +28,7 @@ class GeometryEditorPrefGroupUI(OptionsGroupUI): self.decimals = decimals # Editor Parameters - self.param_label = QtWidgets.QLabel("%s:" % _("Parameters")) + self.param_label = FCLabel("%s:" % _("Parameters")) self.param_label.setToolTip( _("A list of Editor parameters.") ) @@ -38,7 +38,7 @@ class GeometryEditorPrefGroupUI(OptionsGroupUI): self.layout.addLayout(grid0) # Selection Limit - self.sel_limit_label = QtWidgets.QLabel('%s:' % _("Selection limit")) + self.sel_limit_label = FCLabel('%s:' % _("Selection limit")) self.sel_limit_label.setToolTip( _("Set the number of selected geometry\n" "items above which the utility geometry\n" @@ -53,7 +53,7 @@ class GeometryEditorPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.sel_limit_entry, 0, 1) # Milling Type - milling_type_label = QtWidgets.QLabel('%s:' % _('Milling Type')) + milling_type_label = FCLabel('%s:' % _('Milling Type')) milling_type_label.setToolTip( _("Milling type:\n" "- climb / best for precision milling and to reduce tool usage\n" diff --git a/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py b/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py index 91da5c43..8ccdaec8 100644 --- a/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py +++ b/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from appGUI.GUIElements import FCCheckBox, FCSpinner, FCEntry, FCColorEntry, RadioSet +from appGUI.GUIElements import FCCheckBox, FCSpinner, FCEntry, FCColorEntry, RadioSet, FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import platform @@ -30,7 +30,7 @@ class GeometryGenPrefGroupUI(OptionsGroupUI): self.decimals = decimals # ## Plot options - self.plot_options_label = QtWidgets.QLabel("%s:" % _("Plot Options")) + self.plot_options_label = FCLabel("%s:" % _("Plot Options")) self.layout.addWidget(self.plot_options_label) plot_hlay = QtWidgets.QHBoxLayout() @@ -56,7 +56,7 @@ class GeometryGenPrefGroupUI(OptionsGroupUI): grid0.setColumnStretch(1, 1) # Number of circle steps for circular aperture linear approximation - self.circle_steps_label = QtWidgets.QLabel('%s:' % _("Circle Steps")) + self.circle_steps_label = FCLabel('%s:' % _("Circle Steps")) self.circle_steps_label.setToolTip( _("The number of circle steps for Geometry \n" "circle and arc shapes linear approximation.") @@ -68,11 +68,11 @@ class GeometryGenPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.circle_steps_entry, 1, 1) # Tools - self.tools_label = QtWidgets.QLabel("%s:" % _("Tools")) + self.tools_label = FCLabel("%s:" % _("Tools")) grid0.addWidget(self.tools_label, 2, 0, 1, 2) # Tooldia - tdlabel = QtWidgets.QLabel('%s:' % _('Tools Dia')) + tdlabel = FCLabel('%s:' % _('Tools Dia')) tdlabel.setToolTip( _("Diameters of the tools, separated by comma.\n" "The value of the diameter has to use the dot decimals separator.\n" @@ -88,10 +88,10 @@ class GeometryGenPrefGroupUI(OptionsGroupUI): separator_line.setFrameShadow(QtWidgets.QFrame.Sunken) grid0.addWidget(separator_line, 9, 0, 1, 2) - self.opt_label = QtWidgets.QLabel("%s:" % _("Path Optimization")) + self.opt_label = FCLabel("%s:" % _("Path Optimization")) grid0.addWidget(self.opt_label, 10, 0, 1, 2) - self.opt_algorithm_label = QtWidgets.QLabel(_('Algorithm:')) + self.opt_algorithm_label = FCLabel(_('Algorithm:')) self.opt_algorithm_label.setToolTip( _("This sets the path optimization algorithm.\n" "- Rtre -> Rtree algorithm\n" @@ -114,7 +114,7 @@ class GeometryGenPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.opt_algorithm_label, 12, 0) grid0.addWidget(self.opt_algorithm_radio, 12, 1) - self.optimization_time_label = QtWidgets.QLabel('%s:' % _('Duration')) + self.optimization_time_label = FCLabel('%s:' % _('Duration')) self.optimization_time_label.setToolTip( _("When OR-Tools Metaheuristic (MH) is enabled there is a\n" "maximum threshold for how much time is spent doing the\n" @@ -135,7 +135,7 @@ class GeometryGenPrefGroupUI(OptionsGroupUI): grid0.addWidget(separator_line, 16, 0, 1, 2) # Fuse Tools - self.join_geo_label = QtWidgets.QLabel('%s:' % _('Join Option')) + self.join_geo_label = FCLabel('%s:' % _('Join Option')) grid0.addWidget(self.join_geo_label, 18, 0, 1, 2) self.fuse_tools_cb = FCCheckBox(_("Fuse Tools")) @@ -151,11 +151,11 @@ class GeometryGenPrefGroupUI(OptionsGroupUI): grid0.addWidget(separator_line, 22, 0, 1, 2) # Geometry Object Color - self.gerber_color_label = QtWidgets.QLabel('%s:' % _('Object Color')) + self.gerber_color_label = FCLabel('%s:' % _('Object Color')) grid0.addWidget(self.gerber_color_label, 24, 0, 1, 2) # Plot Line Color - self.line_color_label = QtWidgets.QLabel('%s:' % _('Outline')) + self.line_color_label = FCLabel('%s:' % _('Outline')) self.line_color_label.setToolTip( _("Set the line color for plotted objects.") ) diff --git a/appGUI/preferences/geometry/GeometryOptPrefGroupUI.py b/appGUI/preferences/geometry/GeometryOptPrefGroupUI.py index 61d25c47..9b29c00b 100644 --- a/appGUI/preferences/geometry/GeometryOptPrefGroupUI.py +++ b/appGUI/preferences/geometry/GeometryOptPrefGroupUI.py @@ -2,7 +2,7 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import Qt, QSettings from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, OptionalInputSection, FCSpinner, FCComboBox, \ - NumericalEvalTupleEntry + NumericalEvalTupleEntry, FCLabel from appGUI.preferences import machinist_setting from appGUI.preferences.OptionsGroupUI import OptionsGroupUI @@ -32,7 +32,7 @@ class GeometryOptPrefGroupUI(OptionsGroupUI): # ------------------------------ # ## Create CNC Job # ------------------------------ - self.cncjob_label = QtWidgets.QLabel('%s:' % _('Create CNCJob')) + self.cncjob_label = FCLabel('%s:' % _('Create CNCJob')) self.cncjob_label.setToolTip( _("Create a CNC Job object\n" "tracing the contours of this\n" @@ -46,7 +46,7 @@ class GeometryOptPrefGroupUI(OptionsGroupUI): grid1.setColumnStretch(1, 1) # Cut Z - cutzlabel = QtWidgets.QLabel('%s:' % _('Cut Z')) + cutzlabel = FCLabel('%s:' % _('Cut Z')) cutzlabel.setToolTip( _("Cutting depth (negative)\n" "below the copper surface.") @@ -78,7 +78,7 @@ class GeometryOptPrefGroupUI(OptionsGroupUI): grid1.addWidget(self.multidepth_cb, 1, 0) # Depth/pass - dplabel = QtWidgets.QLabel('%s:' % _('Depth/Pass')) + dplabel = FCLabel('%s:' % _('Depth/Pass')) dplabel.setToolTip( _("The depth to cut on each pass,\n" "when multidepth is enabled.\n" @@ -99,7 +99,7 @@ class GeometryOptPrefGroupUI(OptionsGroupUI): self.ois_multidepth = OptionalInputSection(self.multidepth_cb, [self.depthperpass_entry]) # Travel Z - travelzlabel = QtWidgets.QLabel('%s:' % _('Travel Z')) + travelzlabel = FCLabel('%s:' % _('Travel Z')) travelzlabel.setToolTip( _("Height of the tool when\n" "moving without cutting.") @@ -129,7 +129,7 @@ class GeometryOptPrefGroupUI(OptionsGroupUI): grid1.addWidget(self.toolchange_cb, 4, 0, 1, 2) # Toolchange Z - toolchangezlabel = QtWidgets.QLabel('%s:' % _('Toolchange Z')) + toolchangezlabel = FCLabel('%s:' % _('Toolchange Z')) toolchangezlabel.setToolTip( _( "Z-axis position (height) for\n" @@ -151,7 +151,7 @@ class GeometryOptPrefGroupUI(OptionsGroupUI): grid1.addWidget(self.toolchangez_entry, 5, 1) # End move Z - endz_label = QtWidgets.QLabel('%s:' % _('End move Z')) + endz_label = FCLabel('%s:' % _('End move Z')) endz_label.setToolTip( _("Height of the tool after\n" "the last move at the end of the job.") @@ -171,7 +171,7 @@ class GeometryOptPrefGroupUI(OptionsGroupUI): grid1.addWidget(self.endz_entry, 6, 1) # End Move X,Y - endmove_xy_label = QtWidgets.QLabel('%s:' % _('End move X,Y')) + endmove_xy_label = FCLabel('%s:' % _('End move X,Y')) endmove_xy_label.setToolTip( _("End move X,Y position. In format (x,y).\n" "If no value is entered then there is no move\n" @@ -183,7 +183,7 @@ class GeometryOptPrefGroupUI(OptionsGroupUI): grid1.addWidget(self.endxy_entry, 7, 1) # Feedrate X-Y - frlabel = QtWidgets.QLabel('%s:' % _('Feedrate X-Y')) + frlabel = FCLabel('%s:' % _('Feedrate X-Y')) frlabel.setToolTip( _("Cutting speed in the XY\n" "plane in units per minute") @@ -198,7 +198,7 @@ class GeometryOptPrefGroupUI(OptionsGroupUI): grid1.addWidget(self.cncfeedrate_entry, 8, 1) # Feedrate Z (Plunge) - frz_label = QtWidgets.QLabel('%s:' % _('Feedrate Z')) + frz_label = FCLabel('%s:' % _('Feedrate Z')) frz_label.setToolTip( _("Cutting speed in the XY\n" "plane in units per minute.\n" @@ -214,7 +214,7 @@ class GeometryOptPrefGroupUI(OptionsGroupUI): grid1.addWidget(self.feedrate_z_entry, 9, 1) # Spindle Speed - spdlabel = QtWidgets.QLabel('%s:' % _('Spindle speed')) + spdlabel = FCLabel('%s:' % _('Spindle speed')) spdlabel.setToolTip( _( "Speed of the spindle in RPM (optional).\n" @@ -235,7 +235,7 @@ class GeometryOptPrefGroupUI(OptionsGroupUI): _("Pause to allow the spindle to reach its\n" "speed before cutting.") ) - dwelltime = QtWidgets.QLabel('%s:' % _('Duration')) + dwelltime = FCLabel('%s:' % _('Duration')) dwelltime.setToolTip( _("Number of time units for spindle to dwell.") ) @@ -252,7 +252,7 @@ class GeometryOptPrefGroupUI(OptionsGroupUI): self.ois_dwell = OptionalInputSection(self.dwell_cb, [self.dwelltime_entry]) # preprocessor selection - pp_label = QtWidgets.QLabel('%s:' % _("Preprocessor")) + pp_label = FCLabel('%s:' % _("Preprocessor")) pp_label.setToolTip( _("The Preprocessor file that dictates\n" "the Machine Code (like GCode, RML, HPGL) output.") diff --git a/appGUI/preferences/gerber/GerberAdvOptPrefGroupUI.py b/appGUI/preferences/gerber/GerberAdvOptPrefGroupUI.py index e08e9e0d..9bfa0429 100644 --- a/appGUI/preferences/gerber/GerberAdvOptPrefGroupUI.py +++ b/appGUI/preferences/gerber/GerberAdvOptPrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from appGUI.GUIElements import FCCheckBox, RadioSet, FCDoubleSpinner, FCSpinner, OptionalInputSection +from appGUI.GUIElements import FCCheckBox, RadioSet, FCDoubleSpinner, FCLabel, OptionalInputSection from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -28,7 +28,7 @@ class GerberAdvOptPrefGroupUI(OptionsGroupUI): self.decimals = decimals # ## Advanced Gerber Parameters - self.adv_param_label = QtWidgets.QLabel('%s:' % _('Advanced Options')) + self.adv_param_label = FCLabel('%s:' % _('Advanced Options')) self.adv_param_label.setToolTip( _("A list of advanced parameters.\n" "Those parameters are available only for\n" @@ -61,7 +61,7 @@ class GerberAdvOptPrefGroupUI(OptionsGroupUI): grid0.addWidget(separator_line, 2, 0, 1, 2) # Buffering Type - buffering_label = QtWidgets.QLabel('%s:' % _('Buffering')) + buffering_label = FCLabel('%s:' % _('Buffering')) buffering_label.setToolTip( _("Buffering type:\n" "- None --> best performance, fast file loading but no so good display\n" @@ -90,7 +90,7 @@ class GerberAdvOptPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.simplify_cb, 11, 0, 1, 2) # Simplification tolerance - self.simplification_tol_label = QtWidgets.QLabel(_('Tolerance')) + self.simplification_tol_label = FCLabel(_('Tolerance')) self.simplification_tol_label.setToolTip(_("Tolerance for polygon simplification.")) self.simplification_tol_spinner = FCDoubleSpinner() @@ -117,4 +117,4 @@ class GerberAdvOptPrefGroupUI(OptionsGroupUI): if val == 'no': self.delayed_buffer_cb.setDisabled(False) else: - self.delayed_buffer_cb.setDisabled(True) \ No newline at end of file + self.delayed_buffer_cb.setDisabled(True) diff --git a/appGUI/preferences/gerber/GerberEditorPrefGroupUI.py b/appGUI/preferences/gerber/GerberEditorPrefGroupUI.py index bc86e7e6..efb3e0d8 100644 --- a/appGUI/preferences/gerber/GerberEditorPrefGroupUI.py +++ b/appGUI/preferences/gerber/GerberEditorPrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from appGUI.GUIElements import FCSpinner, FCDoubleSpinner, FCComboBox, FCEntry, RadioSet, NumericalEvalTupleEntry +from appGUI.GUIElements import FCSpinner, FCDoubleSpinner, FCComboBox, FCLabel, RadioSet, NumericalEvalTupleEntry from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -28,7 +28,7 @@ class GerberEditorPrefGroupUI(OptionsGroupUI): self.decimals = decimals # Advanced Gerber Parameters - self.param_label = QtWidgets.QLabel("%s:" % _("Parameters")) + self.param_label = FCLabel("%s:" % _("Parameters")) self.param_label.setToolTip( _("A list of Gerber Editor parameters.") ) @@ -38,7 +38,7 @@ class GerberEditorPrefGroupUI(OptionsGroupUI): self.layout.addLayout(grid0) # Selection Limit - self.sel_limit_label = QtWidgets.QLabel('%s:' % _("Selection limit")) + self.sel_limit_label = FCLabel('%s:' % _("Selection limit")) self.sel_limit_label.setToolTip( _("Set the number of selected Gerber geometry\n" "items above which the utility geometry\n" @@ -53,7 +53,7 @@ class GerberEditorPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.sel_limit_entry, 0, 1) # New aperture code - self.addcode_entry_lbl = QtWidgets.QLabel('%s:' % _('New Aperture code')) + self.addcode_entry_lbl = FCLabel('%s:' % _('New Aperture code')) self.addcode_entry_lbl.setToolTip( _("Code for the new aperture") ) @@ -66,7 +66,7 @@ class GerberEditorPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.addcode_entry, 1, 1) # New aperture size - self.addsize_entry_lbl = QtWidgets.QLabel('%s:' % _('New Aperture size')) + self.addsize_entry_lbl = FCLabel('%s:' % _('New Aperture size')) self.addsize_entry_lbl.setToolTip( _("Size for the new aperture") ) @@ -79,7 +79,7 @@ class GerberEditorPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.addsize_entry, 2, 1) # New aperture type - self.addtype_combo_lbl = QtWidgets.QLabel('%s:' % _('New Aperture type')) + self.addtype_combo_lbl = FCLabel('%s:' % _('New Aperture type')) self.addtype_combo_lbl.setToolTip( _("Type for the new aperture.\n" "Can be 'C', 'R' or 'O'.") @@ -92,7 +92,7 @@ class GerberEditorPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.addtype_combo, 3, 1) # Number of pads in a pad array - self.grb_array_size_label = QtWidgets.QLabel('%s:' % _('Nr of pads')) + self.grb_array_size_label = FCLabel('%s:' % _('Nr of pads')) self.grb_array_size_label.setToolTip( _("Specify how many pads to be in the array.") ) @@ -103,7 +103,7 @@ class GerberEditorPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.grb_array_size_label, 4, 0) grid0.addWidget(self.grb_array_size_entry, 4, 1) - self.adddim_label = QtWidgets.QLabel('%s:' % _('Aperture Dimensions')) + self.adddim_label = FCLabel('%s:' % _('Aperture Dimensions')) self.adddim_label.setToolTip( _("Diameters of the tools, separated by comma.\n" "The value of the diameter has to use the dot decimals separator.\n" @@ -114,11 +114,11 @@ class GerberEditorPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.adddim_label, 5, 0) grid0.addWidget(self.adddim_entry, 5, 1) - self.grb_array_linear_label = QtWidgets.QLabel('%s:' % _('Linear Pad Array')) + self.grb_array_linear_label = FCLabel('%s:' % _('Linear Pad Array')) grid0.addWidget(self.grb_array_linear_label, 6, 0, 1, 2) # Linear Pad Array direction - self.grb_axis_label = QtWidgets.QLabel('%s:' % _('Linear Direction')) + self.grb_axis_label = FCLabel('%s:' % _('Linear Direction')) self.grb_axis_label.setToolTip( _("Direction on which the linear array is oriented:\n" "- 'X' - horizontal axis \n" @@ -134,7 +134,7 @@ class GerberEditorPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.grb_axis_radio, 7, 1) # Linear Pad Array pitch distance - self.grb_pitch_label = QtWidgets.QLabel('%s:' % _('Pitch')) + self.grb_pitch_label = FCLabel('%s:' % _('Pitch')) self.grb_pitch_label.setToolTip( _("Pitch = Distance between elements of the array.") ) @@ -146,7 +146,7 @@ class GerberEditorPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.grb_pitch_entry, 8, 1) # Linear Pad Array custom angle - self.grb_angle_label = QtWidgets.QLabel('%s:' % _('Angle')) + self.grb_angle_label = FCLabel('%s:' % _('Angle')) self.grb_angle_label.setToolTip( _("Angle at which each element in circular array is placed.") ) @@ -158,11 +158,11 @@ class GerberEditorPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.grb_angle_label, 9, 0) grid0.addWidget(self.grb_angle_entry, 9, 1) - self.grb_array_circ_label = QtWidgets.QLabel('%s:' % _('Circular Pad Array')) + self.grb_array_circ_label = FCLabel('%s:' % _('Circular Pad Array')) grid0.addWidget(self.grb_array_circ_label, 10, 0, 1, 2) # Circular Pad Array direction - self.grb_circular_direction_label = QtWidgets.QLabel('%s:' % _('Circular Direction')) + self.grb_circular_direction_label = FCLabel('%s:' % _('Circular Direction')) self.grb_circular_direction_label.setToolTip( _("Direction for circular array.\n" "Can be CW = clockwise or CCW = counter clockwise.") @@ -175,7 +175,7 @@ class GerberEditorPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.grb_circular_dir_radio, 11, 1) # Circular Pad Array Angle - self.grb_circular_angle_label = QtWidgets.QLabel('%s:' % _('Circular Angle')) + self.grb_circular_angle_label = FCLabel('%s:' % _('Circular Angle')) self.grb_circular_angle_label.setToolTip( _("Angle at which each element in circular array is placed.") ) @@ -188,11 +188,11 @@ class GerberEditorPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.grb_circular_angle_label, 12, 0) grid0.addWidget(self.grb_circular_angle_entry, 12, 1) - self.grb_array_tools_b_label = QtWidgets.QLabel('%s:' % _('Buffer Tool')) + self.grb_array_tools_b_label = FCLabel('%s:' % _('Buffer Tool')) grid0.addWidget(self.grb_array_tools_b_label, 13, 0, 1, 2) # Buffer Distance - self.grb_buff_label = QtWidgets.QLabel('%s:' % _('Buffer distance')) + self.grb_buff_label = FCLabel('%s:' % _('Buffer distance')) self.grb_buff_label.setToolTip( _("Distance at which to buffer the Gerber element.") ) @@ -203,11 +203,11 @@ class GerberEditorPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.grb_buff_label, 14, 0) grid0.addWidget(self.grb_buff_entry, 14, 1) - self.grb_array_tools_s_label = QtWidgets.QLabel('%s:' % _('Scale Tool')) + self.grb_array_tools_s_label = FCLabel('%s:' % _('Scale Tool')) grid0.addWidget(self.grb_array_tools_s_label, 15, 0, 1, 2) # Scale Factor - self.grb_scale_label = QtWidgets.QLabel('%s:' % _('Scale factor')) + self.grb_scale_label = FCLabel('%s:' % _('Scale factor')) self.grb_scale_label.setToolTip( _("Factor to scale the Gerber element.") ) @@ -218,11 +218,11 @@ class GerberEditorPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.grb_scale_label, 16, 0) grid0.addWidget(self.grb_scale_entry, 16, 1) - self.grb_array_tools_ma_label = QtWidgets.QLabel('%s:' % _('Mark Area Tool')) + self.grb_array_tools_ma_label = FCLabel('%s:' % _('Mark Area Tool')) grid0.addWidget(self.grb_array_tools_ma_label, 17, 0, 1, 2) # Mark area Tool low threshold - self.grb_ma_low_label = QtWidgets.QLabel('%s:' % _('Threshold low')) + self.grb_ma_low_label = FCLabel('%s:' % _('Threshold low')) self.grb_ma_low_label.setToolTip( _("Threshold value under which the apertures are not marked.") ) @@ -234,7 +234,7 @@ class GerberEditorPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.grb_ma_low_entry, 18, 1) # Mark area Tool high threshold - self.grb_ma_high_label = QtWidgets.QLabel('%s:' % _('Threshold high')) + self.grb_ma_high_label = FCLabel('%s:' % _('Threshold high')) self.grb_ma_high_label.setToolTip( _("Threshold value over which the apertures are not marked.") ) diff --git a/appGUI/preferences/gerber/GerberExpPrefGroupUI.py b/appGUI/preferences/gerber/GerberExpPrefGroupUI.py index efcb86ba..f900ea52 100644 --- a/appGUI/preferences/gerber/GerberExpPrefGroupUI.py +++ b/appGUI/preferences/gerber/GerberExpPrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt5 import QtWidgets, QtCore from PyQt5.QtCore import QSettings -from appGUI.GUIElements import RadioSet, FCSpinner +from appGUI.GUIElements import RadioSet, FCSpinner, FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -28,7 +28,7 @@ class GerberExpPrefGroupUI(OptionsGroupUI): self.decimals = decimals # Plot options - self.export_options_label = QtWidgets.QLabel("%s:" % _("Export Options")) + self.export_options_label = FCLabel("%s:" % _("Export Options")) self.export_options_label.setToolTip( _("The parameters set here are used in the file exported\n" "when using the File -> Export -> Export Gerber menu entry.") @@ -39,7 +39,7 @@ class GerberExpPrefGroupUI(OptionsGroupUI): self.layout.addLayout(form) # Gerber Units - self.gerber_units_label = QtWidgets.QLabel('%s:' % _('Units')) + self.gerber_units_label = FCLabel('%s:' % _('Units')) self.gerber_units_label.setToolTip( _("The units used in the Gerber file.") ) @@ -53,7 +53,7 @@ class GerberExpPrefGroupUI(OptionsGroupUI): form.addRow(self.gerber_units_label, self.gerber_units_radio) # Gerber format - self.digits_label = QtWidgets.QLabel("%s:" % _("Int/Decimals")) + self.digits_label = FCLabel("%s:" % _("Int/Decimals")) self.digits_label.setToolTip( _("The number of digits in the whole part of the number\n" "and in the fractional part of the number.") @@ -73,7 +73,7 @@ class GerberExpPrefGroupUI(OptionsGroupUI): ) hlay1.addWidget(self.format_whole_entry, QtCore.Qt.AlignLeft) - gerber_separator_label = QtWidgets.QLabel(':') + gerber_separator_label = FCLabel(':') gerber_separator_label.setFixedWidth(5) hlay1.addWidget(gerber_separator_label, QtCore.Qt.AlignLeft) @@ -93,7 +93,7 @@ class GerberExpPrefGroupUI(OptionsGroupUI): form.addRow(self.digits_label, hlay1) # Gerber Zeros - self.zeros_label = QtWidgets.QLabel('%s:' % _('Zeros')) + self.zeros_label = FCLabel('%s:' % _('Zeros')) self.zeros_label.setAlignment(QtCore.Qt.AlignLeft) self.zeros_label.setToolTip( _("This sets the type of Gerber zeros.\n" diff --git a/appGUI/preferences/gerber/GerberGenPrefGroupUI.py b/appGUI/preferences/gerber/GerberGenPrefGroupUI.py index 12438e8a..92e3f9f4 100644 --- a/appGUI/preferences/gerber/GerberGenPrefGroupUI.py +++ b/appGUI/preferences/gerber/GerberGenPrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt5 import QtWidgets, QtCore, QtGui from PyQt5.QtCore import QSettings -from appGUI.GUIElements import FCCheckBox, FCSpinner, RadioSet, FCButton, FCSliderWithSpinner, FCColorEntry +from appGUI.GUIElements import FCCheckBox, FCSpinner, RadioSet, FCButton, FCSliderWithSpinner, FCColorEntry, FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -28,7 +28,7 @@ class GerberGenPrefGroupUI(OptionsGroupUI): self.decimals = decimals # ## Plot options - self.plot_options_label = QtWidgets.QLabel("%s:" % _("Plot Options")) + self.plot_options_label = FCLabel("%s:" % _("Plot Options")) self.layout.addWidget(self.plot_options_label) grid0 = QtWidgets.QGridLayout() @@ -56,7 +56,7 @@ class GerberGenPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.multicolored_cb, 0, 2) # Number of circle steps for circular aperture linear approximation - self.circle_steps_label = QtWidgets.QLabel('%s:' % _("Circle Steps")) + self.circle_steps_label = FCLabel('%s:' % _("Circle Steps")) self.circle_steps_label.setToolTip( _("The number of circle steps for Gerber \n" "circular aperture linear approximation.") @@ -67,10 +67,10 @@ class GerberGenPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.circle_steps_label, 1, 0) grid0.addWidget(self.circle_steps_entry, 1, 1, 1, 2) - grid0.addWidget(QtWidgets.QLabel(''), 2, 0, 1, 3) + grid0.addWidget(FCLabel(''), 2, 0, 1, 3) # Default format for Gerber - self.gerber_default_label = QtWidgets.QLabel('%s:' % _('Default Values')) + self.gerber_default_label = FCLabel('%s:' % _('Default Values')) self.gerber_default_label.setToolTip( _("Those values will be used as fallback values\n" "in case that they are not found in the Gerber file.") @@ -79,7 +79,7 @@ class GerberGenPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.gerber_default_label, 3, 0, 1, 3) # Gerber Units - self.gerber_units_label = QtWidgets.QLabel('%s:' % _('Units')) + self.gerber_units_label = FCLabel('%s:' % _('Units')) self.gerber_units_label.setToolTip( _("The units used in the Gerber file.") ) @@ -94,7 +94,7 @@ class GerberGenPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.gerber_units_radio, 4, 1, 1, 2) # Gerber Zeros - self.gerber_zeros_label = QtWidgets.QLabel('%s:' % _('Zeros')) + self.gerber_zeros_label = FCLabel('%s:' % _('Zeros')) self.gerber_zeros_label.setAlignment(QtCore.Qt.AlignLeft) self.gerber_zeros_label.setToolTip( _("This sets the type of Gerber zeros.\n" @@ -162,11 +162,11 @@ class GerberGenPrefGroupUI(OptionsGroupUI): grid0.addWidget(separator_line, 13, 0, 1, 3) # Gerber Object Color - self.gerber_color_label = QtWidgets.QLabel('%s' % _('Object Color')) + self.gerber_color_label = FCLabel('%s' % _('Object Color')) grid0.addWidget(self.gerber_color_label, 15, 0, 1, 3) # Plot Line Color - self.line_color_label = QtWidgets.QLabel('%s:' % _('Outline')) + self.line_color_label = FCLabel('%s:' % _('Outline')) self.line_color_label.setToolTip( _("Set the line color for plotted objects.") ) @@ -176,7 +176,7 @@ class GerberGenPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.line_color_entry, 17, 1, 1, 2) # Plot Fill Color - self.fill_color_label = QtWidgets.QLabel('%s:' % _('Fill')) + self.fill_color_label = FCLabel('%s:' % _('Fill')) self.fill_color_label.setToolTip( _("Set the fill color for plotted objects.\n" "First 6 digits are the color and the last 2\n" @@ -188,7 +188,7 @@ class GerberGenPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.fill_color_entry, 20, 1, 1, 2) # Plot Fill Transparency Level - self.gerber_alpha_label = QtWidgets.QLabel('%s:' % _('Alpha')) + self.gerber_alpha_label = FCLabel('%s:' % _('Alpha')) self.gerber_alpha_label.setToolTip( _("Set the fill transparency for plotted objects.") ) diff --git a/appGUI/preferences/gerber/GerberOptPrefGroupUI.py b/appGUI/preferences/gerber/GerberOptPrefGroupUI.py index a7040a87..4002295a 100644 --- a/appGUI/preferences/gerber/GerberOptPrefGroupUI.py +++ b/appGUI/preferences/gerber/GerberOptPrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from appGUI.GUIElements import FCDoubleSpinner, FCSpinner, RadioSet, FCCheckBox, FCComboBox +from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -29,7 +29,7 @@ class GerberOptPrefGroupUI(OptionsGroupUI): self.setTitle(str(_("Gerber Options"))) # ## Clear non-copper regions - self.clearcopper_label = QtWidgets.QLabel("%s:" % _("Non-copper regions")) + self.clearcopper_label = FCLabel("%s:" % _("Non-copper regions")) self.clearcopper_label.setToolTip( _("Create polygons covering the\n" "areas without copper on the PCB.\n" @@ -43,7 +43,7 @@ class GerberOptPrefGroupUI(OptionsGroupUI): self.layout.addLayout(grid1) # Margin - bmlabel = QtWidgets.QLabel('%s:' % _('Boundary Margin')) + bmlabel = FCLabel('%s:' % _('Boundary Margin')) bmlabel.setToolTip( _("Specify the edge of the PCB\n" "by drawing a box around all\n" @@ -70,13 +70,13 @@ class GerberOptPrefGroupUI(OptionsGroupUI): grid1.addWidget(separator_line, 2, 0, 1, 2) # ## Bounding box - self.boundingbox_label = QtWidgets.QLabel('%s:' % _('Bounding Box')) + self.boundingbox_label = FCLabel('%s:' % _('Bounding Box')) self.layout.addWidget(self.boundingbox_label) grid2 = QtWidgets.QGridLayout() self.layout.addLayout(grid2) - bbmargin = QtWidgets.QLabel('%s:' % _('Boundary Margin')) + bbmargin = FCLabel('%s:' % _('Boundary Margin')) bbmargin.setToolTip( _("Distance of the edges of the box\n" "to the nearest polygon.") diff --git a/appGUI/preferences/tools/Tools2CalPrefGroupUI.py b/appGUI/preferences/tools/Tools2CalPrefGroupUI.py index 6b1dde09..93011b97 100644 --- a/appGUI/preferences/tools/Tools2CalPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2CalPrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCCheckBox, NumericalEvalTupleEntry +from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCCheckBox, NumericalEvalTupleEntry, FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -33,14 +33,14 @@ class Tools2CalPrefGroupUI(OptionsGroupUI): grid_lay.setColumnStretch(0, 0) grid_lay.setColumnStretch(1, 1) - self.param_label = QtWidgets.QLabel('%s:' % _('Parameters')) + self.param_label = FCLabel('%s:' % _('Parameters')) self.param_label.setToolTip( _("Parameters used for this tool.") ) grid_lay.addWidget(self.param_label, 0, 0, 1, 2) # Calibration source - self.cal_source_lbl = QtWidgets.QLabel("%s:" % _("Source Type")) + self.cal_source_lbl = FCLabel("%s:" % _("Source Type")) self.cal_source_lbl.setToolTip(_("The source of calibration points.\n" "It can be:\n" "- Object -> click a hole geo for Excellon or a pad for Gerber\n" @@ -58,7 +58,7 @@ class Tools2CalPrefGroupUI(OptionsGroupUI): grid_lay.addWidget(separator_line, 2, 0, 1, 2) # Travel Z entry - travelz_lbl = QtWidgets.QLabel('%s:' % _("Travel Z")) + travelz_lbl = FCLabel('%s:' % _("Travel Z")) travelz_lbl.setToolTip( _("Height (Z) for travelling between the points.") ) @@ -72,7 +72,7 @@ class Tools2CalPrefGroupUI(OptionsGroupUI): grid_lay.addWidget(self.travelz_entry, 3, 1, 1, 2) # Verification Z entry - verz_lbl = QtWidgets.QLabel('%s:' % _("Verification Z")) + verz_lbl = FCLabel('%s:' % _("Verification Z")) verz_lbl.setToolTip( _("Height (Z) for checking the point.") ) @@ -95,7 +95,7 @@ class Tools2CalPrefGroupUI(OptionsGroupUI): grid_lay.addWidget(self.zeroz_cb, 5, 0, 1, 3) # Toochange Z entry - toolchangez_lbl = QtWidgets.QLabel('%s:' % _("Toolchange Z")) + toolchangez_lbl = FCLabel('%s:' % _("Toolchange Z")) toolchangez_lbl.setToolTip( _("Height (Z) for mounting the verification probe.") ) @@ -109,7 +109,7 @@ class Tools2CalPrefGroupUI(OptionsGroupUI): grid_lay.addWidget(self.toolchangez_entry, 6, 1, 1, 2) # Toolchange X-Y entry - toolchangexy_lbl = QtWidgets.QLabel('%s:' % _('Toolchange X-Y')) + toolchangexy_lbl = FCLabel('%s:' % _('Toolchange X-Y')) toolchangexy_lbl.setToolTip( _("Toolchange X,Y position.\n" "If no value is entered then the current\n" @@ -122,7 +122,7 @@ class Tools2CalPrefGroupUI(OptionsGroupUI): grid_lay.addWidget(self.toolchange_xy_entry, 7, 1, 1, 2) # Second point choice - second_point_lbl = QtWidgets.QLabel('%s:' % _("Second point")) + second_point_lbl = FCLabel('%s:' % _("Second point")) second_point_lbl.setToolTip( _("Second point in the Gcode verification can be:\n" "- top-left -> the user will align the PCB vertically\n" diff --git a/appGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py b/appGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py index e61e36dd..b5df5a93 100644 --- a/appGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from appGUI.GUIElements import FCDoubleSpinner, RadioSet +from appGUI.GUIElements import FCDoubleSpinner, RadioSet, FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -33,14 +33,14 @@ class Tools2FiducialsPrefGroupUI(OptionsGroupUI): grid_lay.setColumnStretch(0, 0) grid_lay.setColumnStretch(1, 1) - self.param_label = QtWidgets.QLabel('%s:' % _('Parameters')) + self.param_label = FCLabel('%s:' % _('Parameters')) self.param_label.setToolTip( _("Parameters used for this tool.") ) grid_lay.addWidget(self.param_label, 0, 0, 1, 2) # DIAMETER # - self.dia_label = QtWidgets.QLabel('%s:' % _("Size")) + self.dia_label = FCLabel('%s:' % _("Size")) self.dia_label.setToolTip( _("This set the fiducial diameter if fiducial type is circular,\n" "otherwise is the size of the fiducial.\n" @@ -56,7 +56,7 @@ class Tools2FiducialsPrefGroupUI(OptionsGroupUI): grid_lay.addWidget(self.dia_entry, 1, 1) # MARGIN # - self.margin_label = QtWidgets.QLabel('%s:' % _("Margin")) + self.margin_label = FCLabel('%s:' % _("Margin")) self.margin_label.setToolTip( _("Bounding box margin.") ) @@ -73,7 +73,7 @@ class Tools2FiducialsPrefGroupUI(OptionsGroupUI): {'label': _('Auto'), 'value': 'auto'}, {"label": _("Manual"), "value": "manual"} ], stretch=False) - self.mode_label = QtWidgets.QLabel('%s:' % _("Mode")) + self.mode_label = FCLabel('%s:' % _("Mode")) self.mode_label.setToolTip( _("- 'Auto' - automatic placement of fiducials in the corners of the bounding box.\n" "- 'Manual' - manual placement of fiducials.") @@ -87,7 +87,7 @@ class Tools2FiducialsPrefGroupUI(OptionsGroupUI): {"label": _("Down"), "value": "down"}, {"label": _("None"), "value": "no"} ], stretch=False) - self.pos_label = QtWidgets.QLabel('%s:' % _("Second fiducial")) + self.pos_label = FCLabel('%s:' % _("Second fiducial")) self.pos_label.setToolTip( _("The position for the second fiducial.\n" "- 'Up' - the order is: bottom-left, top-left, top-right.\n" @@ -109,7 +109,7 @@ class Tools2FiducialsPrefGroupUI(OptionsGroupUI): {"label": _("Chess"), "value": "chess"} ], stretch=False) - self.fid_type_label = QtWidgets.QLabel('%s:' % _("Fiducial Type")) + self.fid_type_label = FCLabel('%s:' % _("Fiducial Type")) self.fid_type_label.setToolTip( _("The type of fiducial.\n" "- 'Circular' - this is the regular fiducial.\n" @@ -120,7 +120,7 @@ class Tools2FiducialsPrefGroupUI(OptionsGroupUI): grid_lay.addWidget(self.fid_type_radio, 6, 1) # Line Thickness # - self.line_thickness_label = QtWidgets.QLabel('%s:' % _("Line thickness")) + self.line_thickness_label = FCLabel('%s:' % _("Line thickness")) self.line_thickness_label.setToolTip( _("Bounding box margin.") ) diff --git a/appGUI/preferences/tools/Tools2InvertPrefGroupUI.py b/appGUI/preferences/tools/Tools2InvertPrefGroupUI.py index babe1e3e..953e5326 100644 --- a/appGUI/preferences/tools/Tools2InvertPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2InvertPrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from appGUI.GUIElements import FCDoubleSpinner, RadioSet +from appGUI.GUIElements import FCDoubleSpinner, RadioSet, FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -28,7 +28,7 @@ class Tools2InvertPrefGroupUI(OptionsGroupUI): self.decimals = decimals # ## Subtractor Tool Parameters - self.sublabel = QtWidgets.QLabel("%s:" % _("Parameters")) + self.sublabel = FCLabel("%s:" % _("Parameters")) self.sublabel.setToolTip( _("A tool to invert Gerber geometry from positive to negative\n" "and in revers.") @@ -42,7 +42,7 @@ class Tools2InvertPrefGroupUI(OptionsGroupUI): self.layout.addLayout(grid0) # Margin - self.margin_label = QtWidgets.QLabel('%s:' % _('Margin')) + self.margin_label = FCLabel('%s:' % _('Margin')) self.margin_label.setToolTip( _("Distance by which to avoid\n" "the edges of the Gerber object.") @@ -55,7 +55,7 @@ class Tools2InvertPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.margin_label, 2, 0, 1, 2) grid0.addWidget(self.margin_entry, 3, 0, 1, 2) - self.join_label = QtWidgets.QLabel('%s:' % _("Lines Join Style")) + self.join_label = FCLabel('%s:' % _("Lines Join Style")) self.join_label.setToolTip( _("The way that the lines in the object outline will be joined.\n" "Can be:\n" diff --git a/appGUI/preferences/tools/Tools2OptimalPrefGroupUI.py b/appGUI/preferences/tools/Tools2OptimalPrefGroupUI.py index 05d88af2..e52756f3 100644 --- a/appGUI/preferences/tools/Tools2OptimalPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2OptimalPrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from appGUI.GUIElements import FCSpinner +from appGUI.GUIElements import FCSpinner, FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -28,7 +28,7 @@ class Tools2OptimalPrefGroupUI(OptionsGroupUI): self.decimals = decimals # ## Parameters - self.optlabel = QtWidgets.QLabel("%s:" % _("Parameters")) + self.optlabel = FCLabel("%s:" % _("Parameters")) self.optlabel.setToolTip( _("A tool to find the minimum distance between\n" "every two Gerber geometric elements") @@ -45,7 +45,7 @@ class Tools2OptimalPrefGroupUI(OptionsGroupUI): self.precision_sp.set_step(1) self.precision_sp.setWrapping(True) - self.precision_lbl = QtWidgets.QLabel('%s:' % _("Precision")) + self.precision_lbl = FCLabel('%s:' % _("Precision")) self.precision_lbl.setToolTip( _("Number of decimals for the distances and coordinates in this tool.") ) diff --git a/appGUI/preferences/tools/Tools2PunchGerberPrefGroupUI.py b/appGUI/preferences/tools/Tools2PunchGerberPrefGroupUI.py index b447a738..9db5c545 100644 --- a/appGUI/preferences/tools/Tools2PunchGerberPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2PunchGerberPrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from appGUI.GUIElements import FCCheckBox, RadioSet, FCDoubleSpinner +from appGUI.GUIElements import FCCheckBox, RadioSet, FCDoubleSpinner, FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -33,13 +33,13 @@ class Tools2PunchGerberPrefGroupUI(OptionsGroupUI): grid_lay.setColumnStretch(0, 0) grid_lay.setColumnStretch(1, 1) - self.param_label = QtWidgets.QLabel('%s:' % _('Parameters')) + self.param_label = FCLabel('%s:' % _('Parameters')) self.param_label.setToolTip( _("Parameters used for this tool.") ) grid_lay.addWidget(self.param_label, 0, 0, 1, 2) - self.padt_label = QtWidgets.QLabel("%s:" % _("Processed Pads Type")) + self.padt_label = FCLabel("%s:" % _("Processed Pads Type")) self.padt_label.setToolTip( _("The type of pads shape to be processed.\n" "If the PCB has many SMD pads with rectangular pads,\n" @@ -103,7 +103,7 @@ class Tools2PunchGerberPrefGroupUI(OptionsGroupUI): ], orientation='vertical', stretch=False) - self.hole_size_label = QtWidgets.QLabel('%s:' % _("Method")) + self.hole_size_label = FCLabel('%s:' % _("Method")) self.hole_size_label.setToolTip( _("The punch hole source can be:\n" "- Excellon Object-> the Excellon object drills center will serve as reference.\n" @@ -114,7 +114,7 @@ class Tools2PunchGerberPrefGroupUI(OptionsGroupUI): grid_lay.addWidget(self.hole_size_label, 9, 0) grid_lay.addWidget(self.hole_size_radio, 9, 1) - # grid_lay1.addWidget(QtWidgets.QLabel('')) + # grid_lay1.addWidget(FCLabel('')) separator_line = QtWidgets.QFrame() separator_line.setFrameShape(QtWidgets.QFrame.HLine) @@ -122,7 +122,7 @@ class Tools2PunchGerberPrefGroupUI(OptionsGroupUI): grid_lay.addWidget(separator_line, 10, 0, 1, 2) # Annular Ring - self.fixed_label = QtWidgets.QLabel('%s' % _("Fixed Diameter")) + self.fixed_label = FCLabel('%s' % _("Fixed Diameter")) grid_lay.addWidget(self.fixed_label, 11, 0, 1, 2) # Diameter value @@ -130,7 +130,7 @@ class Tools2PunchGerberPrefGroupUI(OptionsGroupUI): self.dia_entry.set_precision(self.decimals) self.dia_entry.set_range(0.0000, 10000.0000) - self.dia_label = QtWidgets.QLabel('%s:' % _("Value")) + self.dia_label = FCLabel('%s:' % _("Value")) self.dia_label.setToolTip( _("Fixed hole diameter.") ) @@ -139,7 +139,7 @@ class Tools2PunchGerberPrefGroupUI(OptionsGroupUI): grid_lay.addWidget(self.dia_entry, 12, 1) # Annular Ring value - self.ring_label = QtWidgets.QLabel('%s' % _("Fixed Annular Ring")) + self.ring_label = FCLabel('%s' % _("Fixed Annular Ring")) self.ring_label.setToolTip( _("The size of annular ring.\n" "The copper sliver between the hole exterior\n" @@ -148,7 +148,7 @@ class Tools2PunchGerberPrefGroupUI(OptionsGroupUI): grid_lay.addWidget(self.ring_label, 13, 0, 1, 2) # Circular Annular Ring Value - self.circular_ring_label = QtWidgets.QLabel('%s:' % _("Circular")) + self.circular_ring_label = FCLabel('%s:' % _("Circular")) self.circular_ring_label.setToolTip( _("The size of annular ring for circular pads.") ) @@ -161,7 +161,7 @@ class Tools2PunchGerberPrefGroupUI(OptionsGroupUI): grid_lay.addWidget(self.circular_ring_entry, 14, 1) # Oblong Annular Ring Value - self.oblong_ring_label = QtWidgets.QLabel('%s:' % _("Oblong")) + self.oblong_ring_label = FCLabel('%s:' % _("Oblong")) self.oblong_ring_label.setToolTip( _("The size of annular ring for oblong pads.") ) @@ -174,7 +174,7 @@ class Tools2PunchGerberPrefGroupUI(OptionsGroupUI): grid_lay.addWidget(self.oblong_ring_entry, 15, 1) # Square Annular Ring Value - self.square_ring_label = QtWidgets.QLabel('%s:' % _("Square")) + self.square_ring_label = FCLabel('%s:' % _("Square")) self.square_ring_label.setToolTip( _("The size of annular ring for square pads.") ) @@ -187,7 +187,7 @@ class Tools2PunchGerberPrefGroupUI(OptionsGroupUI): grid_lay.addWidget(self.square_ring_entry, 16, 1) # Rectangular Annular Ring Value - self.rectangular_ring_label = QtWidgets.QLabel('%s:' % _("Rectangular")) + self.rectangular_ring_label = FCLabel('%s:' % _("Rectangular")) self.rectangular_ring_label.setToolTip( _("The size of annular ring for rectangular pads.") ) @@ -200,7 +200,7 @@ class Tools2PunchGerberPrefGroupUI(OptionsGroupUI): grid_lay.addWidget(self.rectangular_ring_entry, 17, 1) # Others Annular Ring Value - self.other_ring_label = QtWidgets.QLabel('%s:' % _("Others")) + self.other_ring_label = FCLabel('%s:' % _("Others")) self.other_ring_label.setToolTip( _("The size of annular ring for other pads.") ) @@ -212,7 +212,7 @@ class Tools2PunchGerberPrefGroupUI(OptionsGroupUI): grid_lay.addWidget(self.other_ring_label, 18, 0) grid_lay.addWidget(self.other_ring_entry, 18, 1) - self.prop_label = QtWidgets.QLabel('%s' % _("Proportional Diameter")) + self.prop_label = FCLabel('%s' % _("Proportional Diameter")) grid_lay.addWidget(self.prop_label, 19, 0, 1, 2) # Factor value @@ -221,7 +221,7 @@ class Tools2PunchGerberPrefGroupUI(OptionsGroupUI): self.factor_entry.set_range(0.0000, 100.0000) self.factor_entry.setSingleStep(0.1) - self.factor_label = QtWidgets.QLabel('%s:' % _("Factor")) + self.factor_label = FCLabel('%s:' % _("Factor")) self.factor_label.setToolTip( _("Proportional Diameter.\n" "The hole diameter will be a fraction of the pad size.") diff --git a/appGUI/preferences/tools/Tools2QRCodePrefGroupUI.py b/appGUI/preferences/tools/Tools2QRCodePrefGroupUI.py index 636d063e..8a32038e 100644 --- a/appGUI/preferences/tools/Tools2QRCodePrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2QRCodePrefGroupUI.py @@ -1,7 +1,7 @@ -from PyQt5 import QtWidgets, QtCore, QtGui -from PyQt5.QtCore import Qt, QSettings +from PyQt5 import QtWidgets +from PyQt5.QtCore import QSettings -from appGUI.GUIElements import FCSpinner, RadioSet, FCTextArea, FCEntry, FCColorEntry +from appGUI.GUIElements import FCSpinner, RadioSet, FCTextArea, FCLabel, FCColorEntry from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -28,7 +28,7 @@ class Tools2QRCodePrefGroupUI(OptionsGroupUI): self.decimals = decimals # ## Parameters - self.qrlabel = QtWidgets.QLabel("%s:" % _("Parameters")) + self.qrlabel = FCLabel("%s:" % _("Parameters")) self.qrlabel.setToolTip( _("A tool to create a QRCode that can be inserted\n" "into a selected Gerber file, or it can be exported as a file.") @@ -42,7 +42,7 @@ class Tools2QRCodePrefGroupUI(OptionsGroupUI): grid_lay.setColumnStretch(1, 1) # VERSION # - self.version_label = QtWidgets.QLabel('%s:' % _("Version")) + self.version_label = FCLabel('%s:' % _("Version")) self.version_label.setToolTip( _("QRCode version can have values from 1 (21x21 boxes)\n" "to 40 (177x177 boxes).") @@ -55,7 +55,7 @@ class Tools2QRCodePrefGroupUI(OptionsGroupUI): grid_lay.addWidget(self.version_entry, 1, 1) # ERROR CORRECTION # - self.error_label = QtWidgets.QLabel('%s:' % _("Error correction")) + self.error_label = FCLabel('%s:' % _("Error correction")) self.error_label.setToolTip( _("Parameter that controls the error correction used for the QR Code.\n" "L = maximum 7%% errors can be corrected\n" @@ -78,7 +78,7 @@ class Tools2QRCodePrefGroupUI(OptionsGroupUI): grid_lay.addWidget(self.error_radio, 2, 1) # BOX SIZE # - self.bsize_label = QtWidgets.QLabel('%s:' % _("Box Size")) + self.bsize_label = FCLabel('%s:' % _("Box Size")) self.bsize_label.setToolTip( _("Box size control the overall size of the QRcode\n" "by adjusting the size of each box in the code.") @@ -91,7 +91,7 @@ class Tools2QRCodePrefGroupUI(OptionsGroupUI): grid_lay.addWidget(self.bsize_entry, 3, 1) # BORDER SIZE # - self.border_size_label = QtWidgets.QLabel('%s:' % _("Border Size")) + self.border_size_label = FCLabel('%s:' % _("Border Size")) self.border_size_label.setToolTip( _("Size of the QRCode border. How many boxes thick is the border.\n" "Default value is 4. The width of the clearance around the QRCode.") @@ -104,7 +104,7 @@ class Tools2QRCodePrefGroupUI(OptionsGroupUI): grid_lay.addWidget(self.border_size_entry, 4, 1) # Text box - self.text_label = QtWidgets.QLabel('%s:' % _("QRCode Data")) + self.text_label = FCLabel('%s:' % _("QRCode Data")) self.text_label.setToolTip( _("QRCode Data. Alphanumeric text to be encoded in the QRCode.") ) @@ -116,7 +116,7 @@ class Tools2QRCodePrefGroupUI(OptionsGroupUI): grid_lay.addWidget(self.text_data, 6, 0, 1, 2) # POLARITY CHOICE # - self.pol_label = QtWidgets.QLabel('%s:' % _("Polarity")) + self.pol_label = FCLabel('%s:' % _("Polarity")) self.pol_label.setToolTip( _("Choose the polarity of the QRCode.\n" "It can be drawn in a negative way (squares are clear)\n" @@ -134,7 +134,7 @@ class Tools2QRCodePrefGroupUI(OptionsGroupUI): grid_lay.addWidget(self.pol_radio, 7, 1) # BOUNDING BOX TYPE # - self.bb_label = QtWidgets.QLabel('%s:' % _("Bounding Box")) + self.bb_label = FCLabel('%s:' % _("Bounding Box")) self.bb_label.setToolTip( _("The bounding box, meaning the empty space that surrounds\n" "the QRCode geometry, can have a rounded or a square shape.") @@ -149,7 +149,7 @@ class Tools2QRCodePrefGroupUI(OptionsGroupUI): grid_lay.addWidget(self.bb_radio, 8, 1) # FILL COLOR # - self.fill_color_label = QtWidgets.QLabel('%s:' % _('Fill Color')) + self.fill_color_label = FCLabel('%s:' % _('Fill Color')) self.fill_color_label.setToolTip( _("Set the QRCode fill color (squares color).") ) @@ -159,7 +159,7 @@ class Tools2QRCodePrefGroupUI(OptionsGroupUI): grid_lay.addWidget(self.fill_color_entry, 9, 1) # BACK COLOR # - self.back_color_label = QtWidgets.QLabel('%s:' % _('Back Color')) + self.back_color_label = FCLabel('%s:' % _('Back Color')) self.back_color_label.setToolTip( _("Set the QRCode background color.") ) @@ -169,7 +169,7 @@ class Tools2QRCodePrefGroupUI(OptionsGroupUI): grid_lay.addWidget(self.back_color_entry, 10, 1) # Selection Limit - self.sel_limit_label = QtWidgets.QLabel('%s:' % _("Selection limit")) + self.sel_limit_label = FCLabel('%s:' % _("Selection limit")) self.sel_limit_label.setToolTip( _("Set the number of selected geometry\n" "items above which the utility geometry\n" diff --git a/appGUI/preferences/tools/Tools2RulesCheckPrefGroupUI.py b/appGUI/preferences/tools/Tools2RulesCheckPrefGroupUI.py index 50f94489..be5c28b8 100644 --- a/appGUI/preferences/tools/Tools2RulesCheckPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2RulesCheckPrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from appGUI.GUIElements import FCCheckBox, FCDoubleSpinner +from appGUI.GUIElements import FCCheckBox, FCDoubleSpinner, FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -27,7 +27,7 @@ class Tools2RulesCheckPrefGroupUI(OptionsGroupUI): self.setTitle(str(_("Check Rules Tool Options"))) self.decimals = decimals - self.crlabel = QtWidgets.QLabel("%s:" % _("Parameters")) + self.crlabel = FCLabel("%s:" % _("Parameters")) self.crlabel.setToolTip( _("A tool to check if Gerber files are within a set\n" "of Manufacturing Rules.") @@ -51,7 +51,7 @@ class Tools2RulesCheckPrefGroupUI(OptionsGroupUI): self.trace_size_entry.set_precision(self.decimals) self.trace_size_entry.setSingleStep(0.1) - self.trace_size_lbl = QtWidgets.QLabel('%s:' % _("Min value")) + self.trace_size_lbl = FCLabel('%s:' % _("Min value")) self.trace_size_lbl.setToolTip( _("Minimum acceptable trace size.") ) @@ -71,7 +71,7 @@ class Tools2RulesCheckPrefGroupUI(OptionsGroupUI): self.clearance_copper2copper_entry.set_precision(self.decimals) self.clearance_copper2copper_entry.setSingleStep(0.1) - self.clearance_copper2copper_lbl = QtWidgets.QLabel('%s:' % _("Min value")) + self.clearance_copper2copper_lbl = FCLabel('%s:' % _("Min value")) self.clearance_copper2copper_lbl.setToolTip( _("Minimum acceptable clearance value.") ) @@ -91,7 +91,7 @@ class Tools2RulesCheckPrefGroupUI(OptionsGroupUI): self.clearance_copper2ol_entry.set_precision(self.decimals) self.clearance_copper2ol_entry.setSingleStep(0.1) - self.clearance_copper2ol_lbl = QtWidgets.QLabel('%s:' % _("Min value")) + self.clearance_copper2ol_lbl = FCLabel('%s:' % _("Min value")) self.clearance_copper2ol_lbl.setToolTip( _("Minimum acceptable clearance value.") ) @@ -111,7 +111,7 @@ class Tools2RulesCheckPrefGroupUI(OptionsGroupUI): self.clearance_silk2silk_entry.set_precision(self.decimals) self.clearance_silk2silk_entry.setSingleStep(0.1) - self.clearance_silk2silk_lbl = QtWidgets.QLabel('%s:' % _("Min value")) + self.clearance_silk2silk_lbl = FCLabel('%s:' % _("Min value")) self.clearance_silk2silk_lbl.setToolTip( _("Minimum acceptable clearance value.") ) @@ -131,7 +131,7 @@ class Tools2RulesCheckPrefGroupUI(OptionsGroupUI): self.clearance_silk2sm_entry.set_precision(self.decimals) self.clearance_silk2sm_entry.setSingleStep(0.1) - self.clearance_silk2sm_lbl = QtWidgets.QLabel('%s:' % _("Min value")) + self.clearance_silk2sm_lbl = FCLabel('%s:' % _("Min value")) self.clearance_silk2sm_lbl.setToolTip( _("Minimum acceptable clearance value.") ) @@ -151,7 +151,7 @@ class Tools2RulesCheckPrefGroupUI(OptionsGroupUI): self.clearance_silk2ol_entry.set_precision(self.decimals) self.clearance_silk2ol_entry.setSingleStep(0.1) - self.clearance_silk2ol_lbl = QtWidgets.QLabel('%s:' % _("Min value")) + self.clearance_silk2ol_lbl = FCLabel('%s:' % _("Min value")) self.clearance_silk2ol_lbl.setToolTip( _("Minimum acceptable clearance value.") ) @@ -171,7 +171,7 @@ class Tools2RulesCheckPrefGroupUI(OptionsGroupUI): self.clearance_sm2sm_entry.set_precision(self.decimals) self.clearance_sm2sm_entry.setSingleStep(0.1) - self.clearance_sm2sm_lbl = QtWidgets.QLabel('%s:' % _("Min value")) + self.clearance_sm2sm_lbl = FCLabel('%s:' % _("Min value")) self.clearance_sm2sm_lbl.setToolTip( _("Minimum acceptable clearance value.") ) @@ -191,13 +191,13 @@ class Tools2RulesCheckPrefGroupUI(OptionsGroupUI): self.ring_integrity_entry.set_precision(self.decimals) self.ring_integrity_entry.setSingleStep(0.1) - self.ring_integrity_lbl = QtWidgets.QLabel('%s:' % _("Min value")) + self.ring_integrity_lbl = FCLabel('%s:' % _("Min value")) self.ring_integrity_lbl.setToolTip( _("Minimum acceptable ring value.") ) self.form_layout_1.addRow(self.ring_integrity_lbl, self.ring_integrity_entry) - self.form_layout_1.addRow(QtWidgets.QLabel("")) + self.form_layout_1.addRow(FCLabel("")) # Hole2Hole clearance self.clearance_d2d_cb = FCCheckBox('%s:' % _("Hole to Hole Clearance")) @@ -213,7 +213,7 @@ class Tools2RulesCheckPrefGroupUI(OptionsGroupUI): self.clearance_d2d_entry.set_precision(self.decimals) self.clearance_d2d_entry.setSingleStep(0.1) - self.clearance_d2d_lbl = QtWidgets.QLabel('%s:' % _("Min value")) + self.clearance_d2d_lbl = FCLabel('%s:' % _("Min value")) self.clearance_d2d_lbl.setToolTip( _("Minimum acceptable drill size.") ) @@ -233,7 +233,7 @@ class Tools2RulesCheckPrefGroupUI(OptionsGroupUI): self.drill_size_entry.set_precision(self.decimals) self.drill_size_entry.setSingleStep(0.1) - self.drill_size_lbl = QtWidgets.QLabel('%s:' % _("Min value")) + self.drill_size_lbl = FCLabel('%s:' % _("Min value")) self.drill_size_lbl.setToolTip( _("Minimum acceptable clearance value.") ) diff --git a/appGUI/preferences/tools/Tools2sidedPrefGroupUI.py b/appGUI/preferences/tools/Tools2sidedPrefGroupUI.py index c5c8be7e..d30f008e 100644 --- a/appGUI/preferences/tools/Tools2sidedPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2sidedPrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from appGUI.GUIElements import FCDoubleSpinner, RadioSet +from appGUI.GUIElements import FCDoubleSpinner, RadioSet, FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -28,7 +28,7 @@ class Tools2sidedPrefGroupUI(OptionsGroupUI): self.decimals = decimals # ## Board cuttout - self.dblsided_label = QtWidgets.QLabel("%s:" % _("Parameters")) + self.dblsided_label = FCLabel("%s:" % _("Parameters")) self.dblsided_label.setToolTip( _("A tool to help in creating a double sided\n" "PCB using alignment holes.") @@ -44,7 +44,7 @@ class Tools2sidedPrefGroupUI(OptionsGroupUI): self.drill_dia_entry.set_precision(self.decimals) self.drill_dia_entry.setSingleStep(0.1) - self.dd_label = QtWidgets.QLabel('%s:' % _("Drill Dia")) + self.dd_label = FCLabel('%s:' % _("Drill Dia")) self.dd_label.setToolTip( _("Diameter of the drill for the " "alignment holes.") @@ -53,7 +53,7 @@ class Tools2sidedPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.drill_dia_entry, 0, 1) # ## Alignment Axis - self.align_ax_label = QtWidgets.QLabel('%s:' % _("Align Axis")) + self.align_ax_label = FCLabel('%s:' % _("Align Axis")) self.align_ax_label.setToolTip( _("Mirror vertically (X) or horizontally (Y).") ) @@ -66,7 +66,7 @@ class Tools2sidedPrefGroupUI(OptionsGroupUI): # ## Axis self.mirror_axis_radio = RadioSet([{'label': 'X', 'value': 'X'}, {'label': 'Y', 'value': 'Y'}]) - self.mirax_label = QtWidgets.QLabel('%s:' % _("Mirror Axis")) + self.mirax_label = FCLabel('%s:' % _("Mirror Axis")) self.mirax_label.setToolTip( _("Mirror vertically (X) or horizontally (Y).") ) @@ -87,7 +87,7 @@ class Tools2sidedPrefGroupUI(OptionsGroupUI): {'label': _('Hole Snap'), 'value': 'hole'}, ] ) - self.axloc_label = QtWidgets.QLabel('%s:' % _("Axis Ref")) + self.axloc_label = FCLabel('%s:' % _("Axis Ref")) self.axloc_label.setToolTip( _("The coordinates used as reference for the mirror operation.\n" "Can be:\n" diff --git a/appGUI/preferences/tools/ToolsISOPrefGroupUI.py b/appGUI/preferences/tools/ToolsISOPrefGroupUI.py index 4c34ad09..1f21237c 100644 --- a/appGUI/preferences/tools/ToolsISOPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsISOPrefGroupUI.py @@ -1,7 +1,8 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCComboBox2, FCCheckBox, FCSpinner, NumericalEvalTupleEntry +from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCComboBox2, FCCheckBox, FCSpinner, NumericalEvalTupleEntry, \ + FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -27,7 +28,7 @@ class ToolsISOPrefGroupUI(OptionsGroupUI): self.decimals = decimals # ## Clear non-copper regions - self.iso_label = QtWidgets.QLabel("%s:" % _("Parameters")) + self.iso_label = FCLabel("%s:" % _("Parameters")) self.iso_label.setToolTip( _("Create a Geometry object with\n" "toolpaths to cut around polygons.") @@ -38,7 +39,7 @@ class ToolsISOPrefGroupUI(OptionsGroupUI): self.layout.addLayout(grid0) # Tool Dias - isotdlabel = QtWidgets.QLabel('%s:' % _('Tools Dia')) + isotdlabel = FCLabel('%s:' % _('Tools Dia')) isotdlabel.setToolTip( _("Diameters of the tools, separated by comma.\n" "The value of the diameter has to use the dot decimals separator.\n" @@ -51,7 +52,7 @@ class ToolsISOPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.tool_dia_entry, 0, 1, 1, 2) # Tool order Radio Button - self.order_label = QtWidgets.QLabel('%s:' % _('Tool order')) + self.order_label = FCLabel('%s:' % _('Tool order')) 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" "'Forward' --> means that the tools will be ordered from small to big\n" @@ -67,7 +68,7 @@ class ToolsISOPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.order_radio, 1, 1, 1, 2) # Tool Type Radio Button - self.tool_type_label = QtWidgets.QLabel('%s:' % _('Tool Type')) + self.tool_type_label = FCLabel('%s:' % _('Tool Type')) self.tool_type_label.setToolTip( _("Default tool type:\n" "- 'V-shape'\n" @@ -86,7 +87,7 @@ class ToolsISOPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.tool_type_radio, 2, 1, 1, 2) # Tip Dia - self.tipdialabel = QtWidgets.QLabel('%s:' % _('V-Tip Dia')) + self.tipdialabel = FCLabel('%s:' % _('V-Tip Dia')) self.tipdialabel.setToolTip( _("The tip diameter for V-Shape Tool")) self.tipdia_entry = FCDoubleSpinner() @@ -98,7 +99,7 @@ class ToolsISOPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.tipdia_entry, 3, 1, 1, 2) # Tip Angle - self.tipanglelabel = QtWidgets.QLabel('%s:' % _('V-Tip Angle')) + self.tipanglelabel = FCLabel('%s:' % _('V-Tip Angle')) self.tipanglelabel.setToolTip( _("The tip angle for V-Shape Tool.\n" "In degrees.")) @@ -112,7 +113,7 @@ class ToolsISOPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.tipangle_entry, 4, 1, 1, 2) # Cut Z entry - cutzlabel = QtWidgets.QLabel('%s:' % _('Cut Z')) + cutzlabel = FCLabel('%s:' % _('Cut Z')) cutzlabel.setToolTip( _("Depth of cut into material. Negative value.\n" "In application units.") @@ -131,7 +132,7 @@ class ToolsISOPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.cutz_entry, 5, 1, 1, 2) # New Diameter - self.newdialabel = QtWidgets.QLabel('%s:' % _('New Dia')) + self.newdialabel = FCLabel('%s:' % _('New Dia')) self.newdialabel.setToolTip( _("Diameter for the new tool to add in the Tool Table.\n" "If the tool is V-shape type then this value is automatically\n" @@ -151,7 +152,7 @@ class ToolsISOPrefGroupUI(OptionsGroupUI): grid0.addWidget(separator_line, 7, 0, 1, 3) # Passes - passlabel = QtWidgets.QLabel('%s:' % _('Passes')) + passlabel = FCLabel('%s:' % _('Passes')) passlabel.setToolTip( _("Width of the isolation gap in\n" "number (integer) of tool widths.") @@ -164,7 +165,7 @@ class ToolsISOPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.passes_entry, 8, 1, 1, 2) # Overlap Entry - overlabel = QtWidgets.QLabel('%s:' % _('Overlap')) + overlabel = FCLabel('%s:' % _('Overlap')) overlabel.setToolTip( _("How much (percentage) of the tool width to overlap each tool pass.") ) @@ -179,7 +180,7 @@ class ToolsISOPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.overlap_entry, 9, 1, 1, 2) # Milling Type Radio Button - self.milling_type_label = QtWidgets.QLabel('%s:' % _('Milling Type')) + self.milling_type_label = FCLabel('%s:' % _('Milling Type')) self.milling_type_label.setToolTip( _("Milling type:\n" "- climb / best for precision milling and to reduce tool usage\n" @@ -198,7 +199,7 @@ class ToolsISOPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.milling_type_radio, 10, 1, 1, 2) # Isolation Type - self.iso_type_label = QtWidgets.QLabel('%s:' % _('Isolation Type')) + self.iso_type_label = FCLabel('%s:' % _('Isolation Type')) self.iso_type_label.setToolTip( _("Choose how the isolation will be executed:\n" "- 'Full' -> complete isolation of polygons\n" @@ -265,7 +266,7 @@ class ToolsISOPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.valid_cb, 18, 0, 1, 3) # Isolation Scope - self.select_label = QtWidgets.QLabel('%s:' % _("Selection")) + self.select_label = FCLabel('%s:' % _("Selection")) self.select_label.setToolTip( _("Isolation scope. Choose what to isolate:\n" "- 'All' -> Isolate all the polygons in the object\n" @@ -283,7 +284,7 @@ class ToolsISOPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.select_combo, 20, 1, 1, 2) # Area Shape - self.area_shape_label = QtWidgets.QLabel('%s:' % _("Shape")) + self.area_shape_label = FCLabel('%s:' % _("Shape")) self.area_shape_label.setToolTip( _("The kind of selection shape used for area selection.") ) @@ -319,7 +320,7 @@ class ToolsISOPrefGroupUI(OptionsGroupUI): # ## Plotting type self.plotting_radio = RadioSet([{'label': _('Normal'), 'value': 'normal'}, {"label": _("Progressive"), "value": "progressive"}]) - plotting_label = QtWidgets.QLabel('%s:' % _("Plotting")) + plotting_label = FCLabel('%s:' % _("Plotting")) plotting_label.setToolTip( _("- 'Normal' - normal plotting, done at the end of the job\n" "- 'Progressive' - each shape is plotted after it is generated") diff --git a/appGUI/preferences/tools/ToolsNCCPrefGroupUI.py b/appGUI/preferences/tools/ToolsNCCPrefGroupUI.py index 73f10189..620d36ad 100644 --- a/appGUI/preferences/tools/ToolsNCCPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsNCCPrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCCheckBox, NumericalEvalTupleEntry, FCComboBox2 +from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCCheckBox, NumericalEvalTupleEntry, FCComboBox2, FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -28,7 +28,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI): self.decimals = decimals # ## Clear non-copper regions - self.clearcopper_label = QtWidgets.QLabel("%s:" % _("Parameters")) + self.clearcopper_label = FCLabel("%s:" % _("Parameters")) self.clearcopper_label.setToolTip( _("Create a Geometry object with\n" "toolpaths to cut all non-copper regions.") @@ -38,7 +38,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI): grid0 = QtWidgets.QGridLayout() self.layout.addLayout(grid0) - ncctdlabel = QtWidgets.QLabel('%s:' % _('Tools Dia')) + ncctdlabel = FCLabel('%s:' % _('Tools Dia')) ncctdlabel.setToolTip( _("Diameters of the tools, separated by comma.\n" "The value of the diameter has to use the dot decimals separator.\n" @@ -50,7 +50,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.ncc_tool_dia_entry, 0, 1) # Tool Type Radio Button - self.tool_type_label = QtWidgets.QLabel('%s:' % _('Tool Type')) + self.tool_type_label = FCLabel('%s:' % _('Tool Type')) self.tool_type_label.setToolTip( _("Default tool type:\n" "- 'V-shape'\n" @@ -69,7 +69,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.tool_type_radio, 1, 1) # Tip Dia - self.tipdialabel = QtWidgets.QLabel('%s:' % _('V-Tip Dia')) + self.tipdialabel = FCLabel('%s:' % _('V-Tip Dia')) self.tipdialabel.setToolTip( _("The tip diameter for V-Shape Tool")) self.tipdia_entry = FCDoubleSpinner() @@ -81,7 +81,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.tipdia_entry, 2, 1) # Tip Angle - self.tipanglelabel = QtWidgets.QLabel('%s:' % _('V-Tip Angle')) + self.tipanglelabel = FCLabel('%s:' % _('V-Tip Angle')) self.tipanglelabel.setToolTip( _("The tip angle for V-Shape Tool.\n" "In degree.")) @@ -95,7 +95,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.tipangle_entry, 3, 1) # Cut Z entry - cutzlabel = QtWidgets.QLabel('%s:' % _('Cut Z')) + cutzlabel = FCLabel('%s:' % _('Cut Z')) cutzlabel.setToolTip( _("Depth of cut into material. Negative value.\n" "In application units.") @@ -114,7 +114,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.cutz_entry, 4, 1) # New Diameter - self.newdialabel = QtWidgets.QLabel('%s:' % _('New Dia')) + self.newdialabel = FCLabel('%s:' % _('New Dia')) self.newdialabel.setToolTip( _("Diameter for the new tool to add in the Tool Table.\n" "If the tool is V-shape type then this value is automatically\n" @@ -134,7 +134,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI): grid0.addWidget(separator_line, 6, 0, 1, 2) # Milling Type Radio Button - self.milling_type_label = QtWidgets.QLabel('%s:' % _('Milling Type')) + self.milling_type_label = FCLabel('%s:' % _('Milling Type')) self.milling_type_label.setToolTip( _("Milling type:\n" "- climb / best for precision milling and to reduce tool usage\n" @@ -153,7 +153,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.milling_type_radio, 7, 1) # Tool order Radio Button - self.ncc_order_label = QtWidgets.QLabel('%s:' % _('Tool order')) + self.ncc_order_label = FCLabel('%s:' % _('Tool order')) 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" "'Forward' --> means that the tools will be ordered from small to big\n" @@ -179,7 +179,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI): grid0.addWidget(separator_line, 9, 0, 1, 2) # Overlap Entry - nccoverlabel = QtWidgets.QLabel('%s:' % _('Overlap')) + nccoverlabel = FCLabel('%s:' % _('Overlap')) nccoverlabel.setToolTip( _("How much (percentage) of the tool width to overlap each tool pass.\n" "Adjust the value starting with lower values\n" @@ -199,7 +199,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.ncc_overlap_entry, 10, 1) # Margin entry - nccmarginlabel = QtWidgets.QLabel('%s:' % _('Margin')) + nccmarginlabel = FCLabel('%s:' % _('Margin')) nccmarginlabel.setToolTip( _("Bounding box margin.") ) @@ -212,7 +212,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.ncc_margin_entry, 11, 1) # Method - methodlabel = QtWidgets.QLabel('%s:' % _('Method')) + methodlabel = FCLabel('%s:' % _('Method')) methodlabel.setToolTip( _("Algorithm for copper clearing:\n" "- Standard: Fixed step inwards.\n" @@ -262,7 +262,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.ncc_choice_offset_cb, 14, 0, 1, 2) # ## NCC Offset value - self.ncc_offset_label = QtWidgets.QLabel('%s:' % _("Offset value")) + self.ncc_offset_label = FCLabel('%s:' % _("Offset value")) self.ncc_offset_label.setToolTip( _("If used, it will add an offset to the copper features.\n" "The copper clearing will finish to a distance\n" @@ -306,7 +306,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI): self.select_combo.addItems( [_("Itself"), _("Area Selection"), _("Reference Object")] ) - select_label = QtWidgets.QLabel('%s:' % _("Selection")) + select_label = FCLabel('%s:' % _("Selection")) select_label.setToolTip( _("Selection of area to be processed.\n" "- 'Itself' - the processing extent is based on the object that is processed.\n " @@ -317,7 +317,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI): grid0.addWidget(select_label, 18, 0) grid0.addWidget(self.select_combo, 18, 1) - self.area_shape_label = QtWidgets.QLabel('%s:' % _("Shape")) + self.area_shape_label = FCLabel('%s:' % _("Shape")) self.area_shape_label.setToolTip( _("The kind of selection shape used for area selection.") ) @@ -336,7 +336,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI): # ## Plotting type self.plotting_radio = RadioSet([{'label': _('Normal'), 'value': 'normal'}, {"label": _("Progressive"), "value": "progressive"}]) - plotting_label = QtWidgets.QLabel('%s:' % _("Plotting")) + plotting_label = FCLabel('%s:' % _("Plotting")) plotting_label.setToolTip( _("- 'Normal' - normal plotting, done at the end of the job\n" "- 'Progressive' - each shape is plotted after it is generated") diff --git a/appGUI/preferences/tools/ToolsPaintPrefGroupUI.py b/appGUI/preferences/tools/ToolsPaintPrefGroupUI.py index d4141ac2..6343b410 100644 --- a/appGUI/preferences/tools/ToolsPaintPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsPaintPrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCComboBox2, FCCheckBox, NumericalEvalTupleEntry +from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCComboBox2, FCCheckBox, NumericalEvalTupleEntry, FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -30,7 +30,7 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI): # ------------------------------ # ## Paint area # ------------------------------ - self.paint_label = QtWidgets.QLabel('%s:' % _('Parameters')) + self.paint_label = FCLabel('%s:' % _('Parameters')) self.paint_label.setToolTip( _("Creates tool paths to cover the\n" "whole area of a polygon.") @@ -43,7 +43,7 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI): self.layout.addLayout(grid0) # Tool dia - ptdlabel = QtWidgets.QLabel('%s:' % _('Tools Dia')) + ptdlabel = FCLabel('%s:' % _('Tools Dia')) ptdlabel.setToolTip( _("Diameters of the tools, separated by comma.\n" "The value of the diameter has to use the dot decimals separator.\n" @@ -57,7 +57,7 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.painttooldia_entry, 0, 1) # Tool Type Radio Button - self.tool_type_label = QtWidgets.QLabel('%s:' % _('Tool Type')) + self.tool_type_label = FCLabel('%s:' % _('Tool Type')) self.tool_type_label.setToolTip( _("Default tool type:\n" "- 'V-shape'\n" @@ -73,7 +73,7 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.tool_type_radio, 1, 1) # Tip Dia - self.tipdialabel = QtWidgets.QLabel('%s:' % _('V-Tip Dia')) + self.tipdialabel = FCLabel('%s:' % _('V-Tip Dia')) self.tipdialabel.setToolTip( _("The tip diameter for V-Shape Tool")) self.tipdia_entry = FCDoubleSpinner() @@ -86,7 +86,7 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.tipdia_entry, 2, 1) # Tip Angle - self.tipanglelabel = QtWidgets.QLabel('%s:' % _('V-Tip Angle')) + self.tipanglelabel = FCLabel('%s:' % _('V-Tip Angle')) self.tipanglelabel.setToolTip( _("The tip angle for V-Shape Tool.\n" "In degree.")) @@ -100,7 +100,7 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.tipangle_entry, 3, 1) # Cut Z entry - cutzlabel = QtWidgets.QLabel('%s:' % _('Cut Z')) + cutzlabel = FCLabel('%s:' % _('Cut Z')) cutzlabel.setToolTip( _("Depth of cut into material. Negative value.\n" "In application units.") @@ -118,7 +118,7 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.cutz_entry, 4, 1) # ### Tool Diameter #### - self.newdialabel = QtWidgets.QLabel('%s:' % _('New Dia')) + self.newdialabel = FCLabel('%s:' % _('New Dia')) self.newdialabel.setToolTip( _("Diameter for the new tool to add in the Tool Table.\n" "If the tool is V-shape type then this value is automatically\n" @@ -137,7 +137,7 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI): separator_line.setFrameShadow(QtWidgets.QFrame.Sunken) grid0.addWidget(separator_line, 6, 0, 1, 2) - self.paint_order_label = QtWidgets.QLabel('%s:' % _('Tool order')) + self.paint_order_label = FCLabel('%s:' % _('Tool order')) 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" "'Forward' --> means that the tools will be ordered from small to big\n" @@ -158,7 +158,7 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI): grid0.addWidget(separator_line, 8, 0, 1, 2) # Overlap - ovlabel = QtWidgets.QLabel('%s:' % _('Overlap')) + ovlabel = FCLabel('%s:' % _('Overlap')) ovlabel.setToolTip( _("How much (percentage) of the tool width to overlap each tool pass.\n" "Adjust the value starting with lower values\n" @@ -178,7 +178,7 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.paintoverlap_entry, 9, 1) # Margin - marginlabel = QtWidgets.QLabel('%s:' % _('Margin')) + marginlabel = FCLabel('%s:' % _('Margin')) marginlabel.setToolTip( _("Distance by which to avoid\n" "the edges of the polygon to\n" @@ -193,7 +193,7 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.paintmargin_entry, 10, 1) # Method - methodlabel = QtWidgets.QLabel('%s:' % _('Method')) + methodlabel = FCLabel('%s:' % _('Method')) methodlabel.setToolTip( _("Algorithm for painting:\n" "- Standard: Fixed step inwards.\n" @@ -253,7 +253,7 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.rest_cb, 14, 0, 1, 2) # Polygon selection - selectlabel = QtWidgets.QLabel('%s:' % _('Selection')) + selectlabel = FCLabel('%s:' % _('Selection')) selectlabel.setToolTip( _("Selection of area to be processed.\n" "- 'Polygon Selection' - left mouse click to add/remove polygons to be processed.\n" @@ -281,7 +281,7 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI): grid0.addWidget(selectlabel, 15, 0) grid0.addWidget(self.selectmethod_combo, 15, 1) - self.area_shape_label = QtWidgets.QLabel('%s:' % _("Shape")) + self.area_shape_label = FCLabel('%s:' % _("Shape")) self.area_shape_label.setToolTip( _("The kind of selection shape used for area selection.") ) @@ -300,7 +300,7 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI): # ## Plotting type self.paint_plotting_radio = RadioSet([{'label': _('Normal'), 'value': 'normal'}, {"label": _("Progressive"), "value": "progressive"}]) - plotting_label = QtWidgets.QLabel('%s:' % _("Plotting")) + plotting_label = FCLabel('%s:' % _("Plotting")) plotting_label.setToolTip( _("- 'Normal' - normal plotting, done at the end of the job\n" "- 'Progressive' - each shape is plotted after it is generated") diff --git a/appGUI/preferences/tools/ToolsPanelizePrefGroupUI.py b/appGUI/preferences/tools/ToolsPanelizePrefGroupUI.py index 005a2684..ad040393 100644 --- a/appGUI/preferences/tools/ToolsPanelizePrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsPanelizePrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from appGUI.GUIElements import FCDoubleSpinner, FCSpinner, RadioSet, FCCheckBox +from appGUI.GUIElements import FCDoubleSpinner, FCSpinner, RadioSet, FCCheckBox, FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -28,7 +28,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI): self.decimals = decimals # ## Board cuttout - self.panelize_label = QtWidgets.QLabel("%s:" % _("Parameters")) + self.panelize_label = FCLabel("%s:" % _("Parameters")) self.panelize_label.setToolTip( _("Create an object that contains an array of (x, y) elements,\n" "each element is a copy of the source object spaced\n" @@ -47,7 +47,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI): self.pspacing_columns.set_precision(self.decimals) self.pspacing_columns.setSingleStep(0.1) - self.spacing_columns_label = QtWidgets.QLabel('%s:' % _("Spacing cols")) + self.spacing_columns_label = FCLabel('%s:' % _("Spacing cols")) self.spacing_columns_label.setToolTip( _("Spacing between columns of the desired panel.\n" "In current units.") @@ -61,7 +61,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI): self.pspacing_rows.set_precision(self.decimals) self.pspacing_rows.setSingleStep(0.1) - self.spacing_rows_label = QtWidgets.QLabel('%s:' % _("Spacing rows")) + self.spacing_rows_label = FCLabel('%s:' % _("Spacing rows")) self.spacing_rows_label.setToolTip( _("Spacing between rows of the desired panel.\n" "In current units.") @@ -74,7 +74,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI): self.pcolumns.set_range(1, 1000) self.pcolumns.set_step(1) - self.columns_label = QtWidgets.QLabel('%s:' % _("Columns")) + self.columns_label = FCLabel('%s:' % _("Columns")) self.columns_label.setToolTip( _("Number of columns of the desired panel") ) @@ -86,7 +86,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI): self.prows.set_range(1, 1000) self.prows.set_step(1) - self.rows_label = QtWidgets.QLabel('%s:' % _("Rows")) + self.rows_label = FCLabel('%s:' % _("Rows")) self.rows_label.setToolTip( _("Number of rows of the desired panel") ) @@ -96,7 +96,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI): # ## Type of resulting Panel object self.panel_type_radio = RadioSet([{'label': _('Gerber'), 'value': 'gerber'}, {'label': _('Geo'), 'value': 'geometry'}]) - self.panel_type_label = QtWidgets.QLabel('%s:' % _("Panel Type")) + self.panel_type_label = FCLabel('%s:' % _("Panel Type")) self.panel_type_label.setToolTip( _("Choose the type of object for the panel object:\n" "- Gerber\n" @@ -132,7 +132,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI): self.px_width_entry.set_precision(self.decimals) self.px_width_entry.setSingleStep(0.1) - self.x_width_lbl = QtWidgets.QLabel('%s:' % _("Width (DX)")) + self.x_width_lbl = FCLabel('%s:' % _("Width (DX)")) self.x_width_lbl.setToolTip( _("The width (DX) within which the panel must fit.\n" "In current units.") @@ -145,7 +145,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI): self.py_height_entry.set_precision(self.decimals) self.py_height_entry.setSingleStep(0.1) - self.y_height_lbl = QtWidgets.QLabel('%s:' % _("Height (DY)")) + self.y_height_lbl = FCLabel('%s:' % _("Height (DY)")) self.y_height_lbl.setToolTip( _("The height (DY)within which the panel must fit.\n" "In current units.") diff --git a/appGUI/preferences/tools/ToolsSolderpastePrefGroupUI.py b/appGUI/preferences/tools/ToolsSolderpastePrefGroupUI.py index fdeb1253..1ce762e6 100644 --- a/appGUI/preferences/tools/ToolsSolderpastePrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsSolderpastePrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from appGUI.GUIElements import FCDoubleSpinner, FCSpinner, FCComboBox, NumericalEvalTupleEntry +from appGUI.GUIElements import FCDoubleSpinner, FCSpinner, FCComboBox, NumericalEvalTupleEntry, FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -28,7 +28,7 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): self.decimals = decimals # ## Solder Paste Dispensing - self.solderpastelabel = QtWidgets.QLabel("%s:" % _("Parameters")) + self.solderpastelabel = FCLabel("%s:" % _("Parameters")) self.solderpastelabel.setToolTip( _("A tool to create GCode for dispensing\n" "solder paste onto a PCB.") @@ -39,7 +39,7 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): self.layout.addLayout(grid0) # Nozzle Tool Diameters - nozzletdlabel = QtWidgets.QLabel('%s:' % _('Tools Dia')) + nozzletdlabel = FCLabel('%s:' % _('Tools Dia')) nozzletdlabel.setToolTip( _("Diameters of the tools, separated by comma.\n" "The value of the diameter has to use the dot decimals separator.\n" @@ -51,7 +51,7 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): grid0.addWidget(self.nozzle_tool_dia_entry, 0, 1) # New Nozzle Tool Dia - self.addtool_entry_lbl = QtWidgets.QLabel('%s:' % _('New Nozzle Dia')) + self.addtool_entry_lbl = FCLabel('%s:' % _('New Nozzle Dia')) self.addtool_entry_lbl.setToolTip( _("Diameter for the new tool to add in the Tool Table") ) @@ -69,7 +69,7 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): self.z_start_entry.set_range(0.0000001, 10000.0000) self.z_start_entry.setSingleStep(0.1) - self.z_start_label = QtWidgets.QLabel('%s:' % _("Z Dispense Start")) + self.z_start_label = FCLabel('%s:' % _("Z Dispense Start")) self.z_start_label.setToolTip( _("The height (Z) when solder paste dispensing starts.") ) @@ -82,7 +82,7 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): self.z_dispense_entry.set_range(0.0000001, 10000.0000) self.z_dispense_entry.setSingleStep(0.1) - self.z_dispense_label = QtWidgets.QLabel('%s:' % _("Z Dispense")) + self.z_dispense_label = FCLabel('%s:' % _("Z Dispense")) self.z_dispense_label.setToolTip( _("The height (Z) when doing solder paste dispensing.") ) @@ -95,7 +95,7 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): self.z_stop_entry.set_range(0.0000001, 10000.0000) self.z_stop_entry.setSingleStep(0.1) - self.z_stop_label = QtWidgets.QLabel('%s:' % _("Z Dispense Stop")) + self.z_stop_label = FCLabel('%s:' % _("Z Dispense Stop")) self.z_stop_label.setToolTip( _("The height (Z) when solder paste dispensing stops.") ) @@ -108,7 +108,7 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): self.z_travel_entry.set_range(0.0000001, 10000.0000) self.z_travel_entry.setSingleStep(0.1) - self.z_travel_label = QtWidgets.QLabel('%s:' % _("Z Travel")) + self.z_travel_label = FCLabel('%s:' % _("Z Travel")) self.z_travel_label.setToolTip( _("The height (Z) for travel between pads\n" "(without dispensing solder paste).") @@ -122,7 +122,7 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): self.z_toolchange_entry.set_range(0.0000001, 10000.0000) self.z_toolchange_entry.setSingleStep(0.1) - self.z_toolchange_label = QtWidgets.QLabel('%s:' % _("Z Toolchange")) + self.z_toolchange_label = FCLabel('%s:' % _("Z Toolchange")) self.z_toolchange_label.setToolTip( _("The height (Z) for tool (nozzle) change.") ) @@ -131,7 +131,7 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): # X,Y Toolchange location self.xy_toolchange_entry = NumericalEvalTupleEntry(border_color='#0069A9') - self.xy_toolchange_label = QtWidgets.QLabel('%s:' % _("Toolchange X-Y")) + self.xy_toolchange_label = FCLabel('%s:' % _("Toolchange X-Y")) self.xy_toolchange_label.setToolTip( _("The X,Y location for tool (nozzle) change.\n" "The format is (x, y) where x and y are real numbers.") @@ -145,7 +145,7 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): self.frxy_entry.set_range(0.0000001, 910000.0000) self.frxy_entry.setSingleStep(0.1) - self.frxy_label = QtWidgets.QLabel('%s:' % _("Feedrate X-Y")) + self.frxy_label = FCLabel('%s:' % _("Feedrate X-Y")) self.frxy_label.setToolTip( _("Feedrate (speed) while moving on the X-Y plane.") ) @@ -158,7 +158,7 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): self.frz_entry.set_range(0.0000001, 910000.0000) self.frz_entry.setSingleStep(0.1) - self.frz_label = QtWidgets.QLabel('%s:' % _("Feedrate Z")) + self.frz_label = FCLabel('%s:' % _("Feedrate Z")) self.frz_label.setToolTip( _("Feedrate (speed) while moving vertically\n" "(on Z plane).") @@ -172,7 +172,7 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): self.frz_dispense_entry.set_range(0.0000001, 910000.0000) self.frz_dispense_entry.setSingleStep(0.1) - self.frz_dispense_label = QtWidgets.QLabel('%s:' % _("Feedrate Z Dispense")) + self.frz_dispense_label = FCLabel('%s:' % _("Feedrate Z Dispense")) self.frz_dispense_label.setToolTip( _("Feedrate (speed) while moving up vertically\n" "to Dispense position (on Z plane).") @@ -185,7 +185,7 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): self.speedfwd_entry.set_range(0, 99999) self.speedfwd_entry.set_step(1000) - self.speedfwd_label = QtWidgets.QLabel('%s:' % _("Spindle Speed FWD")) + self.speedfwd_label = FCLabel('%s:' % _("Spindle Speed FWD")) self.speedfwd_label.setToolTip( _("The dispenser speed while pushing solder paste\n" "through the dispenser nozzle.") @@ -199,7 +199,7 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): self.dwellfwd_entry.set_range(0.0000001, 10000.0000) self.dwellfwd_entry.setSingleStep(0.1) - self.dwellfwd_label = QtWidgets.QLabel('%s:' % _("Dwell FWD")) + self.dwellfwd_label = FCLabel('%s:' % _("Dwell FWD")) self.dwellfwd_label.setToolTip( _("Pause after solder dispensing.") ) @@ -211,7 +211,7 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): self.speedrev_entry.set_range(0, 999999) self.speedrev_entry.set_step(1000) - self.speedrev_label = QtWidgets.QLabel('%s:' % _("Spindle Speed REV")) + self.speedrev_label = FCLabel('%s:' % _("Spindle Speed REV")) self.speedrev_label.setToolTip( _("The dispenser speed while retracting solder paste\n" "through the dispenser nozzle.") @@ -225,7 +225,7 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): self.dwellrev_entry.set_range(0.0000001, 10000.0000) self.dwellrev_entry.setSingleStep(0.1) - self.dwellrev_label = QtWidgets.QLabel('%s:' % _("Dwell REV")) + self.dwellrev_label = FCLabel('%s:' % _("Dwell REV")) self.dwellrev_label.setToolTip( _("Pause after solder paste dispenser retracted,\n" "to allow pressure equilibrium.") @@ -234,7 +234,7 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): grid0.addWidget(self.dwellrev_entry, 14, 1) # Preprocessors - pp_label = QtWidgets.QLabel('%s:' % _('Preprocessor')) + pp_label = FCLabel('%s:' % _('Preprocessor')) pp_label.setToolTip( _("Files that control the GCode generation.") ) diff --git a/appGUI/preferences/tools/ToolsSubPrefGroupUI.py b/appGUI/preferences/tools/ToolsSubPrefGroupUI.py index a6cb20dc..08d48d4d 100644 --- a/appGUI/preferences/tools/ToolsSubPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsSubPrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from appGUI.GUIElements import FCCheckBox +from appGUI.GUIElements import FCCheckBox, FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -28,7 +28,7 @@ class ToolsSubPrefGroupUI(OptionsGroupUI): self.decimals = decimals # ## Subtractor Tool Parameters - self.sublabel = QtWidgets.QLabel("%s:" % _("Parameters")) + self.sublabel = FCLabel("%s:" % _("Parameters")) self.sublabel.setToolTip( _("A tool to substract one Gerber or Geometry object\n" "from another of the same type.") diff --git a/appGUI/preferences/tools/ToolsTransformPrefGroupUI.py b/appGUI/preferences/tools/ToolsTransformPrefGroupUI.py index 3a3bb9d0..bff2058d 100644 --- a/appGUI/preferences/tools/ToolsTransformPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsTransformPrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt5 import QtWidgets, QtGui from PyQt5.QtCore import QSettings -from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, NumericalEvalTupleEntry, FCComboBox +from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, NumericalEvalTupleEntry, FCComboBox, FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -28,7 +28,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI): self.decimals = decimals # ## Transformations - self.transform_label = QtWidgets.QLabel("%s:" % _("Parameters")) + self.transform_label = FCLabel("%s:" % _("Parameters")) self.transform_label.setToolTip( _("Various transformations that can be applied\n" "on a application object.") @@ -41,7 +41,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI): grid0.setColumnStretch(1, 1) # Reference Type - ref_label = QtWidgets.QLabel('%s:' % _("Reference")) + ref_label = FCLabel('%s:' % _("Reference")) ref_label.setToolTip( _("The reference point for Rotate, Skew, Scale, Mirror.\n" "Can be:\n" @@ -57,7 +57,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI): grid0.addWidget(ref_label, 0, 0) grid0.addWidget(self.ref_combo, 0, 1) - self.point_label = QtWidgets.QLabel('%s:' % _("Point")) + self.point_label = FCLabel('%s:' % _("Point")) self.point_label.setToolTip( _("A point of reference in format X,Y.") ) @@ -67,7 +67,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.point_entry, 1, 1) # Type of object to be used as reference - self.type_object_label = QtWidgets.QLabel('%s:' % _("Object")) + self.type_object_label = FCLabel('%s:' % _("Object")) self.type_object_label.setToolTip( _("The type of object used as reference.") ) @@ -85,7 +85,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.type_obj_combo, 3, 1) # ## Rotate Angle - rotate_title_lbl = QtWidgets.QLabel('%s' % _("Rotate")) + rotate_title_lbl = FCLabel('%s' % _("Rotate")) grid0.addWidget(rotate_title_lbl, 4, 0, 1, 2) self.rotate_entry = FCDoubleSpinner() @@ -93,7 +93,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI): self.rotate_entry.set_precision(self.decimals) self.rotate_entry.setSingleStep(15) - self.rotate_label = QtWidgets.QLabel('%s:' % _("Angle")) + self.rotate_label = FCLabel('%s:' % _("Angle")) self.rotate_label.setToolTip( _("Angle, in degrees.\n" "Float number between -360 and 359.\n" @@ -104,7 +104,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.rotate_entry, 6, 1) # ## Skew/Shear Angle on X axis - skew_title_lbl = QtWidgets.QLabel('%s' % _("Skew")) + skew_title_lbl = FCLabel('%s' % _("Skew")) grid0.addWidget(skew_title_lbl, 8, 0) # ## Link Skew factors @@ -121,7 +121,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI): self.skewx_entry.set_precision(self.decimals) self.skewx_entry.setSingleStep(0.1) - self.skewx_label = QtWidgets.QLabel('%s:' % _("X angle")) + self.skewx_label = FCLabel('%s:' % _("X angle")) self.skewx_label.setToolTip( _("Angle, in degrees.\n" "Float number between -360 and 359.") @@ -135,7 +135,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI): self.skewy_entry.set_precision(self.decimals) self.skewy_entry.setSingleStep(0.1) - self.skewy_label = QtWidgets.QLabel('%s:' % _("Y angle")) + self.skewy_label = FCLabel('%s:' % _("Y angle")) self.skewy_label.setToolTip( _("Angle, in degrees.\n" "Float number between -360 and 359.") @@ -144,7 +144,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.skewy_entry, 10, 1) # ## Scale - scale_title_lbl = QtWidgets.QLabel('%s' % _("Scale")) + scale_title_lbl = FCLabel('%s' % _("Scale")) grid0.addWidget(scale_title_lbl, 12, 0) # ## Link Scale factors @@ -159,7 +159,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI): self.scalex_entry.set_precision(self.decimals) self.scalex_entry.setSingleStep(0.1) - self.scalex_label = QtWidgets.QLabel('%s:' % _("X factor")) + self.scalex_label = FCLabel('%s:' % _("X factor")) self.scalex_label.setToolTip( _("Factor for scaling on X axis.") ) @@ -172,7 +172,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI): self.scaley_entry.set_precision(self.decimals) self.scaley_entry.setSingleStep(0.1) - self.scaley_label = QtWidgets.QLabel('%s:' % _("Y factor")) + self.scaley_label = FCLabel('%s:' % _("Y factor")) self.scaley_label.setToolTip( _("Factor for scaling on Y axis.") ) @@ -180,7 +180,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.scaley_entry, 16, 1) # ## Offset - offset_title_lbl = QtWidgets.QLabel('%s' % _("Offset")) + offset_title_lbl = FCLabel('%s' % _("Offset")) grid0.addWidget(offset_title_lbl, 20, 0, 1, 2) self.offx_entry = FCDoubleSpinner() @@ -188,7 +188,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI): self.offx_entry.set_precision(self.decimals) self.offx_entry.setSingleStep(0.1) - self.offx_label = QtWidgets.QLabel('%s:' % _("X val")) + self.offx_label = FCLabel('%s:' % _("X val")) self.offx_label.setToolTip( _("Distance to offset on X axis. In current units.") ) @@ -201,7 +201,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI): self.offy_entry.set_precision(self.decimals) self.offy_entry.setSingleStep(0.1) - self.offy_label = QtWidgets.QLabel('%s:' % _("Y val")) + self.offy_label = FCLabel('%s:' % _("Y val")) self.offy_label.setToolTip( _("Distance to offset on Y axis. In current units.") ) @@ -209,7 +209,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.offy_entry, 24, 1) # ## Buffer - buffer_title_lbl = QtWidgets.QLabel('%s' % _("Buffer")) + buffer_title_lbl = FCLabel('%s' % _("Buffer")) grid0.addWidget(buffer_title_lbl, 26, 0) self.buffer_rounded_cb = FCCheckBox() @@ -223,7 +223,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.buffer_rounded_cb, 26, 1) - self.buffer_label = QtWidgets.QLabel('%s:' % _("Distance")) + self.buffer_label = FCLabel('%s:' % _("Distance")) self.buffer_label.setToolTip( _("A positive value will create the effect of dilation,\n" "while a negative value will create the effect of erosion.\n" @@ -240,7 +240,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI): grid0.addWidget(self.buffer_label, 28, 0) grid0.addWidget(self.buffer_entry, 28, 1) - self.buffer_factor_label = QtWidgets.QLabel('%s:' % _("Value")) + self.buffer_factor_label = FCLabel('%s:' % _("Value")) self.buffer_factor_label.setToolTip( _("A positive value will create the effect of dilation,\n" "while a negative value will create the effect of erosion.\n" diff --git a/appGUI/preferences/utilities/AutoCompletePrefGroupUI.py b/appGUI/preferences/utilities/AutoCompletePrefGroupUI.py index 97c8f950..b3e5c56f 100644 --- a/appGUI/preferences/utilities/AutoCompletePrefGroupUI.py +++ b/appGUI/preferences/utilities/AutoCompletePrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt5 import QtWidgets, QtGui from PyQt5.QtCore import QSettings -from appGUI.GUIElements import FCButton, FCTextArea, FCEntry +from appGUI.GUIElements import FCButton, FCTextArea, FCEntry, FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -38,7 +38,7 @@ class AutoCompletePrefGroupUI(OptionsGroupUI): hlay0.addWidget(self.del_all_btn) # ## Gerber associations - self.grb_list_label = QtWidgets.QLabel("%s:" % _("Keywords list")) + self.grb_list_label = FCLabel("%s:" % _("Keywords list")) self.grb_list_label.setToolTip( _("List of keywords used by\n" "the autocompleter in FlatCAM.\n" @@ -61,7 +61,7 @@ class AutoCompletePrefGroupUI(OptionsGroupUI): font.setPointSize(tb_fsize) self.kw_list_text.setFont(font) - self.kw_label = QtWidgets.QLabel('%s:' % _("Extension")) + self.kw_label = FCLabel('%s:' % _("Extension")) self.kw_label.setToolTip(_("A keyword to be added or deleted to the list.")) self.kw_entry = FCEntry() diff --git a/appGUI/preferences/utilities/FAExcPrefGroupUI.py b/appGUI/preferences/utilities/FAExcPrefGroupUI.py index 6feb9a53..06628e2a 100644 --- a/appGUI/preferences/utilities/FAExcPrefGroupUI.py +++ b/appGUI/preferences/utilities/FAExcPrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt5 import QtWidgets, QtGui from PyQt5.QtCore import QSettings -from appGUI.GUIElements import VerticalScrollArea, FCButton, FCTextArea, FCEntry +from appGUI.GUIElements import VerticalScrollArea, FCButton, FCTextArea, FCEntry, FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -48,7 +48,7 @@ class FAExcPrefGroupUI(OptionsGroupUI): self.vertical_lay.addLayout(hlay0) # # ## Excellon associations - list_label = QtWidgets.QLabel("%s:" % _("Extensions list")) + list_label = FCLabel("%s:" % _("Extensions list")) list_label.setToolTip( _("List of file extensions to be\n" "associated with FlatCAM.") @@ -70,7 +70,7 @@ class FAExcPrefGroupUI(OptionsGroupUI): self.vertical_lay.addWidget(self.exc_list_text) - self.ext_label = QtWidgets.QLabel('%s:' % _("Extension")) + self.ext_label = FCLabel('%s:' % _("Extension")) self.ext_label.setToolTip(_("A file extension to be added or deleted to the list.")) self.ext_entry = FCEntry() diff --git a/appGUI/preferences/utilities/FAGcoPrefGroupUI.py b/appGUI/preferences/utilities/FAGcoPrefGroupUI.py index 3ede6614..465a2a87 100644 --- a/appGUI/preferences/utilities/FAGcoPrefGroupUI.py +++ b/appGUI/preferences/utilities/FAGcoPrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt5 import QtWidgets, QtGui from PyQt5.QtCore import QSettings -from appGUI.GUIElements import FCButton, FCTextArea, FCEntry +from appGUI.GUIElements import FCButton, FCTextArea, FCEntry, FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -38,7 +38,7 @@ class FAGcoPrefGroupUI(OptionsGroupUI): hlay0.addWidget(self.del_all_btn) # ## G-Code associations - self.gco_list_label = QtWidgets.QLabel("%s:" % _("Extensions list")) + self.gco_list_label = FCLabel("%s:" % _("Extensions list")) self.gco_list_label.setToolTip( _("List of file extensions to be\n" "associated with FlatCAM.") @@ -60,7 +60,7 @@ class FAGcoPrefGroupUI(OptionsGroupUI): self.layout.addWidget(self.gco_list_text) - self.ext_label = QtWidgets.QLabel('%s:' % _("Extension")) + self.ext_label = FCLabel('%s:' % _("Extension")) self.ext_label.setToolTip(_("A file extension to be added or deleted to the list.")) self.ext_entry = FCEntry() diff --git a/appGUI/preferences/utilities/FAGrbPrefGroupUI.py b/appGUI/preferences/utilities/FAGrbPrefGroupUI.py index 55f8fce5..6fac9244 100644 --- a/appGUI/preferences/utilities/FAGrbPrefGroupUI.py +++ b/appGUI/preferences/utilities/FAGrbPrefGroupUI.py @@ -1,7 +1,7 @@ from PyQt5 import QtWidgets, QtGui from PyQt5.QtCore import QSettings -from appGUI.GUIElements import FCButton, FCTextArea, FCEntry +from appGUI.GUIElements import FCButton, FCTextArea, FCEntry, FCLabel from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext @@ -38,7 +38,7 @@ class FAGrbPrefGroupUI(OptionsGroupUI): hlay0.addWidget(self.del_all_btn) # ## Gerber associations - self.grb_list_label = QtWidgets.QLabel("%s:" % _("Extensions list")) + self.grb_list_label = FCLabel("%s:" % _("Extensions list")) self.grb_list_label.setToolTip( _("List of file extensions to be\n" "associated with FlatCAM.") @@ -59,7 +59,7 @@ class FAGrbPrefGroupUI(OptionsGroupUI): font.setPointSize(tb_fsize) self.grb_list_text.setFont(font) - self.ext_label = QtWidgets.QLabel('%s:' % _("Extension")) + self.ext_label = FCLabel('%s:' % _("Extension")) self.ext_label.setToolTip(_("A file extension to be added or deleted to the list.")) self.ext_entry = FCEntry() diff --git a/appObjects/FlatCAMCNCJob.py b/appObjects/FlatCAMCNCJob.py index dd40cecc..b66e92bc 100644 --- a/appObjects/FlatCAMCNCJob.py +++ b/appObjects/FlatCAMCNCJob.py @@ -10,7 +10,6 @@ # File modified by: Marius Stanciu # # ########################################################## -from copy import deepcopy from io import StringIO from datetime import datetime @@ -22,7 +21,7 @@ from matplotlib.backend_bases import KeyEvent as mpl_key_event from camlib import CNCjob from shapely.ops import unary_union -from shapely.geometry import Point, MultiPoint, Polygon, LineString, box +from shapely.geometry import Point, MultiPoint, box import shapely.affinity as affinity try: from shapely.ops import voronoi_diagram @@ -1910,7 +1909,6 @@ class CNCJobObject(FlatCAMObj, CNCjob): """ Handler activated by a button clicked when exporting GCode. - :param args: :return: """ self.app.defaults.report_usage("cncjob_on_exportgcode_button") @@ -1942,8 +1940,8 @@ class CNCJobObject(FlatCAMObj, CNCjob): self.export_gcode_handler(filename, is_gcode=save_gcode) def export_gcode_handler(self, filename, is_gcode=True, rename_object=True): - preamble = '' - postamble = '' + # preamble = '' + # postamble = '' filename = str(filename) if filename == '': diff --git a/appObjects/FlatCAMExcellon.py b/appObjects/FlatCAMExcellon.py index bf0102c6..c036c731 100644 --- a/appObjects/FlatCAMExcellon.py +++ b/appObjects/FlatCAMExcellon.py @@ -249,8 +249,8 @@ class ExcellonObject(FlatCAMObj, Excellon): # add the data dictionary for each tool with the default values self.tools[tool_no]['data'] = deepcopy(new_options) - drill_cnt = 0 # variable to store the nr of drills per tool - slot_cnt = 0 # variable to store the nr of slots per tool + # drill_cnt = 0 # variable to store the nr of drills per tool + # slot_cnt = 0 # variable to store the nr of slots per tool # Find no of drills for the current tool try: @@ -907,7 +907,7 @@ class ExcellonObject(FlatCAMObj, Excellon): geo_obj.options['Tools_in_use'] = tool_table_items geo_obj.options['type'] = 'Excellon Geometry' geo_obj.options["cnctooldia"] = str(tooldia) - geo_obj.options["multidepth"] = self.app.defaults["geometry_multidepth"] + geo_obj.options["multidepth"] = app_obj.defaults["geometry_multidepth"] geo_obj.solid_geometry = [] # in case that the tool used has the same diameter with the hole, and since the maximum resolution @@ -1007,7 +1007,7 @@ class ExcellonObject(FlatCAMObj, Excellon): geo_obj.options['Tools_in_use'] = tool_table_items geo_obj.options['type'] = 'Excellon Geometry' geo_obj.options["cnctooldia"] = str(tooldia) - geo_obj.options["multidepth"] = self.app.defaults["geometry_multidepth"] + geo_obj.options["multidepth"] = app_obj.defaults["geometry_multidepth"] geo_obj.solid_geometry = [] # in case that the tool used has the same diameter with the hole, and since the maximum resolution diff --git a/appObjects/FlatCAMGeometry.py b/appObjects/FlatCAMGeometry.py index 0b1675c5..654c67d4 100644 --- a/appObjects/FlatCAMGeometry.py +++ b/appObjects/FlatCAMGeometry.py @@ -583,7 +583,7 @@ class GeometryObject(FlatCAMObj, Geometry): _("Copy"), self.on_tool_copy, icon=QtGui.QIcon(self.app.resource_location + "/copy16.png")) self.ui.geo_tools_table.addContextMenu( - _("Delete"), lambda: self.on_tool_delete(all_tools=None), + _("Delete"), lambda: self.on_tool_delete(clicked_signal=None, all_tools=None), icon=QtGui.QIcon(self.app.resource_location + "/trash16.png")) # Show/Hide Advanced Options diff --git a/appObjects/FlatCAMGerber.py b/appObjects/FlatCAMGerber.py index 83eece83..20a0ecc6 100644 --- a/appObjects/FlatCAMGerber.py +++ b/appObjects/FlatCAMGerber.py @@ -434,7 +434,7 @@ class GerberObject(FlatCAMObj, Gerber): self.app.app_obj.new_object("geometry", name, geo_init) def isolate(self, iso_type=None, geometry=None, dia=None, passes=None, overlap=None, outname=None, combine=None, - milling_type=None, follow=None, plot=True): + milling_type=None, plot=True): """ Creates an isolation routing geometry object in the project. @@ -446,13 +446,12 @@ class GerberObject(FlatCAMObj, Gerber): :param outname: Base name of the output object :param combine: Boolean: if to combine passes in one resulting object in case of multiple passes :param milling_type: type of milling: conventional or climbing - :param follow: Boolean: if to generate a 'follow' geometry :param plot: Boolean: if to plot the resulting geometry object :return: None """ if geometry is None: - work_geo = self.follow_geometry if follow is True else self.solid_geometry + work_geo = self.solid_geometry else: work_geo = geometry @@ -555,7 +554,7 @@ class GerberObject(FlatCAMObj, Gerber): # if milling type is climb then the move is counter-clockwise around features mill_dir = 1 if milling_type == 'cl' else 0 geom = self.generate_envelope(iso_offset, mill_dir, geometry=work_geo, env_iso_type=iso_t, - follow=follow, nr_passes=nr_pass) + nr_passes=nr_pass) if geom == 'fail': if plot: @@ -631,8 +630,7 @@ class GerberObject(FlatCAMObj, Gerber): # if milling type is climb then the move is counter-clockwise around features mill_dir = 1 if milling_type == 'cl' else 0 - geom = self.generate_envelope(offset, mill_dir, geometry=work_geo, env_iso_type=iso_t, - follow=follow, nr_passes=i) + geom = self.generate_envelope(offset, mill_dir, geometry=work_geo, env_iso_type=iso_t, nr_passes=i) if geom == 'fail': if plot: @@ -726,7 +724,7 @@ class GerberObject(FlatCAMObj, Gerber): self.app.app_obj.new_object("geometry", iso_name, iso_init, plot=plot) - def generate_envelope(self, offset, invert, geometry=None, env_iso_type=2, follow=None, nr_passes=0): + def generate_envelope(self, offset, invert, geometry=None, env_iso_type=2, nr_passes=0): # isolation_geometry produces an envelope that is going on the left of the geometry # (the copper features). To leave the least amount of burrs on the features # the tool needs to travel on the right side of the features (this is called conventional milling) @@ -734,14 +732,11 @@ class GerberObject(FlatCAMObj, Gerber): # the other passes overlap preceding ones and cut the left over copper. It is better for them # to cut on the right side of the left over copper i.e on the left side of the features. - if follow: - geom = self.isolation_geometry(offset, geometry=geometry, follow=follow) - else: - try: - geom = self.isolation_geometry(offset, geometry=geometry, iso_type=env_iso_type, passes=nr_passes) - except Exception as e: - log.debug('GerberObject.isolate().generate_envelope() --> %s' % str(e)) - return 'fail' + try: + geom = self.isolation_geometry(offset, geometry=geometry, iso_type=env_iso_type, passes=nr_passes) + except Exception as e: + log.debug('GerberObject.isolate().generate_envelope() --> %s' % str(e)) + return 'fail' if invert: try: @@ -783,7 +778,6 @@ class GerberObject(FlatCAMObj, Gerber): follow_obj.options["cnctooldia"] = str(self.app.defaults["tools_iso_tooldia"]) follow_obj.solid_geometry = self.follow_geometry - # TODO: Do something if this is None. Offer changing name? try: self.app.app_obj.new_object("geometry", follow_name, follow_init) except Exception as e: diff --git a/appParsers/ParseDXF.py b/appParsers/ParseDXF.py index 5b257243..4204a068 100644 --- a/appParsers/ParseDXF.py +++ b/appParsers/ParseDXF.py @@ -5,7 +5,7 @@ # MIT Licence # # ########################################################## -from shapely.geometry import LineString +from shapely.geometry import LineString, Point from shapely.affinity import rotate from ezdxf.math.vector import Vector as ezdxf_vector diff --git a/appParsers/ParseGerber.py b/appParsers/ParseGerber.py index 6cfff2cf..debe7aa0 100644 --- a/appParsers/ParseGerber.py +++ b/appParsers/ParseGerber.py @@ -8,7 +8,6 @@ from copy import deepcopy from shapely.ops import unary_union, linemerge import shapely.affinity as affinity from shapely.geometry import box as shply_box -from shapely.geometry import Point from lxml import etree as ET import ezdxf diff --git a/appParsers/ParseSVG.py b/appParsers/ParseSVG.py index 48879708..b6862737 100644 --- a/appParsers/ParseSVG.py +++ b/appParsers/ParseSVG.py @@ -500,11 +500,12 @@ def getsvggeo(node, object_type, root=None, units='MM', res=64, factor=1.0): return geo -def getsvgtext(node, object_type, units='MM'): +def getsvgtext(node, object_type, app, units='MM'): """ Extracts and flattens all geometry from an SVG node into a list of Shapely geometry. + :param app: Main App :param node: xml.etree.ElementTree.Element :param object_type: :param units: FlatCAM units @@ -517,7 +518,7 @@ def getsvgtext(node, object_type, units='MM'): # Recurse if len(node) > 0: for child in node: - subgeo = getsvgtext(child, object_type, units=units) + subgeo = getsvgtext(child, object_type, app=app, units=units) if subgeo is not None: geo += subgeo @@ -538,7 +539,7 @@ def getsvgtext(node, object_type, units='MM'): pos_y = float(current_attrib['y']) # should have used the instance from FlatCAMApp.App but how? without reworking everything ... - pf = ParseFont() + pf = ParseFont(app=app) pf.get_fonts_by_types() font_name = style_dict['font-family'].replace("'", '') diff --git a/appPreProcessor.py b/appPreProcessor.py index 2453a3cf..96ea1921 100644 --- a/appPreProcessor.py +++ b/appPreProcessor.py @@ -9,7 +9,6 @@ from importlib.machinery import SourceFileLoader import os from abc import ABCMeta, abstractmethod -import math # module-root dictionary of preprocessors diff --git a/appTools/ToolQRCode.py b/appTools/ToolQRCode.py index 16d1a89c..d78a88df 100644 --- a/appTools/ToolQRCode.py +++ b/appTools/ToolQRCode.py @@ -441,7 +441,7 @@ class QRCode(AppTool): # flatten the svg geometry for the case when the QRCode SVG is added into a Gerber object solid_geometry = list(self.flatten_list(geos)) - geos_text = getsvgtext(svg_root, object_type, units=units) + geos_text = getsvgtext(svg_root, object_type, app=self.app, units=units) if geos_text is not None: geos_text_f = [] if flip: diff --git a/appTranslation.py b/appTranslation.py index 98e90ad5..61ada23d 100644 --- a/appTranslation.py +++ b/appTranslation.py @@ -211,7 +211,7 @@ def restart_program(app, ask=None): msgbox.setIcon(QtWidgets.QMessageBox.Question) bt_yes = msgbox.addButton(_('Yes'), QtWidgets.QMessageBox.YesRole) - bt_no = msgbox.addButton(_('No'), QtWidgets.QMessageBox.NoRole) + msgbox.addButton(_('No'), QtWidgets.QMessageBox.NoRole) msgbox.setDefaultButton(bt_yes) msgbox.exec_() diff --git a/appWorkerStack.py b/appWorkerStack.py index 1f0a3478..558040d0 100644 --- a/appWorkerStack.py +++ b/appWorkerStack.py @@ -1,6 +1,5 @@ from PyQt5 import QtCore from appWorker import Worker -import multiprocessing class WorkerStack(QtCore.QObject): diff --git a/app_Main.py b/app_Main.py index dbc3d684..d9058d87 100644 --- a/app_Main.py +++ b/app_Main.py @@ -1877,7 +1877,7 @@ class App(QtCore.QObject): self.follow_tool = ToolFollow(self) self.follow_tool.install(icon=QtGui.QIcon(self.resource_location + '/follow32.png'), pos=self.ui.menutool, - before=self.sub_tool.menuAction, separator=True) + before=self.sub_tool.menuAction, separator=True) self.drilling_tool = ToolDrilling(self) self.drilling_tool.install(icon=QtGui.QIcon(self.resource_location + '/extract_drill32.png'), @@ -2247,9 +2247,10 @@ class App(QtCore.QObject): """ Set the toolbars layout (location) + :param connect_signals: Useful when used in the App.__init__(); bool :param index: - :param lay: Type of layout to be set on the toolbard - :return: None + :param lay: Type of layout to be set on the toolbard + :return: None """ self.defaults.report_usage("on_layout()") diff --git a/camlib.py b/camlib.py index 4181d271..58d9ffcc 100644 --- a/camlib.py +++ b/camlib.py @@ -1201,7 +1201,7 @@ class Geometry(object): # flatten the self.solid_geometry list for import_svg() to import SVG as Gerber self.solid_geometry = list(self.flatten_list(self.solid_geometry)) - geos_text = getsvgtext(svg_root, object_type, units=units) + geos_text = getsvgtext(svg_root, object_type, app=self.app, units=units) if geos_text is not None: geos_text_f = [] if flip: @@ -3016,7 +3016,8 @@ class CNCjob(Geometry): return optimized_path # ############################################# ## - def optimized_travelling_salesman(self, points, start=None): + @staticmethod + def optimized_travelling_salesman(points, start=None): """ As solving the problem in the brute force way is too slow, this function implements a simple heuristic: always @@ -3026,10 +3027,10 @@ class CNCjob(Geometry): giving a solution only about 25%% longer than the optimal one (cit. Wikipedia), and runs very fast in O(N^2) time complexity. - >>> optimized_travelling_salesman([[i,j] for i in range(5) for j in range(5)]) + optimized_travelling_salesman([[i,j] for i in range(5) for j in range(5)]) [[0, 0], [0, 1], [0, 2], [0, 3], [0, 4], [1, 4], [1, 3], [1, 2], [1, 1], [1, 0], [2, 0], [2, 1], [2, 2], [2, 3], [2, 4], [3, 4], [3, 3], [3, 2], [3, 1], [3, 0], [4, 0], [4, 1], [4, 2], [4, 3], [4, 4]] - >>> optimized_travelling_salesman([[0,0],[10,0],[6,0]]) + optimized_travelling_salesman([[0,0],[10,0],[6,0]]) [[0, 0], [6, 0], [10, 0]] :param points: List of tuples with x, y coordinates @@ -7619,10 +7620,11 @@ class CNCjob(Geometry): given factor. Tool sizes, feedrates, or Z-axis dimensions are not altered. - :param factor: Number by which to scale the object. - :type factor: float + + :param yfactor: scale factor on the X axis; float + :param xfactor: scale factor on the Y axis; float :param point: the (x,y) coords for the point of origin of scale - :type tuple of floats + :type point: tuple :return: None :rtype: None """ diff --git a/make_freezed.py b/make_freezed.py deleted file mode 100644 index f2686fde..00000000 --- a/make_freezed.py +++ /dev/null @@ -1,120 +0,0 @@ -# ########################################################## -# FlatCAM: 2D Post-processing for Manufacturing # -# http://flatcam.org # -# Author: Juan Pablo Caram (c) # -# Date: 12/20/2018 # -# MIT Licence # -# # -# Creates a portable copy of FlatCAM, including Python # -# itself and all dependencies. # -# # -# This is not an aid to install FlatCAM from source on # -# Windows platforms. It is only useful when FlatCAM is up # -# and running and ready to be packaged. # -# ########################################################## - -# ########################################################## -# File Modified: Marius Adrian Stanciu # -# Date: 3/10/2019 # -# ########################################################## - - -# Files not needed: Qt, tk.dll, tcl.dll, tk/, tcl/, vtk/, -# scipy.lib.lapack.flapack.pyd, scipy.lib.blas.fblas.pyd, -# numpy.core._dotblas.pyd, scipy.sparse.sparsetools._bsr.pyd, -# scipy.sparse.sparsetools._csr.pyd, scipy.sparse.sparsetools._csc.pyd, -# scipy.sparse.sparsetools._coo.pyd - -import os -import site -import sys -import platform -from cx_Freeze import setup, Executable - -# this is done to solve the tkinter not being found -PYTHON_INSTALL_DIR = os.path.dirname(os.path.dirname(os.__file__)) -os.environ['TCL_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tcl8.6') -os.environ['TK_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tk8.6') - -# Get the site-package folder, not everybody will install -# Python into C:\PythonXX -site_dir = site.getsitepackages()[1] - -include_files = [] - -include_files.append((os.path.join(site_dir, "shapely"), "shapely")) -include_files.append((os.path.join(site_dir, "svg"), "svg")) -include_files.append((os.path.join(site_dir, "svg/path"), "svg")) -include_files.append((os.path.join(site_dir, "vispy"), "vispy")) -include_files.append((os.path.join(site_dir, "vispy/app"), "vispy/app")) -include_files.append((os.path.join(site_dir, "vispy/app/backends"), "vispy/app/backends")) -# include_files.append((os.path.join(site_dir, "matplotlib"), "matplotlib")) -include_files.append((os.path.join(site_dir, "rtree"), "rtree")) - -if platform.architecture()[0] == '64bit': - include_files.append((os.path.join(site_dir, "google"), "google")) - include_files.append((os.path.join(site_dir, "google/protobuf"), "google/protobuf")) - include_files.append((os.path.join(site_dir, "ortools"), "ortools")) - -include_files.append(("locale", "lib/locale")) -include_files.append(("preprocessors", "lib/preprocessors")) -# include_files.append(("assets", "lib/assets")) -include_files.append(("assets/examples", "lib/assets/examples")) -include_files.append(("assets/linux", "lib/assets/linux")) -include_files.append(("assets/resources", "lib/assets/resources")) -# include_files.append(("share", "lib/share")) -include_files.append(("appGUI/VisPyData", "lib/vispy")) -include_files.append(("config", "lib/config")) - -include_files.append(("README.md", "README.md")) -include_files.append(("LICENSE", "LICENSE")) -include_files.append(("CHANGELOG.md", "CHANGELOG.md")) -base = None - -# Lets not open the console while running the app -if sys.platform == "win32": - base = "Win32GUI" - -if platform.architecture()[0] == '64bit': - buildOptions = dict( - include_files=include_files, - excludes=['scipy', 'pytz', "matplotlib.tests", "numpy.random._examples"], - # packages=['OpenGL','numpy','vispy','ortools','google'] - # packages=['numpy','google', 'rasterio'] # works for Python 3.7 - packages=['opengl', 'numpy', 'google', 'rasterio'], # works for Python 3.6.5 and Python 3.7.1 - ) -else: - buildOptions = dict( - include_files=include_files, - excludes=['scipy', 'pytz'], - # packages=['OpenGL','numpy','vispy','ortools','google'] - # packages=['numpy', 'rasterio'] # works for Python 3.7 - packages=['opengl', 'numpy', 'rasterio'], # works for Python 3.6.5 and Python 3.7.1 - ) - -if sys.platform == "win32": - buildOptions["include_msvcr"] = True - -print("INCLUDE_FILES", include_files) - - -def getTargetName(): - my_OS = platform.system() - if my_OS == 'Linux': - return "FlatCAM" - elif my_OS == 'Windows': - return "FlatCAM.exe" - else: - return "FlatCAM.dmg" - - -exe = Executable("FlatCAM.py", icon='assets/resources/flatcam_icon48.ico', base=base, targetName=getTargetName()) - -setup( - name="FlatCAM", - author="Community effort", - version="8.9", - description="FlatCAM Evo: 2D Computer Aided PCB Manufacturing", - options=dict(build_exe=buildOptions), - executables=[exe] -) diff --git a/tclCommands/TclCommandIsolate.py b/tclCommands/TclCommandIsolate.py index 248ace37..ddd6a935 100644 --- a/tclCommands/TclCommandIsolate.py +++ b/tclCommands/TclCommandIsolate.py @@ -32,7 +32,6 @@ class TclCommandIsolate(TclCommandSignaled): ('overlap', float), ('combine', str), ('outname', str), - ('follow', str), ('iso_type', int) ]) @@ -51,7 +50,6 @@ class TclCommandIsolate(TclCommandSignaled): 'E.g: for a 25% from tool diameter overlap use -overlap 25'), ('combine', 'Combine all passes into one geometry. Can be True (1) or False (0)'), ('outname', 'Name of the resulting Geometry object.'), - ('follow', 'Create a Geometry that follows the Gerber path. Can be True (1) or False (0).'), ('iso_type', 'A value of 0 will isolate exteriors, a value of 1 will isolate interiors ' 'and a value of 2 will do full isolation.') ]), @@ -78,9 +76,6 @@ class TclCommandIsolate(TclCommandSignaled): # else: # timeout = 10000 - if 'follow' not in args: - args['follow'] = None - # evaluate this parameter so True, False, 0 and 1 works if 'combine' in args: try: