summaryrefslogtreecommitdiffstats
path: root/splashscreen.py
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>2001-10-16 20:59:15 +0000
committerMatt Wilson <msw@redhat.com>2001-10-16 20:59:15 +0000
commitcc02a97cc308be0ae7d6e4ac6c605518103c6f22 (patch)
tree21376b7119090a57bc496a2731b7952fd465b0a9 /splashscreen.py
parent584b653db54b96a7721cffeba67680495e59337c (diff)
downloadanaconda-cc02a97cc308be0ae7d6e4ac6c605518103c6f22.tar.gz
anaconda-cc02a97cc308be0ae7d6e4ac6c605518103c6f22.tar.xz
anaconda-cc02a97cc308be0ae7d6e4ac6c605518103c6f22.zip
merge anaconda-gtk-2-0-branch to HEAD
Diffstat (limited to 'splashscreen.py')
-rw-r--r--splashscreen.py55
1 files changed, 23 insertions, 32 deletions
diff --git a/splashscreen.py b/splashscreen.py
index 75b7ddd73..2144be3c1 100644
--- a/splashscreen.py
+++ b/splashscreen.py
@@ -18,11 +18,8 @@ os.environ["PYGTK_DISABLE_THREADS"] = "1"
os.environ["PYGTK_FATAL_EXCEPTIONS"] = "1"
os.environ["GNOME_DISABLE_CRASH_DIALOG"] = "1"
-from gtk import *
-from gtk import _root_window
+import gtk
from flags import flags
-import GDK
-import gdkpixbuf
splashwindow = None
@@ -32,33 +29,30 @@ def splashScreenShow(configFileData):
path = ("/usr/X11R6/bin/xsetroot",)
args = ("-solid", "gray45")
- child = os.fork ()
+ child = os.fork()
if (child == 0):
- os.execv (path[0], path + args)
+ os.execv(path[0], path + args)
try:
pid, status = os.waitpid(child, 0)
except OSError, (errno, msg):
print __name__, "waitpid:", msg
- root = _root_window ()
- cursor = cursor_new (GDK.LEFT_PTR)
- root.set_cursor (cursor)
+ root = gtk.gdk.get_default_root_window()
+ cursor = gtk.gdk.Cursor(gtk.gdk.LEFT_PTR)
+ root.set_cursor(cursor)
def load_image(file):
- try:
- p = gdkpixbuf.new_from_file("/usr/share/anaconda/" + file)
- except:
- try:
- p = gdkpixbuf.new_from_file("" + file)
- except:
- p = None
- print "Unable to load", file
-
+ p = gtk.Image()
+ pixbuf = gtk.gdk.pixbuf_new_from_file("/usr/share/anaconda/" + file)
+ if pixbuf is None:
+ pixbuf = gtk.gdk.pixbuf_new_from_file(file)
+ if pixbuf:
+ p.set_from_pixbuf(pixbuf)
return p
global splashwindow
- width = screen_width()
+ width = gtk.gdk.screen_width()
p = None
# If the xserver is running at 800x600 res or higher, use the
@@ -71,22 +65,19 @@ def splashScreenShow(configFileData):
p = load_image('pixmaps/first-lowres.png')
if p:
- pix = apply (GtkPixmap, p.render_pixmap_and_mask())
- splashwindow = GtkWindow ()
- splashwindow.set_position (WIN_POS_CENTER)
- box = GtkEventBox ()
- style = box.get_style ().copy ()
- style.bg[STATE_NORMAL] = style.white
- box.set_style (style)
- box.add (pix)
- splashwindow.add (box)
+ splashwindow = gtk.Window()
+ splashwindow.set_position(gtk.WIN_POS_CENTER)
+ box = gtk.EventBox()
+ box.modify_bg(gtk.STATE_NORMAL, box.get_style().white)
+ box.add(p)
+ splashwindow.add(box)
box.show_all()
splashwindow.show_now()
- gdk_flush ()
- while events_pending ():
- mainiteration (FALSE)
+ gtk.gdk.flush()
+ while gtk.events_pending():
+ gtk.main_iteration(gtk.FALSE)
def splashScreenPop():
global splashwindow
if splashwindow:
- splashwindow.destroy ()
+ splashwindow.destroy()