From e1b7305e40d68e920e3e0aeac560958f89f2a35b Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 22 Apr 2014 10:00:43 +0200 Subject: [PATCH] Get rid of unneeded text slots in statusbar --- qutebrowser/app.py | 5 ++--- qutebrowser/utils/message.py | 3 +-- qutebrowser/widgets/statusbar.py | 30 +----------------------------- 3 files changed, 4 insertions(+), 34 deletions(-) diff --git a/qutebrowser/app.py b/qutebrowser/app.py index 0eba74758..512413681 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -261,9 +261,8 @@ class QuteBrowser(QApplication): self._keyparsers["hint"].on_hint_strings_updated) self.mainwindow.tabs.set_mode.connect(self.set_mode) message.bridge.error.connect(self.mainwindow.status.disp_error) - message.bridge.info.connect(self.mainwindow.status.disp_tmp_text) - message.bridge.text.connect(self.mainwindow.status.disp_text) - message.bridge.clear.connect(self.mainwindow.status.clear_text) + message.bridge.info.connect(self.mainwindow.status.txt.set_temptext) + message.bridge.text.connect(self.mainwindow.status.txt.set_normaltext) self.config.style_changed.connect(style.invalidate_caches) self.config.changed.connect(self.mainwindow.tabs.on_config_changed) self.config.changed.connect( diff --git a/qutebrowser/utils/message.py b/qutebrowser/utils/message.py index caf947778..4157114a6 100644 --- a/qutebrowser/utils/message.py +++ b/qutebrowser/utils/message.py @@ -54,7 +54,7 @@ def text(message): def clear(): """Clear a persistent message in the statusbar.""" - bridge.clear.emit() + bridge.text.emit('') class MessageBridge(QObject): @@ -64,4 +64,3 @@ class MessageBridge(QObject): error = pyqtSignal(str) info = pyqtSignal(str) text = pyqtSignal(str) - clear = pyqtSignal() diff --git a/qutebrowser/widgets/statusbar.py b/qutebrowser/widgets/statusbar.py index 1759d9835..ac499e596 100644 --- a/qutebrowser/widgets/statusbar.py +++ b/qutebrowser/widgets/statusbar.py @@ -156,34 +156,6 @@ class StatusBar(QWidget): self.error = False 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') def keypress(self, e): """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]: # Only modifier pressed, don't hide yet. return - self.clear_tmp_text() + self.txt.set_temptext('') self.clear_error() def resizeEvent(self, e):