/[smeserver]/cdrom.image/updates/examine_gui.py
ViewVC logotype

Annotation of /cdrom.image/updates/examine_gui.py

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download) (as text)
Sat Jul 30 07:28:38 2005 UTC (19 years, 4 months ago) by slords
Branch: MAIN
Content type: text/x-python
First major pass as anaconda installer
- Install/Upgrade detection working
- Only screens we want are being displayed
- Raid/LVM partitioning all done for installer
- Except for post-install (run, status) install is done
- TODO: post-install script isn't running
- TODO: post-upgrade script isn't working
- TODO: raid migration for upgrades
- TODO: status message for post-{install,upgrade}

1 slords 1.1 #
2     # examine_gui.py: dialog to allow selection of a RHL installation to upgrade
3     # and if the user wishes to select individual packages.
4     #
5     # Copyright 2000-2003 Red Hat, Inc.
6     #
7     # This software may be freely redistributed under the terms of the GNU
8     # library public license.
9     #
10     # You should have received a copy of the GNU Library Public License
11     # along with this program; if not, write to the Free Software
12     # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
13     #
14    
15     import gtk
16     from iw_gui import *
17     from package_gui import *
18     from pixmapRadioButtonGroup_gui import pixmapRadioButtonGroup
19     from rhpl.translate import _, N_
20     from constants import *
21     from upgrade import *
22     from flags import flags
23    
24     import smeupgradeclass
25     UpgradeClass = smeupgradeclass.InstallClass
26    
27     UPGRADE_STR = "upgrade"
28     REINSTALL_STR = "reinstall"
29    
30     class UpgradeExamineWindow (InstallWindow):
31    
32     windowTitle = N_("Upgrade Examine")
33     htmlTag = "upgradeexamine"
34    
35     def getNext (self):
36     if self.doupgrade:
37     # set the install class to be an upgrade
38     c = UpgradeClass(flags.expert)
39     c.setSteps(self.dispatch)
40     c.setInstallData(self.id)
41    
42     rootfs = self.parts[self.upgradecombo.get_active()]
43     self.id.upgradeRoot = [(rootfs[0], rootfs[1])]
44     self.id.rootParts = self.parts
45    
46     if self.individualPackages is not None and self.individualPackages.get_active():
47     self.dispatch.skipStep("indivpackage", skip = 0)
48     else:
49     self.dispatch.skipStep("indivpackage")
50     self.dispatch.skipStep("installtype", skip = 1)
51    
52     return None
53    
54     def createUpgradeOption(self):
55     r = pixmapRadioButtonGroup()
56     r.addEntry(REINSTALL_STR,
57     _("_Install %s") %(productName,),
58     pixmap=self.ics.readPixmap("install.png"),
59     descr=_("Choose this option to freshly install your system. " "Existing software and data may be overwritten "
60     "depending on your configuration choices."))
61    
62     r.addEntry(UPGRADE_STR,
63     _("_Upgrade an existing installation"),
64     pixmap=self.ics.readPixmap("upgrade.png"),
65     descr=_("Choose this option if you would like "
66     "to upgrade your existing %s system. "
67     "This option will preserve the "
68     "existing data on your drives.") %(productName,))
69    
70     return r
71    
72     def upgradeOptionsSetSensitivity(self, state):
73     self.uplabel.set_sensitive(state)
74     self.upgradecombo.set_sensitive(state)
75     if self.individualPackages is not None:
76     self.individualPackages.set_sensitive(state)
77    
78     def optionToggled(self, widget, name):
79     if name == UPGRADE_STR:
80     self.upgradeOptionsSetSensitivity(widget.get_active())
81    
82     self.doupgrade = widget.get_active()
83    
84     #UpgradeExamineWindow tag = "upgrade"
85     def getScreen (self, dispatch, intf, id, chroot):
86     self.dispatch = dispatch
87     self.intf = intf
88     self.id = id
89     self.chroot = chroot
90    
91     self.doupgrade = dispatch.stepInSkipList("installtype")
92     self.parts = self.id.rootParts
93    
94     vbox = gtk.VBox (gtk.FALSE, 10)
95     vbox.set_border_width (8)
96    
97     r = self.createUpgradeOption()
98     b = r.render()
99     if self.doupgrade:
100     r.setCurrent(UPGRADE_STR)
101     else:
102     r.setCurrent(REINSTALL_STR)
103    
104     r.setToggleCallback(self.optionToggled)
105     box = gtk.VBox (gtk.FALSE)
106     box.pack_start(b, gtk.FALSE)
107    
108     vbox.pack_start (box, gtk.FALSE)
109     self.root = self.parts[0]
110    
111     #
112     # lets remove this seemingly useless option - clutters display
113     #
114     # self.individualPackages = gtk.CheckButton (_("_Customize packages to be "
115     # "upgraded"))
116     # self.individualPackages.set_active (not dispatch.stepInSkipList("indivpackage"))
117     # ipbox = gtk.HBox(gtk.FALSE)
118     # crackhbox = gtk.HBox(gtk.FALSE)
119     # crackhbox.set_size_request(70, -1)
120     # ipbox.pack_start(crackhbox, gtk.FALSE, gtk.FALSE)
121     # ipbox.pack_start(self.individualPackages, gtk.TRUE, gtk.TRUE)
122     # r.packWidgetInEntry(UPGRADE_STR, ipbox)
123     self.individualPackages = None
124    
125    
126     # hack hack hackity hack
127     upboxtmp = gtk.VBox(gtk.FALSE, 5)
128     uplabelstr = _("The following installed system will be upgraded:")
129     self.uplabel = gtk.Label(uplabelstr)
130     self.uplabel.set_alignment(0.0, 0.0)
131     model = gtk.ListStore(str)
132     self.upgradecombo = gtk.ComboBox(model)
133    
134     cell = gtk.CellRendererText()
135     self.upgradecombo.pack_start(cell, True)
136     self.upgradecombo.set_attributes(cell, markup=0)
137    
138     for (part, filesystem, desc) in self.parts:
139     iter = model.append()
140     if (desc is None) or len(desc) < 1:
141     desc = _("Unknown Linux system")
142     if part[:5] != "/dev/":
143     devname = "/dev/" + part
144     else:
145     devname = part
146     model[iter][0] = "<small>%s (%s)</small>" %(desc, devname)
147    
148     upboxtmp.pack_start(self.uplabel)
149    
150     # more indentation
151     box1 = gtk.HBox(gtk.FALSE)
152     crackhbox = gtk.HBox(gtk.FALSE)
153     crackhbox.set_size_request(35, -1)
154     box1.pack_start(crackhbox, gtk.FALSE, gtk.FALSE)
155     box1.pack_start(self.upgradecombo, gtk.FALSE, gtk.FALSE)
156     upboxtmp.pack_start(box1, gtk.FALSE, gtk.FALSE)
157    
158     # hack indent it
159     upbox = gtk.HBox(gtk.FALSE)
160    
161     crackhbox = gtk.HBox(gtk.FALSE)
162     crackhbox.set_size_request(70, -1)
163    
164     upbox.pack_start(crackhbox, gtk.FALSE, gtk.FALSE)
165     # upbox.pack_start(upboxtmp, gtk.TRUE, gtk.TRUE)
166     upbox.pack_start(upboxtmp, gtk.FALSE, gtk.FALSE)
167    
168     # all done phew
169     r.packWidgetInEntry(UPGRADE_STR, upbox)
170    
171     # set default
172     if self.doupgrade:
173     idx = 0
174     for p in self.parts:
175     if self.id.upgradeRoot[0][0] == p[0]:
176     self.upgradecombo.set_active(idx)
177     break
178     idx = idx + 1
179    
180     self.upgradeOptionsSetSensitivity(self.doupgrade)
181    
182     return vbox

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed