- a series of PEP8 corrections in the FlatCAMGeometry.py
- in Geometry UI finished a very basic way for the Polish feature (this will be upgraded in the future, for now is very rough) - added some new GUI elements by subclassing some widgets for the dialog pop-ups - in NCC Tool and Isolation Tool, pressing the shortcut key 'T' will bring the add new tool pop up in which now it is included the button to get the optimal diameter - in Geometry UI and for Solderpaste Tool replaced the pop up window that is launched when using shortcut key with one that has the context menu translated - some UI cleanup in the Geometry UI
This commit is contained in:
@@ -9,7 +9,7 @@ from PyQt5 import QtWidgets, QtCore, QtGui
|
||||
|
||||
from appTool import AppTool
|
||||
from appGUI.GUIElements import FCCheckBox, FCDoubleSpinner, RadioSet, FCTable, FCInputDialog, FCButton, \
|
||||
FCComboBox, OptionalInputSection, FCSpinner, FCLabel
|
||||
FCComboBox, OptionalInputSection, FCSpinner, FCLabel, FCInputDialogSpinnerButton
|
||||
from appParsers.ParseGerber import Gerber
|
||||
from camlib import grace
|
||||
|
||||
@@ -58,7 +58,8 @@ class ToolIsolation(AppTool, Gerber):
|
||||
# #############################################################################
|
||||
self.ui.tools_table.setupContextMenu()
|
||||
self.ui.tools_table.addContextMenu(
|
||||
_("Search and Add"), self.on_add_tool_by_key,
|
||||
_("Search and Add"),
|
||||
self.on_add_tool_by_key,
|
||||
icon=QtGui.QIcon(self.app.resource_location + "/plus16.png")
|
||||
)
|
||||
self.ui.tools_table.addContextMenu(
|
||||
@@ -779,20 +780,34 @@ class ToolIsolation(AppTool, Gerber):
|
||||
self.blockSignals(False)
|
||||
|
||||
def on_add_tool_by_key(self):
|
||||
tool_add_popup = FCInputDialog(title='%s...' % _("New Tool"),
|
||||
text='%s:' % _('Enter a Tool Diameter'),
|
||||
min=0.0001, max=9999.9999, decimals=self.decimals)
|
||||
# tool_add_popup = FCInputDialog(title='%s...' % _("New Tool"),
|
||||
# text='%s:' % _('Enter a Tool Diameter'),
|
||||
# min=0.0001, max=9999.9999, decimals=self.decimals)
|
||||
btn_icon = QtGui.QIcon(self.app.resource_location + '/open_excellon32.png')
|
||||
|
||||
tool_add_popup = FCInputDialogSpinnerButton(title='%s...' % _("New Tool"),
|
||||
text='%s:' % _('Enter a Tool Diameter'),
|
||||
min=0.0001, max=9999.9999, decimals=self.decimals,
|
||||
button_icon=btn_icon,
|
||||
callback=self.on_find_optimal_tooldia)
|
||||
tool_add_popup.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/letter_t_32.png'))
|
||||
|
||||
val, ok = tool_add_popup.get_value()
|
||||
def find_optimal(val):
|
||||
tool_add_popup.set_value(float(val))
|
||||
|
||||
self.optimal_found_sig.connect(find_optimal)
|
||||
|
||||
val, ok = tool_add_popup.get_results()
|
||||
if ok:
|
||||
if float(val) == 0:
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Please enter a tool diameter with non-zero value, in Float format."))
|
||||
self.optimal_found_sig.disconnect(find_optimal)
|
||||
return
|
||||
self.on_tool_add(custom_dia=float(val))
|
||||
else:
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s...' % _("Adding Tool cancelled"))
|
||||
self.optimal_found_sig.disconnect(find_optimal)
|
||||
|
||||
def on_reference_combo_changed(self):
|
||||
obj_type = self.ui.reference_combo_type.currentIndex()
|
||||
@@ -913,7 +928,7 @@ class ToolIsolation(AppTool, Gerber):
|
||||
return
|
||||
|
||||
def job_thread(app_obj, is_display):
|
||||
with self.app.proc_container.new(_("Working...")) as proc:
|
||||
with self.app.proc_container.new(_("Working...")):
|
||||
try:
|
||||
old_disp_number = 0
|
||||
pol_nr = 0
|
||||
|
||||
Reference in New Issue
Block a user