summaryrefslogtreecommitdiffstats
path: root/gui.py
diff options
context:
space:
mode:
authorRadek Vykydal <rvykydal@redhat.com>2010-01-07 09:54:03 +0100
committerRadek Vykydal <rvykydal@redhat.com>2010-01-07 09:54:03 +0100
commit31d5b8f4fec513e4f8e246e47e9fee75c701d07b (patch)
tree9e6506cdf6bb4fdb91f50135a7620184ca14ea10 /gui.py
parent111123c68d9c835947b7636642c9bc2081dd7db0 (diff)
downloadanaconda-31d5b8f4fec513e4f8e246e47e9fee75c701d07b.tar.gz
anaconda-31d5b8f4fec513e4f8e246e47e9fee75c701d07b.tar.xz
anaconda-31d5b8f4fec513e4f8e246e47e9fee75c701d07b.zip
Ask about disk initialization only in storageinit step.
Don't ask again and again e.g. when going back and forth in custom partitioning UI. Related to bug #527711 which is itself fixed by another patch. (*) Answers are cached in InstallInterface classes. (*) Dialog callback is moved from storage code to InstallInterface classes.
Diffstat (limited to 'gui.py')
-rwxr-xr-xgui.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/gui.py b/gui.py
index fc93af4fb..2f9f9258c 100755
--- a/gui.py
+++ b/gui.py
@@ -987,6 +987,7 @@ class InstallInterface:
root = gtk.gdk.get_default_root_window()
cursor = gtk.gdk.Cursor(gtk.gdk.LEFT_PTR)
root.set_cursor(cursor)
+ self._initLabelAnswers = {}
def __del__ (self):
pass
@@ -1123,6 +1124,42 @@ class InstallInterface:
d.destroy()
return rc
+ def resetInitializeDiskQuestion(self):
+ self._initLabelAnswers = {}
+
+ def questionInitializeDisk(self, path, description, size, details=""):
+
+ retVal = False # The less destructive default
+
+ if not path:
+ return retVal
+
+ # we are caching answers so that we don't
+ # ask in each storage.reset() again
+ if path in self._initLabelAnswers:
+ log.info("UI not asking about disk initialization, "
+ "using cached answer: %s" % self._initLabelAnswers[path])
+ return self._initLabelAnswers[path]
+
+ 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")
+ % {'path': path, 'size': size,
+ 'description': description, 'details': details},
+ type="custom",
+ custom_buttons = [ _("_Ignore drive"),
+ _("_Re-initialize drive") ],
+ custom_icon="question")
+ if rc == 0:
+ pass
+ else:
+ retVal = True
+
+ self._initLabelAnswers[path] = retVal
+ return retVal
+
def beep(self):
gtk.gdk.beep()