[GTKUI] Fix treeview columns not saving
This commit is contained in:
parent
eaae568c7c
commit
550ddc0109
|
@ -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):
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue