[pitivi/ges: 211/287] Rename project.sources to project.medialibrary for clarity



commit 719c165d52c69b117eeef61c2a15f0387627dcfa
Author: Jean-FranÃois Fortin Tam <nekohayo gmail com>
Date:   Thu Jan 12 23:25:05 2012 -0500

    Rename project.sources to project.medialibrary for clarity

 pitivi/application.py       |   12 ++++++------
 pitivi/mainwindow.py        |   12 ++++++------
 pitivi/medialibrary.py      |   24 ++++++++++++------------
 pitivi/project.py           |   10 +++++-----
 pitivi/timeline/timeline.py |    2 +-
 pitivi/timeline/track.py    |    2 +-
 6 files changed, 31 insertions(+), 31 deletions(-)
---
diff --git a/pitivi/application.py b/pitivi/application.py
index 68b0599..e37a167 100644
--- a/pitivi/application.py
+++ b/pitivi/application.py
@@ -188,7 +188,7 @@ class Pitivi(Loggable, Signallable):
         self.action_log.clean()
         #self.timelineLogObserver.startObserving(project.timeline)
         self.projectLogObserver.startObserving(project)
-        self.medialibrary_log_observer.startObserving(project.sources)
+        self.medialibrary_log_observer.startObserving(project.medialibrary)
         self._newProjectLoaded(project)
         self.emit("new-project-loaded", project)
 
@@ -320,11 +320,11 @@ class ProjectCreatorGuiPitivi(FullGuiPitivi):
         self.projectManager.newBlankProject(False)
         uris = ["file://" + urllib.quote(os.path.abspath(media_filename))
                 for media_filename in media_filenames]
