pitivi r1416 - in trunk/pitivi: timeline ui
- From: edwardrv svn gnome org
- To: svn-commits-list gnome org
- Subject: pitivi r1416 - in trunk/pitivi: timeline ui
- Date: Fri, 28 Nov 2008 17:36:33 +0000 (UTC)
Author: edwardrv
Date: Fri Nov 28 17:36:33 2008
New Revision: 1416
URL: http://svn.gnome.org/viewvc/pitivi?rev=1416&view=rev
Log:
make property browser do something
Modified:
trunk/pitivi/timeline/timeline.py
trunk/pitivi/ui/propertyeditor.py
Modified: trunk/pitivi/timeline/timeline.py
==============================================================================
--- trunk/pitivi/timeline/timeline.py (original)
+++ trunk/pitivi/timeline/timeline.py Fri Nov 28 17:36:33 2008
@@ -44,6 +44,7 @@
"track-added" : ("track"),
"track-removed" : ("track"),
"start-duration-changed" : ("start", "duration"),
+ "selection-changed" : (),
}
# TODO make the compositions more versatile
@@ -218,6 +219,9 @@
__selection = None
+ def getSelection(self):
+ return self.__selection
+
def setSelectionTo(self, objs, mode=0):
if mode == 1:
objs |= self.__selection
@@ -229,6 +233,7 @@
for obj in objs:
obj.selected = True
self.__selection = objs
+ self.emit("selection-changed")
def setSelectionToObj(self, obj, mode=0):
#TODO: range selection
Modified: trunk/pitivi/ui/propertyeditor.py
==============================================================================
--- trunk/pitivi/ui/propertyeditor.py (original)
+++ trunk/pitivi/ui/propertyeditor.py Fri Nov 28 17:36:33 2008
@@ -24,10 +24,57 @@
"""
import gtk
+import pitivi.instance as instance
from gettext import gettext as _
+from pitivi.receiver import receiver, handler
class PropertyEditor(gtk.VBox):
def __init__(self, *args, **kwargs):
gtk.VBox.__init__(self, *args, **kwargs)
- self.add(gtk.Label(_("Not Implemented")))
+ self.instance = instance.PiTiVi
+ self.timeline = instance.PiTiVi.current.timeline
+ self.__createUi()
+
+ def __createUi(self):
+ # basic initialization
+ self.set_border_width(5)
+ self.set_spacing(6)
+
+ # scrolled window
+ scrolled = gtk.ScrolledWindow()
+ scrolled.set_shadow_type(gtk.SHADOW_ETCHED_IN)
+ self.label = gtk.Label()
+ scrolled.add_with_viewport(self.label)
+ self.add(scrolled)
+ self.__selectionChangedCb(self.timeline)
+
+## Instance Callbacks
+
+ instance = receiver()
+
+ @handler(instance, "new-project-loading")
+ def __newProjectLoading(self, unused_inst, project):
+ self.timeline = project.timeline
+
+ @handler(instance, "new-project-failed")
+ def __newProjectFailed(self, unused_inst, unused_reason, unused_uri):
+ self.timeline = None
+
+## Timeline Callbacks
+
+ timeline = receiver()
+
+ @handler(timeline, "selection-changed")
+ def __selectionChangedCb(self, timeline):
+ if not self.timeline:
+ return
+
+ objs = self.timeline.getSelection()
+ if objs:
+ text = "Properties For: "
+ for obj in self.timeline.getSelection():
+ text += "\n" + obj.factory.name
+ else:
+ text = "No Objects Selected"
+ self.label.set_text(text)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]