- 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

@ -16,6 +16,8 @@ CHANGELOG for FlatCAM beta
- Drilling Tool - now slots are converted to drills if the checkbox is ON for the tool investigated
- Drilling Tool - fixes due of changes in properties (preferences)
- fixed the Drillcncjob TCL command
- 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
12.07.2020

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()

View File

@ -888,13 +888,32 @@ class ToolDrilling(AppTool, Excellon):
if len(sel_rows) == self.t_ui.tools_table.rowCount():
self.t_ui.tools_table.clearSelection()
self.t_ui.exc_param_frame.setDisabled(True)
self.t_ui.generate_cnc_button.setDisabled(True)
self.t_ui.tool_data_label.setText(
"<b>%s: <font color='#0000FF'>%s</font></b>" % (_('Parameters for'), _("No Tool Selected"))
)
else:
self.t_ui.tools_table.selectAll()
self.t_ui.exc_param_frame.setDisabled(False)
self.update_ui()
self.t_ui.generate_cnc_button.setDisabled(False)
self.t_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.t_ui.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):
self.blockSignals(True)

View File

@ -647,12 +647,28 @@ class ToolIsolation(AppTool, Gerber):
if len(sel_rows) == self.t_ui.tools_table.rowCount():
self.t_ui.tools_table.clearSelection()
self.t_ui.tool_data_label.setText(
"<b>%s: <font color='#0000FF'>%s</font></b>" % (_('Parameters for'), _("No Tool Selected"))
)
else:
self.t_ui.tools_table.selectAll()
self.update_ui()
self.t_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.t_ui.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):
self.blockSignals(True)

View File

@ -740,12 +740,28 @@ class ToolMilling(AppTool, Excellon):
if len(sel_rows) == self.ui.tools_table.rowCount():
self.ui.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.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.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):
self.blockSignals(True)

View File

@ -263,12 +263,28 @@ class NonCopperClear(AppTool, Gerber):
if len(sel_rows) == self.ui.tools_table.rowCount():
self.ui.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.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.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):
self.blockSignals(True)

View File

@ -245,12 +245,28 @@ class ToolPaint(AppTool, Gerber):
if len(sel_rows) == self.ui.tools_table.rowCount():
self.ui.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.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.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):
self.blockSignals(True)

View File

@ -305,7 +305,18 @@ class SolderPaste(AppTool):
self.ui_connect()
def on_row_selection_change(self):
self.update_ui()
sel_model = self.ui.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 ui_connect(self):
# on any change to the widgets that matter it will be called self.gui_form_to_storage which will save the