From 9c21a23ce8040621a516bcfb124ff1a39e7f6416 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 8 Oct 2007 20:06:49 +0000 Subject: [PATCH] Check PyQt version and fix icon for lrfviewer --- src/libprs500/linux.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/libprs500/linux.py b/src/libprs500/linux.py index 6810e9445c..90fb563c4f 100644 --- a/src/libprs500/linux.py +++ b/src/libprs500/linux.py @@ -201,6 +201,13 @@ def post_install(): setup_desktop_integration() except: print >>sys.stderr, 'You do not have the Portland Desktop Utilities installed, skipping installation of desktop integration' + + try: + from PyQt4 import Qt + if Qt.PYQT_VERSION < int('0x40301', 16): + print 'WARNING: You need PyQt >= 4.3.1 for the GUI to work. You have', Qt.PYQT_VERSION_STR + except ImportError: + print 'WARNING: You do not have PyQt4 installed. The GUI will not work.' @@ -264,7 +271,7 @@ def setup_desktop_integration(): check_call('xdg-icon-resource install --context mimetypes --size 128 libprs500-lrf.png application-lrf', shell=True) check_call('xdg-icon-resource install --context mimetypes --size 128 libprs500-lrf.png text-lrs', shell=True) check_call('xdg-icon-resource install --size 128 libprs500-gui.png libprs500-gui', shell=True) - check_call('xdg-icon-resource install --size 128 libprs500-gui.png libprs500-gui', shell=True) + check_call('xdg-icon-resource install --size 128 libprs500-viewer.png libprs500-viewer', shell=True) f = open('libprs500-lrfviewer.desktop', 'wb') f.write(VIEWER) f.close()