summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2005-03-29 18:11:45 +0000
committerJeremy Katz <katzj@redhat.com>2005-03-29 18:11:45 +0000
commit916b4c6757fb50b5b9db8710f5a572a0c00b870b (patch)
tree31598e67fbd309a5f14d01cfa58ce48f2b36cab5
parenta27a117b59dedb8b68c758dd1505535dcbfbceea (diff)
downloadanaconda-916b4c6757fb50b5b9db8710f5a572a0c00b870b.tar.gz
anaconda-916b4c6757fb50b5b9db8710f5a572a0c00b870b.tar.xz
anaconda-916b4c6757fb50b5b9db8710f5a572a0c00b870b.zip
2005-03-29 Jeremy Katz <katzj@redhat.com>
* text.py (stepToClasses): Remove silo stuff. * gui.py (stepToClasses): Likewise. * iw/silo_gui.py: Remove. * textw/silo_text.py: Remove.
-rw-r--r--ChangeLog5
-rwxr-xr-xgui.py2
-rw-r--r--iw/silo_gui.py318
-rw-r--r--loader2/cdinstall.c2
-rw-r--r--loader2/loader.c2
-rw-r--r--loader2/method.c4
-rw-r--r--text.py4
-rw-r--r--textw/silo_text.py269
8 files changed, 9 insertions, 597 deletions
diff --git a/ChangeLog b/ChangeLog
index 002b4e24b..620dcf1e8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2005-03-29 Jeremy Katz <katzj@redhat.com>
+ * text.py (stepToClasses): Remove silo stuff.
+ * gui.py (stepToClasses): Likewise.
+ * iw/silo_gui.py: Remove.
+ * textw/silo_text.py: Remove.
+
* utils/genhdlist.c: Genericize product dir
* loader2/loader.c (initProductInfo): Likewise.
* scripts/splittree.py: Likewise.
diff --git a/gui.py b/gui.py
index e1334298d..9a06de8e1 100755
--- a/gui.py
+++ b/gui.py
@@ -82,8 +82,6 @@ stepToClass = {
"complete" : ("congrats_gui", "CongratulationWindow"),
}
-if iutil.getArch() == 'sparc':
- stepToClass["bootloader"] = ("silo_gui", "SiloWindow")
elif iutil.getArch() == 's390':
stepToClass["bootloader"] = ("zipl_gui", "ZiplWindow")
diff --git a/iw/silo_gui.py b/iw/silo_gui.py
deleted file mode 100644
index c3e770647..000000000
--- a/iw/silo_gui.py
+++ /dev/null
@@ -1,318 +0,0 @@
-#
-# silo_gui.py: SILO configuration -- THIS FILE IS DEPRECIATED.
-#
-# Copyright 2001-2002 Red Hat, Inc.
-#
-# This software may be freely redistributed under the terms of the GNU
-# library public license.
-#
-# You should have received a copy of the GNU Library Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-#
-
-# must replace with explcit form so update disks will work
-from iw_gui import *
-
-from gtk import *
-from rhpl.translate import _
-from xpms_gui import SMALL_CHECK
-import gdkpixbuf
-import gui
-
-class SiloWindow (InstallWindow):
- def __init__ (self, ics):
- InstallWindow.__init__ (self, ics)
-
- ics.readHTML ("silo")
-
- ics.setTitle (_("Silo Configuration"))
- ics.setNextEnabled (1)
- self.type = None
- self.bootdisk = None
- self.silo = None
- self.linuxAlias = None
- self.linuxAliasLabel = None
- self.bootDevice = None
-
- def getNext (self):
- # XXX
- if not self.bootdisk:
- if self.todo.silo.hasUsableFloppy() == 2:
- self.todo.bootdisk = 1
- else:
- self.todo.bootdisk = 0
- return None
-
- if self.bootdisk.get_active ():
- self.todo.bootdisk = 1
- else:
- self.todo.bootdisk = 0
-
- if self.silo.get_active ():
- self.todo.silo.setDevice(None)
- elif self.todo.silo.allowSiloLocationConfig(self.todo.fstab):
- if self.mbr.get_active ():
- self.todo.silo.setDevice("mbr")
- else:
- self.todo.silo.setDevice("partition")
-
- self.todo.silo.setAppend(self.appendEntry.get_text())
- self.todo.silo.setSiloImages(self.images)
-
- linuxAlias = 0
- bootDevice = 0
- if self.linuxAlias.get_active ():
- linuxAlias = 1
- if self.bootDevice.get_active ():
- bootDevice = 1
-
- self.todo.silo.setPROM(linuxAlias, bootDevice)
-
- def typeName(self, type):
- if (type == 2):
- return "Linux Native"
- elif (type == 6):
- return "UFS"
- else:
- return "Other"
-
- def toggled (self, widget, *args):
- if widget.get_active ():
- state = FALSE
- else:
- state = TRUE
-
- for n in [ self.radioBox, self.editBox, self.imageList ]:
- n.set_sensitive (state)
-
- def mbr_toggled (self, widget, *args):
- if widget.get_active ():
- part = self.mbrpart
- else:
- part = self.bootpart
- prompath = self.todo.silo.disk2PromPath(part)
- if prompath and len(prompath) > 0:
- self.linuxAliasLabel.set_text ("linux " + prompath)
- if self.todo.silo.hasAliases():
- self.linuxAliasLabel.set_sensitive (TRUE)
- self.linuxAlias.set_sensitive (TRUE)
- return
- self.linuxAliasLabel.set_sensitive (FALSE)
- self.linuxAlias.set_sensitive (FALSE)
-
- def labelUpdated(self, *args):
- index = self.imageList.selection[0]
- device = self.imageList.get_text(index, 1)
-
- label = self.labelEntry.get_text()
- self.imageList.set_text(index, 3, label)
-
- if label:
- self.defaultCheck.set_sensitive (TRUE)
- else:
- self.defaultCheck.set_sensitive (FALSE)
-
- def defaultUpdated(self, *args):
- if self.ignoreSignals: return
-
- index = self.imageList.selection[0]
-
- if self.defaultCheck.get_active():
- if self.default != None:
- self.imageList.set_text(self.default, 0, "")
-
- self.imageList.set_pixmap(index, 0, self.checkMark)
- self.default = index
- else:
- self.imageList.set_text(index, 0, "")
- self.default = None
-
- def labelSelected(self, *args):
- index = self.imageList.selection[0]
- device = self.imageList.get_text(index, 1)
- label = self.imageList.get_text(index, 3)
-
- self.deviceLabel.set_text(_("Partition") + ": " + device)
- device = device[5:]
-
- type = self.images[device][1]
-
- self.typeLabel.set_text(_("Type") + ":" + self.typeName(type))
- self.labelEntry.set_text(label)
-
- if not label:
- self.defaultCheck.set_sensitive (FALSE)
-
- self.ignoreSignals = 1
- if index == self.default:
- self.defaultCheck.set_active(1)
- else:
- self.defaultCheck.set_active(0)
- self.ignoreSignals = 0
-
- # SiloWindow tag="silo"
- def getScreen (self):
- (self.images, defaultLabel) = self.todo.silo.getSiloImages(self.todo.fstab)
- self.ignoreSignals = 0
-
- (mount, dev, fstype, format, size) = self.todo.fstab.mountList()[0]
- if mount != '/': return None
-
- self.bootpart = self.todo.fstab.getBootDevice()
- self.mbrpart = self.todo.silo.getMbrDevice(self.todo.fstab)
- format = "/dev/%s"
-
- self.radioBox = GtkTable(2, 7)
- self.radioBox.set_border_width (5)
-
- spacer = GtkLabel("")
- spacer.set_size_request(10, 1)
- self.radioBox.attach(spacer, 0, 1, 2, 4, FALSE)
-
- label = GtkLabel(_("Install SILO boot record on:"))
- label.set_alignment(0.0, 0.5)
- self.radioBox.attach(label, 0, 2, 1, 2)
-
- mbrpart = self.mbrpart
- if self.bootpart[:2] == "md":
- mbrpart = self.bootpart
- # FIXME: Should be Master Boot Records (MBR) in the RAID1 case
- self.mbr = GtkRadioButton(None,
- ("/dev/%s %s" % (mbrpart, _("Master Boot Record (MBR)"))))
- part = GtkRadioButton(self.mbr,
- ("/dev/%s %s" % (self.bootpart,
- _("First sector of boot partition"))))
- self.radioBox.attach(self.mbr, 1, 2, 2, 3)
- self.radioBox.attach(part, 1, 2, 3, 4)
-
- self.linuxAlias = GtkCheckButton(
- _("Create PROM alias") + ":")
- if (self.todo.silo.hasAliases()):
- self.linuxAlias.set_active (TRUE)
- else:
- self.linuxAlias.set_active (FALSE)
- self.linuxAliasLabel = GtkLabel("")
- self.mbr_toggled(self.mbr)
- tempBox = GtkHBox (FALSE, 5)
- tempBox.pack_start(self.linuxAlias)
- tempBox.pack_start(self.linuxAliasLabel)
- self.radioBox.attach(tempBox, 0, 2, 4, 5)
-
- self.mbr.connect("toggled", self.mbr_toggled)
- if self.bootpart[:2] == "md":
- self.mbr.set_active (TRUE)
- label.set_sensitive (FALSE)
- self.mbr.set_sensitive (FALSE)
- part.set_sensitive (FALSE)
- if self.todo.silo.getSiloMbrDefault(self.todo.fstab) == 'mbr':
- self.mbr.set_active (TRUE)
- else:
- part.set_active (TRUE);
-
- self.bootDevice = GtkCheckButton(_("Set default PROM boot device to linux"))
- self.radioBox.attach(self.bootDevice, 0, 2, 5, 6)
- self.bootDevice.set_active (TRUE)
-
- label = GtkLabel(_("Kernel parameters") + ":")
- label.set_alignment(0.0, 0.5)
- self.appendEntry = GtkEntry(15)
- if self.todo.silo.getAppend():
- self.appendEntry.set_text(self.todo.silo.getAppend())
- box = GtkHBox(FALSE, 5)
- box.pack_start(label)
- box.pack_start(self.appendEntry)
- alignment = GtkAlignment()
- alignment.set(0.0, 0.5, 0, 1.0)
- alignment.add(box)
- self.radioBox.attach(alignment, 0, 2, 6, 7)
-
- box = GtkVBox (FALSE, 0)
-
- topBox = GtkHBox (FALSE, 2)
- optionBox = GtkVBox (FALSE, 5)
- optionBox.set_border_width (5)
- self.bootdisk = GtkCheckButton (_("Create boot disk"))
- floppy = self.todo.silo.hasUsableFloppy()
- if floppy == 2:
- self.bootdisk.set_active (TRUE)
- else:
- self.bootdisk.set_active (FALSE)
- if floppy == 0:
- self.bootdisk.set_sensitive (FALSE)
- optionBox.pack_start (self.bootdisk)
-
- self.silo = GtkCheckButton (_("Do not install SILO"))
- self.silo.set_active (FALSE)
- self.silo.connect ("toggled", self.toggled)
- optionBox.pack_start (self.silo, FALSE)
- topBox.pack_start (optionBox)
-
- pix = gui.readImageFromFile ("silo.png")
- if pix:
- a = GtkAlignment ()
- a.add (pix)
- a.set (1.0, 0.0, 0.0, 0.0)
- topBox.pack_start (a, FALSE)
-
- box.pack_start (topBox, FALSE)
-
- box.pack_start (GtkHSeparator (), FALSE)
- box.pack_start (self.radioBox, FALSE)
-
- self.imageList = GtkCList (4,
- ( _("Default"), _("Device"), _("Partition type"), _("Boot label")))
- self.imageList.set_selection_mode (SELECTION_BROWSE)
-
- sortedKeys = self.images.keys()
- sortedKeys.sort()
-
- self.default = None
- count = 0
- for n in sortedKeys:
- (label, type) = self.images[n]
- self.imageList.append(("", "/dev/" + n, self.typeName(type),
- label))
- if (label == defaultLabel):
- self.default = count
- self.imageList.set_pixmap(count, 0, self.checkMark)
- count = count + 1
-
- self.imageList.columns_autosize ()
- self.imageList.column_title_passive (1)
- self.imageList.set_border_width (5)
- self.imageList.connect("select_row", self.labelSelected)
- self.imageList.set_column_justification(2, JUSTIFY_CENTER)
-
- self.deviceLabel = GtkLabel(_("Partition") + ":")
- self.typeLabel = GtkLabel(_("Type") + ":")
-
- tempBox = GtkHBox(TRUE)
- self.deviceLabel.set_alignment(0.0, 0.0)
- self.typeLabel.set_alignment(0.0, 0.0)
- tempBox.pack_start(self.deviceLabel, FALSE)
- tempBox.pack_start(self.typeLabel, FALSE)
- self.defaultCheck = GtkCheckButton(_("Default boot image"))
- self.defaultCheck.connect("toggled", self.defaultUpdated)
-
- # Alliteration!
- self.labelLabel = GtkLabel(_("Boot label") + ":")
- self.labelEntry = GtkEntry(15)
- self.labelEntry.connect("changed", self.labelUpdated)
-
- tempBox2 = GtkHBox(FALSE, 5)
- self.labelLabel.set_alignment(0.0, 0.5)
- tempBox2.pack_start(self.labelLabel, FALSE)
- tempBox2.pack_start(self.labelEntry, FALSE)
-
- self.editBox = GtkVBox ()
- self.editBox.pack_start (tempBox, FALSE)
- self.editBox.pack_start (self.defaultCheck, FALSE)
- self.editBox.pack_start (tempBox2, FALSE)
- self.editBox.set_border_width (5)
-
- box.pack_start (GtkHSeparator (), FALSE)
- box.pack_start (self.editBox, FALSE)
- box.pack_start (self.imageList, TRUE)
-
- return box
diff --git a/loader2/cdinstall.c b/loader2/cdinstall.c
index 75205fff0..ce327fed8 100644
--- a/loader2/cdinstall.c
+++ b/loader2/cdinstall.c
@@ -403,7 +403,7 @@ char * findAnacondaCD(char * location,
-/* look for a Red Hat CD and mount it. if we have problems, ask */
+/* look for a CD and mount it. if we have problems, ask */
char * mountCdromImage(struct installMethod * method,
char * location, struct loaderData_s * loaderData,
moduleInfoSet modInfo, moduleList modLoaded,
diff --git a/loader2/loader.c b/loader2/loader.c
index b3dc696a7..7a642934b 100644
--- a/loader2/loader.c
+++ b/loader2/loader.c
@@ -763,7 +763,7 @@ static char *doLoaderMain(char * location,
installNames[numValidMethods] = NULL;
- /* check to see if we have a Red Hat Linux CD. If we have one, then
+ /* check to see if we have a CD. If we have one, then
* we can fast-path the CD and not make people answer questions in
* text mode. */
if (!FL_ASKMETHOD(flags) && !FL_KICKSTART(flags)) {
diff --git a/loader2/method.c b/loader2/method.c
index 9397ee003..5feee1ed6 100644
--- a/loader2/method.c
+++ b/loader2/method.c
@@ -158,7 +158,7 @@ char * validIsoImages(char * dirName, int *foundinvalid) {
return 0;
}
- /* Walk through the directories looking for a Red Hat CD image. */
+ /* Walk through the directories looking for a CD image. */
errno = 0;
while ((ent = readdir(dir))) {
snprintf(isoImage, sizeof(isoImage), "%s/%s", dirName, ent->d_name);
@@ -377,7 +377,7 @@ void queryIsoMediaCheck(char *isoFile, int flags) {
return;
}
- /* Walk through the directories looking for a Red Hat CD images. */
+ /* Walk through the directories looking for a CD images. */
errno = 0;
first = 0;
while (1) {
diff --git a/text.py b/text.py
index 31d418d7f..76219d14b 100644
--- a/text.py
+++ b/text.py
@@ -80,10 +80,6 @@ stepToClasses = {
"complete" : ("complete_text", "FinishedWindow"),
}
-if iutil.getArch() == 'sparc':
- stepToClasses["bootloader"] = ("silo_text", ("SiloAppendWindow",
- "SiloWindow"
- "SiloImagesWindow"))
if iutil.getArch() == 's390':
stepToClasses["bootloader"] = ("zipl_text", ( "ZiplWindow"))
diff --git a/textw/silo_text.py b/textw/silo_text.py
deleted file mode 100644
index b0a650dbd..000000000
--- a/textw/silo_text.py
+++ /dev/null
@@ -1,269 +0,0 @@
-#
-# silo_text.py: text mode silo setup dialog
-#
-# Copyright 2001-2002 Red Hat, Inc.
-#
-# This software may be freely redistributed under the terms of the GNU
-# library public license.
-#
-# You should have received a copy of the GNU Library Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-#
-
-# XXX THIS FILE IS DEPRECATED
-
-import iutil
-from snack import *
-from constants_text import *
-from rhpl.translate import _
-
-class SiloAppendWindow:
-
- def __call__(self, screen, todo):
- t = TextboxReflowed(53,
- _("A few systems will need to pass special options "
- "to the kernel at boot time for the system to function "
- "properly. If you need to pass boot options to the "
- "kernel, enter them now. If you don't need any or "
- "aren't sure, leave this blank."))
-
- entry = Entry(48, scroll = 1, returnExit = 1)
-
- if todo.silo.getAppend():
- entry.set(todo.silo.getAppend())
-
- buttons = ButtonBar(screen, [TEXT_OK_BUTTON, (_("Skip"), "skip"),
- TEXT_BACK_BUTTON ] )
-
- grid = GridFormHelp(screen, _("SILO Configuration"),
- "silokernelopts", 1, 3)
- grid.add(t, 0, 0)
- grid.add(entry, 0, 1, padding = (0, 0, 0, 1))
- grid.add(buttons, 0, 2, growx = 1)
-
- result = grid.runOnce ()
- button = buttons.buttonPressed(result)
-
- if button == TEXT_BACK_CHECK:
- return INSTALL_BACK
-
- if button == "skip":
- todo.skipLilo = 1
- todo.silo.setDevice(None)
- else:
- todo.skipLilo = 0
-
- if entry.value():
- todo.silo.setAppend(string.strip(entry.value()))
- else:
- todo.silo.setAppend(None)
-
- return INSTALL_OK
-
-class SiloWindow:
- def __call__(self, screen, todo):
- (mount, dev, fstype, format, size) = todo.fstab.mountList()[0]
- if mount != '/': return INSTALL_NOOP
- if todo.skipLilo: return INSTALL_NOOP
-
- bootpart = todo.fstab.getBootDevice()
- boothd = todo.silo.getMbrDevice(todo.fstab)
-
- format = "/dev/%-11s %s%*s"
- # FIXME: Should be Master Boot Records (MBR) in RAID1 case
- str1 = _("Master Boot Record (MBR)")
- str2 = _("First sector of boot partition")
- str3 = _("Create PROM alias `linux'")
- str4 = _("Set default PROM boot device")
- len1 = len(str1) + 17
- len2 = len(str2) + 17
- len3 = len(str3)
- len4 = len(str4)
- lenmax = max((len1, len2, len3, len4))
- if todo.silo.getSiloMbrDefault(todo.fstab) == 'mbr':
- dflt = 1
- else:
- dflt = 0
- bootdisk = boothd
- if bootpart[:2] == "md":
- bootdisk = bootpart
- rc1 = SingleRadioButton (format % (bootdisk, str1, lenmax - len1, ""), None, dflt )
- rc2 = SingleRadioButton (format % (bootpart, str2, lenmax - len2, ""), rc1, 1 - dflt)
- if bootpart[:2] == "md":
- rc1.setFlags (FLAG_DISABLED, FLAGS_SET)
- rc2.setFlags (FLAG_DISABLED, FLAGS_SET)
-
- bootdisk = bootpart
- if bootpart[:2] == "md":
- bootdisk = boothd
- prompath = todo.silo.disk2PromPath(bootdisk)
- if prompath and len(prompath) > 0 and todo.silo.hasAliases():
- default = 1
- else:
- default = 0
- linuxAlias = Checkbox ("%s%*s" % (str3, lenmax - len3, ""), default)
- if not default:
- linuxAlias.setFlags (FLAG_DISABLED, FLAGS_SET)
- bootDevice = Checkbox ("%s%*s" % (str4, lenmax - len4, ""), 1)
-
- bb = ButtonBar (screen, ((_("OK"), "ok"), (_("Back"), "back")))
-
- g = GridFormHelp (screen, _("SILO Configuration"), "silowin", 1, 8)
-
- g.add (Label (_("Where do you want to install the bootloader?")), 0, 0)
- g.add (rc1, 0, 1)
- g.add (rc2, 0, 2, padding = (0, 0, 0, 1))
- g.add (linuxAlias, 0, 3)
- g.add (bootDevice, 0, 4, padding = (0, 0, 0, 1))
- g.add (bb, 0, 5, growx = 1)
-
- result = g.runOnce()
-
- if rc1.selected():
- todo.silo.setDevice("mbr")
- else:
- todo.silo.setDevice("partition")
-
- lAlias = linuxAlias.selected() != 0
- bDevice = bootDevice.selected() != 0
-
- todo.silo.setPROM(lAlias, bDevice)
-
- rc = bb.buttonPressed (result)
-
- if rc == "back":
- return INSTALL_BACK
- return INSTALL_OK
-
-
-class SiloImagesWindow:
- def editItem(self, screen, partition, itemLabel):
- devLabel = Label(_("Device") + ":")
- bootLabel = Label(_("Boot label") + ":")
- device = Label("/dev/" + partition)
- newLabel = Entry (20, scroll = 1, returnExit = 1, text = itemLabel)
-
- buttons = ButtonBar(screen, [_("OK"), _("Clear"), _("Cancel")])
-
- subgrid = Grid(2, 2)
- subgrid.setField(devLabel, 0, 0, anchorLeft = 1)
- subgrid.setField(device, 1, 0, padding = (1, 0, 0, 0), anchorLeft = 1)
- subgrid.setField(bootLabel, 0, 1, anchorLeft = 1)
- subgrid.setField(newLabel, 1, 1, padding = (1, 0, 0, 0), anchorLeft = 1)
-
- g = GridFormHelp(screen, _("Edit Boot Label"), "bootlabel", 1, 2)
- g.add(subgrid, 0, 0, padding = (0, 0, 0, 1))
- g.add(buttons, 0, 1, growx = 1)
-
- result = ""
- while (result != string.lower(_("OK")) and result != newLabel):
- result = g.run()
- if (buttons.buttonPressed(result)):
- result = buttons.buttonPressed(result)
-
- if (result == string.lower(_("Cancel"))):
- screen.popWindow ()
- return itemLabel
- elif (result == string.lower(_("Clear"))):
- newLabel.set("")
-
- screen.popWindow()
-
- return newLabel.value()
-
- def formatDevice(self, type, label, device, default):
- if (type == 2):
- type = "Linux extended"
- elif (type == 6):
- type = "UFS"
- else:
- type = "Other"
-
- if default == device:
- default = '*'
- else:
- default = ""
-
- return "%-10s %-25s %-7s %-10s" % ( "/dev/" + device, type, default, label)
-
- def __call__(self, screen, todo):
- (images, default) = todo.silo.getSiloImages(todo.fstab)
- if not images: return INSTALL_NOOP
- if todo.skipLilo: return INSTALL_NOOP
-
- # the default item is kept as a label (which makes more sense for the
- # user), but we want our listbox "indexed" by device, which so we keep
- # the default item as a device
- for (dev, (label, type)) in images.items():
- if label == default:
- default = dev
- break
-
- sortedKeys = images.keys()
- sortedKeys.sort()
-
- listboxLabel = Label("%-10s %-25s %-7s %-10s" %
- ( _("Device"), _("Partition type"), _("Default"), _("Boot label")))
- listbox = Listbox(5, scroll = 1, returnExit = 1)
-
- for n in sortedKeys:
- (label, type) = images[n]
- listbox.append(self.formatDevice(type, label, n, default), n)
- if n == default:
- listbox.setCurrent(n)
-
- buttons = ButtonBar(screen, [ TEXT_OK_BUTTON, (_("Edit"), "edit"),
- TEXT_BACK_BUTTON ] )
-
- text = TextboxReflowed(55, _("The boot manager Red Hat uses can boot other "
- "operating systems as well. You need to tell me "
- "what partitions you would like to be able to boot "
- "and what label you want to use for each of them."))
-
- title = _("SILO Configuration")
- g = GridFormHelp(screen, title, "siloimages", 1, 4)
- g.add(text, 0, 0, anchorLeft = 1)
- g.add(listboxLabel, 0, 1, padding = (0, 1, 0, 0), anchorLeft = 1)
- g.add(listbox, 0, 2, padding = (0, 0, 0, 1), anchorLeft = 1)
- g.add(buttons, 0, 3, growx = 1)
- g.addHotKey("F2")
-
- result = None
- while (result != TEXT_OK_CHECK and result != TEXT_BACK_CHECK and result != TEXT_F12_CHECK):
- result = g.run()
- if (buttons.buttonPressed(result)):
- result = buttons.buttonPressed(result)
-
- if (result == string.lower(_("Edit")) or result == listbox):
- item = listbox.current()
- (label, type) = images[item]
- label = self.editItem(screen, item, label)
- images[item] = (label, type)
- if (default == item and not label):
- default = ""
- listbox.replace(self.formatDevice(type, label, item, default), item)
- listbox.setCurrent(item)
- elif result == "F2":
- item = listbox.current()
- (label, type) = images[item]
- if (label):
- if (default):
- (oldLabel, oldType) = images[default]
- listbox.replace(self.formatDevice(oldType, oldLabel, default,
- ""), default)
- default = item
- listbox.replace(self.formatDevice(type, label, item, default),
- item)
- listbox.setCurrent(item)
-
- screen.popWindow()
-
- if (result == TEXT_BACK_CHECK):
- return INSTALL_BACK
-
- todo.silo.setSiloImages(images)
- todo.silo.setDefault(label)
-
- return INSTALL_OK
-