From 82afd3bb6e569cd6d9268618c326d99e2473ab9e Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Wed, 15 Jan 2020 17:59:12 +0200 Subject: [PATCH] - work in Paint Tool GUI functionality --- README.md | 1 + flatcamTools/ToolPaint.py | 22 +++++++--------------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index f91a123c..4a872ab7 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ CAD program, and create G-Code for Isolation routing. - added new functionality (key shortcut SHIFT+J) to locate the corners of the bounding box (and center) in a selected object - modified the NCC Tool GUI to prepare for accepting a tool from a tool database - started to modify the Paint Tool to be similar to NCC Tool and to accept a tool from a database +- work in Paint Tool GUI functionality 14.01.2020 diff --git a/flatcamTools/ToolPaint.py b/flatcamTools/ToolPaint.py index 95fc26e7..462aaeef 100644 --- a/flatcamTools/ToolPaint.py +++ b/flatcamTools/ToolPaint.py @@ -1034,11 +1034,7 @@ class ToolPaint(FlatCAMTool, Gerber): self.tools_table.setContextMenuPolicy(Qt.NoContextMenu) def build_ui(self): - try: - # if connected, disconnect the signal from the slot on item_changed as it creates issues - self.tools_table.itemChanged.disconnect() - except (TypeError, AttributeError): - pass + self.ui_disconnect() # updated units self.units = self.app.defaults['units'].upper() @@ -1119,8 +1115,7 @@ class ToolPaint(FlatCAMTool, Gerber): self.tools_table.setMinimumHeight(self.tools_table.getHeight()) self.tools_table.setMaximumHeight(self.tools_table.getHeight()) - # we reactivate the signals after the after the tool adding as we don't need to see the tool been populated - self.tools_table.itemChanged.connect(self.on_tool_edit) + self.ui_connect() def on_combo_box_type(self): obj_type = self.box_combo_type.currentIndex() @@ -1166,21 +1161,19 @@ class ToolPaint(FlatCAMTool, Gerber): if float('%.*f' % (self.decimals, tool_dia)) in tool_dias: if muted is None: - self.app.inform.emit('[WARNING_NOTCL] %s' % - _("Adding tool cancelled. Tool already in Tool Table.")) + self.app.inform.emit('[WARNING_NOTCL] %s' % _("Adding tool cancelled. Tool already in Tool Table.")) self.tools_table.itemChanged.connect(self.on_tool_edit) return else: if muted is None: - self.app.inform.emit('[success] %s' % - _("New tool added to Tool Table.")) + self.app.inform.emit('[success] %s' % _("New tool added to Tool Table.")) self.paint_tools.update({ int(self.tooluid): { 'tooldia': float('%.*f' % (self.decimals, tool_dia)), 'offset': 'Path', 'offset_value': 0.0, 'type': 'Iso', - 'tool_type': 'V', + 'tool_type': self.tool_type_radio.get_value(), 'data': dict(self.default_data), 'solid_geometry': [] } @@ -3109,9 +3102,8 @@ class ToolPaint(FlatCAMTool, Gerber): elif isinstance(current_widget, FCDoubleSpinner): current_widget.returnPressed.connect(self.form_to_storage) - self.ncc_choice_offset_cb.stateChanged.connect(self.on_offset_choice) - self.ncc_rest_cb.stateChanged.connect(self.on_rest_machining_check) - self.ncc_order_radio.activated_custom[str].connect(self.on_order_changed) + self.rest_cb.stateChanged.connect(self.on_rest_machining_check) + self.order_radio.activated_custom[str].connect(self.on_order_changed) def ui_disconnect(self): try: