diff options
author | Mike Fulbright <msf@redhat.com> | 2001-07-11 02:58:30 +0000 |
---|---|---|
committer | Mike Fulbright <msf@redhat.com> | 2001-07-11 02:58:30 +0000 |
commit | 3f04b3fedfdb6b3b7035ae47c610a6f871f33830 (patch) | |
tree | 9a532f4e686acb840fed2c9e8547196af21d09a2 | |
parent | 596a5cd3898641ecabbff1edc758f75bd1d34482 (diff) | |
download | anaconda-3f04b3fedfdb6b3b7035ae47c610a6f871f33830.tar.gz anaconda-3f04b3fedfdb6b3b7035ae47c610a6f871f33830.tar.xz anaconda-3f04b3fedfdb6b3b7035ae47c610a6f871f33830.zip |
ask user if they are sure they want to reformat a pre-existing partition
-rw-r--r-- | iw/partition_gui.py | 4 | ||||
-rw-r--r-- | partitioning.py | 9 | ||||
-rw-r--r-- | textw/partition_text.py | 20 |
3 files changed, 25 insertions, 8 deletions
diff --git a/iw/partition_gui.py b/iw/partition_gui.py index 16afb3b65..5a021274b 100644 --- a/iw/partition_gui.py +++ b/iw/partition_gui.py @@ -1018,6 +1018,10 @@ class PartitionWindow(InstallWindow): self.intf.messageWindow(_("Error With Request"), "%s" % (err)) continue + + if origrequest.format == None and request.format: + if not queryFormatPreExisting(self.intf): + continue # backup current (known working) configuration backpart = self.partitions.copy() diff --git a/partitioning.py b/partitioning.py index 302b41e11..1a3251894 100644 --- a/partitioning.py +++ b/partitioning.py @@ -1288,3 +1288,12 @@ def partitioningComplete(dispatch, bl, fsset, diskSet, partitions): entry = request.toEntry(partitions) fsset.add (entry) +def queryFormatPreExisting(intf): + rc = intf.messageWindow(_("Format?"), + _("You have chosen to format a pre-existing " + "partition. This will destroy all data " + "that was previously on it.\n\n" + "Are you sure you want to do this?"), + type = "yesno") + return rc + diff --git a/textw/partition_text.py b/textw/partition_text.py index 0d7330967..07964dc5d 100644 --- a/textw/partition_text.py +++ b/textw/partition_text.py @@ -668,20 +668,24 @@ class PartitionWindow: continue else: # pre-existing partition, just set mount point and format flag - if origrequest.fstype.isMountable(): - origrequest.mountpoint = self.mount.value() + request = copy.copy(origrequest) + if request.fstype.isMountable(): + request.mountpoint = self.mount.value() - origrequest.format = format - origrequest.migrate = migrate - origrequest.fstype = newfstype - origrequest.badblocks = badblocks + request.format = format + request.migrate = migrate + request.fstype = newfstype + request.badblocks = badblocks - err = sanityCheckPartitionRequest(self.partitions, origrequest) + err = sanityCheckPartitionRequest(self.partitions, request) if err: self.intf.messageWindow(_("Error With Request"), "%s" % (err)) continue - request = origrequest + + if origrequest.format == None and request.format: + if not queryFormatPreExisting(self.intf): + continue # backup current (known working) configuration backpart = self.partitions.copy() |