-        self.current.sources.connect("source-added",
+        self.current.medialibrary.connect("source-added",
                 self._sourceAddedCb, uris, add_to_timeline)
-        self.current.sources.connect("discovery-error",
+        self.current.medialibrary.connect("discovery-error",
                 self._discoveryErrorCb, uris)
-        self.current.sources.addUris(uris)
+        self.current.medialibrary.addUris(uris)
 
     def _sourceAddedCb(self, medialibrary, info,
             startup_uris, add_to_timeline):
@@ -349,8 +349,8 @@ class ProjectCreatorGuiPitivi(FullGuiPitivi):
             return False
 
         if not startup_uris:
-            self.current.sources.disconnect_by_function(self._sourceAddedCb)
-            self.current.sources.disconnect_by_function(self._discoveryErrorCb)
+            self.current.medialibrary.disconnect_by_function(self._sourceAddedCb)
+            self.current.medialibrary.disconnect_by_function(self._discoveryErrorCb)
 
         return True
 
diff --git a/pitivi/mainwindow.py b/pitivi/mainwindow.py
index 7b7877e..be1df4d 100644
--- a/pitivi/mainwindow.py
+++ b/pitivi/mainwindow.py
@@ -687,7 +687,7 @@ class PitiviMainWindow(gtk.Window, Loggable):
         self._setProject(project)
 
         #FIXME we should reanable it when possible with GES
-        #self._connectToProjectSources(project.sources)
+        #self._connectToProjectSources(project.medialibrary)
         #self._syncDoUndo(self.app.action_log)
 
         #FIXME GES reimplement me
@@ -900,7 +900,7 @@ class PitiviMainWindow(gtk.Window, Loggable):
             self.log("User chose a new URI for the missing file")
             new_uri = chooser.get_uri()
             if new_uri:
-                self.project.sources.addUri(new_uri)
+                self.project.medialibrary.addUri(new_uri)
                 formatter.update_source_uri(tfs, new_uri)
                 self._missingUriOnLoading = True
         else:
@@ -1084,12 +1084,12 @@ class PitiviMainWindow(gtk.Window, Loggable):
             return
 
         try:
-            info = self.project.sources.getInfoFromUri(uri)
+            info = self.project.medialibrary.getInfoFromUri(uri)
         except MediaLibraryError:
-            self.project.sources.addUri(uri)
+            self.project.medialibrary.addUri(uri)
             # FIXME Add a delay/catch signal when we start doing the discovering
             # async
-            info = self.project.sources.getInfoFromUri(uri)
+            info = self.project.medialibrary.getInfoFromUri(uri)
         self._viewUri(info.get_uri())
         context.finish(True, False, ctime)
 
@@ -1109,7 +1109,7 @@ class PitiviMainWindow(gtk.Window, Loggable):
         preview_window.hide()  # Hack to allow setting the window position
         previewer.previewUri(path)
         previewer.setMinimal()
-        info = self.project.sources.getInfoFromUri(path)
+        info = self.project.medialibrary.getInfoFromUri(path)
         try:
             # For videos and images, automatically resize the window
             # Try to keep it 1:1 if it can fit within 85% of the parent window
diff --git a/pitivi/medialibrary.py b/pitivi/medialibrary.py
index 4431b02..211b2c0 100644
--- a/pitivi/medialibrary.py
+++ b/pitivi/medialibrary.py
@@ -621,15 +621,15 @@ class MediaLibraryWidget(gtk.VBox, Loggable):
 
         """
         self.project_signals.connect(
-            project.sources, "source-added", None, self._sourceAddedCb)
+            project.medialibrary, "source-added", None, self._sourceAddedCb)
         self.project_signals.connect(
-            project.sources, "source-removed", None, self._sourceRemovedCb)
+            project.medialibrary, "source-removed", None, self._sourceRemovedCb)
         self.project_signals.connect(
-            project.sources, "discovery-error", None, self._discoveryErrorCb)
+            project.medialibrary, "discovery-error", None, self._discoveryErrorCb)
         self.project_signals.connect(
-            project.sources, "ready", None, self._sourcesStoppedImportingCb)
+            project.medialibrary, "ready", None, self._sourcesStoppedImportingCb)
         self.project_signals.connect(
-            project.sources, "starting", None, self._sourcesStartedImportingCb)
+            project.medialibrary, "starting", None, self._sourcesStartedImportingCb)
 
     def _setClipView(self, show):
         """ Set which clip view to use when medialibrary is showing clips. If
@@ -711,14 +711,14 @@ class MediaLibraryWidget(gtk.VBox, Loggable):
 
     def _addFolders(self, folders):
         """ walks the trees of the folders in the list and adds the files it finds """
-        self.app.threads.addThread(PathWalker, folders, self.app.current.sources.addUris)
+        self.app.threads.addThread(PathWalker, folders, self.app.current.medialibrary.addUris)
 
     def _updateProgressbar(self):
         """
         Update the _progressbar with the ratio of clips imported vs the total
         """
-        current_clip_iter = self.app.current.sources.nb_imported_files
-        total_clips = self.app.current.sources.nb_file_to_import
+        current_clip_iter = self.app.current.medialibrary.nb_imported_files
+        total_clips = self.app.current.medialibrary.nb_file_to_import
         progressbar_text = _("Importing clip %(current_clip)d of %(total)d" %
             {"current_clip": current_clip_iter,
             "total": total_clips})
@@ -847,7 +847,7 @@ class MediaLibraryWidget(gtk.VBox, Loggable):
             if select_folders:
                 self._addFolders(filenames)
             else:
-                self.app.current.sources.addUris(filenames)
+                self.app.current.medialibrary.addUris(filenames)
             if self.app.settings.closeImportDialog:
                 dialogbox.destroy()
                 self._importDialog = None
@@ -877,7 +877,7 @@ class MediaLibraryWidget(gtk.VBox, Loggable):
         self.app.action_log.begin("remove clip from source list")
         for row in rows:
             uri = model[row.get_path()][COL_URI]
-            self.app.current.sources.removeUri(uri)
+            self.app.current.medialibrary.removeUri(uri)
         self.app.action_log.commit()
 
     def _sourceIsUsed(self, uri):
@@ -893,7 +893,7 @@ class MediaLibraryWidget(gtk.VBox, Loggable):
         """
         Select, in the media library, unused sources in the project.
         """
-        sources = self.app.current.sources.getSources()
+        sources = self.app.current.medialibrary.getSources()
         unused_sources_uris = []
 
         model = self.storemodel
@@ -1238,7 +1238,7 @@ class MediaLibraryWidget(gtk.VBox, Loggable):
             pass
 
         uris = [quote_uri(uri) for uri in filenames]
-        self.app.current.sources.addUris(uris)
+        self.app.current.medialibrary.addUris(uris)
 
     #used with TreeView and IconView
     def _dndDragBeginCb(self, view, context):
diff --git a/pitivi/project.py b/pitivi/project.py
index 4b671a4..4feabd5 100644
--- a/pitivi/project.py
+++ b/pitivi/project.py
@@ -185,7 +185,7 @@ class ProjectManager(Signallable, Loggable):
         # the trick for now
         file = gio.File(uri)
         if overwrite or not file.query_exist():
-            formatter.set_sources(project.sources.getSources())
+            formatter.set_sources(project.medialibrary.getSources())
             return formatter.save_to_uri(project.timeline, uri)
 
     def closeRunningProject(self):
@@ -301,7 +301,7 @@ class ProjectManager(Signallable, Loggable):
     def _projectLoadedCb(self, formatter, timeline):
         self.debug("Project Loaded")
         self.emit("new-project-loaded", self.current)
-        self.current.sources.addUris(self.formatter.get_sources())
+        self.current.medialibrary.addUris(self.formatter.get_sources())
 
 
 class ProjectError(Exception):
@@ -316,8 +316,8 @@ class Project(Signallable, Loggable):
     @type name: C{str}
     @ivar description: A description of the project
     @type description: C{str}
-    @ivar sources: The sources used by this project
-    @type sources: L{MediaLibrary}
+    @ivar medialibrary: The sources used by this project
+    @type medialibrary: L{MediaLibrary}
     @ivar timeline: The timeline
     @type timeline: L{ges.Timeline}
     @ivar pipeline: The timeline's pipeline
@@ -352,7 +352,7 @@ class Project(Signallable, Loggable):
         self.uri = uri
         self.urichanged = False
         self.format = None
-        self.sources = MediaLibrary()
+        self.medialibrary = MediaLibrary()
 
         self._dirty = False
 
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index de54b28..d158c8f 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -867,7 +867,7 @@ class Timeline(gtk.Table, Loggable, Zoomable):
         if targetType == TYPE_PITIVI_FILESOURCE:
             uris = selection.data.split("\n")
             self._factories = \
-                [self._project.sources.getInfoFromUri(uri) for uri in uris]
+                [self._project.medialibrary.getInfoFromUri(uri) for uri in uris]
         else:
             if not self._duration:
                 return False
diff --git a/pitivi/timeline/track.py b/pitivi/timeline/track.py
index 7fba6f8..e9d0ce7 100644
--- a/pitivi/timeline/track.py
+++ b/pitivi/timeline/track.py
@@ -478,7 +478,7 @@ class TrackObject(View, goocanvas.Group, Zoomable):
         if self.element and not self.is_transition:
             from pitivi.utils.ui import info_name
 
-            sources = self.app.current.sources
+            sources = self.app.current.medialibrary
             uri = self.element.props.uri
             info = sources.getInfoFromUri(uri)
             self.name.props.text = info_name(info)



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