[pitivi/ges: 229/287] Connect sources removed from the library to the timeline



commit 0f7afc5b2cc87d7c0d9d21314f63204a48556a19
Author: Jean-FranÃois Fortin Tam <nekohayo gmail com>
Date:   Tue Jan 17 09:33:59 2012 -0500

    Connect sources removed from the library to the timeline

 pitivi/mainwindow.py   |   18 +++++++++++++-----
 pitivi/medialibrary.py |    2 +-
 2 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/pitivi/mainwindow.py b/pitivi/mainwindow.py
index ffaf085..6904841 100644
--- a/pitivi/mainwindow.py
+++ b/pitivi/mainwindow.py
@@ -474,7 +474,7 @@ class PitiviMainWindow(gtk.Window, Loggable):
         os.environ["PULSE_PROP_application.icon_name"] = "pitivi"
 
     def _connectToMediaLibrary(self):
-        self.medialibrary.connect('play', self._sourceListPlayCb)
+        self.medialibrary.connect('play', self._mediaLibraryPlayCb)
 
     def setFullScreen(self, fullscreen):
         """ Toggle the fullscreen mode of the application """
@@ -543,9 +543,14 @@ class PitiviMainWindow(gtk.Window, Loggable):
         self.settings.mainWindowShowMainToolbar = mtb.props.active
         self.settings.mainWindowShowTimelineToolbar = ttb.props.active
 
-    def _sourceListPlayCb(self, medialibrary, uri):
+    def _mediaLibraryPlayCb(self, medialibrary, uri):
         self._viewUri(uri)
 
+    def _mediaLibrarySourceRemovedCb(self, medialibrary, uri, unused_info):
+        """When a clip is removed from the Media Library, tell the timeline
+        to remove all instances of that clip."""
+        self.timeline.purgeObject(uri)
+
 ## Toolbar/Menu actions callback
 
     def _newProjectMenuCb(self, unused_action):
@@ -691,8 +696,8 @@ class PitiviMainWindow(gtk.Window, Loggable):
         self.log("A NEW project is loaded, update the UI!")
         self._setProject(project)
 
-        #FIXME we should reanable it when possible with GES
-        #self._connectToProjectSources(project.medialibrary)
+        self._connectToProjectSources(project.medialibrary)
+        #FIXME GES we should re-enable this when possible
         #self._syncDoUndo(self.app.action_log)
 
         #FIXME GES reimplement me
@@ -918,7 +923,10 @@ class PitiviMainWindow(gtk.Window, Loggable):
         dialog.destroy()
 
     def _connectToProjectSources(self, medialibrary):
-        medialibrary.connect("missing-plugins", self._sourceListMissingPluginsCb)
+        #FIXME GES we should re-enable this when possible
+        #medialibrary.connect("missing-plugins", self._sourceListMissingPluginsCb)
+        medialibrary.connect("source-removed",
+            self._mediaLibrarySourceRemovedCb)
 
     def _actionLogCommit(self, action_log, stack, nested):
         if nested:
diff --git a/pitivi/medialibrary.py b/pitivi/medialibrary.py
index 158c647..f18eb81 100644
--- a/pitivi/medialibrary.py
+++ b/pitivi/medialibrary.py
@@ -817,7 +817,7 @@ class MediaLibraryWidget(gtk.VBox, Loggable):
             self.infobar.hide_all()
             self.search_hbox.show_all()
 
-    def _sourceRemovedCb(self, medialibrary, uri, factory):
+    def _sourceRemovedCb(self, medialibrary, uri, unused_info):
         """ the given uri was removed from the medialibrary """
         # find the good line in the storemodel and remove it
         model = self.storemodel



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]