diff options
author | 2011-07-29 20:36:49 +0000 | |
---|---|---|
committer | 2011-07-29 20:36:49 +0000 | |
commit | 0d22a93cf263497c7f72558e0def607e20162cd1 (patch) | |
tree | 2e45f5dcda4ea5d037dfc862af8775acc69312a5 | |
parent | iw/makeconf_gui.py: os.env is actually os.environ (diff) | |
download | anaconda-0d22a93cf263497c7f72558e0def607e20162cd1.tar.gz anaconda-0d22a93cf263497c7f72558e0def607e20162cd1.tar.bz2 anaconda-0d22a93cf263497c7f72558e0def607e20162cd1.zip |
iw/mirrorselect_gui.py: change table into tree
-rw-r--r-- | iw/mirrorselect_gui.py | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/iw/mirrorselect_gui.py b/iw/mirrorselect_gui.py index daf50a7..35462a8 100644 --- a/iw/mirrorselect_gui.py +++ b/iw/mirrorselect_gui.py @@ -23,6 +23,7 @@ import gtk import gtk.glade import gtk.gdk import gobject +import pygtk import pango import sys import gui @@ -66,41 +67,35 @@ class MirrorselectWindow(InstallWindow): mirrors_parsed = self.parseMirrors(mirrorsf) self.mirrors = self.mirrorList(mirrors_parsed, "http+ftp") - - self.table = self.xml.get_widget("mirrors_table") - self.addMirrors(self.table, self.mirrors, mirrors_parsed) + self.addMirrors(self.mirrors, mirrors_parsed) return self.align - def addMirrors(self, table, mirror_list, mirror_data): + def addMirrors(self, mirror_list, mirror_data): (regions, countries, mirrors) = mirror_list + self.treestore = gtk.TreeStore(gtk.CheckButton, str, str, str) for region in regions: + region_ts = self.treestore.append(None, [region]) for country in countries[region]: + country_ts = self.treestore.append(region_ts, [country]) for mirror in mirrors[country]: - self.addMirrorRow(table, 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) + treeview.append_column(_("Mirror URL")) + treeview.append_column(_("Mirror Name")) + treeview.append_column("IPv4?") + treeview.append_column("IPv6?") - def addMirrorRow(self, table, region, country, mirror, data): - cols = table.get_property("n-columns") - rows = table.get_property("n-rows") - table.resize(rows+1, cols) - + def addMirrorRow(self, ts, country_ts, region, country, mirror, data): cb = gtk.CheckButton(label=data["url"], use_underline=False) - name = gtk.Label("%s: %s\n%s" % (region, country, mirror)) - name.set_alignment(0, 0) - flags_text = data["proto"] if data["ipv4"] == "y": - flags_text += " ipv4" + ipv4 += " ipv4" if data["ipv6"] == "y": - flags_text += " ipv6" - flags = gtk.Label(flags_text) - flags.set_alignment(0, 0) + ipv6 += " ipv6" - table.attach(cb, 0, 1, rows, rows+1, gtk.FILL) - table.attach(name, 1, 2, rows, rows+1) - table.attach(flags, 2, 3, rows, rows+1) - self.buttons.append(cb) + ts.append([cb, mirror, ipv4, ipv6]) def downloadMirrorlist(self): try: |