Display toolkit used in About dialog (PySide or PyQt4)
This commit is contained in:
parent
e17d5dc07d
commit
b51e6ba7d7
@ -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
|
||||||
|
@ -190,6 +190,8 @@ class MainWindow(QtGui.QMainWindow):
|
|||||||
messages = ['<b>%s</b> %s' % (NAME, VERSION),
|
messages = ['<b>%s</b> %s' % (NAME, VERSION),
|
||||||
'© 2011-2013 %s <<a href="mailto:%s">%s</a>>' % (AUTHOR, AUTHOR_MAIL, AUTHOR_MAIL),
|
'© 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),
|
'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)
|
||||||
|
Loading…
Reference in New Issue
Block a user