[GTKUI] Fix column sort state not saved in Thinclient mode
* In torrentview.stop the listview is cleared however this meant in thinclient mode that listview sort details are empty and overwrites existing data when save_state is then called in torrentview.shutdown.
This commit is contained in:
parent
a727ee67bc
commit
3668e77a75
|
@ -364,7 +364,6 @@ class TorrentView(ListView, component.Component):
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
"""Stops the torrentview"""
|
"""Stops the torrentview"""
|
||||||
# We need to clear the liststore
|
|
||||||
client.deregister_event_handler('TorrentStateChangedEvent', self.on_torrentstatechanged_event)
|
client.deregister_event_handler('TorrentStateChangedEvent', self.on_torrentstatechanged_event)
|
||||||
client.deregister_event_handler('TorrentAddedEvent', self.on_torrentadded_event)
|
client.deregister_event_handler('TorrentAddedEvent', self.on_torrentadded_event)
|
||||||
client.deregister_event_handler('TorrentRemovedEvent', self.on_torrentremoved_event)
|
client.deregister_event_handler('TorrentRemovedEvent', self.on_torrentremoved_event)
|
||||||
|
@ -374,6 +373,10 @@ class TorrentView(ListView, component.Component):
|
||||||
|
|
||||||
if self.treeview.get_selection():
|
if self.treeview.get_selection():
|
||||||
self.treeview.get_selection().unselect_all()
|
self.treeview.get_selection().unselect_all()
|
||||||
|
|
||||||
|
# Save column state before clearing liststore
|
||||||
|
# so column sort details are correctly saved.
|
||||||
|
self.save_state()
|
||||||
self.liststore.clear()
|
self.liststore.clear()
|
||||||
self.prev_status = {}
|
self.prev_status = {}
|
||||||
self.filter = None
|
self.filter = None
|
||||||
|
@ -381,7 +384,7 @@ class TorrentView(ListView, component.Component):
|
||||||
|
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
"""Called when GtkUi is exiting"""
|
"""Called when GtkUi is exiting"""
|
||||||
self.save_state()
|
pass
|
||||||
|
|
||||||
def save_state(self):
|
def save_state(self):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue