- Tool Copper Thieving - made sure that the clearance for pattern plating mask is applied also for positive values
- Tool Copper Thieving - when creating pattern plating masks now the user can select to use only the pads and that's useful when the soldermsk Gerber is actually a copper Gerber - Tool Copper Thieving - changed the units for plated area from mm2 in cm2 when the app units are Metric - Calculator Tool - Electroplating Calculator - changing the area will update the current value - GUI Elements FCDoubleSpinner and FCSpinner: modified the context menu to not allow cut/paste/delete/step_up/step_down when the GUI element is set as Read Only
This commit is contained in:
@@ -974,6 +974,11 @@ class FCSpinner(QtWidgets.QSpinBox):
|
||||
self.menu = QtWidgets.QMenu()
|
||||
line_edit = self.lineEdit()
|
||||
|
||||
if line_edit.isReadOnly():
|
||||
undo_action = QAction('%s' % _("Read Only"), self)
|
||||
self.menu.addAction(undo_action)
|
||||
self.menu.addSeparator()
|
||||
|
||||
# UNDO
|
||||
undo_action = QAction('%s\t%s' % (_("Undo"), _('Ctrl+Z')), self)
|
||||
self.menu.addAction(undo_action)
|
||||
@@ -994,7 +999,7 @@ class FCSpinner(QtWidgets.QSpinBox):
|
||||
cut_action = QAction('%s\t%s' % (_("Cut"), _('Ctrl+X')), self)
|
||||
self.menu.addAction(cut_action)
|
||||
cut_action.triggered.connect(self.cut_text)
|
||||
if not line_edit.hasSelectedText():
|
||||
if not line_edit.hasSelectedText() or line_edit.isReadOnly():
|
||||
cut_action.setDisabled(True)
|
||||
|
||||
# COPY
|
||||
@@ -1008,11 +1013,15 @@ class FCSpinner(QtWidgets.QSpinBox):
|
||||
paste_action = QAction('%s\t%s' % (_("Paste"), _('Ctrl+V')), self)
|
||||
self.menu.addAction(paste_action)
|
||||
paste_action.triggered.connect(self.paste_text)
|
||||
if line_edit.isReadOnly():
|
||||
paste_action.setDisabled(True)
|
||||
|
||||
# DELETE
|
||||
delete_action = QAction('%s\t%s' % (_("Delete"), _('Del')), self)
|
||||
self.menu.addAction(delete_action)
|
||||
delete_action.triggered.connect(line_edit.del_)
|
||||
if line_edit.isReadOnly():
|
||||
delete_action.setDisabled(True)
|
||||
|
||||
self.menu.addSeparator()
|
||||
|
||||
@@ -1027,11 +1036,15 @@ class FCSpinner(QtWidgets.QSpinBox):
|
||||
step_up_action = QAction('%s\t%s' % (_("Step Up"), ''), self)
|
||||
self.menu.addAction(step_up_action)
|
||||
step_up_action.triggered.connect(self.stepUp)
|
||||
if line_edit.isReadOnly():
|
||||
step_up_action.setDisabled(True)
|
||||
|
||||
# STEP DOWN
|
||||
step_down_action = QAction('%s\t%s' % (_("Step Down"), ''), self)
|
||||
self.menu.addAction(step_down_action)
|
||||
step_down_action.triggered.connect(self.stepDown)
|
||||
if line_edit.isReadOnly():
|
||||
step_down_action.setDisabled(True)
|
||||
|
||||
self.menu.exec_(event.globalPos())
|
||||
|
||||
@@ -1360,6 +1373,11 @@ class FCDoubleSpinner(QtWidgets.QDoubleSpinBox):
|
||||
self.menu = QtWidgets.QMenu()
|
||||
line_edit = self.lineEdit()
|
||||
|
||||
if line_edit.isReadOnly():
|
||||
undo_action = QAction('%s' % _("Read Only"), self)
|
||||
self.menu.addAction(undo_action)
|
||||
self.menu.addSeparator()
|
||||
|
||||
# UNDO
|
||||
undo_action = QAction('%s\t%s' % (_("Undo"), _('Ctrl+Z')), self)
|
||||
self.menu.addAction(undo_action)
|
||||
@@ -1380,7 +1398,7 @@ class FCDoubleSpinner(QtWidgets.QDoubleSpinBox):
|
||||
cut_action = QAction('%s\t%s' % (_("Cut"), _('Ctrl+X')), self)
|
||||
self.menu.addAction(cut_action)
|
||||
cut_action.triggered.connect(self.cut_text)
|
||||
if not line_edit.hasSelectedText():
|
||||
if not line_edit.hasSelectedText() or line_edit.isReadOnly():
|
||||
cut_action.setDisabled(True)
|
||||
|
||||
# COPY
|
||||
@@ -1394,11 +1412,15 @@ class FCDoubleSpinner(QtWidgets.QDoubleSpinBox):
|
||||
paste_action = QAction('%s\t%s' % (_("Paste"), _('Ctrl+V')), self)
|
||||
self.menu.addAction(paste_action)
|
||||
paste_action.triggered.connect(self.paste_text)
|
||||
if line_edit.isReadOnly():
|
||||
paste_action.setDisabled(True)
|
||||
|
||||
# DELETE
|
||||
delete_action = QAction('%s\t%s' % (_("Delete"), _('Del')), self)
|
||||
self.menu.addAction(delete_action)
|
||||
delete_action.triggered.connect(line_edit.del_)
|
||||
if line_edit.isReadOnly():
|
||||
delete_action.setDisabled(True)
|
||||
|
||||
self.menu.addSeparator()
|
||||
|
||||
@@ -1413,11 +1435,15 @@ class FCDoubleSpinner(QtWidgets.QDoubleSpinBox):
|
||||
step_up_action = QAction('%s\t%s' % (_("Step Up"), ''), self)
|
||||
self.menu.addAction(step_up_action)
|
||||
step_up_action.triggered.connect(self.stepUp)
|
||||
if line_edit.isReadOnly():
|
||||
step_up_action.setDisabled(True)
|
||||
|
||||
# STEP DOWN
|
||||
step_down_action = QAction('%s\t%s' % (_("Step Down"), ''), self)
|
||||
self.menu.addAction(step_down_action)
|
||||
step_down_action.triggered.connect(self.stepDown)
|
||||
if line_edit.isReadOnly():
|
||||
step_down_action.setDisabled(True)
|
||||
|
||||
self.menu.exec_(event.globalPos())
|
||||
|
||||
|
||||
@@ -611,6 +611,7 @@ class PreferencesUIManager:
|
||||
"tools_copper_thieving_lines_spacing": self.ui.tools2_defaults_form.tools2_cfill_group.lines_spacing_entry,
|
||||
"tools_copper_thieving_rb_margin": self.ui.tools2_defaults_form.tools2_cfill_group.rb_margin_entry,
|
||||
"tools_copper_thieving_rb_thickness": self.ui.tools2_defaults_form.tools2_cfill_group.rb_thickness_entry,
|
||||
"tools_copper_thieving_only_apds": self.ui.tools2_defaults_form.tools2_cfill_group.only_pads_cb,
|
||||
"tools_copper_thieving_mask_clearance": self.ui.tools2_defaults_form.tools2_cfill_group.clearance_ppm_entry,
|
||||
"tools_copper_thieving_geo_choice": self.ui.tools2_defaults_form.tools2_cfill_group.ppm_choice_radio,
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from PyQt5 import QtWidgets
|
||||
from PyQt5.QtCore import QSettings
|
||||
|
||||
from appGUI.GUIElements import FCSpinner, FCDoubleSpinner, RadioSet, FCLabel
|
||||
from appGUI.GUIElements import FCSpinner, FCDoubleSpinner, RadioSet, FCLabel, FCCheckBox
|
||||
from appGUI.preferences.OptionsGroupUI import OptionsGroupUI
|
||||
|
||||
import gettext
|
||||
@@ -264,12 +264,20 @@ class Tools2CThievingPrefGroupUI(OptionsGroupUI):
|
||||
grid_lay.addWidget(self.rb_thickness_label, 40, 0)
|
||||
grid_lay.addWidget(self.rb_thickness_entry, 40, 1)
|
||||
|
||||
# Pattern Plating Mask Title
|
||||
self.patern_mask_label = FCLabel('<b>%s</b>' % _('Pattern Plating Mask'))
|
||||
self.patern_mask_label.setToolTip(
|
||||
_("Generate a mask for pattern plating.")
|
||||
)
|
||||
grid_lay.addWidget(self.patern_mask_label, 42, 0, 1, 2)
|
||||
|
||||
# Use Only Pads
|
||||
self.only_pads_cb = FCCheckBox(_("Only Pads"))
|
||||
self.only_pads_cb.setToolTip(
|
||||
_("Select only pads in case the selected object is a copper Gerber.")
|
||||
)
|
||||
grid_lay.addWidget(self.only_pads_cb, 43, 0, 1, 2)
|
||||
|
||||
# Openings CLEARANCE #
|
||||
self.clearance_ppm_label = FCLabel('%s:' % _("Clearance"))
|
||||
self.clearance_ppm_label.setToolTip(
|
||||
|
||||
Reference in New Issue
Block a user