mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 22:42:25 -04:00
detect broken pyqt4.6 and recover/warn
This commit is contained in:
parent
d4491869c1
commit
85a6f4197d
3 changed files with 11 additions and 3 deletions
|
@ -185,10 +185,10 @@ interval, factor, noCount, priority, (select tags from facts where
|
|||
facts.id = cards.factId), (select created from facts where
|
||||
facts.id = cards.factId) from cards where id = :id""",
|
||||
id=self.cards[index.row()][0])
|
||||
# storing this in a local var first avoids a segfault
|
||||
end = self.index(idx, 1)
|
||||
if ankiqt.ui.utils.pyQtBroken:
|
||||
raise
|
||||
self.emit(SIGNAL("dataChanged(QModelIndex,QModelIndex)"),
|
||||
index, end)
|
||||
index, self.index(index.row(), 1))
|
||||
except:
|
||||
# called after search changed
|
||||
pass
|
||||
|
|
|
@ -1654,6 +1654,11 @@ learnt today")
|
|||
removeHook("showQuestion", self.onCardStats)
|
||||
|
||||
def onShowGraph(self):
|
||||
if ui.utils.pyQtBroken:
|
||||
ui.utils.showInfo(
|
||||
"Your PyQt installation is broken. "
|
||||
"Please upgrade or downgrade PyQt.")
|
||||
return
|
||||
self.setStatus(_("Loading graphs (may take time)..."))
|
||||
self.app.processEvents()
|
||||
import anki.graphs
|
||||
|
|
|
@ -264,3 +264,6 @@ class ProgressWin(object):
|
|||
self.app.processEvents()
|
||||
time.sleep(0.1)
|
||||
self.diag.cancel()
|
||||
|
||||
import PyQt4.pyqtconfig as PyConf;
|
||||
pyQtBroken = PyConf.Configuration().pyqt_version_str.startswith("4.6")
|
||||
|
|
Loading…
Reference in a new issue