Print nicer message when Qt xkb plugin is missing

This commit is contained in:
Florian Bruhin 2014-06-10 23:11:17 +02:00
parent 6e4f903a96
commit 583546f067
2 changed files with 12 additions and 2 deletions

2
TODO
View File

@ -39,8 +39,6 @@ New big features
Improvements / minor features Improvements / minor features
============================= =============================
- Print some meaningful message (via qInstallMsgHandler) when platform plugins
are missing, especially with xcb (on Arch: libxkbcommon-x11)
- Reimplement tabbar to paint it by ourselves to look like dwb - Reimplement tabbar to paint it by ourselves to look like dwb
- Save cookies in Netscape format so it can be used by wget. (see notes) - Save cookies in Netscape format so it can be used by wget. (see notes)
- Zoom with ctrl + mousewheel - Zoom with ctrl + mousewheel

View File

@ -192,6 +192,18 @@ def qt_message_handler(msg_type, context, msg):
else: else:
func = context.function func = context.function
name = 'qt' if context.category == 'default' else 'qt-' + context.category name = 'qt' if context.category == 'default' else 'qt-' + context.category
if msg.splitlines()[0] == ('This application failed to start because it '
'could not find or load the Qt platform plugin '
'"xcb".'):
# Handle this message specially.
msg += ("\n\nOn Archlinux, this should fix the problem:\n"
" pacman -S libxkbcommon-x11")
try:
import faulthandler
except ImportError:
pass
else:
faulthandler.disable()
record = qt.makeRecord(name, level, context.file, context.line, msg, None, record = qt.makeRecord(name, level, context.file, context.line, msg, None,
None, func) None, func)
qt.handle(record) qt.handle(record)