Display toolkit used in About dialog (PySide or PyQt4)
This commit is contained in:
parent
e17d5dc07d
commit
b51e6ba7d7
2 changed files with 6 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -190,6 +190,8 @@ class MainWindow(QtGui.QMainWindow):
|
|||
messages = ['<b>%s</b> %s' % (NAME, VERSION),
|
||||
'© 2011-2013 %s <<a href="mailto:%s">%s</a>>' % (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)
|
||||
|
|
Loading…
Reference in a new issue