[pitivi] timeline: Get rid of one parameter and field



commit 102176a767bd1a57976b47a01825cd8a24a21ccd
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Tue Nov 3 17:38:30 2015 +0100

    timeline: Get rid of one parameter and field
    
    Reviewed-by: Thibault Saunier <tsaunier gnome org>
    Differential Revision: https://phabricator.freedesktop.org/D552

 pitivi/mainwindow.py        |    3 +--
 pitivi/timeline/elements.py |    8 ++++----
 pitivi/timeline/timeline.py |    4 ++--
 3 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/pitivi/mainwindow.py b/pitivi/mainwindow.py
index dcf098c..b93b8ac 100644
--- a/pitivi/mainwindow.py
+++ b/pitivi/mainwindow.py
@@ -326,8 +326,7 @@ class PitiviMainWindow(Gtk.ApplicationWindow, Loggable):
         self.mainhpaned.pack2(self.viewer, resize=True, shrink=False)
 
         # Now, the lower part: the timeline
-        self.timeline_ui = TimelineContainer(self, self.app)
-        self.timeline_ui.setProjectManager(self.app.project_manager)
+        self.timeline_ui = TimelineContainer(self.app)
         self.vpaned.pack2(self.timeline_ui, resize=True, shrink=False)
 
         # Enable our shortcuts for HeaderBar buttons and menu items:
diff --git a/pitivi/timeline/elements.py b/pitivi/timeline/elements.py
index 95ce0f5..4243df6 100644
--- a/pitivi/timeline/elements.py
+++ b/pitivi/timeline/elements.py
@@ -675,7 +675,7 @@ class Clip(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
                                                                     self.timeline.dropData)
             self.timeline.resetSelectionGroup()
             self.timeline.selection.setSelection([self.bClip], timelineUtils.SELECT)
-            self.timeline.parent.gui.switchContextTab(self.bClip)
+            self.app.gui.switchContextTab(self.bClip)
             self.timeline.cleanDropData()
             success = True
 
@@ -796,7 +796,7 @@ class Clip(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
             self.timeline.resetSelectionGroup()
             self.timeline.current_group.add(
                 self.bClip.get_toplevel_parent())
-            self.timeline.parent.gui.switchContextTab(self.bClip)
+            self.app.gui.switchContextTab(self.bClip)
         else:
             self.timeline.resetSelectionGroup()
 
@@ -997,11 +997,11 @@ class TransitionClip(Clip):
 
     def _selectedChangedCb(self, unused_child, selected, child):
         if selected:
-            self.timeline.parent.app.gui.trans_list.activate(child)
+            self.app.gui.trans_list.activate(child)
             self.selected = True
         else:
             self.selected = False
-            self.timeline.parent.app.gui.trans_list.deactivate()
+            self.app.gui.trans_list.deactivate()
 
 
 GES_TYPE_UI_TYPE = {
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index ae98d42..a67ce51 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -1124,12 +1124,11 @@ class TimelineContainer(Gtk.Grid, Zoomable, Loggable):
     Container for zoom box, ruler, timeline, scrollbars and toolbar.
     """
 
-    def __init__(self, gui, instance):
+    def __init__(self, instance):
         Zoomable.__init__(self)
         Gtk.Grid.__init__(self)
         Loggable.__init__(self)
 
-        self.gui = gui
         self.app = instance
         self._settings = self.app.settings
         self._autoripple_active = self._settings.timelineAutoRipple
@@ -1144,6 +1143,7 @@ class TimelineContainer(Gtk.Grid, Zoomable, Loggable):
 
         self._settings.connect("edgeSnapDeadbandChanged",
                                self._snapDistanceChangedCb)
+        self.setProjectManager(self.app.project_manager)
 
     # Public API
 


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