1 |
commit: 0d22a93cf263497c7f72558e0def607e20162cd1 |
2 |
Author: wiktor w brodlo <wiktor <AT> brodlo <DOT> net> |
3 |
AuthorDate: Fri Jul 29 20:36:49 2011 +0000 |
4 |
Commit: Wiktor W Brodlo <wiktor <AT> brodlo <DOT> net> |
5 |
CommitDate: Fri Jul 29 20:36:49 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/anaconda.git;a=commit;h=0d22a93c |
7 |
|
8 |
iw/mirrorselect_gui.py: change table into tree |
9 |
|
10 |
--- |
11 |
iw/mirrorselect_gui.py | 37 ++++++++++++++++--------------------- |
12 |
1 files changed, 16 insertions(+), 21 deletions(-) |
13 |
|
14 |
diff --git a/iw/mirrorselect_gui.py b/iw/mirrorselect_gui.py |
15 |
index daf50a7..35462a8 100644 |
16 |
--- a/iw/mirrorselect_gui.py |
17 |
+++ b/iw/mirrorselect_gui.py |
18 |
@@ -23,6 +23,7 @@ import gtk |
19 |
import gtk.glade |
20 |
import gtk.gdk |
21 |
import gobject |
22 |
+import pygtk |
23 |
import pango |
24 |
import sys |
25 |
import gui |
26 |
@@ -66,41 +67,35 @@ class MirrorselectWindow(InstallWindow): |
27 |
|
28 |
mirrors_parsed = self.parseMirrors(mirrorsf) |
29 |
self.mirrors = self.mirrorList(mirrors_parsed, "http+ftp") |
30 |
- |
31 |
- self.table = self.xml.get_widget("mirrors_table") |
32 |
|
33 |
- self.addMirrors(self.table, self.mirrors, mirrors_parsed) |
34 |
+ self.addMirrors(self.mirrors, mirrors_parsed) |
35 |
|
36 |
return self.align |
37 |
|
38 |
- def addMirrors(self, table, mirror_list, mirror_data): |
39 |
+ def addMirrors(self, mirror_list, mirror_data): |
40 |
(regions, countries, mirrors) = mirror_list |
41 |
+ self.treestore = gtk.TreeStore(gtk.CheckButton, str, str, str) |
42 |
for region in regions: |
43 |
+ region_ts = self.treestore.append(None, [region]) |
44 |
for country in countries[region]: |
45 |
+ country_ts = self.treestore.append(region_ts, [country]) |
46 |
for mirror in mirrors[country]: |
47 |
- self.addMirrorRow(table, region, country, mirror, mirror_data[region][country][mirror]) |
48 |
+ self.addMirrorRow(self.treestore, country_ts, region, country, mirror, mirror_data[region][country][mirror], ) |
49 |
+ treeview = gtk.TreeView(self.treestore) |
50 |
+ treeview.append_column(_("Mirror URL")) |
51 |
+ treeview.append_column(_("Mirror Name")) |
52 |
+ treeview.append_column("IPv4?") |
53 |
+ treeview.append_column("IPv6?") |
54 |
|
55 |
- def addMirrorRow(self, table, region, country, mirror, data): |
56 |
- cols = table.get_property("n-columns") |
57 |
- rows = table.get_property("n-rows") |
58 |
- table.resize(rows+1, cols) |
59 |
- |
60 |
+ def addMirrorRow(self, ts, country_ts, region, country, mirror, data): |
61 |
cb = gtk.CheckButton(label=data["url"], use_underline=False) |
62 |
- name = gtk.Label("%s: %s\n%s" % (region, country, mirror)) |
63 |
- name.set_alignment(0, 0) |
64 |
|
65 |
- flags_text = data["proto"] |
66 |
if data["ipv4"] == "y": |
67 |
- flags_text += " ipv4" |
68 |
+ ipv4 += " ipv4" |
69 |
if data["ipv6"] == "y": |
70 |
- flags_text += " ipv6" |
71 |
- flags = gtk.Label(flags_text) |
72 |
- flags.set_alignment(0, 0) |
73 |
+ ipv6 += " ipv6" |
74 |
|
75 |
- table.attach(cb, 0, 1, rows, rows+1, gtk.FILL) |
76 |
- table.attach(name, 1, 2, rows, rows+1) |
77 |
- table.attach(flags, 2, 3, rows, rows+1) |
78 |
- self.buttons.append(cb) |
79 |
+ ts.append([cb, mirror, ipv4, ipv6]) |
80 |
|
81 |
def downloadMirrorlist(self): |
82 |
try: |