diff options
Diffstat (limited to 'iw/mirrorselect_gui.py')
-rw-r--r-- | iw/mirrorselect_gui.py | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/iw/mirrorselect_gui.py b/iw/mirrorselect_gui.py index 64d536f..b5f2764 100644 --- a/iw/mirrorselect_gui.py +++ b/iw/mirrorselect_gui.py @@ -76,13 +76,13 @@ class MirrorselectWindow(InstallWindow): def addMirrors(self, mirror_list, mirror_data, xml): (regions, countries, mirrors) = mirror_list - self.treestore = gtk.TreeStore(gtk.Widget, str, str, str) + self.treestore = gtk.TreeStore(bool, str, str, str, str) for region in regions: - region_ts = self.treestore.append(None, [gtk.Label(region), "", "", ""]) + region_ts = self.treestore.append(False, [region, "", "", ""]) for country in countries[region]: - country_ts = self.treestore.append(region_ts, [gtk.Label(country), "", "", ""]) + country_ts = self.treestore.append(region_ts, [country, "", "", ""]) for mirror in mirrors[country]: - cb = self.addMirrorRow(self.treestore, country_ts, region, country, mirror, mirror_data[region][country][mirror], ) + self.addMirrorRow(self.treestore, country_ts, region, country, mirror, mirror_data[region][country][mirror]) treeview = gtk.TreeView(self.treestore) url_column = gtk.TreeViewColumn(_("Mirror URL")) treeview.append_column(url_column) @@ -98,24 +98,19 @@ class MirrorselectWindow(InstallWindow): 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) + url_column.add_attribute(url_cell, "active", 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) - url_cell.connect("toggled", self.toggleCB, cb) + url_cell.connect("toggled", self.toggleCB, self.treestore) xml.get_widget("mirrors_viewport").add(treeview) - def toggleCB(self, cb): - if cb.get_active() == True: - cb.set_active(False) - else: - cb.set_active(True) + def toggleCB(self, widget, path, model): + model[path][0] = not model[path][0] def addMirrorRow(self, ts, country_ts, region, country, mirror, data): - cb = gtk.CheckButton(label=data["url"], use_underline=False) - ipv4 = "" ipv6 = "" if data["ipv4"] == "y": @@ -123,9 +118,7 @@ class MirrorselectWindow(InstallWindow): if data["ipv6"] == "y": ipv6 = " ipv6" - ts.append(country_ts, [cb, mirror, ipv4, ipv6]) - return cb - + ts.append(country_ts, [False, mirror, ipv4, ipv6]) def downloadMirrorlist(self): try: |