- Multiple Tools fix - fixed issue with converting slots to drills selection being cleared when togglinh all rows by clicking on the header

- Multiple Tools fix - fixes for when having multiple tools selected which created issues in tool tables for many tools
This commit is contained in:
Marius Stanciu
2020-07-13 15:49:11 +03:00
parent 1c77e3cc2a
commit c6baa8ca60
8 changed files with 125 additions and 13 deletions

View File

@@ -839,12 +839,28 @@ class GeometryObject(FlatCAMObj, Geometry):
if len(sel_rows) == self.ui.geo_tools_table.rowCount():
self.ui.geo_tools_table.clearSelection()
self.ui.tool_data_label.setText(
"<b>%s: <font color='#0000FF'>%s</font></b>" % (_('Parameters for'), _("No Tool Selected"))
)
else:
self.ui.geo_tools_table.selectAll()
self.update_ui()
self.ui.tool_data_label.setText(
"<b>%s: <font color='#0000FF'>%s</font></b>" % (_('Parameters for'), _("Multiple Tools"))
)
def on_row_selection_change(self):
self.update_ui()
sel_model = self.ui.geo_tools_table.selectionModel()
sel_indexes = sel_model.selectedIndexes()
# it will iterate over all indexes which means all items in all columns too but I'm interested only on rows
sel_rows = set()
for idx in sel_indexes:
sel_rows.add(idx.row())
# update UI only if only one row is selected otherwise having multiple rows selected will deform information
# for the rows other that the current one (first selected)
if len(sel_rows) == 1:
self.update_ui()
def update_ui(self, row=None):
self.ui_disconnect()