~ubuntu-branches/ubuntu/lucid/pitivi/lucid

« back to all changes in this revision

Viewing changes to pitivi/ui/audiofxlist.py

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2009-05-27 14:22:49 UTC
  • mfrom: (1.2.1 upstream) (3.1.13 experimental)
  • Revision ID: james.westby@ubuntu.com-20090527142249-tj0qnkc37320ylml
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# PiTiVi , Non-linear video editor
 
2
#
 
3
#       ui/audiofxlist.py
 
4
#
 
5
# Copyright (c) 2005, Edward Hervey <bilboed@bilboed.com>
 
6
#
 
7
# This program is free software; you can redistribute it and/or
 
8
# modify it under the terms of the GNU Lesser General Public
 
9
# License as published by the Free Software Foundation; either
 
10
# version 2.1 of the License, or (at your option) any later version.
 
11
#
 
12
# This program is distributed in the hope that it will be useful,
 
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
15
# Lesser General Public License for more details.
 
16
#
 
17
# You should have received a copy of the GNU Lesser General Public
 
18
# License along with this program; if not, write to the
 
19
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
20
# Boston, MA 02111-1307, USA.
 
21
 
 
22
import gtk
 
23
import pango
 
24
from gettext import gettext as _
 
25
 
 
26
"""
 
27
Audio FX list widgets
 
28
"""
 
29
 
 
30
class AudioFxList(gtk.VBox):
 
31
    """ Widget for listing video effects """
 
32
 
 
33
    def __init__(self, instance):
 
34
        gtk.VBox.__init__(self)
 
35
        self.set_border_width(5)
 
36
        self.app = instance
 
37
 
 
38
        # model
 
39
        self.storemodel = gtk.ListStore(str, str, object)
 
40
 
 
41
        self.scrollwin = gtk.ScrolledWindow()
 
42
        self.scrollwin.set_policy(gtk.POLICY_NEVER,
 
43
                                  gtk.POLICY_AUTOMATIC)
 
44
        self.pack_start(self.scrollwin)
 
45
 
 
46
        self.iconview = gtk.IconView(self.storemodel)
 
47
        self.treeview = gtk.TreeView(self.storemodel)
 
48
 
 
49
        namecol = gtk.TreeViewColumn(_("Name"))
 
50
        self.treeview.append_column(namecol)
 
51
        namecell = gtk.CellRendererText()
 
52
        namecol.pack_start(namecell)
 
53
        namecol.add_attribute(namecell, "text", 0)
 
54
 
 
55
        namecol = gtk.TreeViewColumn(_("Description"))
 
56
        self.treeview.append_column(namecol)
 
57
        namecell = gtk.CellRendererText()
 
58
        namecell.set_property("ellipsize", pango.ELLIPSIZE_END)
 
59
        namecol.pack_start(namecell)
 
60
        namecol.add_attribute(namecell, "text", 1)
 
61
 
 
62
        self.scrollwin.add(self.treeview)
 
63
 
 
64
        self._fillUpModel()
 
65
 
 
66
    def _fillUpModel(self):
 
67
        for factory in self.app.effects.simple_audio:
 
68
            self.storemodel.append([factory.get_longname(),
 
69
                                    factory.get_description(),
 
70
                                    factory])