diff --git a/deluge/ui/gtkui/mainwindow.py b/deluge/ui/gtkui/mainwindow.py index 862e5684a..a5d51f6d2 100644 --- a/deluge/ui/gtkui/mainwindow.py +++ b/deluge/ui/gtkui/mainwindow.py @@ -120,6 +120,7 @@ class MainWindow(component.Component): def hide(self): component.pause("TorrentView") + component.get("TorrentView").save_state() component.pause("StatusBar") component.pause("TorrentDetails") # Store the x, y positions for when we restore the window diff --git a/deluge/ui/gtkui/torrentview.py b/deluge/ui/gtkui/torrentview.py index 89958330b..50569e3bb 100644 --- a/deluge/ui/gtkui/torrentview.py +++ b/deluge/ui/gtkui/torrentview.py @@ -253,8 +253,15 @@ class TorrentView(listview.ListView, component.Component): def shutdown(self): """Called when GtkUi is exiting""" - self.save_state("torrentview.state") + if self.window.visible(): + self.save_state() + def save_state(self): + """ + Saves the state of the torrent view. + """ + listview.ListView.save_state(self, "torrentview.state") + def set_filter(self, filter_dict): """Sets filters for the torrentview.. see: core.get_torrents_status