summaryrefslogtreecommitdiffstats
path: root/text.py
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2010-01-19 13:19:35 -0500
committerChris Lumens <clumens@redhat.com>2010-01-19 15:06:48 -0500
commit00e34d97077f696cf18c58b784cef449a2017f17 (patch)
tree473ada864385ab885b84fed740951d33246782d0 /text.py
parent65a3c0584c83afa82bda9d6570887c6a578d9286 (diff)
downloadanaconda-00e34d97077f696cf18c58b784cef449a2017f17.tar.gz
anaconda-00e34d97077f696cf18c58b784cef449a2017f17.tar.xz
anaconda-00e34d97077f696cf18c58b784cef449a2017f17.zip
Support ignore all/reinit all on the disk reinitialization question (#512011).
It's possible for the user to have a huge number of disks, which could result in this dialog popping up a huge number of times. Therefore, it'd be a good idea to allow the user to apply their same choice to all following times when the dialog would pop up. Note that it would be nicer to add some sort of checkbox to MessageWindow to make this more clear, but that is not exactly trivial to do.
Diffstat (limited to 'text.py')
-rw-r--r--text.py48
1 files changed, 38 insertions, 10 deletions
diff --git a/text.py b/text.py
index c4602cd6e..1adc6a3da 100644
--- a/text.py
+++ b/text.py
@@ -471,21 +471,35 @@ class InstallInterface:
log.info("UI not asking about disk initialization, "
"using cached answer: %s" % self._initLabelAnswers[path])
return self._initLabelAnswers[path]
+ elif "all" in self._initLabelAnswers:
+ log.info("UI not asking about disk initialization, "
+ "using cached answer: %s" % self._initLabelAnswers["all"])
+ return self._initLabelAnswers["all"]
rc = self.messageWindow(_("Warning"),
_("Error processing drive:\n\n"
"%(path)s\n%(size)-0.fMB\n%(description)s\n\n"
"This device may need to be reinitialized.\n\n"
- "REINITIALIZING WILL CAUSE ALL DATA TO BE LOST!%(details)s")
+ "REINITIALIZING WILL CAUSE ALL DATA TO BE LOST!\n\n"
+ "This action may also be applied to all other disks "
+ "needing reinitialization.%(details)s")
% {'path': path, 'size': size,
'description': description, 'details': details},
type="custom",
- custom_buttons = [ _("_Ignore drive"),
- _("_Re-initialize drive") ],
+ custom_buttons = [ _("_Ignore"),
+ _("Ignore _all"),
+ _("_Re-initialize"),
+ _("Re-ini_tialize all") ],
custom_icon="question")
if rc == 0:
- pass
- else:
+ retVal = False
+ elif rc == 1:
+ path = "all"
+ retVal = False
+ elif rc == 2:
+ retVal = True
+ elif rc == 3:
+ path = "all"
retVal = True
self._initLabelAnswers[path] = retVal
@@ -497,6 +511,7 @@ class InstallInterface:
def questionReinitInconsistentLVM(self, pv_names=None, lv_name=None, vg_name=None):
retVal = False # The less destructive default
+ allSet = frozenset(["all"])
if not pv_names or (lv_name is None and vg_name is None):
return retVal
@@ -510,6 +525,10 @@ class InstallInterface:
log.info("UI not asking about disk initialization, "
"using cached answer: %s" % self._inconsistentLVMAnswers[key])
return self._inconsistentLVMAnswers[key]
+ elif allSet in self._inconsistentLVMAnswers:
+ log.info("UI not asking about disk initialization, "
+ "using cached answer: %s" % self._inconsistentLVMAnswers[allSet])
+ return self._inconsistentLVMAnswers[allSet]
if vg_name is not None:
message = "Volume Group %s" % vg_name
@@ -522,15 +541,24 @@ class InstallInterface:
"There is inconsistent LVM data on %(msg)s. You can "
"reinitialize all related PVs (%(pvs)s) which will erase "
"the LVM metadata, or ignore which will preserve the "
- "contents.") % na,
+ "contents. This action may also be applied to all other "
+ "PVs with inconsistent metadata.") % na,
type="custom",
custom_buttons = [ _("_Ignore"),
- _("_Re-initialize") ],
+ _("Ignore _all"),
+ _("_Re-initialize"),
+ _("Re-ini_tialize all") ],
custom_icon="question")
if rc == 0:
- pass
- else:
- retVal = True # this means clobber.
+ retVal = False
+ elif rc == 1:
+ key = allSet
+ retVal = False
+ elif rc == 2:
+ retVal = True
+ elif rc == 3:
+ key = allSet
+ retval = True
self._inconsistentLVMAnswers[key] = retVal
return retVal