Display toolkit used in About dialog (PySide or PyQt4)

This commit is contained in:
Sebastien Helleu 2013-01-07 13:41:41 +01:00
parent e17d5dc07d
commit b51e6ba7d7
2 changed files with 6 additions and 3 deletions

View File

@ -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

View File

@ -190,6 +190,8 @@ class MainWindow(QtGui.QMainWindow):
messages = ['<b>%s</b> %s' % (NAME, VERSION),
'&copy; 2011-2013 %s &lt;<a href="mailto:%s">%s</a>&gt;' % (AUTHOR, AUTHOR_MAIL, AUTHOR_MAIL),
'',
'Running with %s' % ('PySide' if qt_compat.uses_pyside else 'PyQt4'),
'',
'WeeChat site: <a href="%s">%s</a>' % (WEECHAT_SITE, WEECHAT_SITE),
'']
self.about_dialog = AboutDialog(NAME, messages, self)