- multiple UI changes in Preferences
- UI changes in the Paint Plugin
This commit is contained in:
@@ -268,13 +268,14 @@ class DoubleSpinnerOptionUI(BasicOptionUI):
|
||||
|
||||
|
||||
class HeadingOptionUI(OptionUI):
|
||||
def __init__(self, label_text: str, label_tooltip: Union[str, None] = None):
|
||||
def __init__(self, label_text: str, color: Union[str, None] = None, label_tooltip: Union[str, None] = None):
|
||||
super().__init__(option="__heading")
|
||||
self.label_text = label_text
|
||||
self.label_tooltip = label_tooltip
|
||||
self.color = color if color else ""
|
||||
|
||||
def build_heading_widget(self):
|
||||
heading = FCLabel('<b>%s</b>' % _(self.label_text))
|
||||
heading = FCLabel('<span style="color:%s;"><b>%s</b></span>' % (str(self.color), _(self.label_text)))
|
||||
heading.setToolTip(_(self.label_tooltip))
|
||||
return heading
|
||||
|
||||
|
||||
@@ -450,7 +450,7 @@ class PreferencesUIManager:
|
||||
|
||||
# Paint Area Tool
|
||||
"tools_paint_tooldia": self.ui.plugin_eng_pref_form.tools_paint_group.painttooldia_entry,
|
||||
"tools_paint_order": self.ui.plugin_eng_pref_form.tools_paint_group.paint_order_radio,
|
||||
"tools_paint_order": self.ui.plugin_eng_pref_form.tools_paint_group.paint_order_combo,
|
||||
"tools_paint_overlap": self.ui.plugin_eng_pref_form.tools_paint_group.paintoverlap_entry,
|
||||
"tools_paint_offset": self.ui.plugin_eng_pref_form.tools_paint_group.paintmargin_entry,
|
||||
"tools_paint_method": self.ui.plugin_eng_pref_form.tools_paint_group.paintmethod_combo,
|
||||
|
||||
@@ -101,7 +101,7 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI):
|
||||
self.coords_type_radio = RadioSet([
|
||||
{"label": _("Absolute"), "value": "G90"},
|
||||
{"label": _("Incremental"), "value": "G91"}
|
||||
], orientation='vertical', stretch=False)
|
||||
], orientation='vertical', compact=True)
|
||||
grid0.addWidget(coords_type_label, 8, 0)
|
||||
grid0.addWidget(self.coords_type_radio, 8, 1)
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ class CNCJobOptPrefGroupUI(OptionsGroupUI):
|
||||
{"label": _("All"), "value": "all"},
|
||||
{"label": _("Travel"), "value": "travel"},
|
||||
{"label": _("Cut"), "value": "cut"}
|
||||
], orientation='vertical', stretch=False)
|
||||
], orientation='vertical', compact=True)
|
||||
|
||||
grid0.addWidget(self.cncplot_method_label, 1, 0)
|
||||
grid0.addWidget(self.cncplot_method_radio, 1, 1)
|
||||
|
||||
@@ -217,7 +217,7 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI):
|
||||
self.excellon_optimization_radio = RadioSet([{'label': _('MetaHeuristic'), 'value': 'M'},
|
||||
{'label': _('Basic'), 'value': 'B'},
|
||||
{'label': _('TSA'), 'value': 'T'}],
|
||||
orientation='vertical', stretch=False)
|
||||
orientation='vertical', compact=True)
|
||||
|
||||
grid2.addWidget(self.excellon_optimization_label, 9, 0)
|
||||
grid2.addWidget(self.excellon_optimization_radio, 9, 1)
|
||||
|
||||
@@ -2,7 +2,7 @@ from PyQt6 import QtCore, QtWidgets
|
||||
from PyQt6.QtCore import QSettings
|
||||
|
||||
from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, FCComboBox, RadioSet, OptionalInputSection, FCSpinner, \
|
||||
FCColorEntry, FCLabel, FCGridLayout
|
||||
FCColorEntry, FCLabel, FCGridLayout, FCFrame
|
||||
from appGUI.preferences.OptionsGroupUI import OptionsGroupUI
|
||||
|
||||
import gettext
|
||||
@@ -33,13 +33,19 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
|
||||
else:
|
||||
self.resource_loc = 'assets/resources'
|
||||
|
||||
# Create a grid layout for the Application general settings
|
||||
grid0 = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
self.layout.addLayout(grid0)
|
||||
|
||||
# #############################################################################################################
|
||||
# Grid Settings Frame
|
||||
# #############################################################################################################
|
||||
# GRID Settings
|
||||
self.grid_label = FCLabel('<b>%s</b>' % _('Grid Settings'))
|
||||
grid0.addWidget(self.grid_label, 0, 0, 1, 2)
|
||||
self.grid_label = FCLabel('<span style="color:brown;"><b>%s</b></span>' % _('Grid Settings'))
|
||||
self.layout.addWidget(self.grid_label)
|
||||
|
||||
grids_frame = FCFrame()
|
||||
self.layout.addWidget(grids_frame)
|
||||
|
||||
# Create a grid layout for the Application general settings
|
||||
grids_grid = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
grids_frame.setLayout(grids_grid)
|
||||
|
||||
# Grid X Entry
|
||||
self.gridx_label = FCLabel('%s:' % _('X value'))
|
||||
@@ -50,8 +56,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
|
||||
self.gridx_entry.set_precision(self.decimals)
|
||||
self.gridx_entry.setSingleStep(0.1)
|
||||
|
||||
grid0.addWidget(self.gridx_label, 2, 0)
|
||||
grid0.addWidget(self.gridx_entry, 2, 1)
|
||||
grids_grid.addWidget(self.gridx_label, 2, 0)
|
||||
grids_grid.addWidget(self.gridx_entry, 2, 1)
|
||||
|
||||
# Grid Y Entry
|
||||
self.gridy_label = FCLabel('%s:' % _('Y value'))
|
||||
@@ -62,8 +68,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
|
||||
self.gridy_entry.set_precision(self.decimals)
|
||||
self.gridy_entry.setSingleStep(0.1)
|
||||
|
||||
grid0.addWidget(self.gridy_label, 4, 0)
|
||||
grid0.addWidget(self.gridy_entry, 4, 1)
|
||||
grids_grid.addWidget(self.gridy_label, 4, 0)
|
||||
grids_grid.addWidget(self.gridy_entry, 4, 1)
|
||||
|
||||
# Snap Max Entry
|
||||
self.snap_max_label = FCLabel('%s:' % _('Snap Max'))
|
||||
@@ -72,17 +78,26 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
|
||||
self.snap_max_dist_entry.set_precision(self.decimals)
|
||||
self.snap_max_dist_entry.setSingleStep(0.1)
|
||||
|
||||
grid0.addWidget(self.snap_max_label, 6, 0)
|
||||
grid0.addWidget(self.snap_max_dist_entry, 6, 1)
|
||||
grids_grid.addWidget(self.snap_max_label, 6, 0)
|
||||
grids_grid.addWidget(self.snap_max_dist_entry, 6, 1)
|
||||
|
||||
separator_line = QtWidgets.QFrame()
|
||||
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
grid0.addWidget(separator_line, 8, 0, 1, 2)
|
||||
# separator_line = QtWidgets.QFrame()
|
||||
# separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
# separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
# grids_grid.addWidget(separator_line, 8, 0, 1, 2)
|
||||
|
||||
# #############################################################################################################
|
||||
# Workspace Frame
|
||||
# #############################################################################################################
|
||||
# Workspace
|
||||
self.workspace_label = FCLabel('<b>%s</b>' % _('Workspace Settings'))
|
||||
grid0.addWidget(self.workspace_label, 10, 0, 1, 2)
|
||||
self.workspace_label = FCLabel('<span style="color:darkorchid;"><b>%s</b></span>' % _('Workspace Settings'))
|
||||
self.layout.addWidget(self.workspace_label)
|
||||
|
||||
wk_frame = FCFrame()
|
||||
self.layout.addWidget(wk_frame)
|
||||
|
||||
wk_grid = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
wk_frame.setLayout(wk_grid)
|
||||
|
||||
self.workspace_cb = FCCheckBox('%s' % _('Active'))
|
||||
self.workspace_cb.setToolTip(
|
||||
@@ -90,7 +105,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
|
||||
"The purpose is to illustrate the limits for our work.")
|
||||
)
|
||||
|
||||
grid0.addWidget(self.workspace_cb, 12, 0, 1, 2)
|
||||
wk_grid.addWidget(self.workspace_cb, 0, 0, 1, 2)
|
||||
|
||||
self.workspace_type_lbl = FCLabel('%s:' % _('Size'))
|
||||
self.workspace_type_lbl.setToolTip(
|
||||
@@ -99,8 +114,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
|
||||
)
|
||||
self.wk_cb = FCComboBox()
|
||||
|
||||
grid0.addWidget(self.workspace_type_lbl, 14, 0)
|
||||
grid0.addWidget(self.wk_cb, 14, 1)
|
||||
wk_grid.addWidget(self.workspace_type_lbl, 2, 0)
|
||||
wk_grid.addWidget(self.wk_cb, 2, 1)
|
||||
|
||||
self.pagesize = {}
|
||||
self.pagesize.update(
|
||||
@@ -167,19 +182,23 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
|
||||
|
||||
self.wk_orientation_radio = RadioSet([{'label': _('Portrait'), 'value': 'p'},
|
||||
{'label': _('Landscape'), 'value': 'l'},
|
||||
], stretch=False)
|
||||
], compact=True)
|
||||
|
||||
grid0.addWidget(self.wk_orientation_label, 16, 0)
|
||||
grid0.addWidget(self.wk_orientation_radio, 16, 1)
|
||||
|
||||
separator_line = QtWidgets.QFrame()
|
||||
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
grid0.addWidget(separator_line, 18, 0, 1, 2)
|
||||
wk_grid.addWidget(self.wk_orientation_label, 4, 0)
|
||||
wk_grid.addWidget(self.wk_orientation_radio, 4, 1)
|
||||
|
||||
# #############################################################################################################
|
||||
# Font Frame
|
||||
# #############################################################################################################
|
||||
# Font Size
|
||||
self.font_size_label = FCLabel('<b>%s</b>' % _('Font Size'))
|
||||
grid0.addWidget(self.font_size_label, 20, 0, 1, 2)
|
||||
self.font_size_label = FCLabel('<span style="color:red;"><b>%s</b></span>' % _('Font Size'))
|
||||
self.layout.addWidget(self.font_size_label)
|
||||
|
||||
fnt_frame = FCFrame()
|
||||
self.layout.addWidget(fnt_frame)
|
||||
|
||||
fnt_grid = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
fnt_frame.setLayout(fnt_grid)
|
||||
|
||||
# Notebook Font Size
|
||||
self.notebook_font_size_label = FCLabel('%s:' % _('Notebook'))
|
||||
@@ -199,8 +218,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
|
||||
else:
|
||||
self.notebook_font_size_spinner.set_value(12)
|
||||
|
||||
grid0.addWidget(self.notebook_font_size_label, 22, 0)
|
||||
grid0.addWidget(self.notebook_font_size_spinner, 22, 1)
|
||||
fnt_grid.addWidget(self.notebook_font_size_label, 0, 0)
|
||||
fnt_grid.addWidget(self.notebook_font_size_spinner, 0, 1)
|
||||
|
||||
# Axis Font Size
|
||||
self.axis_font_size_label = FCLabel('%s:' % _('Axis'))
|
||||
@@ -218,8 +237,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
|
||||
else:
|
||||
self.axis_font_size_spinner.set_value(8)
|
||||
|
||||
grid0.addWidget(self.axis_font_size_label, 24, 0)
|
||||
grid0.addWidget(self.axis_font_size_spinner, 24, 1)
|
||||
fnt_grid.addWidget(self.axis_font_size_label, 2, 0)
|
||||
fnt_grid.addWidget(self.axis_font_size_spinner, 2, 1)
|
||||
|
||||
# TextBox Font Size
|
||||
self.textbox_font_size_label = FCLabel('%s:' % _('Textbox'))
|
||||
@@ -238,8 +257,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
|
||||
else:
|
||||
self.textbox_font_size_spinner.set_value(10)
|
||||
|
||||
grid0.addWidget(self.textbox_font_size_label, 26, 0)
|
||||
grid0.addWidget(self.textbox_font_size_spinner, 26, 1)
|
||||
fnt_grid.addWidget(self.textbox_font_size_label, 4, 0)
|
||||
fnt_grid.addWidget(self.textbox_font_size_spinner, 4, 1)
|
||||
|
||||
# HUD Font Size
|
||||
self.hud_font_size_label = FCLabel('%s:' % _('HUD'))
|
||||
@@ -257,13 +276,21 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
|
||||
else:
|
||||
self.hud_font_size_spinner.set_value(8)
|
||||
|
||||
grid0.addWidget(self.hud_font_size_label, 28, 0)
|
||||
grid0.addWidget(self.hud_font_size_spinner, 28, 1)
|
||||
fnt_grid.addWidget(self.hud_font_size_label, 6, 0)
|
||||
fnt_grid.addWidget(self.hud_font_size_spinner, 6, 1)
|
||||
|
||||
separator_line = QtWidgets.QFrame()
|
||||
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
grid0.addWidget(separator_line, 30, 0, 1, 2)
|
||||
# #############################################################################################################
|
||||
# Axis Frame
|
||||
# #############################################################################################################
|
||||
# Axis Size
|
||||
self.axis_label = FCLabel('<span style="color:DarkOrchid;"><b>%s</b></span>' % _('Axis'))
|
||||
self.layout.addWidget(self.axis_label)
|
||||
|
||||
ax_frame = FCFrame()
|
||||
self.layout.addWidget(ax_frame)
|
||||
|
||||
ax_grid = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
ax_frame.setLayout(ax_grid)
|
||||
|
||||
# Axis Color
|
||||
self.axis_color_label = FCLabel('%s:' % _('Axis Color'))
|
||||
@@ -272,20 +299,20 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
|
||||
)
|
||||
self.axis_color_entry = FCColorEntry()
|
||||
|
||||
grid0.addWidget(self.axis_color_label, 32, 0)
|
||||
grid0.addWidget(self.axis_color_entry, 32, 1)
|
||||
ax_grid.addWidget(self.axis_color_label, 0, 0)
|
||||
ax_grid.addWidget(self.axis_color_entry, 0, 1)
|
||||
|
||||
separator_line = QtWidgets.QFrame()
|
||||
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
grid0.addWidget(separator_line, 34, 0, 1, 2)
|
||||
# #############################################################################################################
|
||||
# Mouse Frame
|
||||
# #############################################################################################################
|
||||
self.mouse_lbl = FCLabel('<span style="color:LightSeaGreen;"><b>%s</b></span>' % _('Mouse Settings'))
|
||||
self.layout.addWidget(self.mouse_lbl)
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# -------------- MOUSE SETTINGS -----------------------------
|
||||
# -----------------------------------------------------------
|
||||
m_frame = FCFrame()
|
||||
self.layout.addWidget(m_frame)
|
||||
|
||||
self.mouse_lbl = FCLabel('<b>%s</b>' % _('Mouse Settings'))
|
||||
grid0.addWidget(self.mouse_lbl, 36, 0, 1, 2)
|
||||
m_grid = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
m_frame.setLayout(m_grid)
|
||||
|
||||
# Mouse Cursor Shape
|
||||
self.cursor_lbl = FCLabel('%s:' % _('Cursor Shape'))
|
||||
@@ -298,10 +325,10 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
|
||||
self.cursor_radio = RadioSet([
|
||||
{"label": _("Small"), "value": "small"},
|
||||
{"label": _("Big"), "value": "big"}
|
||||
], orientation='horizontal', stretch=False)
|
||||
], orientation='horizontal', compact=True)
|
||||
|
||||
grid0.addWidget(self.cursor_lbl, 38, 0)
|
||||
grid0.addWidget(self.cursor_radio, 38, 1)
|
||||
m_grid.addWidget(self.cursor_lbl, 0, 0)
|
||||
m_grid.addWidget(self.cursor_radio, 0, 1)
|
||||
|
||||
# Mouse Cursor Size
|
||||
self.cursor_size_lbl = FCLabel('%s:' % _('Cursor Size'))
|
||||
@@ -313,8 +340,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
|
||||
self.cursor_size_entry.set_range(10, 70)
|
||||
self.cursor_size_entry.setWrapping(True)
|
||||
|
||||
grid0.addWidget(self.cursor_size_lbl, 40, 0)
|
||||
grid0.addWidget(self.cursor_size_entry, 40, 1)
|
||||
m_grid.addWidget(self.cursor_size_lbl, 2, 0)
|
||||
m_grid.addWidget(self.cursor_size_entry, 2, 1)
|
||||
|
||||
# Cursor Width
|
||||
self.cursor_width_lbl = FCLabel('%s:' % _('Cursor Width'))
|
||||
@@ -326,15 +353,15 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
|
||||
self.cursor_width_entry.set_range(1, 10)
|
||||
self.cursor_width_entry.setWrapping(True)
|
||||
|
||||
grid0.addWidget(self.cursor_width_lbl, 42, 0)
|
||||
grid0.addWidget(self.cursor_width_entry, 42, 1)
|
||||
m_grid.addWidget(self.cursor_width_lbl, 4, 0)
|
||||
m_grid.addWidget(self.cursor_width_entry, 4, 1)
|
||||
|
||||
# Cursor Color Enable
|
||||
self.mouse_cursor_color_cb = FCCheckBox(label='%s' % _('Cursor Color'))
|
||||
self.mouse_cursor_color_cb.setToolTip(
|
||||
_("Check this box to color mouse cursor.")
|
||||
)
|
||||
grid0.addWidget(self.mouse_cursor_color_cb, 44, 0, 1, 2)
|
||||
m_grid.addWidget(self.mouse_cursor_color_cb, 6, 0, 1, 2)
|
||||
|
||||
# Cursor Color
|
||||
self.mouse_color_label = FCLabel('%s:' % _('Cursor Color'))
|
||||
@@ -343,8 +370,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
|
||||
)
|
||||
self.mouse_cursor_entry = FCColorEntry()
|
||||
|
||||
grid0.addWidget(self.mouse_color_label, 46, 0)
|
||||
grid0.addWidget(self.mouse_cursor_entry, 46, 1)
|
||||
m_grid.addWidget(self.mouse_color_label, 8, 0)
|
||||
m_grid.addWidget(self.mouse_cursor_entry, 8, 1)
|
||||
|
||||
self.mois = OptionalInputSection(
|
||||
self.mouse_cursor_color_cb,
|
||||
@@ -362,26 +389,33 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
|
||||
"- RMB --> Right Mouse Button")
|
||||
)
|
||||
self.pan_button_radio = RadioSet([{'label': _('MMB'), 'value': '3'},
|
||||
{'label': _('RMB'), 'value': '2'}])
|
||||
{'label': _('RMB'), 'value': '2'}], compact=True)
|
||||
|
||||
grid0.addWidget(self.panbuttonlabel, 48, 0)
|
||||
grid0.addWidget(self.pan_button_radio, 48, 1)
|
||||
m_grid.addWidget(self.panbuttonlabel, 10, 0)
|
||||
m_grid.addWidget(self.pan_button_radio, 10, 1)
|
||||
|
||||
# Multiple Selection Modifier Key
|
||||
self.mselectlabel = FCLabel('%s:' % _('Multiple Selection'))
|
||||
self.mselectlabel = FCLabel('%s:' % _('Multi-Selection'))
|
||||
self.mselectlabel.setToolTip(
|
||||
_("Select the key used for multiple selection.")
|
||||
)
|
||||
self.mselect_radio = RadioSet([{'label': _('CTRL'), 'value': 'Control'},
|
||||
{'label': _('SHIFT'), 'value': 'Shift'}])
|
||||
{'label': _('SHIFT'), 'value': 'Shift'}], compact=True)
|
||||
|
||||
grid0.addWidget(self.mselectlabel, 50, 0)
|
||||
grid0.addWidget(self.mselect_radio, 50, 1)
|
||||
m_grid.addWidget(self.mselectlabel, 50, 0)
|
||||
m_grid.addWidget(self.mselect_radio, 50, 1)
|
||||
|
||||
separator_line = QtWidgets.QFrame()
|
||||
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
grid0.addWidget(separator_line, 52, 0, 1, 2)
|
||||
# #############################################################################################################
|
||||
# Parameters Frame
|
||||
# #############################################################################################################
|
||||
self.par_label = FCLabel('<b><font color="blue">%s:</font></b>' % _('Parameters'))
|
||||
self.layout.addWidget(self.par_label)
|
||||
|
||||
par_frame = FCFrame()
|
||||
self.layout.addWidget(par_frame)
|
||||
|
||||
par_grid = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
par_frame.setLayout(par_grid)
|
||||
|
||||
# Delete confirmation
|
||||
self.delete_conf_cb = FCCheckBox(_('Delete object confirmation'))
|
||||
@@ -390,14 +424,14 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
|
||||
"whenever the Delete object(s) event is triggered, either by\n"
|
||||
"menu shortcut or key shortcut.")
|
||||
)
|
||||
grid0.addWidget(self.delete_conf_cb, 54, 0, 1, 2)
|
||||
par_grid.addWidget(self.delete_conf_cb, 0, 0, 1, 2)
|
||||
|
||||
self.allow_edit_cb = FCCheckBox(_("Allow Edit"))
|
||||
self.allow_edit_cb.setToolTip(
|
||||
_("When checked, the user can edit the object names in the Project Tab\n"
|
||||
"by clicking on the object name. Active after restart.")
|
||||
)
|
||||
grid0.addWidget(self.allow_edit_cb, 56, 0, 1, 2)
|
||||
par_grid.addWidget(self.allow_edit_cb, 2, 0, 1, 2)
|
||||
|
||||
# Open behavior
|
||||
self.open_style_cb = FCCheckBox('%s' % _('"Open" behavior'))
|
||||
@@ -408,7 +442,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
|
||||
"path for saving files or the path for opening files.")
|
||||
)
|
||||
|
||||
grid0.addWidget(self.open_style_cb, 58, 0, 1, 2)
|
||||
par_grid.addWidget(self.open_style_cb, 4, 0, 1, 2)
|
||||
|
||||
# Enable/Disable ToolTips globally
|
||||
self.toggle_tooltips_cb = FCCheckBox(label=_('Enable ToolTips'))
|
||||
@@ -417,7 +451,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
|
||||
"when hovering with mouse over items throughout the App.")
|
||||
)
|
||||
|
||||
grid0.addWidget(self.toggle_tooltips_cb, 60, 0, 1, 2)
|
||||
par_grid.addWidget(self.toggle_tooltips_cb, 6, 0, 1, 2)
|
||||
|
||||
# Bookmarks Limit in the Help Menu
|
||||
self.bm_limit_spinner = FCSpinner()
|
||||
@@ -429,8 +463,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
|
||||
"but the menu will hold only so much.")
|
||||
)
|
||||
|
||||
grid0.addWidget(self.bm_limit_label, 62, 0)
|
||||
grid0.addWidget(self.bm_limit_spinner, 62, 1)
|
||||
par_grid.addWidget(self.bm_limit_label, 8, 0)
|
||||
par_grid.addWidget(self.bm_limit_spinner, 8, 1)
|
||||
|
||||
# Activity monitor icon
|
||||
self.activity_label = FCLabel('%s:' % _("Activity Icon"))
|
||||
@@ -440,8 +474,8 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
|
||||
self.activity_combo = FCComboBox()
|
||||
self.activity_combo.addItems(['Ball black', 'Ball green', 'Arrow green', 'Eclipse green'])
|
||||
|
||||
grid0.addWidget(self.activity_label, 64, 0)
|
||||
grid0.addWidget(self.activity_combo, 64, 1)
|
||||
par_grid.addWidget(self.activity_label, 10, 0)
|
||||
par_grid.addWidget(self.activity_combo, 10, 1)
|
||||
|
||||
self.layout.addStretch()
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import sys
|
||||
|
||||
from PyQt6 import QtWidgets
|
||||
from PyQt6.QtCore import QSettings
|
||||
|
||||
from appGUI.GUIElements import RadioSet, FCSpinner, FCCheckBox, FCComboBox, FCButton, OptionalInputSection, \
|
||||
FCDoubleSpinner, FCLabel, FCGridLayout, RadioSetDefaults
|
||||
FCDoubleSpinner, FCLabel, FCGridLayout, RadioSetDefaults, FCFrame
|
||||
from appGUI.preferences.OptionsGroupUI import OptionsGroupUI
|
||||
|
||||
import gettext
|
||||
@@ -16,6 +15,8 @@ if '_' not in builtins.__dict__:
|
||||
_ = gettext.gettext
|
||||
|
||||
|
||||
# https://www.w3schools.com/colors/colors_names.asp
|
||||
# Colors names
|
||||
class GeneralAppPrefGroupUI(OptionsGroupUI):
|
||||
def __init__(self, defaults, decimals=4, parent=None):
|
||||
super(GeneralAppPrefGroupUI, self).__init__(self, parent=parent)
|
||||
@@ -24,21 +25,28 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
|
||||
self.decimals = decimals
|
||||
self.defaults = defaults
|
||||
|
||||
# Create a form layout for the Application general settings
|
||||
grid0 = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
self.layout.addLayout(grid0)
|
||||
|
||||
# Units for FlatCAM
|
||||
self.unitslabel = FCLabel('<span style="color:red;"><b>%s:</b></span>' % _('Units'))
|
||||
# #############################################################################################################
|
||||
# Grid0 Frame
|
||||
# #############################################################################################################
|
||||
self.unitslabel = FCLabel('<span style="color:red;"><b>%s</b></span>' % _('Units'))
|
||||
self.unitslabel.setToolTip(_("The default value for the application units.\n"
|
||||
"Whatever is selected here is set every time\n"
|
||||
"FlatCAM is started."))
|
||||
self.layout.addWidget(self.unitslabel)
|
||||
|
||||
grid0_frame = FCFrame()
|
||||
self.layout.addWidget(grid0_frame)
|
||||
|
||||
grid0 = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
grid0_frame.setLayout(grid0)
|
||||
|
||||
# Units for FlatCAM
|
||||
self.units_radio = RadioSetDefaults(
|
||||
choices=[{'label': _('MM'), 'value': 'MM'}, {'label': _('IN'), 'value': 'IN'}]
|
||||
choices=[{'label': _('mm'), 'value': 'MM'}, {'label': _('inch'), 'value': 'IN'}],
|
||||
compact=True
|
||||
)
|
||||
|
||||
grid0.addWidget(self.unitslabel, 0, 0)
|
||||
grid0.addWidget(self.units_radio, 0, 1)
|
||||
grid0.addWidget(self.units_radio, 0, 0, 1, 2)
|
||||
|
||||
# Precision Metric
|
||||
self.precision_metric_label = FCLabel('%s:' % _('Precision MM'))
|
||||
@@ -68,6 +76,18 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
|
||||
grid0.addWidget(self.precision_inch_label, 4, 0)
|
||||
grid0.addWidget(self.precision_inch_entry, 4, 1)
|
||||
|
||||
self.par_label = FCLabel('<span style="color:blue;"><b>%s</b></span>' % _("Parameters"))
|
||||
self.layout.addWidget(self.par_label)
|
||||
|
||||
# #############################################################################################################
|
||||
# Parameters
|
||||
# #############################################################################################################
|
||||
grid1_frame = FCFrame()
|
||||
self.layout.addWidget(grid1_frame)
|
||||
|
||||
grid1 = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
grid1_frame.setLayout(grid1)
|
||||
|
||||
# Graphic Engine for FlatCAM
|
||||
self.ge_label = FCLabel('<b>%s:</b>' % _('Graphic Engine'))
|
||||
self.ge_label.setToolTip(_("Choose what graphic engine to use in FlatCAM.\n"
|
||||
@@ -76,141 +96,16 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
|
||||
"Some graphic cards are too old and do not work in OpenGL(3D) mode, like:\n"
|
||||
"Intel HD3000 or older. In this case the plot area will be black therefore\n"
|
||||
"use the Legacy(2D) mode."))
|
||||
self.ge_radio = RadioSet([{'label': _('Legacy(2D)'), 'value': '2D'},
|
||||
{'label': _('OpenGL(3D)'), 'value': '3D'}],
|
||||
orientation='vertical')
|
||||
self.ge_radio = RadioSet([{'label': _('2D'), 'value': '2D'},
|
||||
{'label': _('3D'), 'value': '3D'}], compact=True)
|
||||
|
||||
grid0.addWidget(self.ge_label, 6, 0)
|
||||
grid0.addWidget(self.ge_radio, 6, 1)
|
||||
grid1.addWidget(self.ge_label, 0, 0)
|
||||
grid1.addWidget(self.ge_radio, 0, 1)
|
||||
|
||||
separator_line = QtWidgets.QFrame()
|
||||
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
grid0.addWidget(separator_line, 8, 0, 1, 2)
|
||||
|
||||
# Application Level for FlatCAM
|
||||
self.app_level_label = FCLabel('<span style="color:red;"><b>%s:</b></span>' % _('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"
|
||||
"The choice here will influence the parameters in\n"
|
||||
"the Selected Tab for all kinds of FlatCAM objects."))
|
||||
grid0.addWidget(self.app_level_label, 10, 0, 1, 2)
|
||||
|
||||
self.app_level_radio = RadioSet([{'label': _('Beginner'), 'value': 'b'},
|
||||
{'label': _('Advanced'), 'value': 'a'}])
|
||||
grid0.addWidget(self.app_level_radio, 12, 0, 1, 2)
|
||||
|
||||
# Portability
|
||||
self.portability_cb = FCCheckBox('%s' % _('Portable app'))
|
||||
self.portability_cb.setToolTip(_("Choose if the application should run as portable.\n\n"
|
||||
"If Checked the application will run portable,\n"
|
||||
"which means that the preferences files will be saved\n"
|
||||
"in the application folder, in the lib\\config subfolder."))
|
||||
|
||||
grid0.addWidget(self.portability_cb, 14, 0, 1, 2)
|
||||
|
||||
# Verbose Log
|
||||
self.verbose_cb = FCCheckBox('%s' % _('Verbose log'))
|
||||
self.verbose_cb.setToolTip(_("Enable log messages in the Tcl Shell.\n"
|
||||
"Require restart."))
|
||||
|
||||
grid0.addWidget(self.verbose_cb, 16, 0, 1, 2)
|
||||
|
||||
separator_line = QtWidgets.QFrame()
|
||||
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
grid0.addWidget(separator_line, 18, 0, 1, 2)
|
||||
|
||||
# Languages for FlatCAM
|
||||
self.languagelabel = FCLabel('<b>%s</b>' % _('Languages'))
|
||||
self.languagelabel.setToolTip(_("Set the language used throughout FlatCAM."))
|
||||
grid0.addWidget(self.languagelabel, 20, 0, 1, 2)
|
||||
|
||||
self.language_combo = FCComboBox()
|
||||
grid0.addWidget(self.language_combo, 22, 0, 1, 2)
|
||||
self.language_combo.addItems(self.defaults["global_languages"])
|
||||
|
||||
self.language_apply_btn = FCButton(_("Apply Language"))
|
||||
self.language_apply_btn.setToolTip(_("Set the language used throughout FlatCAM.\n"
|
||||
"The app will restart after click."))
|
||||
|
||||
grid0.addWidget(self.language_apply_btn, 24, 0, 1, 2)
|
||||
|
||||
separator_line = QtWidgets.QFrame()
|
||||
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
grid0.addWidget(separator_line, 26, 0, 1, 2)
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# ----------- APPLICATION STARTUP SETTINGS ------------------
|
||||
# -----------------------------------------------------------
|
||||
|
||||
self.startup_label = FCLabel('<b>%s</b>' % _('Startup Settings'))
|
||||
grid0.addWidget(self.startup_label, 28, 0, 1, 2)
|
||||
|
||||
# Splash Screen
|
||||
self.splash_cb = FCCheckBox('%s' % _('Splash Screen'))
|
||||
self.splash_cb.setToolTip(
|
||||
_("Enable display of the splash screen at application startup.")
|
||||
)
|
||||
|
||||
qsettings = QSettings("Open Source", "FlatCAM")
|
||||
if qsettings.value("splash_screen"):
|
||||
self.splash_cb.set_value(True)
|
||||
else:
|
||||
self.splash_cb.set_value(False)
|
||||
|
||||
grid0.addWidget(self.splash_cb, 30, 0, 1, 2)
|
||||
|
||||
# Sys Tray Icon
|
||||
self.systray_cb = FCCheckBox('%s' % _('Sys Tray Icon'))
|
||||
self.systray_cb.setToolTip(
|
||||
_("Enable display of FlatCAM icon in Sys Tray.")
|
||||
)
|
||||
grid0.addWidget(self.systray_cb, 32, 0, 1, 2)
|
||||
|
||||
# Shell StartUp CB
|
||||
self.shell_startup_cb = FCCheckBox(label='%s' % _('Show Shell'))
|
||||
self.shell_startup_cb.setToolTip(
|
||||
_("Check this box if you want the shell to\n"
|
||||
"start automatically at startup.")
|
||||
)
|
||||
|
||||
grid0.addWidget(self.shell_startup_cb, 34, 0, 1, 2)
|
||||
|
||||
# Project at StartUp CB
|
||||
self.project_startup_cb = FCCheckBox(label='%s' % _('Show Project'))
|
||||
self.project_startup_cb.setToolTip(
|
||||
_("Check this box if you want the project/selected/tool tab area to\n"
|
||||
"to be shown automatically at startup.")
|
||||
)
|
||||
grid0.addWidget(self.project_startup_cb, 36, 0, 1, 2)
|
||||
|
||||
# Version Check CB
|
||||
self.version_check_cb = FCCheckBox(label='%s' % _('Version Check'))
|
||||
self.version_check_cb.setToolTip(
|
||||
_("Check this box if you want to check\n"
|
||||
"for a new version automatically at startup.")
|
||||
)
|
||||
|
||||
grid0.addWidget(self.version_check_cb, 38, 0, 1, 2)
|
||||
|
||||
# Send Stats CB
|
||||
self.send_stats_cb = FCCheckBox(label='%s' % _('Send Statistics'))
|
||||
self.send_stats_cb.setToolTip(
|
||||
_("Check this box if you agree to send anonymous\n"
|
||||
"stats automatically at startup, to help improve FlatCAM.")
|
||||
)
|
||||
|
||||
grid0.addWidget(self.send_stats_cb, 40, 0, 1, 2)
|
||||
|
||||
self.ois_version_check = OptionalInputSection(self.version_check_cb, [self.send_stats_cb])
|
||||
|
||||
separator_line = QtWidgets.QFrame()
|
||||
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
grid0.addWidget(separator_line, 42, 0, 1, 2)
|
||||
# separator_line = QtWidgets.QFrame()
|
||||
# separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
# separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
# grid0.addWidget(separator_line, 8, 0, 1, 2)
|
||||
|
||||
# Worker Numbers
|
||||
self.worker_number_label = FCLabel('%s:' % _('Workers number'))
|
||||
@@ -225,8 +120,8 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
|
||||
self.worker_number_sb = FCSpinner()
|
||||
self.worker_number_sb.set_range(2, 16)
|
||||
|
||||
grid0.addWidget(self.worker_number_label, 44, 0)
|
||||
grid0.addWidget(self.worker_number_sb, 44, 1)
|
||||
grid1.addWidget(self.worker_number_label, 2, 0)
|
||||
grid1.addWidget(self.worker_number_sb, 2, 1)
|
||||
|
||||
# Geometric tolerance
|
||||
tol_label = FCLabel('%s:' % _("Geo Tolerance"))
|
||||
@@ -242,17 +137,157 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
|
||||
self.tol_entry.setSingleStep(0.001)
|
||||
self.tol_entry.set_precision(6)
|
||||
|
||||
grid0.addWidget(tol_label, 46, 0)
|
||||
grid0.addWidget(self.tol_entry, 46, 1)
|
||||
grid1.addWidget(tol_label, 4, 0)
|
||||
grid1.addWidget(self.tol_entry, 4, 1)
|
||||
|
||||
separator_line = QtWidgets.QFrame()
|
||||
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
grid0.addWidget(separator_line, 48, 0, 1, 2)
|
||||
# Portability
|
||||
self.portability_cb = FCCheckBox('%s' % _('Portable app'))
|
||||
self.portability_cb.setToolTip(_("Choose if the application should run as portable.\n\n"
|
||||
"If Checked the application will run portable,\n"
|
||||
"which means that the preferences files will be saved\n"
|
||||
"in the application folder, in the lib\\config subfolder."))
|
||||
|
||||
grid1.addWidget(self.portability_cb, 6, 0, 1, 2)
|
||||
|
||||
# Verbose Log
|
||||
self.verbose_cb = FCCheckBox('%s' % _('Verbose log'))
|
||||
self.verbose_cb.setToolTip(_("Enable log messages in the Tcl Shell.\n"
|
||||
"Require restart."))
|
||||
|
||||
grid1.addWidget(self.verbose_cb, 8, 0, 1, 2)
|
||||
|
||||
# #############################################################################################################
|
||||
# Grid0 Frame
|
||||
# #############################################################################################################
|
||||
self.app_level_label = FCLabel('<span style="color:red;"><b>%s</b></span>' % _('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"
|
||||
"The choice here will influence the parameters in\n"
|
||||
"the Selected Tab for all kinds of FlatCAM objects."))
|
||||
self.layout.addWidget(self.app_level_label)
|
||||
|
||||
grid2_frame = FCFrame()
|
||||
self.layout.addWidget(grid2_frame)
|
||||
|
||||
grid2 = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
grid2_frame.setLayout(grid2)
|
||||
|
||||
# Application Level for FlatCAM
|
||||
self.app_level_radio = RadioSet([{'label': _('Beginner'), 'value': 'b'},
|
||||
{'label': _('Advanced'), 'value': 'a'}], compact=True)
|
||||
grid2.addWidget(self.app_level_radio, 2, 0, 1, 2)
|
||||
|
||||
# #############################################################################################################
|
||||
# Grid3 Frame
|
||||
# #############################################################################################################
|
||||
# Languages for FlatCAM
|
||||
self.languagelabel = FCLabel('<span style="color:DarkCyan;"><b>%s</b></span>' % _('Languages'))
|
||||
self.languagelabel.setToolTip(_("Set the language used throughout FlatCAM."))
|
||||
self.layout.addWidget(self.languagelabel)
|
||||
|
||||
grid3_frame = FCFrame()
|
||||
self.layout.addWidget(grid3_frame)
|
||||
|
||||
grid3 = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
grid3_frame.setLayout(grid3)
|
||||
|
||||
self.language_combo = FCComboBox()
|
||||
self.language_combo.addItems(self.defaults["global_languages"])
|
||||
grid3.addWidget(self.language_combo, 0, 0, 1, 2)
|
||||
|
||||
self.language_apply_btn = FCButton(_("Apply Language"))
|
||||
self.language_apply_btn.setToolTip(_("Set the language used throughout FlatCAM.\n"
|
||||
"The app will restart after click."))
|
||||
|
||||
grid3.addWidget(self.language_apply_btn, 2, 0, 1, 2)
|
||||
|
||||
# -----------------------------------------------------------
|
||||
# ----------- APPLICATION STARTUP SETTINGS ------------------
|
||||
# -----------------------------------------------------------
|
||||
|
||||
self.startup_label = FCLabel('<span style="color:green;"><b>%s</b></span>' % _('Startup Settings'))
|
||||
self.layout.addWidget(self.startup_label)
|
||||
|
||||
# #############################################################################################################
|
||||
# Grid4 Frame
|
||||
# #############################################################################################################
|
||||
grid4_frame = FCFrame()
|
||||
self.layout.addWidget(grid4_frame)
|
||||
|
||||
grid4 = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
grid4_frame.setLayout(grid4)
|
||||
|
||||
# Splash Screen
|
||||
self.splash_cb = FCCheckBox('%s' % _('Splash Screen'))
|
||||
self.splash_cb.setToolTip(
|
||||
_("Enable display of the splash screen at application startup.")
|
||||
)
|
||||
|
||||
qsettings = QSettings("Open Source", "FlatCAM")
|
||||
if qsettings.value("splash_screen"):
|
||||
self.splash_cb.set_value(True)
|
||||
else:
|
||||
self.splash_cb.set_value(False)
|
||||
|
||||
grid4.addWidget(self.splash_cb, 0, 0, 1, 2)
|
||||
|
||||
# Sys Tray Icon
|
||||
self.systray_cb = FCCheckBox('%s' % _('Sys Tray Icon'))
|
||||
self.systray_cb.setToolTip(
|
||||
_("Enable display of FlatCAM icon in Sys Tray.")
|
||||
)
|
||||
grid4.addWidget(self.systray_cb, 2, 0, 1, 2)
|
||||
|
||||
# Shell StartUp CB
|
||||
self.shell_startup_cb = FCCheckBox(label='%s' % _('Show Shell'))
|
||||
self.shell_startup_cb.setToolTip(
|
||||
_("Check this box if you want the shell to\n"
|
||||
"start automatically at startup.")
|
||||
)
|
||||
|
||||
grid4.addWidget(self.shell_startup_cb, 4, 0, 1, 2)
|
||||
|
||||
# Project at StartUp CB
|
||||
self.project_startup_cb = FCCheckBox(label='%s' % _('Show Project'))
|
||||
self.project_startup_cb.setToolTip(
|
||||
_("Check this box if you want the project/selected/tool tab area to\n"
|
||||
"to be shown automatically at startup.")
|
||||
)
|
||||
grid4.addWidget(self.project_startup_cb, 6, 0, 1, 2)
|
||||
|
||||
# Version Check CB
|
||||
self.version_check_cb = FCCheckBox(label='%s' % _('Version Check'))
|
||||
self.version_check_cb.setToolTip(
|
||||
_("Check this box if you want to check\n"
|
||||
"for a new version automatically at startup.")
|
||||
)
|
||||
|
||||
grid4.addWidget(self.version_check_cb, 8, 0, 1, 2)
|
||||
|
||||
# Send Stats CB
|
||||
self.send_stats_cb = FCCheckBox(label='%s' % _('Send Statistics'))
|
||||
self.send_stats_cb.setToolTip(
|
||||
_("Check this box if you agree to send anonymous\n"
|
||||
"stats automatically at startup, to help improve FlatCAM.")
|
||||
)
|
||||
|
||||
grid4.addWidget(self.send_stats_cb, 10, 0, 1, 2)
|
||||
|
||||
self.ois_version_check = OptionalInputSection(self.version_check_cb, [self.send_stats_cb])
|
||||
|
||||
# Save Settings
|
||||
self.save_label = FCLabel('<b>%s</b>' % _("Save Settings"))
|
||||
grid0.addWidget(self.save_label, 50, 0, 1, 2)
|
||||
self.save_label = FCLabel('<span style="color:purple;"><b>%s</b></span>' % _("Save Settings"))
|
||||
self.layout.addWidget(self.save_label)
|
||||
|
||||
# #############################################################################################################
|
||||
# Grid6 Frame
|
||||
# #############################################################################################################
|
||||
grid6_frame = FCFrame()
|
||||
self.layout.addWidget(grid6_frame)
|
||||
|
||||
grid6 = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
grid6_frame.setLayout(grid6)
|
||||
|
||||
# Save compressed project CB
|
||||
self.save_type_cb = FCCheckBox(_('Save Compressed Project'))
|
||||
@@ -261,7 +296,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
|
||||
"When checked it will save a compressed FlatCAM project.")
|
||||
)
|
||||
|
||||
grid0.addWidget(self.save_type_cb, 52, 0, 1, 2)
|
||||
grid6.addWidget(self.save_type_cb, 0, 0, 1, 2)
|
||||
|
||||
# Project LZMA Comppression Level
|
||||
self.compress_spinner = FCSpinner()
|
||||
@@ -273,8 +308,8 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
|
||||
"but require more RAM usage and more processing time.")
|
||||
)
|
||||
|
||||
grid0.addWidget(self.compress_label, 54, 0)
|
||||
grid0.addWidget(self.compress_spinner, 54, 1)
|
||||
grid6.addWidget(self.compress_label, 2, 0)
|
||||
grid6.addWidget(self.compress_spinner, 2, 1)
|
||||
|
||||
self.proj_ois = OptionalInputSection(self.save_type_cb, [self.compress_label, self.compress_spinner], True)
|
||||
|
||||
@@ -286,7 +321,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
|
||||
"at the set interval.")
|
||||
)
|
||||
|
||||
grid0.addWidget(self.autosave_cb, 56, 0, 1, 2)
|
||||
grid6.addWidget(self.autosave_cb, 4, 0, 1, 2)
|
||||
|
||||
# Auto Save Timeout Interval
|
||||
self.autosave_entry = FCSpinner()
|
||||
@@ -299,21 +334,25 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
|
||||
"While active, some operations may block this feature.")
|
||||
)
|
||||
|
||||
grid0.addWidget(self.autosave_label, 58, 0)
|
||||
grid0.addWidget(self.autosave_entry, 58, 1)
|
||||
grid6.addWidget(self.autosave_label, 6, 0)
|
||||
grid6.addWidget(self.autosave_entry, 6, 1)
|
||||
|
||||
# self.as_ois = OptionalInputSection(self.autosave_cb, [self.autosave_label, self.autosave_entry], True)
|
||||
|
||||
separator_line = QtWidgets.QFrame()
|
||||
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
grid0.addWidget(separator_line, 60, 0, 1, 2)
|
||||
|
||||
self.pdf_param_label = FCLabel('<B>%s:</b>' % _("Text to PDF parameters"))
|
||||
self.pdf_param_label = FCLabel('<span style="color:orange;"><b>%s</b></span>' % _("Text to PDF parameters"))
|
||||
self.pdf_param_label.setToolTip(
|
||||
_("Used when saving text in Code Editor or in FlatCAM Document objects.")
|
||||
)
|
||||
grid0.addWidget(self.pdf_param_label, 62, 0, 1, 2)
|
||||
self.layout.addWidget(self.pdf_param_label)
|
||||
|
||||
# #############################################################################################################
|
||||
# Grid7 Frame
|
||||
# #############################################################################################################
|
||||
grid7_frame = FCFrame()
|
||||
self.layout.addWidget(grid7_frame)
|
||||
|
||||
grid7 = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
grid7_frame.setLayout(grid7)
|
||||
|
||||
# Top Margin value
|
||||
self.tmargin_entry = FCDoubleSpinner()
|
||||
@@ -325,8 +364,8 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
|
||||
_("Distance between text body and the top of the PDF file.")
|
||||
)
|
||||
|
||||
grid0.addWidget(self.tmargin_label, 64, 0)
|
||||
grid0.addWidget(self.tmargin_entry, 64, 1)
|
||||
grid7.addWidget(self.tmargin_label, 0, 0)
|
||||
grid7.addWidget(self.tmargin_entry, 0, 1)
|
||||
|
||||
# Bottom Margin value
|
||||
self.bmargin_entry = FCDoubleSpinner()
|
||||
@@ -338,8 +377,8 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
|
||||
_("Distance between text body and the bottom of the PDF file.")
|
||||
)
|
||||
|
||||
grid0.addWidget(self.bmargin_label, 66, 0)
|
||||
grid0.addWidget(self.bmargin_entry, 66, 1)
|
||||
grid7.addWidget(self.bmargin_label, 2, 0)
|
||||
grid7.addWidget(self.bmargin_entry, 2, 1)
|
||||
|
||||
# Left Margin value
|
||||
self.lmargin_entry = FCDoubleSpinner()
|
||||
@@ -351,8 +390,8 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
|
||||
_("Distance between text body and the left of the PDF file.")
|
||||
)
|
||||
|
||||
grid0.addWidget(self.lmargin_label, 68, 0)
|
||||
grid0.addWidget(self.lmargin_entry, 68, 1)
|
||||
grid7.addWidget(self.lmargin_label, 4, 0)
|
||||
grid7.addWidget(self.lmargin_entry, 4, 1)
|
||||
|
||||
# Right Margin value
|
||||
self.rmargin_entry = FCDoubleSpinner()
|
||||
@@ -364,11 +403,13 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
|
||||
_("Distance between text body and the right of the PDF file.")
|
||||
)
|
||||
|
||||
grid0.addWidget(self.rmargin_label, 70, 0)
|
||||
grid0.addWidget(self.rmargin_entry, 70, 1)
|
||||
grid7.addWidget(self.rmargin_label, 6, 0)
|
||||
grid7.addWidget(self.rmargin_entry, 6, 1)
|
||||
|
||||
self.layout.addStretch()
|
||||
|
||||
FCGridLayout.set_common_column_size([grid0, grid1, grid6, grid7], 0)
|
||||
|
||||
if sys.platform != 'win32':
|
||||
self.portability_cb.hide()
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ class GeneralAppSettingsGroupUI(OptionsGroupUI2):
|
||||
|
||||
self.textbox_font_size_field = self.option_dict()["textbox_font_size"].get_field()
|
||||
if qsettings.contains("textbox_font_size"):
|
||||
self.textbox_font_size_field.set_value(settings.value('textbox_font_size', type=int))
|
||||
self.textbox_font_size_field.set_value(qsettings.value('textbox_font_size', type=int))
|
||||
else:
|
||||
self.textbox_font_size_field.set_value(10)
|
||||
|
||||
@@ -120,7 +120,7 @@ class GeneralAppSettingsGroupUI(OptionsGroupUI2):
|
||||
|
||||
def build_options(self) -> [OptionUI]:
|
||||
return [
|
||||
HeadingOptionUI(label_text="Grid Settings", label_tooltip=None),
|
||||
HeadingOptionUI(label_text="Grid Settings", color="brown", label_tooltip=None),
|
||||
DoubleSpinnerOptionUI(
|
||||
option="global_gridx",
|
||||
label_text="X value",
|
||||
|
||||
@@ -2,7 +2,7 @@ from PyQt6 import QtWidgets, QtCore
|
||||
from PyQt6.QtCore import QSettings
|
||||
|
||||
from appGUI.GUIElements import RadioSet, FCCheckBox, FCComboBox, FCSliderWithSpinner, FCColorEntry, FCLabel, \
|
||||
FCGridLayout
|
||||
FCGridLayout, FCFrame
|
||||
from appGUI.preferences.OptionsGroupUI import OptionsGroupUI
|
||||
|
||||
import gettext
|
||||
@@ -22,9 +22,17 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
|
||||
self.decimals = decimals
|
||||
self.defaults = defaults
|
||||
|
||||
# Create a grid layout for the Application general settings
|
||||
self.param_lbl = FCLabel('<span style="color:blue;"><b>%s</b></span>' % _("Parameters"))
|
||||
self.layout.addWidget(self.param_lbl)
|
||||
|
||||
# #############################################################################################################
|
||||
# Grid0 Frame
|
||||
# #############################################################################################################
|
||||
par_frame = FCFrame()
|
||||
self.layout.addWidget(par_frame)
|
||||
|
||||
grid0 = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
self.layout.addLayout(grid0)
|
||||
par_frame.setLayout(grid0)
|
||||
|
||||
# Theme selection
|
||||
self.theme_label = FCLabel('%s:' % _('Theme'))
|
||||
@@ -36,7 +44,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
|
||||
self.theme_radio = RadioSet([
|
||||
{"label": _("Light"), "value": "white"},
|
||||
{"label": _("Dark"), "value": "black"}
|
||||
], orientation='vertical')
|
||||
], compact=True)
|
||||
|
||||
grid0.addWidget(self.theme_label, 0, 0)
|
||||
grid0.addWidget(self.theme_radio, 0, 1)
|
||||
@@ -48,7 +56,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
|
||||
"a lighter (gray) color. To be used when a\n"
|
||||
"full dark theme is applied.")
|
||||
)
|
||||
grid0.addWidget(self.gray_icons_cb, 1, 0, 1, 3)
|
||||
grid0.addWidget(self.gray_icons_cb, 2, 0, 1, 3)
|
||||
|
||||
# self.theme_button = FCButton(_("Apply Theme"))
|
||||
# self.theme_button.setToolTip(
|
||||
@@ -61,7 +69,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
|
||||
separator_line = QtWidgets.QFrame()
|
||||
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
grid0.addWidget(separator_line, 3, 0, 1, 2)
|
||||
grid0.addWidget(separator_line, 4, 0, 1, 2)
|
||||
|
||||
# Layout selection
|
||||
self.layout_label = FCLabel('%s:' % _('Layout'))
|
||||
@@ -75,8 +83,8 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
|
||||
self.layout_combo.addItem("compact")
|
||||
self.layout_combo.addItem("minimal")
|
||||
|
||||
grid0.addWidget(self.layout_label, 4, 0)
|
||||
grid0.addWidget(self.layout_combo, 4, 1)
|
||||
grid0.addWidget(self.layout_label, 6, 0)
|
||||
grid0.addWidget(self.layout_combo, 6, 1)
|
||||
|
||||
# Set the current index for layout_combo
|
||||
qsettings = QSettings("Open Source", "FlatCAM")
|
||||
@@ -99,8 +107,8 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
|
||||
self.style_combo.setCurrentIndex(index)
|
||||
self.style_combo.activated.connect(self.handle_style)
|
||||
|
||||
grid0.addWidget(self.style_label, 5, 0)
|
||||
grid0.addWidget(self.style_combo, 5, 1)
|
||||
grid0.addWidget(self.style_label, 8, 0)
|
||||
grid0.addWidget(self.style_combo, 8, 1)
|
||||
|
||||
# Enable Hover box
|
||||
self.hover_cb = FCCheckBox('%s' % _('Hover Shape'))
|
||||
@@ -109,7 +117,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
|
||||
"It is displayed whenever the mouse cursor is hovering\n"
|
||||
"over any kind of not-selected object.")
|
||||
)
|
||||
grid0.addWidget(self.hover_cb, 8, 0, 1, 3)
|
||||
grid0.addWidget(self.hover_cb, 10, 0, 1, 3)
|
||||
|
||||
# Enable Selection box
|
||||
self.selection_cb = FCCheckBox('%s' % _('Selection Shape'))
|
||||
@@ -119,16 +127,23 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
|
||||
"either by clicking or dragging mouse from left to right or\n"
|
||||
"right to left.")
|
||||
)
|
||||
grid0.addWidget(self.selection_cb, 9, 0, 1, 3)
|
||||
grid0.addWidget(self.selection_cb, 12, 0, 1, 3)
|
||||
|
||||
separator_line = QtWidgets.QFrame()
|
||||
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
grid0.addWidget(separator_line, 14, 0, 1, 2)
|
||||
# #############################################################################################################
|
||||
# Grid1 Frame
|
||||
# #############################################################################################################
|
||||
self.color_lbl = FCLabel('<span style="color:red;"><b>%s</b></span>' % _("Colors"))
|
||||
self.layout.addWidget(self.color_lbl)
|
||||
|
||||
color_frame = FCFrame()
|
||||
self.layout.addWidget(color_frame)
|
||||
|
||||
grid1 = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
color_frame.setLayout(grid1)
|
||||
|
||||
# Plot Selection (left - right) Color
|
||||
self.sel_lr_label = FCLabel('<b>%s</b>' % _('Left-Right Selection Color'))
|
||||
grid0.addWidget(self.sel_lr_label, 15, 0, 1, 2)
|
||||
grid1.addWidget(self.sel_lr_label, 0, 0, 1, 2)
|
||||
|
||||
self.sl_color_label = FCLabel('%s:' % _('Outline'))
|
||||
self.sl_color_label.setToolTip(
|
||||
@@ -136,8 +151,8 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
|
||||
)
|
||||
self.sl_color_entry = FCColorEntry()
|
||||
|
||||
grid0.addWidget(self.sl_color_label, 16, 0)
|
||||
grid0.addWidget(self.sl_color_entry, 16, 1)
|
||||
grid1.addWidget(self.sl_color_label, 2, 0)
|
||||
grid1.addWidget(self.sl_color_entry, 2, 1)
|
||||
|
||||
self.sf_color_label = FCLabel('%s:' % _('Fill'))
|
||||
self.sf_color_label.setToolTip(
|
||||
@@ -148,8 +163,8 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
|
||||
)
|
||||
self.sf_color_entry = FCColorEntry()
|
||||
|
||||
grid0.addWidget(self.sf_color_label, 17, 0)
|
||||
grid0.addWidget(self.sf_color_entry, 17, 1)
|
||||
grid1.addWidget(self.sf_color_label, 4, 0)
|
||||
grid1.addWidget(self.sf_color_entry, 4, 1)
|
||||
|
||||
# Plot Selection (left - right) Fill Transparency Level
|
||||
self.left_right_alpha_label = FCLabel('%s:' % _('Alpha'))
|
||||
@@ -158,17 +173,17 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
|
||||
)
|
||||
self.left_right_alpha_entry = FCSliderWithSpinner(0, 255, 1)
|
||||
|
||||
grid0.addWidget(self.left_right_alpha_label, 18, 0)
|
||||
grid0.addWidget(self.left_right_alpha_entry, 18, 1)
|
||||
grid1.addWidget(self.left_right_alpha_label, 6, 0)
|
||||
grid1.addWidget(self.left_right_alpha_entry, 6, 1)
|
||||
|
||||
separator_line = QtWidgets.QFrame()
|
||||
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
grid0.addWidget(separator_line, 19, 0, 1, 2)
|
||||
grid1.addWidget(separator_line, 8, 0, 1, 2)
|
||||
|
||||
# Plot Selection (left - right) Color
|
||||
self.sel_rl_label = FCLabel('<b>%s</b>' % _('Right-Left Selection Color'))
|
||||
grid0.addWidget(self.sel_rl_label, 20, 0, 1, 2)
|
||||
grid1.addWidget(self.sel_rl_label, 10, 0, 1, 2)
|
||||
|
||||
# Plot Selection (right - left) Line Color
|
||||
self.alt_sl_color_label = FCLabel('%s:' % _('Outline'))
|
||||
@@ -177,8 +192,8 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
|
||||
)
|
||||
self.alt_sl_color_entry = FCColorEntry()
|
||||
|
||||
grid0.addWidget(self.alt_sl_color_label, 21, 0)
|
||||
grid0.addWidget(self.alt_sl_color_entry, 21, 1)
|
||||
grid1.addWidget(self.alt_sl_color_label, 12, 0)
|
||||
grid1.addWidget(self.alt_sl_color_entry, 12, 1)
|
||||
|
||||
# Plot Selection (right - left) Fill Color
|
||||
self.alt_sf_color_label = FCLabel('%s:' % _('Fill'))
|
||||
@@ -190,8 +205,8 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
|
||||
)
|
||||
self.alt_sf_color_entry = FCColorEntry()
|
||||
|
||||
grid0.addWidget(self.alt_sf_color_label, 22, 0)
|
||||
grid0.addWidget(self.alt_sf_color_entry, 22, 1)
|
||||
grid1.addWidget(self.alt_sf_color_label, 14, 0)
|
||||
grid1.addWidget(self.alt_sf_color_entry, 14, 1)
|
||||
|
||||
# Plot Selection (right - left) Fill Transparency Level
|
||||
self.right_left_alpha_label = FCLabel('%s:' % _('Alpha'))
|
||||
@@ -200,20 +215,20 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
|
||||
)
|
||||
self.right_left_alpha_entry = FCSliderWithSpinner(0, 255, 1)
|
||||
|
||||
grid0.addWidget(self.right_left_alpha_label, 23, 0)
|
||||
grid0.addWidget(self.right_left_alpha_entry, 23, 1)
|
||||
grid1.addWidget(self.right_left_alpha_label, 16, 0)
|
||||
grid1.addWidget(self.right_left_alpha_entry, 16, 1)
|
||||
|
||||
separator_line = QtWidgets.QFrame()
|
||||
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
grid0.addWidget(separator_line, 24, 0, 1, 2)
|
||||
grid1.addWidget(separator_line, 18, 0, 1, 2)
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# ----------------------- Editor Color -----------------------------
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
self.editor_color_label = FCLabel('<b>%s</b>' % _('Editor Color'))
|
||||
grid0.addWidget(self.editor_color_label, 25, 0, 1, 2)
|
||||
grid1.addWidget(self.editor_color_label, 20, 0, 1, 2)
|
||||
|
||||
# Editor Draw Color
|
||||
self.draw_color_label = FCLabel('%s:' % _('Drawing'))
|
||||
@@ -222,8 +237,8 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
|
||||
)
|
||||
self.draw_color_entry = FCColorEntry()
|
||||
|
||||
grid0.addWidget(self.draw_color_label, 26, 0)
|
||||
grid0.addWidget(self.draw_color_entry, 26, 1)
|
||||
grid1.addWidget(self.draw_color_label, 22, 0)
|
||||
grid1.addWidget(self.draw_color_entry, 22, 1)
|
||||
|
||||
# Editor Draw Selection Color
|
||||
self.sel_draw_color_label = FCLabel('%s:' % _('Selection'))
|
||||
@@ -232,20 +247,20 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
|
||||
)
|
||||
self.sel_draw_color_entry = FCColorEntry()
|
||||
|
||||
grid0.addWidget(self.sel_draw_color_label, 27, 0)
|
||||
grid0.addWidget(self.sel_draw_color_entry, 27, 1)
|
||||
grid1.addWidget(self.sel_draw_color_label, 24, 0)
|
||||
grid1.addWidget(self.sel_draw_color_entry, 24, 1)
|
||||
|
||||
separator_line = QtWidgets.QFrame()
|
||||
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
grid0.addWidget(separator_line, 28, 0, 1, 2)
|
||||
grid1.addWidget(separator_line, 26, 0, 1, 2)
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# ----------------------- Project Settings -----------------------------
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
self.proj_settings_label = FCLabel('<b>%s</b>' % _('Project Items Color'))
|
||||
grid0.addWidget(self.proj_settings_label, 29, 0, 1, 2)
|
||||
grid1.addWidget(self.proj_settings_label, 28, 0, 1, 2)
|
||||
|
||||
# Project Tab items color
|
||||
self.proj_color_label = FCLabel('%s:' % _('Enabled'))
|
||||
@@ -254,8 +269,8 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
|
||||
)
|
||||
self.proj_color_entry = FCColorEntry()
|
||||
|
||||
grid0.addWidget(self.proj_color_label, 30, 0)
|
||||
grid0.addWidget(self.proj_color_entry, 30, 1)
|
||||
grid1.addWidget(self.proj_color_label, 30, 0)
|
||||
grid1.addWidget(self.proj_color_entry, 30, 1)
|
||||
|
||||
self.proj_color_dis_label = FCLabel('%s:' % _('Disabled'))
|
||||
self.proj_color_dis_label.setToolTip(
|
||||
@@ -264,8 +279,10 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
|
||||
)
|
||||
self.proj_color_dis_entry = FCColorEntry()
|
||||
|
||||
grid0.addWidget(self.proj_color_dis_label, 31, 0)
|
||||
grid0.addWidget(self.proj_color_dis_entry, 31, 1)
|
||||
grid1.addWidget(self.proj_color_dis_label, 32, 0)
|
||||
grid1.addWidget(self.proj_color_dis_entry, 32, 1)
|
||||
|
||||
FCGridLayout.set_common_column_size([grid0, grid1], 0)
|
||||
|
||||
# Project autohide CB
|
||||
self.project_autohide_cb = FCCheckBox(label=_('Project AutoHide'))
|
||||
@@ -275,10 +292,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
|
||||
"to show whenever a new object is created.")
|
||||
)
|
||||
|
||||
grid0.addWidget(self.project_autohide_cb, 32, 0, 1, 2)
|
||||
|
||||
# Just to add empty rows
|
||||
grid0.addWidget(FCLabel(''), 33, 0, 1, 2)
|
||||
self.layout.addWidget(self.project_autohide_cb)
|
||||
|
||||
self.layout.addStretch()
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ class GeometryGenPrefGroupUI(OptionsGroupUI):
|
||||
{'label': _('MetaHeuristic'), 'value': 'M'},
|
||||
{'label': _('Basic'), 'value': 'B'},
|
||||
{'label': _('TSA'), 'value': 'T'}
|
||||
], orientation='vertical', stretch=False)
|
||||
], orientation='vertical', compact=True)
|
||||
|
||||
grid0.addWidget(self.opt_algorithm_label, 12, 0)
|
||||
grid0.addWidget(self.opt_algorithm_radio, 12, 1)
|
||||
|
||||
@@ -110,7 +110,7 @@ class Tools2CThievingPrefGroupUI(OptionsGroupUI):
|
||||
self.bbox_type_radio = RadioSet([
|
||||
{'label': _('Rectangular'), 'value': 'rect'},
|
||||
{"label": _("Minimal"), "value": "min"}
|
||||
], stretch=False)
|
||||
], compact=True)
|
||||
self.bbox_type_label = FCLabel('%s:' % _("Box Type"))
|
||||
self.bbox_type_label.setToolTip(
|
||||
_("- 'Rectangular' - the bounding box will be of rectangular shape.\n"
|
||||
|
||||
@@ -39,7 +39,7 @@ class Tools2CalPrefGroupUI(OptionsGroupUI):
|
||||
"- Free -> click freely on canvas to acquire the calibration points"))
|
||||
self.cal_source_radio = RadioSet([{'label': _('Object'), 'value': 'object'},
|
||||
{'label': _('Free'), 'value': 'free'}],
|
||||
stretch=False)
|
||||
compact=True)
|
||||
|
||||
grid_lay.addWidget(self.cal_source_lbl, 1, 0)
|
||||
grid_lay.addWidget(self.cal_source_radio, 1, 1, 1, 2)
|
||||
|
||||
@@ -93,7 +93,7 @@ class Tools2EDrillsPrefGroupUI(OptionsGroupUI):
|
||||
{'label': _("Proportional"), 'value': 'prop'}
|
||||
],
|
||||
orientation='vertical',
|
||||
stretch=False)
|
||||
compact=True)
|
||||
self.method_label = FCLabel('<b>%s:</b>' % _("Method"))
|
||||
self.method_label.setToolTip(
|
||||
_("The method for processing pads. Can be:\n"
|
||||
|
||||
@@ -71,7 +71,7 @@ class Tools2FiducialsPrefGroupUI(OptionsGroupUI):
|
||||
{'label': _('Up'), 'value': 'up'},
|
||||
{"label": _("Down"), "value": "down"},
|
||||
{"label": _("None"), "value": "no"}
|
||||
], stretch=False)
|
||||
], compact=True)
|
||||
self.pos_label = FCLabel('%s:' % _("Second fiducial"))
|
||||
self.pos_label.setToolTip(
|
||||
_("The position for the second fiducial.\n"
|
||||
@@ -132,7 +132,7 @@ class Tools2FiducialsPrefGroupUI(OptionsGroupUI):
|
||||
self.mode_radio = RadioSet([
|
||||
{'label': _('Auto'), 'value': 'auto'},
|
||||
{"label": _("Manual"), "value": "manual"}
|
||||
], stretch=False)
|
||||
], compact=True)
|
||||
self.mode_label = FCLabel('%s:' % _("Mode"))
|
||||
self.mode_label.setToolTip(
|
||||
_("- 'Auto' - automatic placement of fiducials in the corners of the bounding box.\n"
|
||||
|
||||
@@ -59,7 +59,7 @@ class Tools2InvertPrefGroupUI(OptionsGroupUI):
|
||||
{'label': _('Rounded'), 'value': 'r'},
|
||||
{'label': _('Square'), 'value': 's'},
|
||||
{'label': _('Bevel'), 'value': 'b'}
|
||||
], orientation='vertical', stretch=False)
|
||||
], orientation='vertical', compact=True)
|
||||
|
||||
grid0.addWidget(self.join_label, 5, 0, 1, 2)
|
||||
grid0.addWidget(self.join_radio, 7, 0, 1, 2)
|
||||
|
||||
@@ -94,7 +94,7 @@ class Tools2PunchGerberPrefGroupUI(OptionsGroupUI):
|
||||
{'label': _("Proportional"), 'value': 'prop'}
|
||||
],
|
||||
orientation='vertical',
|
||||
stretch=False)
|
||||
compact=True)
|
||||
self.hole_size_label = FCLabel('<b>%s:</b>' % _("Method"))
|
||||
self.hole_size_label.setToolTip(
|
||||
_("The punch hole source can be:\n"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from PyQt6 import QtWidgets
|
||||
|
||||
from appGUI.GUIElements import FCDoubleSpinner, RadioSet, FCLabel, FCGridLayout
|
||||
from appGUI.GUIElements import FCDoubleSpinner, RadioSet, FCLabel, FCGridLayout, FCFrame
|
||||
from appGUI.preferences.OptionsGroupUI import OptionsGroupUI
|
||||
|
||||
import gettext
|
||||
@@ -22,15 +22,21 @@ class Tools2sidedPrefGroupUI(OptionsGroupUI):
|
||||
self.defaults = defaults
|
||||
|
||||
# ## Board cuttout
|
||||
self.dblsided_label = FCLabel("<b>%s:</b>" % _("Parameters"))
|
||||
self.dblsided_label = FCLabel('<span style="color:indigo;"><b>%s</b></span>' % _("PCB Alignment"))
|
||||
self.dblsided_label.setToolTip(
|
||||
_("A tool to help in creating a double sided\n"
|
||||
"PCB using alignment holes.")
|
||||
)
|
||||
self.layout.addWidget(self.dblsided_label)
|
||||
|
||||
grid0 = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
self.layout.addLayout(grid0)
|
||||
# #############################################################################################################
|
||||
# Parameters Frame
|
||||
# #############################################################################################################
|
||||
par_frame = FCFrame()
|
||||
self.layout.addWidget(par_frame)
|
||||
|
||||
param_grid = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
par_frame.setLayout(param_grid)
|
||||
|
||||
# ## Drill diameter for alignment holes
|
||||
self.drill_dia_entry = FCDoubleSpinner()
|
||||
@@ -43,8 +49,8 @@ class Tools2sidedPrefGroupUI(OptionsGroupUI):
|
||||
_("Diameter of the drill for the "
|
||||
"alignment holes.")
|
||||
)
|
||||
grid0.addWidget(self.dd_label, 0, 0)
|
||||
grid0.addWidget(self.drill_dia_entry, 0, 1)
|
||||
param_grid.addWidget(self.dd_label, 0, 0)
|
||||
param_grid.addWidget(self.drill_dia_entry, 0, 1)
|
||||
|
||||
# ## Alignment Axis
|
||||
self.align_ax_label = FCLabel('%s:' % _("Align Axis"))
|
||||
@@ -52,26 +58,39 @@ class Tools2sidedPrefGroupUI(OptionsGroupUI):
|
||||
_("Mirror vertically (X) or horizontally (Y).")
|
||||
)
|
||||
self.align_axis_radio = RadioSet([{'label': 'X', 'value': 'X'},
|
||||
{'label': 'Y', 'value': 'Y'}])
|
||||
{'label': 'Y', 'value': 'Y'}], compact=True)
|
||||
|
||||
grid0.addWidget(self.align_ax_label, 1, 0)
|
||||
grid0.addWidget(self.align_axis_radio, 1, 1)
|
||||
param_grid.addWidget(self.align_ax_label, 1, 0)
|
||||
param_grid.addWidget(self.align_axis_radio, 1, 1)
|
||||
|
||||
# ## Axis
|
||||
self.mirror_axis_radio = RadioSet([{'label': 'X', 'value': 'X'},
|
||||
{'label': 'Y', 'value': 'Y'}])
|
||||
{'label': 'Y', 'value': 'Y'}], compact=True)
|
||||
self.mirax_label = FCLabel('%s:' % _("Mirror Axis"))
|
||||
self.mirax_label.setToolTip(
|
||||
_("Mirror vertically (X) or horizontally (Y).")
|
||||
)
|
||||
|
||||
separator_line = QtWidgets.QFrame()
|
||||
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
grid0.addWidget(separator_line, 2, 0, 1, 2)
|
||||
# separator_line = QtWidgets.QFrame()
|
||||
# separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
# separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
# param_grid.addWidget(separator_line, 2, 0, 1, 2)
|
||||
|
||||
grid0.addWidget(self.mirax_label, 3, 0)
|
||||
grid0.addWidget(self.mirror_axis_radio, 3, 1)
|
||||
# #############################################################################################################
|
||||
# Mirror Frame
|
||||
# #############################################################################################################
|
||||
# ### Tools ## ##
|
||||
self.mirror_label = FCLabel('<span style="color:red;"><b>%s</b></span>' % _("Mirror Operation"))
|
||||
self.layout.addWidget(self.mirror_label)
|
||||
|
||||
mirror_frame = FCFrame()
|
||||
self.layout.addWidget(mirror_frame)
|
||||
|
||||
mirror_grid = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
mirror_frame.setLayout(mirror_grid)
|
||||
|
||||
mirror_grid.addWidget(self.mirax_label, 0, 0)
|
||||
mirror_grid.addWidget(self.mirror_axis_radio, 0, 1)
|
||||
|
||||
# ## Axis Location
|
||||
self.axis_location_radio = RadioSet(
|
||||
@@ -79,7 +98,7 @@ class Tools2sidedPrefGroupUI(OptionsGroupUI):
|
||||
{'label': _('Point'), 'value': 'point'},
|
||||
{'label': _('Box'), 'value': 'box'},
|
||||
{'label': _('Snap'), 'value': 'hole'},
|
||||
]
|
||||
], compact=True
|
||||
)
|
||||
self.axloc_label = FCLabel('%s:' % _("Axis Ref"))
|
||||
self.axloc_label.setToolTip(
|
||||
@@ -91,7 +110,9 @@ class Tools2sidedPrefGroupUI(OptionsGroupUI):
|
||||
"- Snap-> a point defined by the center of a drill hone in a Excellon object")
|
||||
)
|
||||
|
||||
grid0.addWidget(self.axloc_label, 4, 0)
|
||||
grid0.addWidget(self.axis_location_radio, 4, 1)
|
||||
mirror_grid.addWidget(self.axloc_label, 2, 0)
|
||||
mirror_grid.addWidget(self.axis_location_radio, 2, 1)
|
||||
|
||||
self.layout.addStretch()
|
||||
FCGridLayout.set_common_column_size([param_grid, mirror_grid], 0)
|
||||
|
||||
# self.layout.addStretch(1)
|
||||
|
||||
@@ -41,7 +41,7 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI):
|
||||
# Scale Geometry
|
||||
self.film_scale_cb = FCCheckBox('%s' % _("Scale"))
|
||||
self.film_scale_cb.setToolTip(
|
||||
_("A value greater than 1 will stretch the film\n"
|
||||
_("A value greater than 1 will compact the film\n"
|
||||
"while a value less than 1 will jolt it.")
|
||||
)
|
||||
self.film_scale_cb.setStyleSheet(
|
||||
@@ -157,7 +157,7 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI):
|
||||
self.film_mirror_axis = RadioSet([{'label': _('X'), 'value': 'x'},
|
||||
{'label': _('Y'), 'value': 'y'},
|
||||
{'label': _('Both'), 'value': 'both'}],
|
||||
stretch=False)
|
||||
compact=True)
|
||||
self.film_mirror_axis_label = FCLabel('%s:' % _("Mirror Axis"))
|
||||
|
||||
adj_grid.addWidget(self.film_mirror_axis_label, 12, 0)
|
||||
@@ -209,7 +209,7 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI):
|
||||
|
||||
# Polarity
|
||||
self.film_type_radio = RadioSet([{'label': 'Pos', 'value': 'pos'},
|
||||
{'label': 'Neg', 'value': 'neg'}])
|
||||
{'label': 'Neg', 'value': 'neg'}], compact=True)
|
||||
ftypelbl = FCLabel('%s:' % _('Polarity'))
|
||||
ftypelbl.setToolTip(
|
||||
_("Generate a Positive black film or a Negative film.")
|
||||
@@ -265,7 +265,7 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI):
|
||||
self.file_type_radio = RadioSet([{'label': _('SVG'), 'value': 'svg'},
|
||||
{'label': _('PNG'), 'value': 'png'},
|
||||
{'label': _('PDF'), 'value': 'pdf'}
|
||||
], stretch=False)
|
||||
], compact=True)
|
||||
|
||||
self.file_type_label = FCLabel('%s:' % _("Film Type"))
|
||||
self.file_type_label.setToolTip(
|
||||
@@ -285,7 +285,7 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI):
|
||||
|
||||
self.orientation_radio = RadioSet([{'label': _('Portrait'), 'value': 'p'},
|
||||
{'label': _('Landscape'), 'value': 'l'},
|
||||
], stretch=False)
|
||||
], compact=True)
|
||||
|
||||
grid_par.addWidget(self.orientation_label, 14, 0)
|
||||
grid_par.addWidget(self.orientation_radio, 14, 1)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from PyQt6 import QtWidgets
|
||||
|
||||
from appGUI.GUIElements import FCDoubleSpinner, FCSpinner, RadioSet, FCLabel, FCComboBox, FCGridLayout
|
||||
from appGUI.GUIElements import FCDoubleSpinner, FCSpinner, RadioSet, FCLabel, FCComboBox, FCGridLayout, FCFrame
|
||||
from appGUI.preferences.OptionsGroupUI import OptionsGroupUI
|
||||
|
||||
import gettext
|
||||
@@ -22,15 +22,20 @@ class ToolsLevelPrefGroupUI(OptionsGroupUI):
|
||||
self.defaults = defaults
|
||||
|
||||
# ## Board cuttout
|
||||
self.levelling_label = FCLabel("<b>%s:</b>" % _("Parameters"))
|
||||
self.levelling_label = FCLabel('<span style="color:blue;"><b>%s</b></span>' % _("Parameters"))
|
||||
self.levelling_label.setToolTip(
|
||||
_("Generate CNC Code with auto-levelled paths.")
|
||||
)
|
||||
self.layout.addWidget(self.levelling_label)
|
||||
|
||||
# Grid Layout
|
||||
grid0 = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
self.layout.addLayout(grid0)
|
||||
# #############################################################################################################
|
||||
# Parameters Frame
|
||||
# #############################################################################################################
|
||||
par_frame = FCFrame()
|
||||
self.layout.addWidget(par_frame)
|
||||
|
||||
par_grid = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
par_frame.setLayout(par_grid)
|
||||
|
||||
# Probe points mode
|
||||
al_mode_lbl = FCLabel('%s:' % _("Mode"))
|
||||
@@ -43,8 +48,8 @@ class ToolsLevelPrefGroupUI(OptionsGroupUI):
|
||||
{'label': _('Manual'), 'value': 'manual'},
|
||||
{'label': _('Grid'), 'value': 'grid'}
|
||||
])
|
||||
grid0.addWidget(al_mode_lbl, 8, 0)
|
||||
grid0.addWidget(self.al_mode_radio, 8, 1)
|
||||
par_grid.addWidget(al_mode_lbl, 8, 0)
|
||||
par_grid.addWidget(self.al_mode_radio, 8, 1)
|
||||
|
||||
# AUTOLEVELL METHOD
|
||||
self.al_method_lbl = FCLabel('%s:' % _("Method"))
|
||||
@@ -57,8 +62,8 @@ class ToolsLevelPrefGroupUI(OptionsGroupUI):
|
||||
{'label': _('Voronoi'), 'value': 'v'},
|
||||
{'label': _('Bilinear'), 'value': 'b'}
|
||||
])
|
||||
grid0.addWidget(self.al_method_lbl, 9, 0)
|
||||
grid0.addWidget(self.al_method_radio, 9, 1)
|
||||
par_grid.addWidget(self.al_method_lbl, 9, 0)
|
||||
par_grid.addWidget(self.al_method_radio, 9, 1)
|
||||
|
||||
# ## Columns
|
||||
self.al_columns_entry = FCSpinner()
|
||||
@@ -67,8 +72,8 @@ class ToolsLevelPrefGroupUI(OptionsGroupUI):
|
||||
self.al_columns_label.setToolTip(
|
||||
_("The number of grid columns.")
|
||||
)
|
||||
grid0.addWidget(self.al_columns_label, 10, 0)
|
||||
grid0.addWidget(self.al_columns_entry, 10, 1)
|
||||
par_grid.addWidget(self.al_columns_label, 10, 0)
|
||||
par_grid.addWidget(self.al_columns_entry, 10, 1)
|
||||
|
||||
# ## Rows
|
||||
self.al_rows_entry = FCSpinner()
|
||||
@@ -77,8 +82,8 @@ class ToolsLevelPrefGroupUI(OptionsGroupUI):
|
||||
self.al_rows_label.setToolTip(
|
||||
_("The number of grid rows.")
|
||||
)
|
||||
grid0.addWidget(self.al_rows_label, 12, 0)
|
||||
grid0.addWidget(self.al_rows_entry, 12, 1)
|
||||
par_grid.addWidget(self.al_rows_label, 12, 0)
|
||||
par_grid.addWidget(self.al_rows_entry, 12, 1)
|
||||
|
||||
# Travel Z Probe
|
||||
self.ptravelz_label = FCLabel('%s:' % _("Probe Z travel"))
|
||||
@@ -89,8 +94,8 @@ class ToolsLevelPrefGroupUI(OptionsGroupUI):
|
||||
self.ptravelz_entry.set_precision(self.decimals)
|
||||
self.ptravelz_entry.set_range(0.0000, 10000.0000)
|
||||
|
||||
grid0.addWidget(self.ptravelz_label, 14, 0)
|
||||
grid0.addWidget(self.ptravelz_entry, 14, 1)
|
||||
par_grid.addWidget(self.ptravelz_label, 14, 0)
|
||||
par_grid.addWidget(self.ptravelz_entry, 14, 1)
|
||||
|
||||
# Probe depth
|
||||
self.pdepth_label = FCLabel('%s:' % _("Probe Z depth"))
|
||||
@@ -102,8 +107,8 @@ class ToolsLevelPrefGroupUI(OptionsGroupUI):
|
||||
self.pdepth_entry.set_precision(self.decimals)
|
||||
self.pdepth_entry.set_range(-910000.0000, 0.0000)
|
||||
|
||||
grid0.addWidget(self.pdepth_label, 16, 0)
|
||||
grid0.addWidget(self.pdepth_entry, 16, 1)
|
||||
par_grid.addWidget(self.pdepth_label, 16, 0)
|
||||
par_grid.addWidget(self.pdepth_entry, 16, 1)
|
||||
|
||||
# Probe feedrate
|
||||
self.feedrate_probe_label = FCLabel('%s:' % _("Probe Feedrate"))
|
||||
@@ -114,13 +119,13 @@ class ToolsLevelPrefGroupUI(OptionsGroupUI):
|
||||
self.feedrate_probe_entry.set_precision(self.decimals)
|
||||
self.feedrate_probe_entry.set_range(0, 910000.0000)
|
||||
|
||||
grid0.addWidget(self.feedrate_probe_label, 18, 0)
|
||||
grid0.addWidget(self.feedrate_probe_entry, 18, 1)
|
||||
par_grid.addWidget(self.feedrate_probe_label, 18, 0)
|
||||
par_grid.addWidget(self.feedrate_probe_entry, 18, 1)
|
||||
|
||||
separator_line = QtWidgets.QFrame()
|
||||
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
grid0.addWidget(separator_line, 20, 0, 1, 2)
|
||||
par_grid.addWidget(separator_line, 20, 0, 1, 2)
|
||||
|
||||
self.al_controller_label = FCLabel('%s:' % _("Controller"))
|
||||
self.al_controller_label.setToolTip(
|
||||
@@ -130,8 +135,8 @@ class ToolsLevelPrefGroupUI(OptionsGroupUI):
|
||||
|
||||
self.al_controller_combo = FCComboBox()
|
||||
self.al_controller_combo.addItems(["MACH3", "MACH4", "LinuxCNC", "GRBL"])
|
||||
grid0.addWidget(self.al_controller_label, 22, 0)
|
||||
grid0.addWidget(self.al_controller_combo, 22, 1)
|
||||
par_grid.addWidget(self.al_controller_label, 22, 0)
|
||||
par_grid.addWidget(self.al_controller_combo, 22, 1)
|
||||
|
||||
# JOG Step
|
||||
self.jog_step_label = FCLabel('%s:' % _("Step"))
|
||||
@@ -143,8 +148,8 @@ class ToolsLevelPrefGroupUI(OptionsGroupUI):
|
||||
self.jog_step_entry.set_precision(self.decimals)
|
||||
self.jog_step_entry.set_range(0, 910000.0000)
|
||||
|
||||
grid0.addWidget(self.jog_step_label, 24, 0)
|
||||
grid0.addWidget(self.jog_step_entry, 24, 1)
|
||||
par_grid.addWidget(self.jog_step_label, 24, 0)
|
||||
par_grid.addWidget(self.jog_step_entry, 24, 1)
|
||||
|
||||
# JOG Feedrate
|
||||
self.jog_fr_label = FCLabel('%s:' % _("Feedrate"))
|
||||
@@ -156,8 +161,8 @@ class ToolsLevelPrefGroupUI(OptionsGroupUI):
|
||||
self.jog_fr_entry.set_precision(self.decimals)
|
||||
self.jog_fr_entry.set_range(0, 910000.0000)
|
||||
|
||||
grid0.addWidget(self.jog_fr_label, 26, 0)
|
||||
grid0.addWidget(self.jog_fr_entry, 26, 1)
|
||||
par_grid.addWidget(self.jog_fr_label, 26, 0)
|
||||
par_grid.addWidget(self.jog_fr_entry, 26, 1)
|
||||
|
||||
# JOG Travel Z
|
||||
self.jog_travelz_label = FCLabel('%s:' % _("Travel Z"))
|
||||
@@ -169,7 +174,7 @@ class ToolsLevelPrefGroupUI(OptionsGroupUI):
|
||||
self.jog_travelz_entry.set_precision(self.decimals)
|
||||
self.jog_travelz_entry.set_range(0, 910000.0000)
|
||||
|
||||
grid0.addWidget(self.jog_travelz_label, 28, 0)
|
||||
grid0.addWidget(self.jog_travelz_entry, 28, 1)
|
||||
par_grid.addWidget(self.jog_travelz_label, 28, 0)
|
||||
par_grid.addWidget(self.jog_travelz_entry, 28, 1)
|
||||
|
||||
self.layout.addStretch(1)
|
||||
|
||||
@@ -141,7 +141,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
|
||||
)
|
||||
|
||||
self.milling_type_radio = RadioSet([{'label': _('Climb'), 'value': 'cl'},
|
||||
{'label': _('Conventional'), 'value': 'cv'}])
|
||||
{'label': _('Conventional'), 'value': 'cv'}], compact=True)
|
||||
self.milling_type_radio.setToolTip(
|
||||
_("Milling type:\n"
|
||||
"- climb / best for precision milling and to reduce tool usage\n"
|
||||
@@ -210,7 +210,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
|
||||
# {"label": _("Standard"), "value": "standard"},
|
||||
# {"label": _("Seed-based"), "value": "seed"},
|
||||
# {"label": _("Straight lines"), "value": "lines"}
|
||||
# ], orientation='vertical', stretch=False)
|
||||
# ], orientation='vertical', compact=True)
|
||||
self.ncc_method_combo = FCComboBox2()
|
||||
self.ncc_method_combo.addItems(
|
||||
[_("Standard"), _("Seed"), _("Lines"), _("Combo")]
|
||||
@@ -302,7 +302,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
|
||||
# {"label": _("Area Selection"), "value": "area"},
|
||||
# {'label': _('Reference Object'), 'value': 'box'}],
|
||||
# orientation='vertical',
|
||||
# stretch=None)
|
||||
# compact=None)
|
||||
self.select_combo = FCComboBox2()
|
||||
self.select_combo.addItems(
|
||||
[_("Itself"), _("Area Selection"), _("Reference Object")]
|
||||
@@ -324,7 +324,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
|
||||
)
|
||||
|
||||
self.area_shape_radio = RadioSet([{'label': _("Square"), 'value': 'square'},
|
||||
{'label': _("Polygon"), 'value': 'polygon'}])
|
||||
{'label': _("Polygon"), 'value': 'polygon'}], compact=True)
|
||||
|
||||
gen_grid.addWidget(self.area_shape_label, 4, 0)
|
||||
gen_grid.addWidget(self.area_shape_radio, 4, 1)
|
||||
@@ -336,7 +336,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
|
||||
|
||||
# ## Plotting type
|
||||
self.plotting_radio = RadioSet([{'label': _('Normal'), 'value': 'normal'},
|
||||
{"label": _("Progressive"), "value": "progressive"}])
|
||||
{"label": _("Progressive"), "value": "progressive"}], compact=True)
|
||||
plotting_label = FCLabel('%s:' % _("Plotting"))
|
||||
plotting_label.setToolTip(
|
||||
_("- 'Normal' - normal plotting, done at the end of the job\n"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from PyQt6 import QtWidgets
|
||||
|
||||
from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCComboBox2, FCCheckBox, NumericalEvalTupleEntry, FCLabel, \
|
||||
FCGridLayout
|
||||
FCGridLayout, FCFrame
|
||||
from appGUI.preferences.OptionsGroupUI import OptionsGroupUI
|
||||
|
||||
import gettext
|
||||
@@ -25,15 +25,21 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI):
|
||||
# ------------------------------
|
||||
# ## Paint area
|
||||
# ------------------------------
|
||||
self.paint_label = FCLabel('<b>%s:</b>' % _('Parameters'))
|
||||
self.paint_label = FCLabel('<span style="color:blue;"><b>%s</b></span>' % _('Parameters'))
|
||||
self.paint_label.setToolTip(
|
||||
_("Creates tool paths to cover the\n"
|
||||
"whole area of a polygon.")
|
||||
)
|
||||
self.layout.addWidget(self.paint_label)
|
||||
|
||||
grid0 = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
self.layout.addLayout(grid0)
|
||||
# #############################################################################################################
|
||||
# Parameters Frame
|
||||
# #############################################################################################################
|
||||
par_frame = FCFrame()
|
||||
self.layout.addWidget(par_frame)
|
||||
|
||||
param_grid = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
par_frame.setLayout(param_grid)
|
||||
|
||||
# Tool dia
|
||||
ptdlabel = FCLabel('<b><font color="green">%s:</font></b>' % _('Tools Dia'))
|
||||
@@ -42,20 +48,26 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI):
|
||||
"The value of the diameter has to use the dot decimals separator.\n"
|
||||
"Valid values: 0.3, 1.0")
|
||||
)
|
||||
grid0.addWidget(ptdlabel, 0, 0)
|
||||
param_grid.addWidget(ptdlabel, 0, 0)
|
||||
|
||||
self.painttooldia_entry = NumericalEvalTupleEntry(border_color='#0069A9')
|
||||
self.painttooldia_entry.setPlaceholderText(_("Comma separated values"))
|
||||
|
||||
grid0.addWidget(self.painttooldia_entry, 0, 1)
|
||||
param_grid.addWidget(self.painttooldia_entry, 0, 1)
|
||||
|
||||
# Tool Type Radio Button
|
||||
self.tool_type_label = FCLabel('%s:' % _('Tool Type'))
|
||||
self.tool_type_label.setToolTip(
|
||||
_("Default tool type:\n"
|
||||
"- 'V-shape'\n"
|
||||
"- Circular")
|
||||
)
|
||||
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"
|
||||
"'Reverse' --> means that the tools will ordered from big to small\n\n"
|
||||
"WARNING: using rest machining will automatically set the order\n"
|
||||
"in reverse and disable this control."))
|
||||
|
||||
self.paint_order_combo = FCComboBox2()
|
||||
self.paint_order_combo.addItems([_('Default'), _('Forward'), _('Reverse')])
|
||||
|
||||
param_grid.addWidget(self.paint_order_label, 2, 0)
|
||||
param_grid.addWidget(self.paint_order_combo, 2, 1)
|
||||
|
||||
# Tip Dia
|
||||
self.tipdialabel = FCLabel('%s:' % _('V-Tip Dia'))
|
||||
@@ -67,8 +79,8 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI):
|
||||
self.tipdia_entry.setSingleStep(0.1)
|
||||
self.tipdia_entry.setObjectName(_("V-Tip Dia"))
|
||||
|
||||
grid0.addWidget(self.tipdialabel, 2, 0)
|
||||
grid0.addWidget(self.tipdia_entry, 2, 1)
|
||||
param_grid.addWidget(self.tipdialabel, 4, 0)
|
||||
param_grid.addWidget(self.tipdia_entry, 4, 1)
|
||||
|
||||
# Tip Angle
|
||||
self.tipanglelabel = FCLabel('%s:' % _('V-Tip Angle'))
|
||||
@@ -81,8 +93,8 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI):
|
||||
self.tipangle_entry.setSingleStep(5)
|
||||
self.tipangle_entry.setObjectName(_("V-Tip Angle"))
|
||||
|
||||
grid0.addWidget(self.tipanglelabel, 3, 0)
|
||||
grid0.addWidget(self.tipangle_entry, 3, 1)
|
||||
param_grid.addWidget(self.tipanglelabel, 6, 0)
|
||||
param_grid.addWidget(self.tipangle_entry, 6, 1)
|
||||
|
||||
# Cut Z entry
|
||||
cutzlabel = FCLabel('%s:' % _('Cut Z'))
|
||||
@@ -99,8 +111,8 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI):
|
||||
_("Depth of cut into material. Negative value.\n"
|
||||
"In application units.")
|
||||
)
|
||||
grid0.addWidget(cutzlabel, 4, 0)
|
||||
grid0.addWidget(self.cutz_entry, 4, 1)
|
||||
param_grid.addWidget(cutzlabel, 8, 0)
|
||||
param_grid.addWidget(self.cutz_entry, 8, 1)
|
||||
|
||||
# ### Tool Diameter ####
|
||||
self.newdialabel = FCLabel('%s:' % _('New Dia'))
|
||||
@@ -114,33 +126,26 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI):
|
||||
self.newdia_entry.set_range(-10000.000, 10000.0000)
|
||||
self.newdia_entry.setObjectName(_("Tool Dia"))
|
||||
|
||||
grid0.addWidget(self.newdialabel, 5, 0)
|
||||
grid0.addWidget(self.newdia_entry, 5, 1)
|
||||
param_grid.addWidget(self.newdialabel, 10, 0)
|
||||
param_grid.addWidget(self.newdia_entry, 10, 1)
|
||||
|
||||
separator_line = QtWidgets.QFrame()
|
||||
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
grid0.addWidget(separator_line, 6, 0, 1, 2)
|
||||
# separator_line = QtWidgets.QFrame()
|
||||
# separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
# separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
# param_grid.addWidget(separator_line, 6, 0, 1, 2)
|
||||
|
||||
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"
|
||||
"'Reverse' --> means that the tools will ordered from big to small\n\n"
|
||||
"WARNING: using rest machining will automatically set the order\n"
|
||||
"in reverse and disable this control."))
|
||||
# #############################################################################################################
|
||||
# Tool Frame
|
||||
# #############################################################################################################
|
||||
# ### Tools ## ##
|
||||
self.tools_table_label = FCLabel('<span style="color:green;"><b>%s</b></span>' % _("Tool Parameters"))
|
||||
self.layout.addWidget(self.tools_table_label)
|
||||
|
||||
self.paint_order_radio = RadioSet([{'label': _('No'), 'value': 'no'},
|
||||
{'label': _('Forward'), 'value': 'fwd'},
|
||||
{'label': _('Reverse'), 'value': 'rev'}])
|
||||
tt_frame = FCFrame()
|
||||
self.layout.addWidget(tt_frame)
|
||||
|
||||
grid0.addWidget(self.paint_order_label, 7, 0)
|
||||
grid0.addWidget(self.paint_order_radio, 7, 1)
|
||||
|
||||
separator_line = QtWidgets.QFrame()
|
||||
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
grid0.addWidget(separator_line, 8, 0, 1, 2)
|
||||
tool_grid = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
tt_frame.setLayout(tool_grid)
|
||||
|
||||
# Overlap
|
||||
ovlabel = FCLabel('%s:' % _('Overlap'))
|
||||
@@ -159,8 +164,8 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI):
|
||||
self.paintoverlap_entry.setRange(0.0000, 99.9999)
|
||||
self.paintoverlap_entry.setSingleStep(0.1)
|
||||
|
||||
grid0.addWidget(ovlabel, 9, 0)
|
||||
grid0.addWidget(self.paintoverlap_entry, 9, 1)
|
||||
tool_grid.addWidget(ovlabel, 0, 0)
|
||||
tool_grid.addWidget(self.paintoverlap_entry, 0, 1)
|
||||
|
||||
# Margin
|
||||
marginlabel = FCLabel('%s:' % _('Margin'))
|
||||
@@ -174,8 +179,8 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI):
|
||||
self.paintmargin_entry.set_precision(self.decimals)
|
||||
self.paintmargin_entry.setSingleStep(0.1)
|
||||
|
||||
grid0.addWidget(marginlabel, 10, 0)
|
||||
grid0.addWidget(self.paintmargin_entry, 10, 1)
|
||||
tool_grid.addWidget(marginlabel, 2, 0)
|
||||
tool_grid.addWidget(self.paintmargin_entry, 2, 1)
|
||||
|
||||
# Method
|
||||
methodlabel = FCLabel('%s:' % _('Method'))
|
||||
@@ -194,14 +199,14 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI):
|
||||
# {"label": _("Standard"), "value": "standard"},
|
||||
# {"label": _("Seed-based"), "value": "seed"},
|
||||
# {"label": _("Straight lines"), "value": "lines"}
|
||||
# ], orientation='vertical', stretch=False)
|
||||
# ], orientation='vertical', compact=True)
|
||||
self.paintmethod_combo = FCComboBox2()
|
||||
self.paintmethod_combo.addItems(
|
||||
[_("Standard"), _("Seed"), _("Lines"), _("Laser_lines"), _("Combo")]
|
||||
)
|
||||
|
||||
grid0.addWidget(methodlabel, 11, 0)
|
||||
grid0.addWidget(self.paintmethod_combo, 11, 1)
|
||||
tool_grid.addWidget(methodlabel, 4, 0)
|
||||
tool_grid.addWidget(self.paintmethod_combo, 4, 1)
|
||||
|
||||
# Connect lines
|
||||
self.pathconnect_cb = FCCheckBox('%s' % _("Connect"))
|
||||
@@ -209,7 +214,6 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI):
|
||||
_("Draw lines between resulting\n"
|
||||
"segments to minimize tool lifts.")
|
||||
)
|
||||
grid0.addWidget(self.pathconnect_cb, 12, 0)
|
||||
|
||||
# Paint contour
|
||||
self.contour_cb = FCCheckBox('%s' % _("Contour"))
|
||||
@@ -217,12 +221,24 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI):
|
||||
_("Cut around the perimeter of the polygon\n"
|
||||
"to trim rough edges.")
|
||||
)
|
||||
grid0.addWidget(self.contour_cb, 12, 1)
|
||||
|
||||
separator_line = QtWidgets.QFrame()
|
||||
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
grid0.addWidget(separator_line, 13, 0, 1, 2)
|
||||
tool_grid.addWidget(self.pathconnect_cb, 6, 0)
|
||||
tool_grid.addWidget(self.contour_cb, 6, 1)
|
||||
|
||||
# #############################################################################################################
|
||||
# General Parameters Frame
|
||||
# #############################################################################################################
|
||||
self.gen_param_label = FCLabel('<span style="color:indigo;"><b>%s</b></span>' % _("Common Parameters"))
|
||||
self.gen_param_label.setToolTip(
|
||||
_("Parameters that are common for all tools.")
|
||||
)
|
||||
self.layout.addWidget(self.gen_param_label)
|
||||
|
||||
gp_frame = FCFrame()
|
||||
self.layout.addWidget(gp_frame)
|
||||
|
||||
gen_grid = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
gp_frame.setLayout(gen_grid)
|
||||
|
||||
self.rest_cb = FCCheckBox('%s' % _("Rest"))
|
||||
self.rest_cb.setObjectName(_("Rest"))
|
||||
@@ -235,7 +251,7 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI):
|
||||
"nothing left to process or there are no more tools.\n\n"
|
||||
"If not checked, use the standard algorithm.")
|
||||
)
|
||||
grid0.addWidget(self.rest_cb, 14, 0, 1, 2)
|
||||
gen_grid.addWidget(self.rest_cb, 0, 0, 1, 2)
|
||||
|
||||
# Polygon selection
|
||||
selectlabel = FCLabel('%s:' % _('Selection'))
|
||||
@@ -256,15 +272,15 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI):
|
||||
# {"label": _("Reference Object"), "value": "ref"}
|
||||
# ],
|
||||
# orientation='vertical',
|
||||
# stretch=None
|
||||
# compact=None
|
||||
# )
|
||||
self.selectmethod_combo = FCComboBox2()
|
||||
self.selectmethod_combo.addItems(
|
||||
[_("All"), _("Polygon Selection"), _("Area Selection"), _("Reference Object")]
|
||||
)
|
||||
|
||||
grid0.addWidget(selectlabel, 15, 0)
|
||||
grid0.addWidget(self.selectmethod_combo, 15, 1)
|
||||
gen_grid.addWidget(selectlabel, 2, 0)
|
||||
gen_grid.addWidget(self.selectmethod_combo, 2, 1)
|
||||
|
||||
self.area_shape_label = FCLabel('%s:' % _("Shape"))
|
||||
self.area_shape_label.setToolTip(
|
||||
@@ -272,25 +288,28 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI):
|
||||
)
|
||||
|
||||
self.area_shape_radio = RadioSet([{'label': _("Square"), 'value': 'square'},
|
||||
{'label': _("Polygon"), 'value': 'polygon'}])
|
||||
{'label': _("Polygon"), 'value': 'polygon'}], compact=True)
|
||||
|
||||
grid0.addWidget(self.area_shape_label, 18, 0)
|
||||
grid0.addWidget(self.area_shape_radio, 18, 1)
|
||||
gen_grid.addWidget(self.area_shape_label, 4, 0)
|
||||
gen_grid.addWidget(self.area_shape_radio, 4, 1)
|
||||
|
||||
separator_line = QtWidgets.QFrame()
|
||||
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
grid0.addWidget(separator_line, 19, 0, 1, 2)
|
||||
gen_grid.addWidget(separator_line, 6, 0, 1, 2)
|
||||
|
||||
# ## Plotting type
|
||||
self.paint_plotting_radio = RadioSet([{'label': _('Normal'), 'value': 'normal'},
|
||||
{"label": _("Progressive"), "value": "progressive"}])
|
||||
{"label": _("Progressive"), "value": "progressive"}],
|
||||
compact=True)
|
||||
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")
|
||||
)
|
||||
grid0.addWidget(plotting_label, 20, 0)
|
||||
grid0.addWidget(self.paint_plotting_radio, 20, 1)
|
||||
gen_grid.addWidget(plotting_label, 8, 0)
|
||||
gen_grid.addWidget(self.paint_plotting_radio, 8, 1)
|
||||
|
||||
self.layout.addStretch()
|
||||
FCGridLayout.set_common_column_size([tool_grid, param_grid, gen_grid], 0)
|
||||
|
||||
self.layout.addStretch(1)
|
||||
|
||||
Reference in New Issue
Block a user