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 from __future__ import division
_TRY_PYSIDE = True _TRY_PYSIDE = True
uses_pyside = False
try: try:
if not _TRY_PYSIDE: if not _TRY_PYSIDE:
raise ImportError() raise ImportError()
import PySide.QtCore as _QtCore import PySide.QtCore as _QtCore
QtCore = _QtCore QtCore = _QtCore
USES_PYSIDE = True uses_pyside = True
except ImportError: except ImportError:
import sip import sip
sip.setapi('QString', 2) sip.setapi('QString', 2)
sip.setapi('QVariant', 2) sip.setapi('QVariant', 2)
import PyQt4.QtCore as _QtCore import PyQt4.QtCore as _QtCore
QtCore = _QtCore QtCore = _QtCore
USES_PYSIDE = False uses_pyside = False
def _pyside_import_module(moduleName): def _pyside_import_module(moduleName):
@ -35,7 +36,7 @@ def _pyqt4_import_module(moduleName):
return getattr(pyside, moduleName) return getattr(pyside, moduleName)
if USES_PYSIDE: if uses_pyside:
import_module = _pyside_import_module import_module = _pyside_import_module
Signal = QtCore.Signal Signal = QtCore.Signal

View file

@ -190,6 +190,8 @@ class MainWindow(QtGui.QMainWindow):
messages = ['<b>%s</b> %s' % (NAME, VERSION), messages = ['<b>%s</b> %s' % (NAME, VERSION),
'&copy; 2011-2013 %s &lt;<a href="mailto:%s">%s</a>&gt;' % (AUTHOR, AUTHOR_MAIL, AUTHOR_MAIL), '&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), 'WeeChat site: <a href="%s">%s</a>' % (WEECHAT_SITE, WEECHAT_SITE),
''] '']
self.about_dialog = AboutDialog(NAME, messages, self) self.about_dialog = AboutDialog(NAME, messages, self)