[pitivi] timeline: Reset selection_group when selecting a new clip or deselecting all



commit 4be46b9b130877cddaf2022a6c992c2311df9384
Author: Thibault Saunier <tsaunier gnome org>
Date:   Thu May 14 19:32:30 2015 +0200

    timeline: Reset selection_group when selecting a new clip or deselecting all
    
    + Rename createSelectionGroup to resetSelectionGroup
    
    (resetSelectionGroup already does
     GES.Container.ungroup(timeline.current_group, False))
    
    Fixes http://phabricator.freedesktop.org/T72

 pitivi/timeline/elements.py |    5 +++--
 pitivi/timeline/timeline.py |   12 ++++++------
 2 files changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/pitivi/timeline/elements.py b/pitivi/timeline/elements.py
index 05e26f7..59ee354 100644
--- a/pitivi/timeline/elements.py
+++ b/pitivi/timeline/elements.py
@@ -637,11 +637,12 @@ class Clip(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
                     self.bClip.get_toplevel_parent())
                 mode = timelineUtils.UNSELECT
         elif not self.get_state_flags() & Gtk.StateFlags.SELECTED:
-            GES.Container.ungroup(self.timeline.current_group, False)
-            self.timeline.createSelectionGroup()
+            self.timeline.resetSelectionGroup()
             self.timeline.current_group.add(
                 self.bClip.get_toplevel_parent())
             self.timeline.parent.gui.switchContextTab(self.bClip)
+        else:
+            self.timeline.resetSelectionGroup()
 
         parent = self.bClip.get_parent()
         if parent == self.timeline.current_group or parent is None:
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index b503357..998d58e 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -247,7 +247,7 @@ class Timeline(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
         self._project = None
 
         self.current_group = None
-        self.createSelectionGroup()
+        self.resetSelectionGroup()
 
         self.__playhead = VerticalBar("PlayHead")
         self.__playhead.show()
@@ -316,7 +316,8 @@ class Timeline(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
         self.debug("Setting AllowSeek to %s" % value)
         self.__allow_seek = value
 
-    def createSelectionGroup(self):
+    def resetSelectionGroup(self):
+        self.debug("Reset selection group")
         if self.current_group:
             GES.Container.ungroup(self.current_group, False)
 
@@ -576,12 +577,11 @@ class Timeline(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
         return False
 
     def _selectUnderMarquee(self):
+        self.resetSelectionGroup()
         if self.__marquee.props.width_request > 0:
             clips = self.__marquee.findSelected()
 
             if clips:
-                self.createSelectionGroup()
-
                 for clip in clips:
                     self.current_group.add(clip.get_toplevel_parent())
 
@@ -1429,7 +1429,7 @@ class TimelineContainer(Gtk.Grid, Zoomable, Loggable):
 
                 self._project.pipeline.commit_timeline()
 
-            self.timeline.createSelectionGroup()
+            self.timeline.resetSelectionGroup()
 
             self.app.action_log.commit()
             self._project.pipeline.commit_timeline()
@@ -1452,7 +1452,7 @@ class TimelineContainer(Gtk.Grid, Zoomable, Loggable):
             if containers:
                 GES.Container.group(list(containers))
 
-            self.timeline.createSelectionGroup()
+            self.timeline.resetSelectionGroup()
 
             self._project.pipeline.commit_timeline()
             self.app.action_log.commit()


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