~ubuntu-branches/ubuntu/trusty/pitivi/trusty

« back to all changes in this revision

Viewing changes to pitivi/ui/videofxlist.py

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2011-07-07 13:43:47 UTC
  • mto: (6.1.9 sid) (1.2.12)
  • mto: This revision was merged to the branch mainline in revision 32.
  • Revision ID: james.westby@ubuntu.com-20110707134347-cari9kxjiakzej9z
Tags: upstream-0.14.1
ImportĀ upstreamĀ versionĀ 0.14.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# PiTiVi , Non-linear video editor
2
 
#
3
 
#       ui/videofxlist.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
 
"""
23
 
Video effects list widget
24
 
"""
25
 
 
26
 
import gtk
27
 
import pango
28
 
from gettext import gettext as _
29
 
 
30
 
(COL_NAME,
31
 
 COL_DESCRIPTION,
32
 
 COL_FACTORY) = range(3)
33
 
 
34
 
class VideoFxList(gtk.VBox):
35
 
    """ Widget for listing video effects """
36
 
 
37
 
    def __init__(self, instance):
38
 
        gtk.VBox.__init__(self)
39
 
        self.set_border_width(5)
40
 
        self.app = instance
41
 
 
42
 
        # model
43
 
        self.storemodel = gtk.ListStore(str, str, object)
44
 
 
45
 
        self.scrollwin = gtk.ScrolledWindow()
46
 
        self.scrollwin.set_policy(gtk.POLICY_NEVER,
47
 
                                  gtk.POLICY_AUTOMATIC)
48
 
        self.pack_start(self.scrollwin)
49
 
 
50
 
        self.iconview = gtk.IconView(self.storemodel)
51
 
        self.treeview = gtk.TreeView(self.storemodel)
52
 
 
53
 
        namecol = gtk.TreeViewColumn(_("Name"))
54
 
        self.treeview.append_column(namecol)
55
 
        namecell = gtk.CellRendererText()
56
 
        namecol.pack_start(namecell)
57
 
        namecol.add_attribute(namecell, "text", COL_NAME)
58
 
 
59
 
        namecol = gtk.TreeViewColumn(_("Description"))
60
 
        self.treeview.append_column(namecol)
61
 
        namecell = gtk.CellRendererText()
62
 
        namecell.set_property("ellipsize", pango.ELLIPSIZE_END)
63
 
        namecol.pack_start(namecell)
64
 
        namecol.add_attribute(namecell, "text", COL_DESCRIPTION)
65
 
 
66
 
        self.scrollwin.add(self.treeview)
67
 
 
68
 
        self._fillUpModel()
69
 
 
70
 
    def _fillUpModel(self):
71
 
        for factory in self.app.effects.simple_video:
72
 
            self.storemodel.append([factory.get_longname(),
73
 
                                    factory.get_description(),
74
 
                                    factory])