From 78c376a0b004e3be2691dc4f63834b1317784ddd Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Sun, 8 May 2016 00:47:10 +0300 Subject: [PATCH] bug with clearing history fixed, close to tray on esc --- src/main.py | 2 ++ src/mainscreen.py | 6 ++++++ src/profile.py | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 80cb018..f3c56cb 100644 --- a/src/main.py +++ b/src/main.py @@ -117,6 +117,8 @@ class Toxygen(object): if not self.ms.isActiveWindow(): self.ms.setWindowState(self.ms.windowState() & ~QtCore.Qt.WindowMinimized | QtCore.Qt.WindowActive) self.ms.activateWindow() + if self.ms.isHidden(): + self.ms.show() m.connect(show, QtCore.SIGNAL("triggered()"), show_window) m.connect(exit, QtCore.SIGNAL("triggered()"), lambda: app.exit()) diff --git a/src/mainscreen.py b/src/mainscreen.py index 57ce918..e7f7690 100644 --- a/src/mainscreen.py +++ b/src/mainscreen.py @@ -310,6 +310,12 @@ class MainWindow(QtGui.QMainWindow): self.account_status.setGeometry(QtCore.QRect(100, 50, self.width() - 520, 25)) self.profile.update() + def keyPressEvent(self, event): + if event.key() == QtCore.Qt.Key_Escape: + self.hide() + else: + super(MainWindow, self).keyPressEvent(event) + # ----------------------------------------------------------------------------------------------------------------- # Functions which called when user click in menu # ----------------------------------------------------------------------------------------------------------------- diff --git a/src/profile.py b/src/profile.py index a161aa6..89d97c3 100644 --- a/src/profile.py +++ b/src/profile.py @@ -207,7 +207,7 @@ class Friend(Contact): """ if hasattr(self, '_message_getter'): del self._message_getter - self._corr = filter(lambda x: x.get_type() == 2 and x.get_status() in (2, 4), self._corr) + self._corr = filter(lambda x: x.get_type() == 2 and x.get_status() in (2, 3, 4), self._corr) self._unsaved_messages = 0 def update_transfer_data(self, file_number, status, inline=None):