From 37c0a1e34298fb64ba7043a4c0fc0f17309f1df5 Mon Sep 17 00:00:00 2001 From: wiktor w brodlo Date: Mon, 1 Aug 2011 01:24:16 +0000 Subject: iw/mirrorselect_gui.py: rework the treeview render slightly --- iw/mirrorselect_gui.py | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/iw/mirrorselect_gui.py b/iw/mirrorselect_gui.py index 57ebf1b..e5a2b13 100644 --- a/iw/mirrorselect_gui.py +++ b/iw/mirrorselect_gui.py @@ -82,10 +82,27 @@ class MirrorselectWindow(InstallWindow): for mirror in mirrors[country]: self.addMirrorRow(self.treestore, country_ts, region, country, mirror, mirror_data[region][country][mirror], ) treeview = gtk.TreeView(self.treestore) - treeview.append_column(gtk.TreeViewColumn(_("Mirror URL"))) - treeview.append_column(gtk.TreeViewColumn(_("Mirror Name"))) - treeview.append_column(gtk.TreeViewColumn("IPv4?")) - treeview.append_column(gtk.TreeViewColumn("IPv6?")) + url_column = gtk.TreeViewColumn(_("Mirror URL")) + treeview.append_column(url_column) + name_column = gtk.TreeViewColumn(_("Mirror Name")) + treeview.append_column(name_column) + ipv4_column = gtk.TreeViewColumn("IPv4?") + treeview.append_column(ipv4_column) + ipv6_column = gtk.TreeViewColumn("IPv6?") + treeview.append_column(ipv6_column) + url_cell = gtk.CellRendererToggle() + text_cell = gtk.CellRendererText() + url_column.pack_start(url_cell, True) + name_column.pack_start(text_cell, True) + ipv4_column.pack_start(text_cell, True) + ipv6_column.pack_start(text_cell, True) + url_column.add_attribute(url_cell, "activatable", 0) + name_column.add_attribute(text_cell, "text", 1) + ipv4_column.add_attribute(text_cell, "text", 2) + ipv6_column.add_attribute(text_cell, "text", 3) + treeview.set_search_column(1) + treeview.set_sort_column_id(0) + self.xml.get_widget("mirrors_viewport").add(treeview) -- cgit v1.2.3-65-gdbad