diff options
author | Mike Fulbright <msf@redhat.com> | 2001-06-25 19:07:54 +0000 |
---|---|---|
committer | Mike Fulbright <msf@redhat.com> | 2001-06-25 19:07:54 +0000 |
commit | 656359e03d1c836ba1232b91f8b521f2f5623100 (patch) | |
tree | b76ec2f91bf4df8e3bf61f6b25444c50afa422a4 | |
parent | 17ca1c75dc2e7f76555ee49329bdf50d95c100a7 (diff) | |
download | anaconda-656359e03d1c836ba1232b91f8b521f2f5623100.tar.gz anaconda-656359e03d1c836ba1232b91f8b521f2f5623100.tar.xz anaconda-656359e03d1c836ba1232b91f8b521f2f5623100.zip |
add partition method to GUI, rework to use skiplist
-rw-r--r-- | autopart.py | 7 | ||||
-rw-r--r-- | dispatch.py | 4 | ||||
-rw-r--r-- | installclass.py | 1 | ||||
-rw-r--r-- | instdata.py | 10 | ||||
-rw-r--r-- | iw/fdisk_gui.py | 13 | ||||
-rw-r--r-- | iw/partition_gui.py | 3 | ||||
-rw-r--r-- | iw/partmethod_gui.py | 54 | ||||
-rw-r--r-- | partitioning.py | 16 | ||||
-rw-r--r-- | textw/fdisk_text.py | 2 |
9 files changed, 92 insertions, 18 deletions
diff --git a/autopart.py b/autopart.py index e9ee39794..247f53c05 100644 --- a/autopart.py +++ b/autopart.py @@ -530,9 +530,10 @@ def doClearPartAction(id, type, cleardrives): id.partrequests.addDelete(delete) continue -def doAutoPartition(id): - if not id.useAutopartitioning: - return DISPATCH_NOOP +def doAutoPartition(dir, id): + + if dir == DISPATCH_BACK: + return # if no auto partition info in instclass we bail if len(id.autoPartitionRequests) < 1: diff --git a/dispatch.py b/dispatch.py index 6c47704c4..5e63ed8a9 100644 --- a/dispatch.py +++ b/dispatch.py @@ -21,6 +21,7 @@ from packages import handleX11Packages, writeConfiguration, writeXConfiguration from packages import writeKSConfiguration, turnOnFilesystems from packages import queryUpgradeContinue from autopart import doAutoPartition +from partitioning import partitionMethodSetup from floppy import makeBootdisk from bootloader import partitioningComplete, writeBootloader from flags import flags @@ -50,8 +51,9 @@ installSteps = [ ( "upgradecontinue", queryUpgradeContinue, ("intf", "dir")), ( "addswap", ("dispatch", "intf", "id.fsset", "id.diskset", "instPath") ), ( "partitionmethod", ("id",) ), + ( "partitionmethodsetup", partitionMethodSetup, ("id", "dispatch") ), ( "autopartition", ("id", "intf") ), - ( "autopartitionexecute", doAutoPartition, ("id",)), + ( "autopartitionexecute", doAutoPartition, ("dir", "id",)), ( "fdisk", ("id.useFdisk", "id.diskset", "id.partrequests")), ( "partition", ("id.fsset", "id.diskset", "id.partrequests", "intf")), ( "partitiondone", partitioningComplete, ("dispatch", "id.bootloader", diff --git a/installclass.py b/installclass.py index 239b51135..855a14511 100644 --- a/installclass.py +++ b/installclass.py @@ -97,6 +97,7 @@ class BaseInstallClass: "welcome", "installtype", "partitionmethod", + "partitionmethodsetup", "autopartition", "autopartitionexecute", "fdisk", diff --git a/instdata.py b/instdata.py index b8ca432a3..7ac159205 100644 --- a/instdata.py +++ b/instdata.py @@ -21,8 +21,8 @@ import timezone import desktop import users import fsset -import partitioning import bootloader + from simpleconfig import SimpleConfigFile class Boolean: @@ -59,8 +59,12 @@ class InstallData: self.comps = None self.upgrade = Boolean() self.fsset.reset() - self.diskset = partitioning.DiskSet() - self.partrequests = partitioning.PartitionRequests(self.diskset) +# +# delay setting these until we know the partition method +# self.diskset = partitioning.DiskSet() +# self.partrequests = partitioning.PartitionRequests(self.diskset) + self.diskset = None + self.partrequests = None self.autoPartitionRequests = [] self.autoClearPartType = None self.autoClearPartDrives = [] diff --git a/iw/fdisk_gui.py b/iw/fdisk_gui.py index eee1acae6..1d59d671d 100644 --- a/iw/fdisk_gui.py +++ b/iw/fdisk_gui.py @@ -2,6 +2,7 @@ from gtk import * from iw_gui import * from gnome.zvt import * from translate import _ +from dispatch import DISPATCH_NOOP import isys import os @@ -11,6 +12,14 @@ class FDiskWindow (InstallWindow): ics.setTitle (_("fdisk")) ics.readHTML ("fdisk") + def getNext(self): + + # reread partitions + self.partrequests.setFromDisk(self.diskset) + + return None + + def child_died (self, widget, button): self.windowContainer.remove (self.windowContainer.children ()[0]) self.windowContainer.pack_start (self.buttonBox) @@ -54,8 +63,10 @@ class FDiskWindow (InstallWindow): self.ics.setNextEnabled (0) # FDiskWindow tag="fdisk" - def getScreen (self, diskset): + def getScreen (self, useFdisk, diskset, partrequests): + self.diskset = diskset + self.partrequests = partrequests self.windowContainer = GtkVBox (FALSE) self.buttonBox = GtkVBox (FALSE, 5) diff --git a/iw/partition_gui.py b/iw/partition_gui.py index 072186c93..584b0d6df 100644 --- a/iw/partition_gui.py +++ b/iw/partition_gui.py @@ -17,6 +17,7 @@ from iw_gui import * from gtk import * from GDK import * from gnome.ui import * +from dispatch import DISPATCH_NOOP from translate import _, N_ from partitioning import * from fsset import * @@ -1268,8 +1269,6 @@ class PartitionWindow(InstallWindow): return box - - class AutoPartitionWindow(InstallWindow): def __init__(self, ics): InstallWindow.__init__(self, ics) diff --git a/iw/partmethod_gui.py b/iw/partmethod_gui.py index 4c3a753d4..83733a939 100644 --- a/iw/partmethod_gui.py +++ b/iw/partmethod_gui.py @@ -23,24 +23,64 @@ class PartitionMethodWindow(InstallWindow): ics.setTitle (_("Automatic Partitioning")) def getNext(self): + if self.useFdisk.get_active(): - self.dispatch.skipStep("fdisk", skip = 0) - else: - self.dispatch.skipStep("fdisk") + self.id.useAutopartitioning = 0 + self.id.useFdisk = 1 + elif self.useAuto.get_active(): + self.id.useAutopartitioning = 1 + self.id.useFdisk = 0 + else: + self.id.useAutopartitioning = 0 + self.id.useFdisk = 0 + return None - def getScreen (self, dispatch): - self.dispatch = dispatch + def getScreen (self, id): + + # XXX Change to not use id in (use more specific components of id) + self.id = id box = GtkVBox (FALSE) box.set_border_width (5) + label = GtkLabel( + _("Autopartitioning sets up your partitioning in a reasonable " + "way depending on your installation type and then gives you a " + "chance to customize this setup.\n" + "\n" + "Disk Shaman is a tool designed for partitioning and setting " + "up mount points. It is designed to be easier to use than " + "Linux's traditional disk partitioning software, fdisk, as " + "well as more powerful. However, there are some cases where " + "fdisk may be preferred.\n" + "\n" + "Which tool would you like to use?")) + + label.set_line_wrap(1) + label.set_alignment(0.0, 0.0) + label.set_usize(400, -1) + + box.pack_start(label) + radioBox = GtkVBox (FALSE) + self.useAuto = GtkRadioButton( + None, _("Have the installer autopartition for you")) + radioBox.pack_start(self.useAuto, FALSE) + self.useDS = GtkRadioButton( + self.useAuto, _("Manually partition with Disk Shaman")) + radioBox.pack_start(self.useDS, FALSE) self.useFdisk = GtkRadioButton( - None, _("Manually partition with fdisk [experts only]")) + self.useAuto, _("Manually partition with fdisk [experts only]")) radioBox.pack_start(self.useFdisk, FALSE) - self.useFdisk.set_active (not dispatch.stepInSkipList("fdisk")) + + if id.useAutopartitioning: + self.useAuto.set_active(1) + elif id.useFdisk: + self.useFdisk.set_active(1) + else: + self.useDS.set_active(1) align = GtkAlignment() align.add(radioBox) diff --git a/partitioning.py b/partitioning.py index dd553c36a..4b4fb4edd 100644 --- a/partitioning.py +++ b/partitioning.py @@ -814,3 +814,19 @@ class DiskSet: flags)) part = disk.next_partition(part) return rc + +def partitionMethodSetup(id, dispatch): + + # turn on/off step based on 3 paths: + # - use fdisk, then set mount points + # - use autopartitioning, then set mount points + # - use interactive partitioning tool, continue + + dispatch.skipStep("autopartition", skip = not id.useAutopartitioning) + dispatch.skipStep("autopartitionexecute",skip = not id.useAutopartitioning) + dispatch.skipStep("fdisk", skip = not id.useFdisk) + + # read in drive info + id.diskset = DiskSet() + id.partrequests = PartitionRequests(id.diskset) + diff --git a/textw/fdisk_text.py b/textw/fdisk_text.py index aa5f2e3b6..7ac172675 100644 --- a/textw/fdisk_text.py +++ b/textw/fdisk_text.py @@ -36,7 +36,7 @@ class fdiskPartitionWindow: (button, choice) = \ ListboxChoiceWindow(screen, _("Disk Setup"), _("Choose a disk to run fdisk on"), choices, - [ (_("Done"), "done"), (_("Edit"), "edit"), + [ (_("Ok"), "done"), (_("Edit"), "edit"), TEXT_BACK_BUTTON ], width = 50, help = "fdisk") if button != "done" and button != TEXT_BACK_CHECK: |