[GTKUI] Fix treeview columns not saving

This commit is contained in:
Calum Lind 2015-11-30 22:49:42 +00:00
parent eaae568c7c
commit 550ddc0109
2 changed files with 7 additions and 4 deletions

View File

@ -263,6 +263,8 @@ class GtkUI(object):
def pre_shutdown(self, *args, **kwargs):
"""Modal dialogs can prevent the application exiting so destroy mainwindow"""
# Ensure columns state is saved
self.torrentview.save_state()
self.mainwindow.window.destroy()
def print_rpc_stats(self):

View File

@ -358,18 +358,19 @@ class TorrentView(ListView, component.Component):
def shutdown(self):
"""Called when GtkUi is exiting"""
if self.window.visible():
self.save_state()
def save_state(self):
"""
Saves the state of the torrent view.
"""
if self.window.visible():
ListView.save_state(self, "torrentview.state")
def remove_column(self, header):
"""Removes the column with the name 'header' from the torrentview"""
self.save_state()
if self.window.visible():
ListView.remove_column(self, header)
def set_filter(self, filter_dict):