Skip to content

Commit

Permalink
Bug 1248212 - Don't allow clicking on bounds in the skip chooser wind…
Browse files Browse the repository at this point in the history
…ow (#675)

Since it leads to an AssertionError[0] when OK is clicked to confirm the
selection, or if the bound was double clicked to do so.

[0] `assert len(items) == 1` in `choose_next_build()`
  • Loading branch information
KwanEsq committed Jun 17, 2020
1 parent dc2a649 commit 25e3806
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions gui/mozregui/skip_chooser.py
Expand Up @@ -69,8 +69,12 @@ def setScene(self, scene):
scene.mid_build.setSelected(True)

def mousePressEvent(self, evt):
item = self.itemAt(evt.pos())
# do nothing if we don't click on an item
if not self.itemAt(evt.pos()):
if not item:
return
# do nothing if we click on a bound
if not (item.flags() & QGraphicsRectItem.ItemIsSelectable):
return
# only one item can be selected at a time, so deselect if any
for item in self.scene().selectedItems():
Expand All @@ -86,7 +90,8 @@ def mouseMoveEvent(self, evt):

def mouseDoubleClickEvent(self, evt):
item = self.itemAt(evt.pos())
if item:
# do nothing if we click on a bound
if item and item.flags() & QGraphicsRectItem.ItemIsSelectable:
self.build_choosen.emit()


Expand Down

0 comments on commit 25e3806

Please sign in to comment.