[pitivi] timeline: Get rid of the allowSeek field



commit 2302b02ffeef7b976572e786614d5cabac39cb19
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Wed Oct 21 10:31:46 2015 +0200

    timeline: Get rid of the allowSeek field
    
    allowSeek is basically = not __got_dragged.
    
    Differential Revision: https://phabricator.freedesktop.org/D510
    Reviewed-by: Thibault Saunier <tsaunier gnome org>

 pitivi/timeline/timeline.py |   17 +++--------------
 1 files changed, 3 insertions(+), 14 deletions(-)
---
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index 8189b27..e9a4960 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -263,8 +263,6 @@ class Timeline(Gtk.EventBox, Zoomable, Loggable):
         self.__snap_bar = VerticalBar("SnapBar")
         self.layout.put(self.__snap_bar, 0, 0)
 
-        self.__allow_seek = True
-
         self.__setupTimelineEdition()
         self.__setUpDragAndDrop()
         self.__setupSelectionMarquee()
@@ -307,15 +305,6 @@ class Timeline(Gtk.EventBox, Zoomable, Loggable):
 
         return Gtk.get_event_widget(event)
 
-    @property
-    def allowSeek(self):
-        return self.__allow_seek
-
-    @allowSeek.setter
-    def allowSeek(self, value):
-        self.debug("Setting AllowSeek to %s", value)
-        self.__allow_seek = value
-
     def resetSelectionGroup(self):
         self.debug("Reset selection group")
         if self.current_group:
@@ -570,6 +559,8 @@ class Timeline(Gtk.EventBox, Zoomable, Loggable):
         return False
 
     def __buttonReleaseEventCb(self, unused_widget, event):
+        allow_seek = not self.__got_dragged
+
         res, button = event.get_button()
         if self.draggingElement:
             self.dragEnd()
@@ -586,7 +577,7 @@ class Timeline(Gtk.EventBox, Zoomable, Loggable):
 
             return False
 
-        if self.allowSeek:
+        if allow_seek:
             event_widget = self.get_event_widget(event)
             x, unusedy = event_widget.translate_coordinates(self, event.x, event.y)
             x -= CONTROL_WIDTH
@@ -595,7 +586,6 @@ class Timeline(Gtk.EventBox, Zoomable, Loggable):
             position = self.pixelToNs(x)
             self._project.seeker.seek(position)
 
-        self.allowSeek = True
         self._snapEndedCb()
 
         return False
@@ -990,7 +980,6 @@ class Timeline(Gtk.EventBox, Zoomable, Loggable):
 
         if self.__got_dragged is False:
             self.__got_dragged = True
-            self.allowSeek = False
             if self.__clickedHandle:
                 edit_mode = GES.EditMode.EDIT_TRIM
                 dragging_edge = self.__clickedHandle.edge


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