/[gli]/branches/overhaul/src/fe/gtk/Stage.py
Gentoo

Contents of /branches/overhaul/src/fe/gtk/Stage.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1649 - (show annotations) (download) (as text)
Wed Jan 24 04:50:51 2007 UTC (7 years, 6 months ago) by agaffney
File MIME type: text/x-python
File size: 5968 byte(s)
cosmetic changes
1 # Copyright 1999-2005 Gentoo Foundation
2 # This source code is distributed under the terms of version 2 of the GNU
3 # General Public License as published by the Free Software Foundation, a copy
4 # of which can be found in the main directory of this project.
5
6 import gtk
7 import GLIScreen
8 import GLIUtility
9 import URIBrowser
10 from ProgressDialog import *
11
12 class Panel(GLIScreen.GLIScreen):
13
14 title = "Stage Selection"
15 _helptext = """
16 <b><u>Stage Selection</u></b>
17
18 Installing from stage3 is the recommended (and only supported) method for Gentoo \
19 installations. It contains a complete base system and is already optimized for \
20 whatever architecture/processor specified in the filename. While Gentoo still \
21 offers stage1 and stage2 tarballs, the official installation method uses only \
22 the stage3 tarball.
23
24 The Livecd also provides many programs using GRP, which will package up the \
25 livecd files and install them as binaries. This is useful for getting large \
26 applications like gnome installed quickly. If doing a GRP install, the Dynamic \
27 stage3 is also recommended. Dynamic creates a stage3 tarball on the fly from \
28 the contents of the Livecd, and does not involve any downloading, but can be a \
29 bit slow.
30
31 <b>For those doing a networkless installation, you must select "Dynamic" and \
32 "GRP Install" from the Stage screen.</b> Otherwise select a stage and click \
33 the "..." to browse for a tarball location.
34
35 In the URI Browser, select the type (such as http) and then press the "..." next \
36 to Host to choose a mirror address. Once your host has been selected the path \
37 below should change automatically and you should be able to browse through the \
38 folders to find your stage tarball. The path to the tarballs is usually \
39 /releases/{architecture ex. x86}/current/stages/{sub-arch}/filename.tar.bz2 \
40 """
41
42 def __init__(self, controller):
43 GLIScreen.GLIScreen.__init__(self, controller)
44
45 vert = gtk.VBox(False, 0)
46 vert.set_border_width(10)
47
48 if self.controller.install_type == "networkless":
49 hbox = gtk.HBox(False, 0)
50 label = gtk.Label()
51 label.set_markup('<b>Your base system will be created from files on the LiveCD.</b>')
52 hbox.pack_start(label, expand=False, fill=False, padding=5)
53 vert.pack_start(hbox, expand=False, fill=False, padding=10)
54 else:
55 self.radio_fetchstage = gtk.RadioButton(None, "Fetch stage from internet")
56 self.radio_fetchstage.set_name("fetch")
57 self.radio_fetchstage.connect("toggled", self.stage_selected, "fetch")
58 hbox = gtk.HBox(False, 0)
59 hbox.pack_start(self.radio_fetchstage, expand=False, fill=False, padding=5)
60 vert.pack_start(hbox, expand=False, fill=False, padding=10)
61
62 hbox = gtk.HBox(False, 0)
63 hbox.pack_start(gtk.Label(" "), expand=False, fill=False, padding=30)
64 hbox.pack_start(gtk.Label("URI:"), expand=False, fill=False, padding=5)
65 self.entry_stage_tarball_uri = gtk.Entry()
66 self.entry_stage_tarball_uri.set_width_chars(50)
67 hbox.pack_start(self.entry_stage_tarball_uri, expand=False, fill=False, padding=0)
68 self.browse_uri = gtk.Button("Browse")
69 self.browse_uri.connect("clicked", self.browse_uri_clicked)
70 hbox.pack_start(self.browse_uri, expand=False, fill=False, padding=5)
71 vert.pack_start(hbox, expand=False, fill=False, padding=0)
72
73 self.radio_dynamicstage = gtk.RadioButton(self.radio_fetchstage, "Build stage from files on LiveCD")
74 self.radio_dynamicstage.set_name("dynamic")
75 self.radio_dynamicstage.connect("toggled", self.stage_selected, "dynamic")
76 hbox = gtk.HBox(False, 0)
77 hbox.pack_start(self.radio_dynamicstage, expand=False, fill=False, padding=5)
78 vert.pack_start(hbox, expand=False, fill=False, padding=40)
79
80 self.add_content(vert)
81
82 def browse_uri_clicked(self, widget):
83 uribrowser = URIBrowser.URIBrowser(self, self.entry_stage_tarball_uri)
84 uribrowser.run(self.entry_stage_tarball_uri.get_text())
85
86 def stage_selected(self, widget, data=None):
87 if data == "fetch":
88 self.entry_stage_tarball_uri.set_sensitive(True)
89 self.browse_uri.set_sensitive(True)
90 else:
91 self.entry_stage_tarball_uri.set_sensitive(False)
92 self.browse_uri.set_sensitive(False)
93
94 def activate(self):
95 self.controller.SHOW_BUTTON_BACK = False
96 self.controller.SHOW_BUTTON_FORWARD = True
97 self.entry_stage_tarball_uri.set_text(self.controller.install_profile.get_stage_tarball_uri())
98 # self.check_grp.set_active(self.controller.install_profile.get_grp_install())
99 # self.check_dynamic.set_active(self.controller.install_profile.get_dynamic_stage3())
100
101 def next(self):
102 if self.controller.install_type == "networkless":
103 self.controller.install_profile.set_install_stage(None, 3, None)
104 self.controller.install_profile.set_dynamic_stage3(None, True, None)
105 else:
106 if self.radio_fetchstage.get_active():
107 uri = self.entry_stage_tarball_uri.get_text().strip()
108 if not uri:
109 msgdlg = gtk.MessageDialog(parent=self.controller.window, type=gtk.MESSAGE_WARNING, buttons=gtk.BUTTONS_OK, message_format="You did not enter a stage tarball URI. You cannot continue until you set this value.")
110 resp = msgdlg.run()
111 msgdlg.destroy()
112 return
113 if not GLIUtility.validate_uri(uri):
114 msgdlg = gtk.MessageDialog(parent=self.controller.window, type=gtk.MESSAGE_WARNING, buttons=gtk.BUTTONS_OK, message_format="The stage tarball URI you entered does not exist or is invalid. You cannot continue until this value is valid")
115 resp = msgdlg.run()
116 msgdlg.destroy()
117 return
118 self.controller.install_profile.set_install_stage(None, 3, None)
119 self.controller.install_profile.set_dynamic_stage3(None, self.radio_dynamicstage.get_active(), None)
120 self.controller.install_profile.set_stage_tarball_uri(None, self.entry_stage_tarball_uri.get_text(), None)
121 progress = ProgressDialog(self.controller, ("unpack_stage_tarball", ), self.progress_callback)
122 progress.run()
123
124 def progress_callback(self, result, data=None):
125 if result == PROGRESS_DONE:
126 self.controller.load_screen("Portage Tree")

Properties

Name Value
svn:eol-style native

  ViewVC Help
Powered by ViewVC 1.1.20