FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Kernel

 
 
LinkBack Thread Tools
 
Old 03-15-2010, 04:12 PM
Chris Lumens
 
Default livecd: show graphical error dialog when memory check fails (#572263)

> + if flags.livecdInstall:
> + stdoutLog.warning(complain)
> + recommendation = _("Try the text mode installer by running:

"
> + "'/usr/bin/liveinst -T'

from a root "
> + "terminal.")
> + title = _("Not enough RAM")
> + text = "%s %s" %(complain, recommendation)
> + text_arg = "--text="%s"" % text
> + title_arg = "--title="%s"" % title
> + import shlex
> + argv = ['--error'] + shlex.split(text_arg) + shlex.split(title_arg)
> + iutil.execWithRedirect('zenity', argv)
> + sys.exit(1)
> + else:
> + resolution = _("Starting text mode.")
> + stdoutLog.warning("%s %s" % (complain, resolution))
> + anaconda.displayMode = 't'
> + time.sleep(2)

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

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 03-16-2010, 08:26 AM
Ales Kozumplik
 
Default livecd: show graphical error dialog when memory check fails (#572263)

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:

"
+ "'/usr/bin/liveinst -T'

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@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 03-16-2010, 01:09 PM
Chris Lumens
 
Default livecd: show graphical error dialog when memory check fails (#572263)

> Allright, how about the patch below?

Looks okay to me.

- Chris

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

Thread Tools




All times are GMT. The time now is 04:24 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org