From 790a10e31748bb22e6bf7bc5dde72dcbb2dca510 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Fri, 26 Jun 2009 05:29:48 +0000 Subject: [PATCH] Fix #535 fix saving column widths --- deluge/ui/gtkui/gtkui.py | 6 ++++++ deluge/ui/gtkui/listview.py | 6 +----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/deluge/ui/gtkui/gtkui.py b/deluge/ui/gtkui/gtkui.py index af4b463ca..b0b8b88b3 100644 --- a/deluge/ui/gtkui/gtkui.py +++ b/deluge/ui/gtkui/gtkui.py @@ -215,6 +215,12 @@ class GtkUI: def shutdown(self, *args, **kwargs): log.debug("gtkui shutting down..") + component.stop() + + # Process any pending gtk events since the mainloop has been quit + while gtk.events_pending(): + gtk.main_iteration(False) + # Shutdown all components component.shutdown() if self.started_in_classic: diff --git a/deluge/ui/gtkui/listview.py b/deluge/ui/gtkui/listview.py index 566c72d60..363a2466a 100644 --- a/deluge/ui/gtkui/listview.py +++ b/deluge/ui/gtkui/listview.py @@ -200,9 +200,7 @@ class ListView: state = [] # Get the list of TreeViewColumns from the TreeView - treeview_columns = self.treeview.get_columns() - counter = 0 - for column in treeview_columns: + for counter, column in enumerate(self.treeview.get_columns()): sort = None id, order = self.model_filter.get_sort_column_id() if self.get_column_name(id) == column.get_title(): @@ -211,8 +209,6 @@ class ListView: state.append(ListViewColumnState(column.get_title(), counter, column.get_width(), column.get_visible(), sort, int(column.get_sort_order()))) - # Increase the counter because this is how we determine position - counter += 1 # Get the config location for saving the state file config_location = deluge.configmanager.get_config_dir()