From b51e6ba7d737a423e1d85e91f7ec1c7a4a15d2ce Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Mon, 7 Jan 2013 13:41:41 +0100 Subject: [PATCH] Display toolkit used in About dialog (PySide or PyQt4) --- src/qweechat/qt_compat.py | 7 ++++--- src/qweechat/qweechat.py | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/qweechat/qt_compat.py b/src/qweechat/qt_compat.py index d59b5be..9f7b93b 100644 --- a/src/qweechat/qt_compat.py +++ b/src/qweechat/qt_compat.py @@ -9,20 +9,21 @@ from __future__ import with_statement from __future__ import division _TRY_PYSIDE = True +uses_pyside = False try: if not _TRY_PYSIDE: raise ImportError() import PySide.QtCore as _QtCore QtCore = _QtCore - USES_PYSIDE = True + uses_pyside = True except ImportError: import sip sip.setapi('QString', 2) sip.setapi('QVariant', 2) import PyQt4.QtCore as _QtCore QtCore = _QtCore - USES_PYSIDE = False + uses_pyside = False def _pyside_import_module(moduleName): @@ -35,7 +36,7 @@ def _pyqt4_import_module(moduleName): return getattr(pyside, moduleName) -if USES_PYSIDE: +if uses_pyside: import_module = _pyside_import_module Signal = QtCore.Signal diff --git a/src/qweechat/qweechat.py b/src/qweechat/qweechat.py index 6c4e5fa..55bd70b 100755 --- a/src/qweechat/qweechat.py +++ b/src/qweechat/qweechat.py @@ -190,6 +190,8 @@ class MainWindow(QtGui.QMainWindow): messages = ['%s %s' % (NAME, VERSION), '© 2011-2013 %s <%s>' % (AUTHOR, AUTHOR_MAIL, AUTHOR_MAIL), '', + 'Running with %s' % ('PySide' if qt_compat.uses_pyside else 'PyQt4'), + '', 'WeeChat site: %s' % (WEECHAT_SITE, WEECHAT_SITE), ''] self.about_dialog = AboutDialog(NAME, messages, self)