[pitivi] Fix deprecated usage of GObject namespace for timeout and source



commit 86252c0d12452ce661f4a1f6a758ca64ba59b0b7
Author: Nicolas Dufresne <nicolas dufresne collabora com>
Date:   Wed May 1 14:26:00 2013 -0400

    Fix deprecated usage of GObject namespace for timeout and source
    
    Fix for a second time deprecated usage of GObject namespace for timeout_add
    and source_remove

 pitivi/mainwindow.py          |    2 +-
 pitivi/mediafilespreviewer.py |    3 ++-
 pitivi/project.py             |    3 ++-
 pitivi/timeline/ruler.py      |    9 +++++----
 pitivi/titleeditor.py         |    6 +++---
 5 files changed, 13 insertions(+), 10 deletions(-)
---
diff --git a/pitivi/mainwindow.py b/pitivi/mainwindow.py
index 6cfe9cf..e222bbe 100644
--- a/pitivi/mainwindow.py
+++ b/pitivi/mainwindow.py
@@ -552,7 +552,7 @@ class PitiviMainWindow(Gtk.Window, Loggable):
     def _animateFullscreenToolbar(self, *args):
         """
         Animate the fullscreen toolbar by moving it up or down by a few pixels.
-        This is meant to be called repeatedly by a GObject timer.
+        This is meant to be called repeatedly by a GLib timer.
         """
         # Believe it or not, that's how it's done in Gedit!
         # However, it seems like moving by 1 pixel is too slow with the overhead
diff --git a/pitivi/mediafilespreviewer.py b/pitivi/mediafilespreviewer.py
index 7acf423..e4ce58b 100644
--- a/pitivi/mediafilespreviewer.py
+++ b/pitivi/mediafilespreviewer.py
@@ -1,6 +1,7 @@
 # -*- coding: utf-8 -*-
 import os
 from gettext import gettext as _
+from gi.repository import GLib
 from gi.repository import GObject
 from gi.repository import Gst
 from gi.repository import Gtk
@@ -266,7 +267,7 @@ class PreviewWidget(Gtk.VBox, Loggable):
         self.player.set_state(Gst.State.PLAYING)
         self.is_playing = True
         self.play_button.set_stock_id(Gtk.STOCK_MEDIA_PAUSE)
-        GObject.timeout_add(250, self._update_position)
+        GLib.timeout_add(250, self._update_position)
         self.debug("Preview started")
 
     def pause(self):
diff --git a/pitivi/project.py b/pitivi/project.py
index 020cca8..2247246 100644
--- a/pitivi/project.py
+++ b/pitivi/project.py
@@ -28,6 +28,7 @@ from gi.repository import GstPbutils
 from gi.repository import GES
 from gi.repository import Gst
 from gi.repository import Gtk
+from gi.repository import GLib
 from gi.repository import GObject
 import tarfile
 
@@ -428,7 +429,7 @@ class ProjectManager(Signallable, Loggable):
 
         if self.backup_lock == 0:
             self.backup_lock = 10
-            GObject.timeout_add_seconds(self.backup_lock, self._saveBackupCb, project, uri)
+            GLib.timeout_add_seconds(self.backup_lock, self._saveBackupCb, project, uri)
         else:
             if self.backup_lock < 60:
                 self.backup_lock += 5
diff --git a/pitivi/timeline/ruler.py b/pitivi/timeline/ruler.py
index b77c65a..9c91e68 100644
--- a/pitivi/timeline/ruler.py
+++ b/pitivi/timeline/ruler.py
@@ -27,6 +27,7 @@ import cairo
 from gi.repository import Gtk
 from gi.repository import Gdk
 from gi.repository import Gst
+from gi.repository import GLib
 from gi.repository import GObject
 
 from gettext import gettext as _
@@ -92,8 +93,8 @@ class ScaleRuler(Gtk.DrawingArea, Zoomable, Loggable):
     def _hadjValueChangedCb(self, hadj):
         self.pixbuf_offset = self.hadj.get_value()
         if self.callback_id_scroll is not None:
-            GObject.source_remove(self.callback_id_scroll)
-        self.callback_id_scroll = GObject.timeout_add(100, self._maybeUpdate)
+            GLib.source_remove(self.callback_id_scroll)
+        self.callback_id_scroll = GLib.timeout_add(100, self._maybeUpdate)
 
 ## Zoomable interface override
 
@@ -104,8 +105,8 @@ class ScaleRuler(Gtk.DrawingArea, Zoomable, Loggable):
 
     def zoomChanged(self):
         if self.callback_id is not None:
-            GObject.source_remove(self.callback_id)
-        self.callback_id = GObject.timeout_add(100, self._maybeUpdate)
+            GLib.source_remove(self.callback_id)
+        self.callback_id = GLib.timeout_add(100, self._maybeUpdate)
 
 ## timeline position changed method
 
diff --git a/pitivi/titleeditor.py b/pitivi/titleeditor.py
index 73e1eec..7220138 100644
--- a/pitivi/titleeditor.py
+++ b/pitivi/titleeditor.py
@@ -26,7 +26,7 @@ from gi.repository import Gdk
 from gi.repository import Pango
 from gi.repository import GES
 from gi.repository import Gst
-from gi.repository import GObject
+from gi.repository import GLib
 
 from gettext import gettext as _
 from xml.sax import saxutils
@@ -830,10 +830,10 @@ class TitleEditor(Loggable):
         if event.button == 1:
             self._drag_events = [(event.x, event.y)]
             #Update drag by drag event change, but not too often
-            self.timeout = GObject.timeout_add(100, self.drag_update_event)
+            self.timeout = GLib.timeout_add(100, self.drag_update_event)
             #If drag goes out for 0.3 second, and do not come back, consider drag end
             self._drag_updated = True
-            self.timeout = GObject.timeout_add(1000, self.drag_possible_end_event)
+            self.timeout = GLib.timeout_add(1000, self.drag_possible_end_event)
 
     def drag_possible_end_event(self):
         if self._drag_updated:


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