Fix #1371321 [HTML Paragraph Tag Shown In Bottom Status Bar](https://bugs.launchpad.net/calibre/+bug/1371321)

This commit is contained in:
Kovid Goyal 2014-09-19 08:36:30 +05:30
parent eff70b081a
commit 015bc98066

View File

@ -5,14 +5,14 @@ __license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>' __copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en' __docformat__ = 'restructuredtext en'
import textwrap import textwrap, re
from functools import partial from functools import partial
from collections import OrderedDict from collections import OrderedDict
from PyQt5.Qt import (QMainWindow, Qt, QIcon, QStatusBar, QFont, QWidget, from PyQt5.Qt import (QMainWindow, Qt, QIcon, QStatusBar, QFont, QWidget,
QScrollArea, QStackedWidget, QVBoxLayout, QLabel, QFrame, QKeySequence, QScrollArea, QStackedWidget, QVBoxLayout, QLabel, QFrame, QKeySequence,
QToolBar, QSize, pyqtSignal, QPixmap, QToolButton, QAction, QToolBar, QSize, pyqtSignal, QPixmap, QToolButton, QAction,
QDialogButtonBox, QHBoxLayout) QDialogButtonBox, QHBoxLayout, QStatusTipEvent)
from calibre.constants import __appname__, __version__, islinux from calibre.constants import __appname__, __version__, islinux
from calibre.gui2 import (gprefs, min_available_height, available_width, from calibre.gui2 import (gprefs, min_available_height, available_width,
@ -258,6 +258,12 @@ class Preferences(QMainWindow):
if plugin is not None: if plugin is not None:
self.show_plugin(plugin) self.show_plugin(plugin)
def event(self, ev):
if ev.type() == ev.StatusTip:
msg = re.sub(r'</?[a-z1-6]+>', ' ', ev.tip())
ev = QStatusTipEvent(msg)
return QMainWindow.event(self, ev)
def run_wizard(self): def run_wizard(self):
self.close() self.close()
self.run_wizard_requested.emit() self.run_wizard_requested.emit()