summaryrefslogtreecommitdiffstats
path: root/iw
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2008-02-22 13:12:14 -0500
committerJeremy Katz <katzj@redhat.com>2008-02-22 13:14:11 -0500
commit7ad65d9e30fd21d8c0356dc998ea97c579a73d53 (patch)
tree08e6a3947ab013ab899bd0c40201b2aba634d522 /iw
parent7adcf8307f6c5e07e5946e247a8d6eb7b8bba07b (diff)
downloadanaconda-7ad65d9e30fd21d8c0356dc998ea97c579a73d53.tar.gz
anaconda-7ad65d9e30fd21d8c0356dc998ea97c579a73d53.tar.xz
anaconda-7ad65d9e30fd21d8c0356dc998ea97c579a73d53.zip
Remove advanced bootloader bits
Diffstat (limited to 'iw')
-rw-r--r--iw/bootloader_advanced_gui.py114
-rw-r--r--iw/bootlocwidget.py153
-rw-r--r--iw/driveorderwidget.py132
3 files changed, 0 insertions, 399 deletions
diff --git a/iw/bootloader_advanced_gui.py b/iw/bootloader_advanced_gui.py
deleted file mode 100644
index 689ee5ea7..000000000
--- a/iw/bootloader_advanced_gui.py
+++ /dev/null
@@ -1,114 +0,0 @@
-#
-# bootloader_advanced.py: gui advanced bootloader configuration dialog
-#
-# Copyright (C) 2001, 2002 Red Hat, Inc. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# Author(s): Jeremy Katz <katzj@redhat.com>
-#
-
-import gtk
-import gui
-from iw_gui import *
-from rhpl.translate import _, N_
-
-from bootlocwidget import BootloaderLocationWidget
-
-class AdvancedBootloaderWindow(InstallWindow):
- windowTitle = N_("Advanced Boot Loader Configuration")
-
- def __init__(self, ics):
- InstallWindow.__init__(self, ics)
- self.parent = ics.getICW().window
-
-
- def getPrev(self):
- pass
-
-
- def getNext(self):
- # forcing lba32 can be a bad idea.. make sure they really want to
- if (self.forceLBA.get_active() and not self.bl.forceLBA32):
- rc = self.intf.messageWindow(_("Warning"),
- _("If LBA32 is not supported by your system's BIOS, "
- "forcing its use can prevent your machine from "
- "booting.\n\n"
- "Would you like to continue and force LBA32 mode?"),
- type = "custom",
- custom_buttons = [_("Cancel"),
- _("Force LBA32")])
- if rc != 1:
- raise gui.StayOnScreen
-
- # set forcelba
- self.bl.setForceLBA(self.forceLBA.get_active())
- # set kernel args
- self.bl.args.set(self.appendEntry.get_text())
-
- # set the boot device
- self.bl.setDevice(self.blloc.getBootDevice())
-
- # set the drive order
- self.bl.drivelist = self.blloc.getDriveOrder()
-
-
- # set up the vbox with force lba32 and kernel append
- def setupOptionsVbox(self):
- self.options_vbox = gtk.VBox(False, 5)
- self.options_vbox.set_border_width(5)
-
- self.forceLBA = gtk.CheckButton(_("_Force LBA32 (not normally required)"))
- self.options_vbox.pack_start(self.forceLBA, False)
- self.forceLBA.set_active(self.bl.forceLBA32)
-
- label = gui.WrappingLabel(_("If you wish to add default options to the "
- "boot command, enter them into "
- "the 'General kernel parameters' field."))
- label.set_alignment(0.0, 0.0)
- self.options_vbox.pack_start(label, False)
-
- label = gui.MnemonicLabel(_("_General kernel parameters"))
- self.appendEntry = gtk.Entry()
- label.set_mnemonic_widget(self.appendEntry)
- args = self.bl.args.get()
- if args:
- self.appendEntry.set_text(args)
- box = gtk.HBox(False, 0)
- box.pack_start(label)
- box.pack_start(self.appendEntry)
- al = gtk.Alignment(0.0, 0.0)
- al.add(box)
- self.options_vbox.pack_start(al, False)
-
-
- def getScreen(self, anaconda):
- self.dispatch = anaconda.dispatch
- self.bl = anaconda.id.bootloader
- self.intf = anaconda.intf
-
- thebox = gtk.VBox (False, 10)
-
- # boot loader location bits (mbr vs boot, drive order)
- self.blloc = BootloaderLocationWidget(anaconda, self.parent)
- thebox.pack_start(self.blloc.getWidget(), False)
-
- thebox.pack_start (gtk.HSeparator(), False)
-
- # some optional things
- self.setupOptionsVbox()
- thebox.pack_start(self.options_vbox, False)
-
-
- return thebox
diff --git a/iw/bootlocwidget.py b/iw/bootlocwidget.py
deleted file mode 100644
index 03583fb2a..000000000
--- a/iw/bootlocwidget.py
+++ /dev/null
@@ -1,153 +0,0 @@
-#
-# bootlocwidget.py: widget for setting the location of the boot loader
-#
-# Copyright (C) 2001, 2002 Red Hat, Inc. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# Author(s): Jeremy Katz <katzj@redhat.com>
-#
-
-import gtk
-import gobject
-import iutil
-import gui
-from rhpl.translate import _, N_
-
-from driveorderwidget import DriveOrderWidget
-
-class BootloaderLocationWidget:
- """Widget to set where to install the boot loader to"""
-
- def __init__(self, anaconda, parent):
- self.bl = anaconda.id.bootloader
- self.fsset = anaconda.id.fsset
- self.diskset = anaconda.id.diskset
- self.parent = parent
- self.intf = anaconda.intf
- self.driveOrder = self.bl.drivelist
- self.usingGrub = self.bl.useGrub()
-
- locationBox = gtk.VBox (False, 2)
- locationBox.set_border_width(5)
-
- label = gtk.Label(_("Install Boot Loader record on:"))
- label.set_alignment(0.0, 0.5)
- locationBox.pack_start(label)
-
- spacer = gtk.Label("")
- spacer.set_size_request(10, 1)
- locationBox.pack_start(spacer, False)
-
- choices = self.fsset.bootloaderChoices(self.diskset, self.bl)
- self.bootDevices = {}
-
- if choices:
- radio = None
- keys = choices.keys()
- keys.reverse()
- for key in keys:
- (device, desc) = choices[key]
- radio = gtk.RadioButton(radio,
- ("/dev/%s %s" % (device, _(desc))))
- locationBox.pack_start(radio, False)
- self.bootDevices[key] = (radio, device, desc)
-
- if self.bl.getDevice() == device:
- radio.set_active(True)
- else:
- radio.set_active(False)
- if not radio is None:
- radio.set_use_underline(False)
-
- spacer = gtk.Label("")
- spacer.set_size_request(25, 1)
- locationBox.pack_start(spacer, False)
-
- orderButton = gtk.Button(_("_Change Drive Order"))
- locationBox.pack_start(orderButton, False)
- orderButton.connect("clicked", self.editDriveOrder)
-
- self.setMbrLabel(self.driveOrder[0])
-
- alignment = gtk.Alignment()
- alignment.set(0.0, 0, 0, 0)
- alignment.add(locationBox)
- self.widget = alignment
-
- def editDriveOrder(self, *args):
- dialog = gtk.Dialog(_("Edit Drive Order"), flags = gtk.DIALOG_MODAL)
- gui.addFrame(dialog)
- dialog.set_modal(True)
- dialog.set_position(gtk.WIN_POS_CENTER)
-
- label = gui.WrappingLabel(_("Arrange the drives to be in the same "
- "order as used by the BIOS. Changing "
- "the drive order may be useful if you "
- "have multiple SCSI adapters or both SCSI "
- "and IDE adapters and want to boot from "
- "the SCSI device.\n\n"
- "Changing the drive order will change "
- "where the installation program "
- "locates the Master Boot Record (MBR)."))
- label.set_alignment(0.0, 0.0)
- dialog.vbox.pack_start(label, padding = 25)
-
- orderWidget = DriveOrderWidget(self.driveOrder, self.diskset)
- alignment = gtk.Alignment()
- alignment.set(0.5, 0, 0, 0)
- alignment.add(orderWidget.getWidget())
- dialog.vbox.pack_start(alignment)
-
- dialog.add_button('gtk-cancel', 1)
- dialog.add_button('gtk-ok', 0)
- dialog.show_all()
-
- while 1:
- rc = dialog.run()
- if rc == 1:
- break
-
- self.driveOrder = orderWidget.getOrder()
- self.setMbrLabel(self.driveOrder[0])
- break
-
- dialog.destroy()
- return rc
-
-
- # set the label on the mbr radio button to show the right device.
- # kind of a hack
- def setMbrLabel(self, firstDrive):
- if not self.bootDevices.has_key("mbr"):
- return
-
- (radio, olddev, desc) = self.bootDevices["mbr"]
- radio.set_label("/dev/%s %s" % (firstDrive, _(desc)))
- radio.set_use_underline(False)
- self.bootDevices["mbr"] = (radio, firstDrive, desc)
-
- def getWidget(self):
- return self.widget
-
- def getBootDevice(self):
- for key in self.bootDevices.keys():
- if self.bootDevices[key][0].get_active():
- return self.bootDevices[key][1]
-
- def getDriveOrder(self):
- return self.driveOrder
-
- def setUsingGrub(self, val):
- self.usingGrub = val
diff --git a/iw/driveorderwidget.py b/iw/driveorderwidget.py
deleted file mode 100644
index c39ceacef..000000000
--- a/iw/driveorderwidget.py
+++ /dev/null
@@ -1,132 +0,0 @@
-#
-# driveorderwidget.py: widget for reordering drives into BIOS order
-#
-# Copyright (C) 2001, 2002 Red Hat, Inc. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# Author(s): Jeremy Katz <katzj@redhat.com>
-#
-
-import gtk
-import gobject
-import iutil
-import partedUtils
-import gui
-from rhpl.translate import _, N_
-
-
-class DriveOrderWidget:
- """Widget to reorder drives according to BIOS drive order."""
-
-
- def __init__(self, driveorder, diskset):
- self.driveOrder = driveorder
- self.diskset = diskset
-
- hbox = gtk.HBox(False, 5)
-
- # different widget for this maybe?
- self.driveOrderStore = gtk.ListStore(gobject.TYPE_STRING,
- gobject.TYPE_STRING,
- gobject.TYPE_STRING)
- sw = gtk.ScrolledWindow()
- sw.set_shadow_type(gtk.SHADOW_ETCHED_IN)
- sw.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
-
- self.driveOrderView = gtk.TreeView(self.driveOrderStore)
- i = 0
- for columnName in [ N_("Drive"), N_("Size"), N_("Model") ]:
- renderer = gtk.CellRendererText()
- column = gtk.TreeViewColumn(columnName, renderer, text = i)
- i = i + 1
- column.set_clickable(False)
- self.driveOrderView.append_column(column)
-
-
- self.driveOrderView.set_rules_hint(False)
- self.driveOrderView.set_headers_visible(False)
- self.driveOrderView.set_enable_search(False)
-
- self.makeDriveOrderStore()
-
- sw.add(self.driveOrderView)
- self.driveOrderView.set_size_request(375, 80)
- hbox.pack_start(sw, False)
-
- arrowbox = gtk.VBox(False, 5)
- arrowButton = gtk.Button()
- arrow = gtk.Arrow(gtk.ARROW_UP, gtk.SHADOW_ETCHED_IN)
- arrowButton.add(arrow)
- arrowButton.connect("clicked", self.arrowClicked, gtk.ARROW_UP)
- arrowbox.pack_start(arrowButton, False)
-
- spacer = gtk.Label("")
- spacer.set_size_request(10, 1)
- arrowbox.pack_start(spacer, False)
-
- arrowButton = gtk.Button()
- arrow = gtk.Arrow(gtk.ARROW_DOWN, gtk.SHADOW_ETCHED_IN)
- arrowButton.add(arrow)
- arrowButton.connect("clicked", self.arrowClicked, gtk.ARROW_DOWN)
- arrowbox.pack_start(arrowButton, False)
-
- alignment = gtk.Alignment()
- alignment.set(0, 0.5, 0, 0)
- alignment.add(arrowbox)
- hbox.pack_start(alignment, False)
-
- self.widget = hbox
-
-
- def getWidget(self):
- return self.widget
-
-
- def getOrder(self):
- return self.driveOrder
-
-
- def arrowClicked(self, widget, direction, *args):
- selection = self.driveOrderView.get_selection()
- (model, iter) = selection.get_selected()
- if not iter:
- return
-
- # there has got to be a better way to do this =\
- drive = model.get_value(iter, 0)[5:]
- index = self.driveOrder.index(drive)
- if direction == gtk.ARROW_DOWN:
- self.driveOrder.remove(drive)
- self.driveOrder.insert(index + 1, drive)
- elif direction == gtk.ARROW_UP:
- self.driveOrder.remove(drive)
- self.driveOrder.insert(index - 1, drive)
- self.makeDriveOrderStore()
-
- # make the store for the drive order
- def makeDriveOrderStore(self):
- disks = self.diskset.disks
-
- self.driveOrderStore.clear()
- for drive in self.driveOrder:
- iter = self.driveOrderStore.append()
- self.driveOrderStore.set_value(iter, 0, "/dev/%s" % (drive,))
- # if we have it in the diskset, get the size and type of drive
- if disks.has_key(drive):
- size = partedUtils.getDeviceSizeMB(disks[drive].dev)
- sizestr = "%8.0f MB" %(size,)
-
- self.driveOrderStore.set_value(iter, 1, sizestr)
- self.driveOrderStore.set_value(iter, 2, disks[drive].dev.model)