check we're not using qt4.6

This commit is contained in:
Damien Elmes 2012-12-04 19:49:09 +09:00
parent 3e6bb426a3
commit a25ad01c1b
3 changed files with 13 additions and 2 deletions

4
README
View file

@ -12,8 +12,8 @@ sudo apt-get install python-qt4 mplayer lame libportaudio2
If you're on another distribution the packages may be named differently, so
please consult your package manager.
Your Python version will need to be 2.6 or 2.7 (not 3+), and PyQt needs to be
4.7 or later.
Your Python version will need to be 2.6 or 2.7 (not 3+), and both Qt and PyQt
need to be 4.7 or later.
Installation & Running
------------------------

View file

@ -201,6 +201,12 @@ No usable temporary folder found. Make sure C:\\temp exists or TEMP in your \
environment points to a valid, writable folder.""")
return
# qt version must be up to date
if qtmajor <= 4 and qtminor <= 6:
QMessageBox.critical(
None, "Error", "Anki requires Qt4.7 or later.")
return
# parse args
opts, args = parseArgs(sys.argv)
opts.base = unicode(opts.base or "", sys.getfilesystemencoding())

View file

@ -29,3 +29,8 @@ if os.environ.get("DEBUG"):
from pdb import pm
pm()
sys.excepthook = info
qtconf = pyqtconfig.Configuration()
qtmajor = (qtconf.qt_version & 0xff0000) >> 16
qtminor = (qtconf.qt_version & 0x00ff00) >> 8