summaryrefslogtreecommitdiffstats
path: root/textw
diff options
context:
space:
mode:
authorMike Fulbright <msf@redhat.com>2002-06-25 15:06:05 +0000
committerMike Fulbright <msf@redhat.com>2002-06-25 15:06:05 +0000
commitf3f2d34d39c16dfa1799970586196634f60430ed (patch)
tree6155e5fe47545a2aaeaf0ad50ba3b6fefa08b798 /textw
parentda154de9262e87d3946b6b1a39fb180064bbe973 (diff)
downloadanaconda-f3f2d34d39c16dfa1799970586196634f60430ed.tar.gz
anaconda-f3f2d34d39c16dfa1799970586196634f60430ed.tar.xz
anaconda-f3f2d34d39c16dfa1799970586196634f60430ed.zip
dont show badblocks options for preexisting LVM and RAID devices
Diffstat (limited to 'textw')
-rw-r--r--textw/partition_text.py36
1 files changed, 26 insertions, 10 deletions
diff --git a/textw/partition_text.py b/textw/partition_text.py
index 1eda15560..154b32dfc 100644
--- a/textw/partition_text.py
+++ b/textw/partition_text.py
@@ -499,13 +499,15 @@ class PartitionWindow:
return (subgrid, fsoptLbl, type)
- def fsOptionsDialog(self, origrequest, format, migrate, newfstype, badblocks):
+ def fsOptionsDialog(self, origrequest, format, migrate, newfstype, badblocks, showbadblocks=1):
def formatChanged((formatrb, badblocksCB)):
flag = FLAGS_SET
if formatrb.selected():
flag = FLAGS_RESET
- badblocksCB.setFlags(FLAG_DISABLED, flag)
+
+ if badblocksCB:
+ badblocksCB.setFlags(FLAG_DISABLED, flag)
poplevel = GridFormHelp(self.screen, _("Filesystem Options"),
"fsoption", 1, 6)
@@ -516,7 +518,11 @@ class PartitionWindow:
row = row + 1
subgrid = Grid(2, 5)
srow = 0
- badblocksCB = Checkbox(_("Check for bad blocks"))
+
+ if showbadblocks:
+ badblocksCB = Checkbox(_("Check for bad blocks"))
+ else:
+ badblocksCB = None
noformatrb = SingleRadioButton(_("Leave unchanged (preserve data)"),
None, not format and not migrate)
@@ -567,10 +573,11 @@ class PartitionWindow:
row = row + 1
- poplevel.add(badblocksCB, 0, row, (0,1,0,1))
- if badblocks:
- badblocksCB.setValue("*")
- row = row + 1
+ if badblocksCB:
+ poplevel.add(badblocksCB, 0, row, (0,1,0,1))
+ if badblocks:
+ badblocksCB.setValue("*")
+ row = row + 1
formatChanged((formatrb, badblocksCB))
@@ -598,7 +605,12 @@ class PartitionWindow:
newfstype = migtype.current()
self.screen.popWindow()
- return (format, migrate, newfstype, badblocksCB.selected())
+
+ if badblocksCB:
+ badblockstate = badblocksCB.selected()
+ else:
+ badblockstate = 0
+ return (format, migrate, newfstype, badblockstate)
def shutdownUI(self):
# XXX remove parted object refs
@@ -700,7 +712,11 @@ class PartitionWindow:
return
if popbb.buttonPressed(res) == 'fsopts':
- (format, migrate, newfstype, badblocks) = self.fsOptionsDialog(origrequest, format, migrate, newfstype, badblocks)
+ if origrequest.type == REQUEST_LV:
+ showbad = 0
+ else:
+ showbad = 1
+ (format, migrate, newfstype, badblocks) = self.fsOptionsDialog(origrequest, format, migrate, newfstype, badblocks, showbadblocks = showbad)
self.fstypeSet((newfstype, self.mount))
fstypeLbl.setText(newfstype.getName())
@@ -928,7 +944,7 @@ class PartitionWindow:
return
if popbb.buttonPressed(res) == 'fsopts':
- (format, migrate, newfstype, badblocks) = self.fsOptionsDialog(raidrequest, format, migrate, newfstype, badblocks)
+ (format, migrate, newfstype, badblocks) = self.fsOptionsDialog(raidrequest, format, migrate, newfstype, badblocks, showbadblocks=0)
self.fstypeSet((newfstype, self.mount))
fstypeLbl.setText(newfstype.getName())