Skip to content

Commit

Permalink
BUG: ToolTable - allow tool numbers up to 99999, but limit entries to 56
Browse files Browse the repository at this point in the history
  • Loading branch information
KurtJacobson committed Feb 17, 2019
1 parent dabebbf commit 91567b2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions qtpyvcp/widgets/input_widgets/tool_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __init__(self, parent=None):
self._tool_table = self.tt.loadToolTable()

self.setColumnCount(self.columnCount())
self.setRowCount(100) # (self.rowCount())
self.setRowCount(56) # (self.rowCount())

def setColumns(self, columns):
self._columns = columns
Expand Down Expand Up @@ -151,11 +151,12 @@ def addTool(self):
except IndexError:
tnum = 1

if tnum > 100:
# max 100 tools
return False

row = len(self._tool_table) - 1
print tnum, row

if row == 56:
# max 56 tools
return False

self.beginInsertRows(QModelIndex(), row, row)
self._tool_table[tnum] = self.tt.newTool(tnum=tnum)
Expand Down

0 comments on commit 91567b2

Please # to comment.