Get rid of unneeded text slots in statusbar
This commit is contained in:
parent
1e27f5537d
commit
e1b7305e40
@ -261,9 +261,8 @@ class QuteBrowser(QApplication):
|
|||||||
self._keyparsers["hint"].on_hint_strings_updated)
|
self._keyparsers["hint"].on_hint_strings_updated)
|
||||||
self.mainwindow.tabs.set_mode.connect(self.set_mode)
|
self.mainwindow.tabs.set_mode.connect(self.set_mode)
|
||||||
message.bridge.error.connect(self.mainwindow.status.disp_error)
|
message.bridge.error.connect(self.mainwindow.status.disp_error)
|
||||||
message.bridge.info.connect(self.mainwindow.status.disp_tmp_text)
|
message.bridge.info.connect(self.mainwindow.status.txt.set_temptext)
|
||||||
message.bridge.text.connect(self.mainwindow.status.disp_text)
|
message.bridge.text.connect(self.mainwindow.status.txt.set_normaltext)
|
||||||
message.bridge.clear.connect(self.mainwindow.status.clear_text)
|
|
||||||
self.config.style_changed.connect(style.invalidate_caches)
|
self.config.style_changed.connect(style.invalidate_caches)
|
||||||
self.config.changed.connect(self.mainwindow.tabs.on_config_changed)
|
self.config.changed.connect(self.mainwindow.tabs.on_config_changed)
|
||||||
self.config.changed.connect(
|
self.config.changed.connect(
|
||||||
|
@ -54,7 +54,7 @@ def text(message):
|
|||||||
|
|
||||||
def clear():
|
def clear():
|
||||||
"""Clear a persistent message in the statusbar."""
|
"""Clear a persistent message in the statusbar."""
|
||||||
bridge.clear.emit()
|
bridge.text.emit('')
|
||||||
|
|
||||||
|
|
||||||
class MessageBridge(QObject):
|
class MessageBridge(QObject):
|
||||||
@ -64,4 +64,3 @@ class MessageBridge(QObject):
|
|||||||
error = pyqtSignal(str)
|
error = pyqtSignal(str)
|
||||||
info = pyqtSignal(str)
|
info = pyqtSignal(str)
|
||||||
text = pyqtSignal(str)
|
text = pyqtSignal(str)
|
||||||
clear = pyqtSignal()
|
|
||||||
|
@ -156,34 +156,6 @@ class StatusBar(QWidget):
|
|||||||
self.error = False
|
self.error = False
|
||||||
self.txt.errortext = ''
|
self.txt.errortext = ''
|
||||||
|
|
||||||
@pyqtSlot(str)
|
|
||||||
def disp_tmp_text(self, text):
|
|
||||||
"""Display a temporary text.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
text: The text to display, or an empty string to clear.
|
|
||||||
"""
|
|
||||||
self.txt.temptext = text
|
|
||||||
|
|
||||||
@pyqtSlot()
|
|
||||||
def clear_tmp_text(self):
|
|
||||||
"""Clear a temporary text."""
|
|
||||||
self.disp_tmp_text('')
|
|
||||||
|
|
||||||
@pyqtSlot(str)
|
|
||||||
def disp_text(self, text):
|
|
||||||
"""Display a persistent text.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
text: The text to display, or an empty string to clear.
|
|
||||||
"""
|
|
||||||
self.txt.normaltext = text
|
|
||||||
|
|
||||||
@pyqtSlot()
|
|
||||||
def clear_text(self):
|
|
||||||
"""Clear a persistent text."""
|
|
||||||
self.disp_text('')
|
|
||||||
|
|
||||||
@pyqtSlot('QKeyEvent')
|
@pyqtSlot('QKeyEvent')
|
||||||
def keypress(self, e):
|
def keypress(self, e):
|
||||||
"""Hide temporary error message if a key was pressed.
|
"""Hide temporary error message if a key was pressed.
|
||||||
@ -194,7 +166,7 @@ class StatusBar(QWidget):
|
|||||||
if e.key() in [Qt.Key_Control, Qt.Key_Alt, Qt.Key_Shift, Qt.Key_Meta]:
|
if e.key() in [Qt.Key_Control, Qt.Key_Alt, Qt.Key_Shift, Qt.Key_Meta]:
|
||||||
# Only modifier pressed, don't hide yet.
|
# Only modifier pressed, don't hide yet.
|
||||||
return
|
return
|
||||||
self.clear_tmp_text()
|
self.txt.set_temptext('')
|
||||||
self.clear_error()
|
self.clear_error()
|
||||||
|
|
||||||
def resizeEvent(self, e):
|
def resizeEvent(self, e):
|
||||||
|
Loading…
Reference in New Issue
Block a user