1
# PiTiVi , Non-linear video editor
5
# Copyright (c) 2005, Edward Hervey <bilboed@bilboed.com>
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.
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.
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.
23
Source and effects list widgets
27
from gettext import gettext as _
28
from sourcelist import SourceList
29
from audiofxlist import AudioFxList
30
from videofxlist import VideoFxList
31
from propertyeditor import PropertyEditor
33
class DetachLabel(gtk.HBox):
35
def __init__(self, parent, child, label, *args, **kwargs):
36
gtk.HBox.__init__(self, *args, **kwargs)
38
self.label = gtk.Label(label)
40
self.button = gtk.Button()
42
image.set_from_stock(gtk.STOCK_LEAVE_FULLSCREEN,
43
gtk.ICON_SIZE_SMALL_TOOLBAR)
44
self.button.set_image(image)
45
self.button.connect("clicked", self._windowize)
46
self.pack_start(self.button, False, False)
47
self.pack_start(self.label)
51
self.button.set_sensitive(True)
54
self.button.set_sensitive(False)
56
def _windowize(self, unused_button):
57
self.parent.windowizeComponent(self.child, self)
59
class ProjectTabs(gtk.Notebook):
61
Widget for the various source factories (files, effects, live,...)
64
__DEFAULT_COMPONENTS__ = (
65
(SourceList, _("Clip Library")),
66
# (AudioFxList, _("Audio Effects")),
67
# (VideoFxList, _("Video Effects")),
68
# FIXME : Property editor disabled for 0.11.3 release, re-enable after
69
# (PropertyEditor, _("Properties")),
72
def __init__(self, instance, uiman):
74
gtk.Notebook.__init__(self)
78
self.connect("switch-page", self._switchPage)
82
""" set up the gui """
83
self.set_tab_pos(gtk.POS_TOP)
84
for component, label in self.__DEFAULT_COMPONENTS__:
85
self.addComponent(component(self.app, self.uiman), label)
87
def addComponent(self, component, label):
88
self.append_page(component, DetachLabel(self, component, label))
89
self._full_list.append(component)
91
def windowizeComponent(self, component, label):
92
self.remove_page(self.page_num(component))
96
window.connect("destroy", self._replaceComponent, component, label)
97
window.resize(200, 200)
98
if not self.get_n_pages():
101
def _replaceComponent(self, window, component, label):
102
window.remove(component)
103
self.set_current_page(self.insert_page(component, label,
104
self._full_list.index(component)))
107
def _switchPage(self, unused_widget, unused_page, num):
108
for child in (self.get_nth_page(i) for i in xrange(self.get_n_pages())):
109
self.get_tab_label(child).deselect()
110
cur = self.get_tab_label(self.get_nth_page(num))