/[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 1623 - (show annotations) (download) (as text)
Fri Jan 19 10:19:38 2007 UTC (7 years, 2 months ago) by agaffney
File MIME type: text/x-python
File size: 7371 byte(s)
remove Help button
rearrange Stage screen
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
11 class Panel(GLIScreen.GLIScreen):
12
13 title = "Stage Selection"
14 active_selection = 1
15 radio_stages = [None, None, None, None]
16 _helptext = """
17 <b><u>Stage</u></b>
18
19 The Stage 3 tarball is the recommended (and only supported) tarball for Gentoo \
20 installations. It contains a complete base system and is already optimized for \
21 whatever architecture/processor you download the stage3 for. While Gentoo still \
22 offers stage1 and stage2 tarballs, the official installation method uses the \
23 stage3 tarball.
24
25 The Livecd also provides many programs using GRP, which will package up the \
26 livecd files and install them as binaries. This is useful for getting large \
27 applications like gnome installed quickly. If doing a GRP install, the Dynamic \
28 stage3 is also recommended. Dynamic creates a stage3 tarball on the fly from \
29 the contents of the Livecd, and does not involve any downloading, but can be a \
30 bit slow.
31
32 <b>For those doing a networkless installation, you must select "Dynamic" and \
33 "GRP Install" from the Stage screen.</b> Otherwise select a stage and click \
34 the "..." to browse for a tarball location.
35
36 In the URI Browser, select the type (such as http) and then press the "..." next \
37 to Host to choose a mirror address. Once your host has been selected the path \
38 below should change automatically and you should be able to browse through the \
39 folders to find your stage tarball. The path to the tarballs is usually \
40 /releases/{architecture ex. x86}/current/stages/{sub-arch}/filename.tar.bz2 \
41 """
42
43 def __init__(self, controller):
44 GLIScreen.GLIScreen.__init__(self, controller)
45
46 self.has_systempkgs = GLIUtility.is_file("/usr/livecd/systempkgs.txt")
47
48 vert = gtk.VBox(False, 0)
49 vert.set_border_width(10)
50
51 self.radio_fetchstage = gtk.RadioButton(None, "Fetch stage from internet")
52 self.radio_fetchstage.set_name("fetch")
53 self.radio_fetchstage.connect("toggled", self.stage_selected, "fetch")
54 # self.radio_fetchstage.set_size_request(100, -1)
55 hbox = gtk.HBox(False, 0)
56 hbox.pack_start(self.radio_fetchstage, expand=False, fill=False, padding=5)
57 vert.pack_start(hbox, expand=False, fill=False, padding=10)
58
59 hbox = gtk.HBox(False, 0)
60 # hbox.pack_start(gtk.Label("Stage tarball URI:"), expand=False, fill=False, padding=30)
61 self.entry_stage_tarball_uri = gtk.Entry()
62 self.entry_stage_tarball_uri.set_width_chars(70)
63 hbox.pack_start(self.entry_stage_tarball_uri, expand=False, fill=False, padding=30)
64 self.browse_uri = gtk.Button("Browse")
65 self.browse_uri.connect("clicked", self.browse_uri_clicked)
66 hbox.pack_start(self.browse_uri, expand=False, fill=False, padding=0)
67 vert.pack_start(hbox, expand=False, fill=False, padding=5)
68
69 # self.check_grp = gtk.CheckButton("GRP Install")
70 # self.check_grp.set_sensitive(False)
71 # self.check_grp.set_size_request(100, -1)
72 # hbox = gtk.HBox(False, 0)
73 # hbox.pack_start(self.check_grp, expand=False, fill=False, padding=5)
74 # tmplabel = gtk.Label("Any extra packages installed (beyond the stage3) will be installed using binaries from the LiveCD that you are installing from")
75 # tmplabel.set_line_wrap(True)
76 # hbox.pack_start(tmplabel, expand=False, fill=False, padding=20)
77 # vert.pack_start(hbox, expand=False, fill=False, padding=10)
78
79 self.radio_dynamicstage = gtk.RadioButton(self.radio_fetchstage, "Build stage from files on LiveCD")
80 self.radio_dynamicstage.set_name("dynamic")
81 self.radio_dynamicstage.connect("toggled", self.stage_selected, "dynamic")
82 # self.radio_dynamicstage.set_size_request(100, -1)
83 hbox = gtk.HBox(False, 0)
84 hbox.pack_start(self.radio_dynamicstage, expand=False, fill=False, padding=5)
85 vert.pack_start(hbox, expand=False, fill=False, padding=40)
86
87 self.add_content(vert)
88
89 def browse_uri_clicked(self, widget):
90 uribrowser = URIBrowser.URIBrowser(self, self.entry_stage_tarball_uri)
91 uribrowser.run(self.entry_stage_tarball_uri.get_text())
92
93 def stage_selected(self, widget, data=None):
94 if data == "fetch":
95 self.entry_stage_tarball_uri.set_sensitive(True)
96 self.browse_uri.set_sensitive(True)
97 else:
98 self.entry_stage_tarball_uri.set_sensitive(False)
99 self.browse_uri.set_sensitive(False)
100
101 def activate(self):
102 self.controller.SHOW_BUTTON_EXIT = True
103 self.controller.SHOW_BUTTON_BACK = False
104 self.controller.SHOW_BUTTON_FORWARD = True
105 self.controller.SHOW_BUTTON_FINISH = False
106 # self.active_selection = int(self.controller.install_profile.get_install_stage()) or 3
107 # self.radio_stages[self.active_selection].set_active(True)
108 self.entry_stage_tarball_uri.set_text(self.controller.install_profile.get_stage_tarball_uri())
109 # self.check_grp.set_active(self.controller.install_profile.get_grp_install())
110 # self.check_dynamic.set_active(self.controller.install_profile.get_dynamic_stage3())
111 # if self.controller.install_type == "networkless":
112 # self.radio_stages[1].set_sensitive(False)
113 # self.radio_stages[2].set_sensitive(False)
114 # self.entry_stage_tarball_uri.set_sensitive(False)
115 # self.browse_uri.set_sensitive(False)
116 # self.check_grp.set_active(True)
117 # self.check_grp.set_sensitive(False)
118 # self.check_dynamic.set_active(True)
119 # self.check_dynamic.set_sensitive(False)
120
121 def deactivate(self):
122 # if not self.check_dynamic.get_active():
123 # if not self.entry_stage_tarball_uri.get_text():
124 # msgdlg = gtk.MessageDialog(parent=self.controller.window, type=gtk.MESSAGE_QUESTION, buttons=gtk.BUTTONS_YES_NO, message_format="You did not enter a stage tarball URI. You cannot complete an installation until you set this value. Continue?")
125 # resp = msgdlg.run()
126 # msgdlg.destroy()
127 # if resp == gtk.RESPONSE_NO:
128 # return False
129 # elif not GLIUtility.validate_uri(self.entry_stage_tarball_uri.get_text()):
130 # msgdlg = gtk.MessageDialog(parent=self.controller.window, type=gtk.MESSAGE_QUESTION, buttons=gtk.BUTTONS_YES_NO, message_format="The stage tarball URI you entered does not exist. You cannot complete an installation until this value is a valid. Continue?")
131 # resp = msgdlg.run()
132 # msgdlg.destroy()
133 # if resp == gtk.RESPONSE_NO:
134 # return False
135 # elif self.active_selection == 3 and self.check_grp.get_active() and self.has_systempkgs:
136 # msgdlg = gtk.MessageDialog(parent=self.controller.window, type=gtk.MESSAGE_QUESTION, buttons=gtk.BUTTONS_YES_NO, message_format="When doing a GRP install, it is recommended to use the Dynamic option instead of selecting your own tarball. Continue?")
137 # resp = msgdlg.run()
138 # msgdlg.destroy()
139 # if resp == gtk.RESPONSE_NO:
140 # return False
141 # self.controller.install_profile.set_install_stage(None, self.active_selection, None)
142 # if self.active_selection == 3:
143 # self.controller.install_profile.set_grp_install(None, self.check_grp.get_active(), None)
144 # self.controller.install_profile.set_dynamic_stage3(None, self.check_dynamic.get_active(), None)
145 # else:
146 # self.controller.install_profile.set_grp_install(None, False, None)
147 # try: self.controller.install_profile.set_stage_tarball_uri(None, self.entry_stage_tarball_uri.get_text(), None)
148 # except: pass
149 return True

Properties

Name Value
svn:eol-style native

  ViewVC Help
Powered by ViewVC 1.1.20