- fixed the Offset spinbox not being controller by offset checkbox in NCC Tool

This commit is contained in:
Marius Stanciu 2020-02-18 04:26:53 +02:00 committed by Marius
parent a9c6db73bf
commit 042dc26cfa
2 changed files with 11 additions and 32 deletions

View File

@ -23,6 +23,7 @@ CAD program, and create G-Code for Isolation routing.
- when multiple tools are selected in Excellon UI and parameters are modified it will applied to all selected
- in Excellon UI, Paint Tool and NCC Tool finished the "Apply parameters to all tools" functionality
- updated Paint Tool and NCC Tool in the UI functionality
- fixed the Offset spinbox not being controller by offset checkbox in NCC Tool
16.02.2020

View File

@ -1108,35 +1108,6 @@ class NonCopperClear(FlatCAMTool, Gerber):
self.tool_type_radio.activated_custom.connect(self.on_tool_type)
# first disconnect
for opt in self.form_fields:
current_widget = self.form_fields[opt]
if isinstance(current_widget, FCCheckBox):
try:
current_widget.stateChanged.disconnect()
except (TypeError, ValueError):
pass
if isinstance(current_widget, RadioSet):
try:
current_widget.activated_custom.disconnect()
except (TypeError, ValueError):
pass
elif isinstance(current_widget, FCDoubleSpinner):
try:
current_widget.returnPressed.disconnect()
except (TypeError, ValueError):
pass
try:
self.ncc_rest_cb.stateChanged.disconnect()
except (TypeError, ValueError):
pass
try:
self.ncc_order_radio.activated_custom[str].disconnect()
except (TypeError, ValueError):
pass
# then reconnect
for opt in self.form_fields:
current_widget = self.form_fields[opt]
if isinstance(current_widget, FCCheckBox):
@ -1145,6 +1116,8 @@ class NonCopperClear(FlatCAMTool, Gerber):
current_widget.activated_custom.connect(self.form_to_storage)
elif isinstance(current_widget, FCDoubleSpinner):
current_widget.returnPressed.connect(self.form_to_storage)
elif isinstance(current_widget, FCComboBox):
current_widget.currentIndexChanged.connect(self.form_to_storage)
self.ncc_rest_cb.stateChanged.connect(self.on_rest_machining_check)
self.ncc_order_radio.activated_custom[str].connect(self.on_order_changed)
@ -1174,17 +1147,22 @@ class NonCopperClear(FlatCAMTool, Gerber):
current_widget = self.form_fields[opt]
if isinstance(current_widget, FCCheckBox):
try:
current_widget.stateChanged.disconnect()
current_widget.stateChanged.disconnect(self.form_to_storage)
except (TypeError, ValueError):
pass
if isinstance(current_widget, RadioSet):
try:
current_widget.activated_custom.disconnect()
current_widget.activated_custom.disconnect(self.form_to_storage)
except (TypeError, ValueError):
pass
elif isinstance(current_widget, FCDoubleSpinner):
try:
current_widget.returnPressed.disconnect()
current_widget.returnPressed.disconnect(self.form_to_storage)
except (TypeError, ValueError):
pass
elif isinstance(current_widget, FCComboBox):
try:
current_widget.currentIndexChanged.disconnect(self.form_to_storage)
except (TypeError, ValueError):
pass