1 |
commit: d098ced2c10103fac6e71bb7a2704326d785a51e |
2 |
Author: wiktor w brodlo <wiktor <AT> brodlo <DOT> net> |
3 |
AuthorDate: Sun Jul 3 19:18:40 2011 +0000 |
4 |
Commit: Wiktor W Brodlo <wiktor <AT> brodlo <DOT> net> |
5 |
CommitDate: Sun Jul 3 19:18:40 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/anaconda.git;a=commit;h=d098ced2 |
7 |
|
8 |
mirrorselect-sync |
9 |
|
10 |
--- |
11 |
dispatch.py | 2 +- |
12 |
gui.py | 2 +- |
13 |
installclass.py | 1 + |
14 |
iw/mirrorselect-sync_gui.py | 70 +++++++++++++++++++++++++++++++++++++++++++ |
15 |
4 files changed, 73 insertions(+), 2 deletions(-) |
16 |
|
17 |
diff --git a/dispatch.py b/dispatch.py |
18 |
index 073dc2c..4ade775 100644 |
19 |
--- a/dispatch.py |
20 |
+++ b/dispatch.py |
21 |
@@ -97,7 +97,7 @@ installSteps = [ |
22 |
|
23 |
# Installing the Gentoo Base System |
24 |
("mirrorselect", ), |
25 |
- #("mirrorselect-sync", ), |
26 |
+ ("mirrorselect-sync", ), |
27 |
# profile |
28 |
# use |
29 |
|
30 |
|
31 |
diff --git a/gui.py b/gui.py |
32 |
index addce82..41f127c 100755 |
33 |
--- a/gui.py |
34 |
+++ b/gui.py |
35 |
@@ -81,7 +81,7 @@ stepToClass = { |
36 |
|
37 |
# Installing the Gentoo Base System |
38 |
"mirrorselect": ("mirrorselect_gui", "MirrorselectWindow"), |
39 |
- #("mirrorselect-sync", ), |
40 |
+ "mirrorselect-sync": ("mirrorselect-sync_gui", "MirrorselectSyncWindow"), |
41 |
|
42 |
# Configuring the Kernel |
43 |
"timezone" : ("timezone_gui", "TimezoneWindow"), |
44 |
|
45 |
diff --git a/installclass.py b/installclass.py |
46 |
index 561ccdf..28104d8 100644 |
47 |
--- a/installclass.py |
48 |
+++ b/installclass.py |
49 |
@@ -104,6 +104,7 @@ class BaseInstallClass(object): |
50 |
|
51 |
# Installing the Gentoo Base System |
52 |
"mirrorselect", |
53 |
+ "mirrorselect-sync", |
54 |
|
55 |
# Configuring the Kernel |
56 |
"timezone", |
57 |
|
58 |
diff --git a/iw/mirrorselect-sync_gui.py b/iw/mirrorselect-sync_gui.py |
59 |
new file mode 100644 |
60 |
index 0000000..17d84ec |
61 |
--- /dev/null |
62 |
+++ b/iw/mirrorselect-sync_gui.py |
63 |
@@ -0,0 +1,70 @@ |
64 |
+# |
65 |
+# mirrorselect-sync_gui.py: gui mirrorselect. |
66 |
+# |
67 |
+# Copyright (C) 2011 wiktor w brodlo |
68 |
+# Copyright (C) 2011 Gentoo Foundation |
69 |
+# |
70 |
+# This program is free software; you can redistribute it and/or modify |
71 |
+# it under the terms of the GNU General Public License as published by |
72 |
+# the Free Software Foundation; either version 2 of the License, or |
73 |
+# (at your option) any later version. |
74 |
+# |
75 |
+# This program is distributed in the hope that it will be useful, |
76 |
+# but WITHOUT ANY WARRANTY; without even the implied warranty of |
77 |
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
78 |
+# GNU General Public License for more details. |
79 |
+# |
80 |
+# You should have received a copy of the GNU General Public License |
81 |
+# along with this program. If not, see <http://www.gnu.org/licenses/>. |
82 |
+# |
83 |
+ |
84 |
+import string |
85 |
+import gtk |
86 |
+import gtk.glade |
87 |
+import gtk.gdk |
88 |
+import gobject |
89 |
+import pango |
90 |
+import sys |
91 |
+import gui |
92 |
+import os |
93 |
+from mirrorselect_gui import MirrorselectWindow |
94 |
+ |
95 |
+from iw_gui import * |
96 |
+ |
97 |
+from constants import * |
98 |
+import gettext |
99 |
+_ = lambda x: gettext.ldgettext("anaconda", x) |
100 |
+ |
101 |
+class MirrorselectSyncWindow(InstallWindow): |
102 |
+ def getNext(self): |
103 |
+ return None |
104 |
+ |
105 |
+ def getScreen(self, anaconda): |
106 |
+ self.anaconda = anaconda |
107 |
+ self.intf = anaconda.intf |
108 |
+ ms = MirrorselectWindow() |
109 |
+ |
110 |
+ (self.xml, self.align) = gui.getGladeWidget("mirrorselect.glade", "mirrorselect_align") |
111 |
+ |
112 |
+ mirrorsf = None |
113 |
+ |
114 |
+ while mirrorsf == None: |
115 |
+ # Try downloading the mirrorlist |
116 |
+ mirrorsf = ms.downloadMirrorlist() |
117 |
+ # if failed, |
118 |
+ if mirrorsf == None: |
119 |
+ md = gtk.MessageDialog(buttons=gtk.BUTTONS_YES_NO) |
120 |
+ md.set_property("title", _("Failed to download mirrorlist")) |
121 |
+ md.set_property("text", _("Failed to download the mirror list. Would you like to try again?\nPressing 'No' will abort the installation.")) |
122 |
+ if md.run() == gtk.RESPONSE_NO: |
123 |
+ md.destroy() |
124 |
+ InstallControlWindow._doExit([]) |
125 |
+ |
126 |
+ mirrors_parsed = ms.parseMirrors(mirrorsf) |
127 |
+ self.mirrors = ms.mirrorList(mirrors_parsed, "rsync") |
128 |
+ |
129 |
+ self.table = self.xml.get_widget("mirrors_table") |
130 |
+ |
131 |
+ ms.addMirrors(self.table, self.mirrors, mirrors_parsed) |
132 |
+ |
133 |
+ return self.align |