[pitivi] Avoid using deprecated APIs
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] Avoid using deprecated APIs
- Date: Sat, 25 Nov 2017 19:32:34 +0000 (UTC)
commit 77def3904fd525c1949dfe3099d3902dc91cdf1d
Author: Thibault Saunier <tsaunier gnome org>
Date: Tue Nov 7 17:17:32 2017 -0300
Avoid using deprecated APIs
Reviewed-by: Alex Băluț <<alexandru balut gmail com>>
Differential Revision: https://phabricator.freedesktop.org/D1878
pitivi/check.py | 7 +++++++
pitivi/timeline/timeline.py | 2 +-
2 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/check.py b/pitivi/check.py
index 4bac3a2..3cc7834 100644
--- a/pitivi/check.py
+++ b/pitivi/check.py
@@ -341,6 +341,11 @@ def initialize_modules():
require_version("Gdk", GTK_API_VERSION)
from gi.repository import Gdk
Gdk.init([])
+ from gi.repository import Gtk
+
+ # Monkey patch deprecated methods to use the new variant by default
+ Gtk.Layout.get_vadjustment = Gtk.Scrollable.get_vadjustment
+ Gtk.Layout.get_hadjustment = Gtk.Scrollable.get_hadjustment
if not gi.version_info >= (3, 11):
from gi.repository import GObject
@@ -359,6 +364,8 @@ def initialize_modules():
require_version("GES", GST_API_VERSION)
from gi.repository import GES
res, sys.argv = GES.init_check(sys.argv)
+ # Monkey patch deprecated methods to use the new variant by default
+ GES.TrackElement.list_children_properties = GES.TimelineElement.list_children_properties
from pitivi.utils import validate
if validate.init() and "--inspect-action-type" in sys.argv:
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index 3407f45..a3d02fc 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -1432,7 +1432,7 @@ class TimelineContainer(Gtk.Grid, Zoomable, Loggable):
# Internal API
def _createUi(self):
- left_size_group = Gtk.SizeGroup(Gtk.SizeGroupMode.HORIZONTAL)
+ left_size_group = Gtk.SizeGroup.new(Gtk.SizeGroupMode.HORIZONTAL)
zoom_box = ZoomBox(self)
left_size_group.add_widget(zoom_box)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]