Merge pull request #133 from trainstopperd/main
fix: accessing text when no quirks selected
This commit is contained in:
commit
a0ef2531c3
1 changed files with 10 additions and 0 deletions
10
menus.py
10
menus.py
|
@ -112,6 +112,11 @@ class PesterQuirkList(QtWidgets.QTreeWidget):
|
||||||
|
|
||||||
@QtCore.pyqtSlot()
|
@QtCore.pyqtSlot()
|
||||||
def upShiftQuirk(self):
|
def upShiftQuirk(self):
|
||||||
|
# We cannot move the quirk up if there are no selected quirks,
|
||||||
|
# or if there are none period.
|
||||||
|
if self.currentItem() is None:
|
||||||
|
return
|
||||||
|
|
||||||
found = self.findItems(
|
found = self.findItems(
|
||||||
self.currentItem().text(0), QtCore.Qt.MatchFlag.MatchExactly
|
self.currentItem().text(0), QtCore.Qt.MatchFlag.MatchExactly
|
||||||
)
|
)
|
||||||
|
@ -150,6 +155,11 @@ class PesterQuirkList(QtWidgets.QTreeWidget):
|
||||||
|
|
||||||
@QtCore.pyqtSlot()
|
@QtCore.pyqtSlot()
|
||||||
def downShiftQuirk(self):
|
def downShiftQuirk(self):
|
||||||
|
# We cannot move the quirk down if there are no selected quirks,
|
||||||
|
# or if there are none period.
|
||||||
|
if self.currentItem() is None:
|
||||||
|
return
|
||||||
|
|
||||||
found = self.findItems(
|
found = self.findItems(
|
||||||
self.currentItem().text(0), QtCore.Qt.MatchFlag.MatchExactly
|
self.currentItem().text(0), QtCore.Qt.MatchFlag.MatchExactly
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue