Re: [master] livecd: show graphical error dialog when memory check fails (#572263)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/15/2010 06:12 PM, Chris Lumens wrote:
I think you're on the right track here, but do you really need to use an
external program to accomplish this?  Couldn't you do something like:

import gtk
win = gtk.MessageDialog(whatever, ...)
win.show_all()

I don't know that it's any different or really saves any lines, but it
seems nicer to me.

- Chris


Allright, how about the patch below?

Ales


diff --git a/anaconda b/anaconda
index dcea88b..f613618 100755
--- a/anaconda
+++ b/anaconda
@@ -347,10 +347,27 @@ def checkMemory(anaconda):
     # override display mode if machine cannot nicely run X
     if not flags.usevnc:
if anaconda.displayMode not in ('t', 'c') and iutil.memInstalled() < isys.MIN_GUI_RAM: - stdoutLog.warning(_("You do not have enough RAM to use the graphical "
-                                "installer.  Starting text mode."))
-            anaconda.displayMode = 't'
-            time.sleep(2)
+            complain = _("You do not have enough RAM to use the graphical "
+                         "installer.")
+            if flags.livecdInstall:
+                stdoutLog.warning(complain)
+ recommendation = _("Try the text mode installer by running:\n\n" + "'/usr/bin/liveinst -T'\n\n from a root "
+                                   "terminal.")
+                title = _("Not enough RAM")
+                text = "%s %s" %(complain, recommendation)
+                import gtk
+                dialog = gtk.MessageDialog(type = gtk.MESSAGE_ERROR,
+                                           buttons = gtk.BUTTONS_CLOSE,
+                                           message_format=text)
+                dialog.set_title(title)
+                dialog.run()
+                sys.exit(1)
+            else:
+                resolution = _("Starting text mode.")
+                stdoutLog.warning("%s %s" % (complain, resolution))
+                anaconda.displayMode = 't'
+                time.sleep(2)

 def setupGraphicalLinks():
     for i in ( "imrc", "im_palette.pal", "gtk-2.0", "pango", "fonts",

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux