~necoro/portato/0.9.0

« back to all changes in this revision

Viewing changes to portato/gui/gtk/splash.py

  • Committer: Necoro
  • Date: 2008-03-24 22:05:07 UTC
  • Revision ID: svn-v3-trunk0:707e4503-1661-43cb-8fc9-483266be2d6d:tags%2F0.9.0.2:686
Tags: 0.9.0.2
Moved versions back to tags

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: utf-8 -*-
 
2
#
 
3
# File: portato/gui/gtk/splash.py
 
4
# This file is part of the Portato-Project, a graphical portage-frontend.
 
5
#
 
6
# Copyright (C) 2007 René 'Necoro' Neumann
 
7
# This is free software.  You may redistribute copies of it under the terms of
 
8
# the GNU General Public License version 2.
 
9
# There is NO WARRANTY, to the extent permitted by law.
 
10
#
 
11
# Written by René 'Necoro' Neumann <necoro@necoro.net>
 
12
 
 
13
from __future__ import absolute_import
 
14
 
 
15
import gtk
 
16
import gobject
 
17
from gettext import lgettext as _
 
18
 
 
19
from ...constants import VERSION, APP_ICON
 
20
from .basic import Window
 
21
 
 
22
class SplashScreen (Window):
 
23
        
 
24
        def __init__ (self, startStr = ""):
 
25
                Window.__init__(self)
 
26
 
 
27
                self.image = self.tree.get_widget("image")
 
28
                self.genLabel = self.tree.get_widget("generalLabel")
 
29
                self.descrLabel = self.tree.get_widget("descrLabel")
 
30
                
 
31
                self.image.set_from_file(APP_ICON)
 
32
                self.genLabel.set_label("<b><big>Portato %s ...</big></b>" % VERSION)
 
33
                
 
34
                self.set_descr(startStr)
 
35
 
 
36
        def set_descr (self, string):
 
37
                self.descrLabel.set_label(_("... is starting up: %s") % string)
 
38
                self.do_iteration()
 
39
 
 
40
        def do_iteration (self):
 
41
                while gtk.events_pending():
 
42
                        gtk.main_iteration()
 
43
        
 
44
        def show (self):
 
45
                self.window.show_all()
 
46
                self.do_iteration()
 
47
 
 
48
        def hide (self):
 
49
                self.window.hide()
 
50
                self.do_iteration()
 
51
 
 
52
        __call__ = set_descr