|
@@ -888,13 +888,32 @@ class ToolDrilling(AppTool, Excellon):
|
|
|
if len(sel_rows) == self.t_ui.tools_table.rowCount():
|
|
if len(sel_rows) == self.t_ui.tools_table.rowCount():
|
|
|
self.t_ui.tools_table.clearSelection()
|
|
self.t_ui.tools_table.clearSelection()
|
|
|
self.t_ui.exc_param_frame.setDisabled(True)
|
|
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:
|
|
else:
|
|
|
self.t_ui.tools_table.selectAll()
|
|
self.t_ui.tools_table.selectAll()
|
|
|
self.t_ui.exc_param_frame.setDisabled(False)
|
|
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):
|
|
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):
|
|
def update_ui(self):
|
|
|
self.blockSignals(True)
|
|
self.blockSignals(True)
|