summaryrefslogtreecommitdiffstats
path: root/iw
diff options
context:
space:
mode:
authorpnfisher <pnfisher>1999-09-11 20:38:15 +0000
committerpnfisher <pnfisher>1999-09-11 20:38:15 +0000
commit770776a38116e6e69e29665945f9c598fe1f7731 (patch)
tree2cbbf2ce0b1f8e3ae76bb13ccbefa2ef7aa169ef /iw
parent8f4fbe67c01dbb8693dadbd629cbbb50a2f632bc (diff)
downloadanaconda-770776a38116e6e69e29665945f9c598fe1f7731.tar.gz
anaconda-770776a38116e6e69e29665945f9c598fe1f7731.tar.xz
anaconda-770776a38116e6e69e29665945f9c598fe1f7731.zip
Add fdisk support for expert mode.
Diffstat (limited to 'iw')
-rw-r--r--iw/fdisk.py55
-rw-r--r--iw/installpath.py20
2 files changed, 70 insertions, 5 deletions
diff --git a/iw/fdisk.py b/iw/fdisk.py
new file mode 100644
index 000000000..546377dc0
--- /dev/null
+++ b/iw/fdisk.py
@@ -0,0 +1,55 @@
+from gtk import *
+from iw import *
+from gnome.zvt import *
+from os import execvp
+from gui import _
+
+class FDiskWindow (InstallWindow):
+
+ def __init__ (self, ics):
+ InstallWindow.__init__ (self, ics)
+ ics.setTitle (_("fdisk"))
+
+ def child_died (self, widget, button):
+ self.windowContainer.remove (self.windowContainer.children ()[0])
+ self.windowContainer.pack_start (self.buttonBox)
+ button.set_state (STATE_NORMAL)
+
+ self.ics.setPrevEnabled (1)
+ self.ics.setNextEnabled (1)
+ self.ics.setHelpEnabled (1)
+
+ def button_clicked (self, widget, drive):
+ zvt = ZvtTerm (80, 24)
+ zvt.connect ("child_died", self.child_died, widget)
+ if zvt.forkpty() == 0:
+ execvp ("/sbin/fdisk", ("/sbin/fdisk", "/dev/%s" % (drive,)))
+ zvt.show ()
+
+ self.windowContainer.remove (self.buttonBox)
+ self.windowContainer.pack_start (zvt)
+
+ self.ics.setHelpEnabled (0)
+ self.ics.setPrevEnabled (0)
+ self.ics.setNextEnabled (0)
+
+
+ def getScreen (self):
+ self.windowContainer = GtkVBox (FALSE)
+ self.buttonBox = GtkVBox (FALSE, 5)
+ self.buttonBox.set_border_width (5)
+ box = GtkVButtonBox ()
+ label = GtkLabel (_("Select drive to run fdisk on"))
+
+ drives = self.todo.drives.available ().keys ()
+ drives.sort ()
+ for drive in drives:
+ button = GtkButton (drive)
+ button.connect ("clicked", self.button_clicked, drive)
+ box.add (button)
+
+ self.buttonBox.pack_start (label, FALSE)
+ self.buttonBox.pack_start (box, FALSE)
+ self.windowContainer.pack_start (self.buttonBox)
+
+ return self.windowContainer
diff --git a/iw/installpath.py b/iw/installpath.py
index b08b90fbf..d4e20cf9e 100644
--- a/iw/installpath.py
+++ b/iw/installpath.py
@@ -6,7 +6,6 @@ from progress import *
from package import *
from network import *
from account import *
-from rootpartition import *
from auth import *
from mouse import *
from keyboard import *
@@ -18,6 +17,8 @@ from examine import *
from bootdisk import *
from timezone import *
from xconfig import *
+from fdisk import *
+from rootpartition import *
from gui import _
import installclass
@@ -77,13 +78,14 @@ class InstallPathWindow (InstallWindow):
if not self.__dict__.has_key("upgradeButton"):
return
+ icw = self.ics.getICW ()
if self.upgradeButton.get_active():
self.todo.upgrade = 1
- self.ics.getICW ().setStateList (self.commonSteps +
- self.upgradeSteps, len (self.commonSteps)-1)
+ icw.setStateList (self.commonSteps +
+ self.upgradeSteps, len (self.commonSteps)-1)
else:
- self.ics.getICW ().setStateList (self.commonSteps +
- self.installSteps, len (self.commonSteps)-1)
+ icw.setStateList (self.commonSteps +
+ self.installSteps, len (self.commonSteps)-1)
self.todo.upgrade = 0
for (button, type) in self.installClasses:
@@ -159,6 +161,14 @@ class InstallPathWindow (InstallWindow):
box.pack_start(table, FALSE)
+ if self.todo.expert:
+ InstallPathWindow.fdisk = GtkCheckButton (_("Use fdisk to format drives"))
+ line = GtkHSeparator ()
+ box.pack_start (line, FALSE)
+ box.pack_start (InstallPathWindow.fdisk, FALSE)
+ else:
+ InstallPathWindow.fdisk = None
+
self.toggled (installButton, INSTALL)
box.set_border_width (5)
return box