- fixed a weird error that created a crash in the following scenario: create a new excellon, edit it, add some drills/slots, delete it without saving, create a new excellon, try to edit and a crash is issued due of a wrapped C++ error

- fixed bug selection in Excellon editor with a selection window in case that the number of selected items is even
- updated the default values to more convenient ones
This commit is contained in:
Marius Stanciu
2019-08-16 16:03:26 +03:00
parent 3a5622ffc6
commit bbc00c8f35
4 changed files with 59 additions and 49 deletions

View File

@@ -3358,11 +3358,18 @@ class FlatCAMExcEditor(QtCore.QObject):
for storage in self.storage_dict:
for shape_s in self.selected:
if shape_s in self.storage_dict[storage].get_objects():
for key in self.tool2tooldia:
if self.tool2tooldia[key] == storage:
item = self.tools_table_exc.item((key - 1), 1)
self.tools_table_exc.setCurrentItem(item)
self.last_tool_selected = int(key)
for key_tool_nr in self.tool2tooldia:
if self.tool2tooldia[key_tool_nr] == storage:
row_to_sel = key_tool_nr - 1
# item = self.tools_table_exc.item(row_to_sel, 1)
# self.tools_table_exc.setCurrentItem(item)
# item.setSelected(True)
# if the row to be selected is not already in the selected rows then select it
# otherwise don't do it as it seems that we have a toggle effect
if row_to_sel not in set(index.row() for index in self.tools_table_exc.selectedIndexes()):
self.tools_table_exc.selectRow(row_to_sel)
self.last_tool_selected = int(key_tool_nr)
self.tools_table_exc.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)

View File

@@ -4205,9 +4205,10 @@ class FlatCAMGrbEditor(QtCore.QObject):
# select the aperture code of the selected geometry, in the tool table
self.apertures_table.setSelectionMode(QtWidgets.QAbstractItemView.MultiSelection)
for aper in sel_aperture:
for row in range(self.apertures_table.rowCount()):
if str(aper) == self.apertures_table.item(row, 1).text():
self.apertures_table.selectRow(row)
for row_to_sel in range(self.apertures_table.rowCount()):
if str(aper) == self.apertures_table.item(row_to_sel, 1).text():
if row_to_sel not in set(index.row() for index in self.apertures_table.selectedIndexes()):
self.apertures_table.selectRow(row_to_sel)
self.last_aperture_selected = aper
self.apertures_table.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)