From 935777fb490ebbb35acf58693152f6adf64d99f4 Mon Sep 17 00:00:00 2001 From: Asmageddon Date: Tue, 29 May 2012 20:51:28 +0200 Subject: [PATCH] Fixed resize causing crashes and/or improper resize of AllTorrents view --- deluge/ui/console/modes/alltorrents.py | 9 ++++++--- deluge/ui/console/modes/legacy.py | 8 ++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/deluge/ui/console/modes/alltorrents.py b/deluge/ui/console/modes/alltorrents.py index 6804c7811..b4a705f7a 100644 --- a/deluge/ui/console/modes/alltorrents.py +++ b/deluge/ui/console/modes/alltorrents.py @@ -473,11 +473,14 @@ class AllTorrents(BaseMode, component.Component): def on_resize(self, *args): BaseMode.on_resize_norefresh(self, *args) - self.__update_columns() - self.__split_help() if self.popup: self.popup.handle_resize() - self.refresh() + + self.update() + self.__update_columns() + self.__split_help() + + self.refresh([]) def _queue_sort(self, v1, v2): if v1 == v2: diff --git a/deluge/ui/console/modes/legacy.py b/deluge/ui/console/modes/legacy.py index 4d1bdd651..b6126fbf7 100644 --- a/deluge/ui/console/modes/legacy.py +++ b/deluge/ui/console/modes/legacy.py @@ -316,7 +316,15 @@ class Legacy(BaseMode, component.Component): pass self.stdscr.refresh() + def on_resize(self, *args): + BaseMode.on_resize_norefresh(self, *args) + #We need to also refresh AllTorrents because otherwise it will + # be only us that get properly resized + all_torrents = component.get("AllTorrents") + all_torrents.on_resize(*args) + self.stdscr.erase() + self.refresh() def refresh(self): """