Skip to content

Commit

Permalink
BUG: ToolTable - Warn user when trying to delete tool in spindle
Browse files Browse the repository at this point in the history
  • Loading branch information
KurtJacobson committed Jan 31, 2021
1 parent 0902f44 commit d9ed820
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions qtpyvcp/widgets/input_widgets/tool_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,20 @@ def deleteSelectedTool(self):
return

tdata = self.tool_model.toolDataFromRow(current_row)
tnum = tdata['T']

# should not delete tool if currently loaded in spindle. Warn user
if tnum == self.tool_model.stat.tool_in_spindle:

box = QMessageBox(QMessageBox.Warning,
"Can't delete current tool!",
"Tool #{} is currently loaded in the spindle.\n"
"Please remove tool from spindle and try again.".format(tnum),
QMessageBox.Ok,
parent=self)
box.show()
return False

if not self.confirmAction('Are you sure you want to delete T{tdata[T]}?\n'
'"{tdata[R]}"'.format(tdata=tdata)):
return
Expand Down

0 comments on commit d9ed820

Please # to comment.