From 620db695445e79cde235c58f0a60497540ea1e5b Mon Sep 17 00:00:00 2001 From: David Bailey Date: Mon, 9 Jan 2017 10:55:30 +0000 Subject: [PATCH 1/2] Fix bug caused when deleting a card just added and clicking History --- aqt/addcards.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/aqt/addcards.py b/aqt/addcards.py index a069c0696..d5f4c1775 100644 --- a/aqt/addcards.py +++ b/aqt/addcards.py @@ -142,10 +142,14 @@ class AddCards(QDialog): def onHistory(self): m = QMenu(self) for nid in self.history: - fields = self.mw.col.getNote(nid).fields - txt = stripHTMLMedia(",".join(fields))[:30] - a = m.addAction(_("Edit %s") % txt) - a.triggered.connect(lambda b, nid=nid: self.editHistory(nid)) + if self.mw.col.findNotes("nid:%s" % nid): + fields = self.mw.col.getNote(nid).fields + txt = stripHTMLMedia(",".join(fields))[:30] + a = m.addAction(_("Edit %s") % txt) + a.triggered.connect(lambda b, nid=nid: self.editHistory(nid)) + else: + a = m.addAction(_("(Note deleted)")) + a.setEnabled(False) runHook("AddCards.onHistory", self, m) m.exec_(self.historyButton.mapToGlobal(QPoint(0,0))) From 39b12d6cfc8aed542f4c28f7667fd0becdb729bf Mon Sep 17 00:00:00 2001 From: Fredrick Lockert Date: Mon, 9 Jan 2017 16:09:48 +0100 Subject: [PATCH 2/2] Update required versions for Python & PyQt --- README.development | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.development b/README.development index 18feb310d..a1ffddfe1 100644 --- a/README.development +++ b/README.development @@ -12,9 +12,9 @@ provide support for problems you encounter when running from source. Anki requires: - - Python 3.4+ + - Python 3.5+ - Qt 5.5+ - - PyQt5.6+ + - PyQt5.7.1+ - mplayer - lame