~ubuntu-branches/debian/squeeze/elisa/squeeze

« back to all changes in this revision

Viewing changes to elisa/core/plugins/skins/default/loading.py

  • Committer: Bazaar Package Importer
  • Author(s): Loic Minier
  • Date: 2007-06-25 14:08:21 UTC
  • Revision ID: james.westby@ubuntu.com-20070625140821-nq0yskdi51xc9ogj
Tags: upstream-0.1.7
ImportĀ upstreamĀ versionĀ 0.1.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: utf-8 -*-
 
2
# Elisa - Home multimedia server
 
3
# Copyright (C) 2006,2007 Fluendo Embedded S.L. (www.fluendo.com).
 
4
# All rights reserved.
 
5
#
 
6
# This file is available under one of two license agreements.
 
7
#
 
8
# This file is licensed under the GPL version 2.
 
9
# See "LICENSE.GPL" in the root of this distribution including a special
 
10
# exception to use Elisa with Fluendo's plugins.
 
11
#
 
12
# The GPL part of Elisa is also available under a commercial licensing
 
13
# agreement from Fluendo.
 
14
# See "LICENSE.Elisa" in the root directory of this distribution package
 
15
# for details on that license.
 
16
 
 
17
from pgm.form import rectangle, label, color, stroke
 
18
from pgm.layout import group
 
19
from pgm import widget
 
20
 
 
21
class Loading(group.Group):
 
22
 
 
23
    def __init__(self):
 
24
        size = (800, 600)
 
25
        group.Group.__init__(self, size=size)
 
26
        self._rect = rectangle.Rectangle(size=size)
 
27
        self._rect.ordering = widget.NEAR
 
28
        #self._rect.tz = 200
 
29
        self._label = label.Label(font_size=34, size=(size[0], 40),
 
30
                                  weight=label.WEIGHT_BOLD)
 
31
        self.add(self._rect)
 
32
        self.add(self._label)
 
33
        self._label.position = (50, 250)
 
34
        self._label.ordering = widget.NEAR
 
35
 
 
36
        self.hide()
 
37
 
 
38
    def text__set(self, text):
 
39
        self._label.text = text
 
40
        if text:
 
41
            self.opacity = 150
 
42
        else:
 
43
            self.opacity = 0
 
44
            
 
45
    def text__get(self):
 
46
        return self._label.text
 
47
 
 
48
    def hide(self):
 
49
        self.visible = False
 
50
 
 
51
    def show(self):
 
52
        self.visible = True
 
53
 
 
54
    def visible__set(self, visible):
 
55
        group.Group.visible__set(self, visible)
 
56
        self._label.visible = visible
 
57
        self._rect.visible = visible