Просмотр исходного кода

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

Marius Stanciu 6 лет назад
Родитель
Сommit
042dc26cfa
2 измененных файлов с 11 добавлено и 32 удалено
  1. 1 0
      README.md
  2. 10 32
      flatcamTools/ToolNonCopperClear.py

+ 1 - 0
README.md

@@ -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
 - 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
 - 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
 - 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
 16.02.2020
 
 

+ 10 - 32
flatcamTools/ToolNonCopperClear.py

@@ -1108,35 +1108,6 @@ class NonCopperClear(FlatCAMTool, Gerber):
 
 
         self.tool_type_radio.activated_custom.connect(self.on_tool_type)
         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:
         for opt in self.form_fields:
             current_widget = self.form_fields[opt]
             current_widget = self.form_fields[opt]
             if isinstance(current_widget, FCCheckBox):
             if isinstance(current_widget, FCCheckBox):
@@ -1145,6 +1116,8 @@ class NonCopperClear(FlatCAMTool, Gerber):
                 current_widget.activated_custom.connect(self.form_to_storage)
                 current_widget.activated_custom.connect(self.form_to_storage)
             elif isinstance(current_widget, FCDoubleSpinner):
             elif isinstance(current_widget, FCDoubleSpinner):
                 current_widget.returnPressed.connect(self.form_to_storage)
                 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_rest_cb.stateChanged.connect(self.on_rest_machining_check)
         self.ncc_order_radio.activated_custom[str].connect(self.on_order_changed)
         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]
             current_widget = self.form_fields[opt]
             if isinstance(current_widget, FCCheckBox):
             if isinstance(current_widget, FCCheckBox):
                 try:
                 try:
-                    current_widget.stateChanged.disconnect()
+                    current_widget.stateChanged.disconnect(self.form_to_storage)
                 except (TypeError, ValueError):
                 except (TypeError, ValueError):
                     pass
                     pass
             if isinstance(current_widget, RadioSet):
             if isinstance(current_widget, RadioSet):
                 try:
                 try:
-                    current_widget.activated_custom.disconnect()
+                    current_widget.activated_custom.disconnect(self.form_to_storage)
                 except (TypeError, ValueError):
                 except (TypeError, ValueError):
                     pass
                     pass
             elif isinstance(current_widget, FCDoubleSpinner):
             elif isinstance(current_widget, FCDoubleSpinner):
                 try:
                 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):
                 except (TypeError, ValueError):
                     pass
                     pass