Tweaks to the Peers plugin.
This commit is contained in:
parent
cdf3011c81
commit
ec1c5cf2c7
|
@ -117,8 +117,7 @@ class TorrentPeers:
|
|||
self.tab_peers.clear_flag_cache()
|
||||
self.tab_peers.set_flag_size("25x15")
|
||||
else:
|
||||
self.tab_peers.disable_flags()
|
||||
|
||||
self.tab_peers.disable_flags()
|
||||
|
||||
def toggle_ui(self, widget):
|
||||
if not self.dialog_initialize:
|
||||
|
@ -155,13 +154,10 @@ class TorrentPeers:
|
|||
|
||||
def ok_pressed(self, src):
|
||||
self.dialog.hide()
|
||||
if self.config.get("enable_flags") and not \
|
||||
self.glade.get_widget("chk_flags").get_active():
|
||||
self.tab_peers.clear_peer_store()
|
||||
self.tab_peers.rebuild_peer_view(self.top_widget)
|
||||
self.tab_peers.update_peer_store()
|
||||
self.config.set("enable_flags", self.glade.get_widget("chk_flags").get_active())
|
||||
self.config.set("size_18", self.glade.get_widget("radio_18").get_active())
|
||||
self.config.set("enable_flags",
|
||||
self.glade.get_widget("chk_flags").get_active())
|
||||
self.config.set("size_18",
|
||||
self.glade.get_widget("radio_18").get_active())
|
||||
self.update_config()
|
||||
|
||||
def cancel_pressed(self, src):
|
||||
|
|
|
@ -22,16 +22,10 @@ class PeersTabManager(object):
|
|||
def clear_peer_store(self):
|
||||
self.peer_store.clear()
|
||||
self.peer_store_dict = {}
|
||||
self.peer_unique_id = None
|
||||
|
||||
def set_unique_id(self, unique_id):
|
||||
self.peer_unique_id = unique_id
|
||||
|
||||
def rebuild_peers_view(self, top_widget):
|
||||
self.peer_view.destroy()
|
||||
self.peer_view = gtk.TreeView()
|
||||
top_widget.add(self.peer_view)
|
||||
|
||||
def build_peers_view(self):
|
||||
def percent(column, cell, model, iter, data):
|
||||
percent = float(model.get_value(iter, data))
|
||||
|
|
|
@ -132,6 +132,9 @@ def add_texticon_column(view, header, icon_col, text_col):
|
|||
column.set_expand(False)
|
||||
column.set_min_width(10)
|
||||
column.set_reorderable(True)
|
||||
# gtk.TREE_VIEW_COLUMN_AUTOSIZE is because of toggled flags in Peers tab
|
||||
# in IP Address column.
|
||||
column.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE)
|
||||
render = gtk.CellRendererPixbuf()
|
||||
column.pack_start(render, expand=False)
|
||||
column.add_attribute(render, 'pixbuf', icon_col)
|
||||
|
|
Loading…
Reference in New Issue