Correcting a small bug
I though «addMode» meant «call from addcard window». Instead, to know whether parent is addcard, I check whether it has attribute deckChooser
This commit is contained in:
parent
20ff61e59e
commit
6532023c3e
@ -61,7 +61,9 @@ class CardLayout(QDialog):
|
|||||||
self.setFocus()
|
self.setFocus()
|
||||||
|
|
||||||
def redraw(self):
|
def redraw(self):
|
||||||
did = self.parent.deckChooser.selectedId() if self.addMode else None
|
did = None
|
||||||
|
if hasattr(self.parent,"deckChooser"):
|
||||||
|
did = self.parent.deckChooser.selectedId()
|
||||||
self.cards = self.col.previewCards(self.note, 2, did = did)
|
self.cards = self.col.previewCards(self.note, 2, did = did)
|
||||||
idx = self.ord
|
idx = self.ord
|
||||||
if idx >= len(self.cards):
|
if idx >= len(self.cards):
|
||||||
|
Loading…
Reference in New Issue
Block a user