From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Qn0kw-00008F-9C for garchives@archives.gentoo.org; Sat, 30 Jul 2011 04:02:30 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BBA8C21C154 for ; Sat, 30 Jul 2011 04:02:29 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 9A3E721C04D for ; Sat, 30 Jul 2011 03:16:19 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0446E1B401D for ; Sat, 30 Jul 2011 03:16:19 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 147E18003D for ; Sat, 30 Jul 2011 03:16:18 +0000 (UTC) From: "Wiktor W Brodlo" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Wiktor W Brodlo" Message-ID: <0d22a93cf263497c7f72558e0def607e20162cd1.wiktor@gentoo> Subject: [gentoo-commits] proj/anaconda:master commit in: iw/ X-VCS-Repository: proj/anaconda X-VCS-Files: iw/mirrorselect_gui.py X-VCS-Directories: iw/ X-VCS-Committer: wiktor X-VCS-Committer-Name: Wiktor W Brodlo X-VCS-Revision: 0d22a93cf263497c7f72558e0def607e20162cd1 Date: Sat, 30 Jul 2011 03:16:18 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: fbfe75f597be0452658fb44b9c110f62 commit: 0d22a93cf263497c7f72558e0def607e20162cd1 Author: wiktor w brodlo brodlo net> AuthorDate: Fri Jul 29 20:36:49 2011 +0000 Commit: Wiktor W Brodlo brodlo net> CommitDate: Fri Jul 29 20:36:49 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/anaconda.git;= a=3Dcommit;h=3D0d22a93c iw/mirrorselect_gui.py: change table into tree --- 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): =09 mirrors_parsed =3D self.parseMirrors(mirrorsf) self.mirrors =3D self.mirrorList(mirrors_parsed, "http+ftp") -=09 - self.table =3D self.xml.get_widget("mirrors_table") =09 - self.addMirrors(self.table, self.mirrors, mirrors_parsed) + self.addMirrors(self.mirrors, mirrors_parsed) =09 return self.align =09 - def addMirrors(self, table, mirror_list, mirror_data): + def addMirrors(self, mirror_list, mirror_data): (regions, countries, mirrors) =3D mirror_list + self.treestore =3D gtk.TreeStore(gtk.CheckButton, str, str, str) for region in regions: + region_ts =3D self.treestore.append(None, [region]) for country in countries[region]: + country_ts =3D self.treestore.append(region_ts, [country]) for mirror in mirrors[country]: - self.addMirrorRow(table, region, country, mirror, mirror_data[regio= n][country][mirror]) + self.addMirrorRow(self.treestore, country_ts, region, country, mirr= or, mirror_data[region][country][mirror], ) + treeview =3D gtk.TreeView(self.treestore) + treeview.append_column(_("Mirror URL")) + treeview.append_column(_("Mirror Name")) + treeview.append_column("IPv4?") + treeview.append_column("IPv6?") =09 - def addMirrorRow(self, table, region, country, mirror, data): - cols =3D table.get_property("n-columns") - rows =3D table.get_property("n-rows") - table.resize(rows+1, cols) - =09 + def addMirrorRow(self, ts, country_ts, region, country, mirror, data): cb =3D gtk.CheckButton(label=3Ddata["url"], use_underline=3DFalse) - name =3D gtk.Label("%s: %s\n%s" % (region, country, mirror)) - name.set_alignment(0, 0) =09 - flags_text =3D data["proto"] if data["ipv4"] =3D=3D "y": - flags_text +=3D " ipv4" + ipv4 +=3D " ipv4" if data["ipv6"] =3D=3D "y": - flags_text +=3D " ipv6" - flags =3D gtk.Label(flags_text) - flags.set_alignment(0, 0) + ipv6 +=3D " ipv6" =09 - 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]) =09 def downloadMirrorlist(self): try: