Clean up esc pressing in statusbar

This commit is contained in:
Florian Bruhin 2014-01-19 20:20:35 +01:00
parent 90cbf5362f
commit a6aa95cba8
2 changed files with 3 additions and 2 deletions

View File

@ -25,6 +25,7 @@ class MainWindow(QMainWindow):
self.tabs.cur_progress.connect(self.status.prog.set_progress)
self.tabs.cur_load_finished.connect(self.status.prog.load_finished)
self.status.cmd.esc_pressed.connect(self.tabs.setFocus)
#self.retranslateUi(MainWindow)
#self.tabWidget.setCurrentIndex(0)

View File

@ -106,6 +106,7 @@ class StatusText(QLabel):
class StatusCommand(QLineEdit):
got_cmd = pyqtSignal(str)
parent = None
esc_pressed = pyqtSignal()
def __init__(self, parent):
super().__init__(parent)
@ -118,8 +119,7 @@ class StatusCommand(QLineEdit):
self.esc = QShortcut(self)
self.esc.setKey(QKeySequence(Qt.Key_Escape))
self.esc.setContext(Qt.WidgetWithChildrenShortcut)
# FIXME this is fugly and doesn't clear the keystring
self.esc.activated.connect(parent.parent.tabs.setFocus)
self.esc.activated.connect(self.esc_pressed)
def process_cmd(self):
text = self.text().lstrip(':')