- fixed the on_delete() method in the App class; sometime it will delete all files that have similar names

- made sure that on creation of new objects the adding of the names to the auto-complete list is done properly
This commit is contained in:
Marius Stanciu
2020-12-09 19:13:06 +02:00
committed by Marius
parent c1fdf2d8e8
commit d6c34f97ef
4 changed files with 16 additions and 9 deletions

View File

@@ -4856,8 +4856,8 @@ class App(QtCore.QObject):
"App.on_delete() --> delete annotations on a FlatCAMCNCJob object. %s" % str(e)
)
while self.collection.get_selected():
self.delete_first_selected()
for ob in self.collection.get_selected():
self.delete_first_selected(ob)
# make sure that the selection shape is deleted, too
self.delete_selection_shape()
@@ -4870,10 +4870,15 @@ class App(QtCore.QObject):
else:
self.inform.emit(_("Save the work in Editor and try again ..."))
def delete_first_selected(self):
def delete_first_selected(self, del_obj=None):
# Keep this for later
try:
sel_obj = self.collection.get_active()
if del_obj is not None:
sel_obj = del_obj
else:
sel_obj = self.collection.get_active()
name = sel_obj.options["name"]
isPlotted = sel_obj.options["plot"]
except AttributeError: