[POS-commit] r3882 - in stoq/trunk/stoq: .

Lincoln Vieira de Lana Molica lincoln at async.com.br
Fri Jul 7 17:31:54 BRT 2006


Author: lincoln
Date: Fri Jul  7 17:31:54 2006
New Revision: 3882

Modified:
   stoq/trunk/stoq/lib/stoqconfig.py
   stoq/trunk/stoq/main.py

Log:
Fixed bug 2607, splash screen reintegrated.
r=henrique


Modified: stoq/trunk/stoq/lib/stoqconfig.py
==============================================================================
--- stoq/trunk/stoq/lib/stoqconfig.py	(original)
+++ stoq/trunk/stoq/lib/stoqconfig.py	Fri Jul  7 17:31:54 2006
@@ -31,7 +31,6 @@
 import time
 
 import gtk
-import gobject
 from stoqlib.exceptions import (DatabaseError, UserProfileError,
                                 LoginError, DatabaseInconsistency)
 from stoqlib.gui.base.gtkadds import register_iconsets
@@ -44,7 +43,6 @@
 from stoq.lib.configparser import get_config
 
 _ = gettext.gettext
-SPLASH_TIMEOUT = 4000
 
 
 class AppConfig:
@@ -202,6 +200,7 @@
                 username, password, appname = ret
 
             if not dialog:
+                hide_splash()
                 dialog = StoqLoginDialog(_("Access Control"),
                                          choose_applications)
             if not ret or choose_applications:
@@ -301,9 +300,9 @@
             warning(msg)
         raise SystemExit
 
-#
-# Splash screen code
-#
+    #
+    # Splash screen code
+    #
 
 def show_splash(splash_path):
     msg = "The stoq directory %s doesn't exists." % splash_path
@@ -311,22 +310,18 @@
 
     # Interestingly enough, loading an XPM is slower than a JPG here
     f = os.path.join(splash_path, "splash.jpg")
-
     gtkimage = gtk.Image()
     gtkimage.set_from_file(f)
-
+    gtkimage.show()
     w = gtk.Window()
-    w.set_title('Stoq')
+    w.set_decorated(False)
     w.add(gtkimage)
     w.set_position(gtk.WIN_POS_CENTER)
-    w.show_all()
-
+    w.show_now()
     time.sleep(0.01)
     while gtk.events_pending():
         time.sleep(0.01)
         gtk.main_iteration()
-    gobject.timeout_add(SPLASH_TIMEOUT, hide_splash)
-
     global splash_win
     splash_win = w
 
@@ -334,7 +329,8 @@
 def hide_splash(*args):
     global splash_win
     if splash_win:
-        splash_win.hide()
+        splash_win.destroy()
+        splash_win = None
 
 splash_win = None
 

Modified: stoq/trunk/stoq/main.py
==============================================================================
--- stoq/trunk/stoq/main.py	(original)
+++ stoq/trunk/stoq/main.py	Fri Jul  7 17:31:54 2006
@@ -93,8 +93,8 @@
 
 
 def _run_app(options, appname):
-    from stoq.lib.stoqconfig import AppConfig
-
+    from stoq.lib.stoqconfig import AppConfig, show_splash
+    show_splash('data/pixmaps')
     appconf = AppConfig()
     appname = appconf.setup_app(appname, splash=True)
     module = __import__("stoq.gui.%s.app" % appname, globals(), locals(), [''])


More information about the POS-commit mailing list