ソースを参照

- Geometry Editor: modified the intersection (if the selected shapes don't intersects preserve them) and substract functions (delete all shapes that were used in the process)
- work in the ToolSilk

Marius Stanciu 6 年 前
コミット
ddc2f2d873
3 ファイル変更17 行追加11 行削除
  1. 11 10
      FlatCAMObj.py
  2. 1 0
      README.md
  3. 5 1
      flatcamTools/ToolSilk.py

+ 11 - 10
FlatCAMObj.py

@@ -181,17 +181,18 @@ class FlatCAMObj(QtCore.QObject):
         old_name = copy(self.options["name"])
         old_name = copy(self.options["name"])
         new_name = self.ui.name_entry.get_value()
         new_name = self.ui.name_entry.get_value()
 
 
-        # update the SHELL auto-completer model data
-        try:
-            self.app.myKeywords.remove(old_name)
-            self.app.myKeywords.append(new_name)
-            self.app.shell._edit.set_model_data(self.app.myKeywords)
-            self.app.ui.code_editor.set_model_data(self.app.myKeywords)
-        except:
-            log.debug("on_name_activate() --> Could not remove the old object name from auto-completer model list")
+        if new_name != old_name:
+            # update the SHELL auto-completer model data
+            try:
+                self.app.myKeywords.remove(old_name)
+                self.app.myKeywords.append(new_name)
+                self.app.shell._edit.set_model_data(self.app.myKeywords)
+                self.app.ui.code_editor.set_model_data(self.app.myKeywords)
+            except:
+                log.debug("on_name_activate() --> Could not remove the old object name from auto-completer model list")
 
 
-        self.options["name"] = self.ui.name_entry.get_value()
-        self.app.inform.emit(_("[success] Name changed from {old} to {new}").format(old=old_name, new=new_name))
+            self.options["name"] = self.ui.name_entry.get_value()
+            self.app.inform.emit(_("[success] Name changed from {old} to {new}").format(old=old_name, new=new_name))
 
 
     def on_offset_button_click(self):
     def on_offset_button_click(self):
         self.app.report_usage("obj_on_offset_button")
         self.app.report_usage("obj_on_offset_button")

+ 1 - 0
README.md

@@ -13,6 +13,7 @@ CAD program, and create G-Code for Isolation routing.
 
 
 - Geometry Editor: modified the intersection (if the selected shapes don't intersects preserve them) and substract functions (delete all shapes that were used in the process)
 - Geometry Editor: modified the intersection (if the selected shapes don't intersects preserve them) and substract functions (delete all shapes that were used in the process)
 - work in the ToolSilk
 - work in the ToolSilk
+- for all objects, if in Selected the object name is changed to the same name, the rename is not done (because there is nothing changed)
 
 
 24.04.2019
 24.04.2019
 
 

+ 5 - 1
flatcamTools/ToolSilk.py

@@ -209,9 +209,13 @@ class ToolSilk(FlatCAMTool):
             while True:
             while True:
                 # removal from list is done in a multithreaded way therefore not always the removal can be done
                 # removal from list is done in a multithreaded way therefore not always the removal can be done
                 # so we keep trying until it's done
                 # so we keep trying until it's done
-                self.promises.remove(apid)
+                if apid in self.promises:
+                    self.promises.remove(apid)
+                else:
+                    break
                 time.sleep(0.1)
                 time.sleep(0.1)
         except:
         except:
+            log.debug("Promise fulfilled: %s" % str(apid))
             pass
             pass
 
 
     def periodic_check(self, check_period, reset=False):
     def periodic_check(self, check_period, reset=False):