[pitivi] Remove the GObject.GObject inits from the pygi conversion tool



commit 99d23dbf528d2ae3657b23c132d22229bc5e9936
Author: Jean-FranÃois Fortin Tam <nekohayo gmail com>
Date:   Thu Aug 30 22:07:34 2012 -0700

    Remove the GObject.GObject inits from the pygi conversion tool

 pitivi/autoaligner.py         |    2 +-
 pitivi/dialogs/depsmanager.py |    2 +-
 pitivi/effects.py             |    2 +-
 pitivi/mainwindow.py          |    2 +-
 pitivi/mediafilespreviewer.py |    3 ++-
 pitivi/medialibrary.py        |    2 +-
 pitivi/render.py              |    4 ++--
 pitivi/tabsmanager.py         |    1 +
 pitivi/timeline/layer.py      |    6 +++---
 pitivi/timeline/ruler.py      |    2 +-
 pitivi/timeline/timeline.py   |    8 ++++----
 pitivi/titleeditor.py         |    2 +-
 pitivi/transitions.py         |    2 +-
 pitivi/utils/widgets.py       |   29 +++++++++++++++--------------
 pitivi/viewer.py              |    4 ++--
 15 files changed, 37 insertions(+), 34 deletions(-)
---
diff --git a/pitivi/autoaligner.py b/pitivi/autoaligner.py
index cfc9109..b5afb1d 100644
--- a/pitivi/autoaligner.py
+++ b/pitivi/autoaligner.py
@@ -671,7 +671,7 @@ class AlignmentProgressDialog:
         # taken from RenderingProgressDialog.  In both cases, it appears
         # to work correctly, although there is a known bug for Gnome 3 in
         # RenderingProgressDialog (bug #652917)
-        self.set_transient_for(app.gui)
+        self.window.set_transient_for(app.gui)
 
         # UI widgets
         # We currently reuse the render icon for this dialog.
diff --git a/pitivi/dialogs/depsmanager.py b/pitivi/dialogs/depsmanager.py
index 808e89e..ffd2215 100644
--- a/pitivi/dialogs/depsmanager.py
+++ b/pitivi/dialogs/depsmanager.py
@@ -79,7 +79,7 @@ class DepsManager(object):
         self.builder.get_object("pkg_list").set_text(label_contents)
 
     def show(self):
-        self.set_transient_for(self.app.gui)
+        self.window.set_transient_for(self.app.gui)
         self.window.set_modal(True)
         self._setDepsLabel()
         self.window.show()
diff --git a/pitivi/effects.py b/pitivi/effects.py
index 2f892ae..b6a6a93 100644
--- a/pitivi/effects.py
+++ b/pitivi/effects.py
@@ -348,7 +348,7 @@ class EffectListWidget(Gtk.VBox, Loggable):
     """ Widget for listing effects """
 
     def __init__(self, instance, uiman):
-        GObject.GObject.__init__(self)
+        Gtk.VBox.__init__(self)
         Loggable.__init__(self)
 
         self.app = instance
diff --git a/pitivi/mainwindow.py b/pitivi/mainwindow.py
index 42ffc1a..7597761 100644
--- a/pitivi/mainwindow.py
+++ b/pitivi/mainwindow.py
@@ -184,7 +184,7 @@ class PitiviMainWindow(Gtk.Window, Loggable):
         """ initialize with the Pitivi object """
         gtksettings = Gtk.Settings.get_default()
         gtksettings.set_property("gtk-application-prefer-dark-theme", True)
-        GObject.GObject.__init__(self)
+        Gtk.Window.__init__(self)
         Loggable.__init__(self, "mainwindow")
         self.app = instance
         self.log("Creating MainWindow")
diff --git a/pitivi/mediafilespreviewer.py b/pitivi/mediafilespreviewer.py
index 489be44..5fc8260 100644
--- a/pitivi/mediafilespreviewer.py
+++ b/pitivi/mediafilespreviewer.py
@@ -2,6 +2,7 @@
 from gi.repository import GObject
 from gi.repository import Gst
 from gi.repository import Gtk
+from gi.repository import Gdk
 from gi.repository import Pango
 import os
 
@@ -51,7 +52,7 @@ acceptable_tags = [Gst.TAG_ALBUM_ARTIST,
 class PreviewWidget(Gtk.VBox, Loggable):
 
     def __init__(self, instance):
-        GObject.GObject.__init__(self)
+        Gtk.VBox.__init__(self)
         Loggable.__init__(self)
 
         self.log("Init PreviewWidget")
diff --git a/pitivi/medialibrary.py b/pitivi/medialibrary.py
index e41513e..ca01d60 100644
--- a/pitivi/medialibrary.py
+++ b/pitivi/medialibrary.py
@@ -269,7 +269,7 @@ class MediaLibraryWidget(Gtk.VBox, Loggable):
                 (GObject.TYPE_PYOBJECT,))}
 
     def __init__(self, instance, uiman):
-        GObject.GObject.__init__(self)
+        Gtk.VBox.__init__(self)
         Loggable.__init__(self)
 
         self.pending_rows = []
diff --git a/pitivi/render.py b/pitivi/render.py
index f6b8093..f2a8eea 100644
--- a/pitivi/render.py
+++ b/pitivi/render.py
@@ -340,7 +340,7 @@ class RenderingProgressDialog(Signallable):
         self.play_pause_button = self.builder.get_object("play_pause_button")
         # Parent the dialog with mainwindow, since renderingdialog is hidden.
         # It allows this dialog to properly minimize together with mainwindow
-        self.set_transient_for(self.app.gui)
+        self.window.set_transient_for(self.app.gui)
 
         # UI widgets
         self.window.set_icon_from_file(configure.get_pixmap_dir() + "/pitivi-render-16.png")
@@ -854,7 +854,7 @@ class RenderDialog(Loggable):
         """
         properties = getattr(self.settings, settings_attr)
         self.dialog = GstElementSettingsDialog(factory, properties=properties)
-        self.dialog.set_transient_for(self.window)
+        self.dialog.window.set_transient_for(self.window)
         self.dialog.ok_btn.connect("clicked", self._okButtonClickedCb, settings_attr)
         self.dialog.window.run()
 
diff --git a/pitivi/tabsmanager.py b/pitivi/tabsmanager.py
index 84657b8..2770141 100644
--- a/pitivi/tabsmanager.py
+++ b/pitivi/tabsmanager.py
@@ -20,6 +20,7 @@
 # Boston, MA 02110-1301, USA.
 
 from gi.repository import Gtk
+from gi.repository import Gdk
 from pitivi.utils.ui import SPACING
 
 
diff --git a/pitivi/timeline/layer.py b/pitivi/timeline/layer.py
index c7fcecf..31c97e2 100644
--- a/pitivi/timeline/layer.py
+++ b/pitivi/timeline/layer.py
@@ -40,7 +40,7 @@ class BaseLayerControl(Gtk.VBox, Loggable):
     __gtype_name__ = 'LayerControl'
 
     def __init__(self, app, layer, layer_type):
-        GObject.GObject.__init__(self, spacing=0)
+        Gtk.VBox.__init__(self, spacing=0)
         Loggable.__init__(self)
 
         self._app = app
@@ -350,7 +350,7 @@ class TwoStateButton(Gtk.Button):
        }
 
     def __init__(self, state1="", state2=""):
-        GObject.GObject.__init__(self)
+        Gtk.Button.__init__(self)
         self.set_relief(Gtk.ReliefStyle.NONE)
         self.connect("clicked", self._clickedCb)
 
@@ -377,7 +377,7 @@ class SpacedSeparator(Gtk.EventBox):
     """
 
     def __init__(self):
-        GObject.GObject.__init__(self)
+        Gtk.EventBox.__init__(self)
 
         self.box = Gtk.VBox()
         self.box.add(Gtk.HSeparator())
diff --git a/pitivi/timeline/ruler.py b/pitivi/timeline/ruler.py
index 5d1f1ae..42d355a 100644
--- a/pitivi/timeline/ruler.py
+++ b/pitivi/timeline/ruler.py
@@ -58,7 +58,7 @@ class ScaleRuler(Gtk.DrawingArea, Zoomable, Loggable):
     subdivide = ((1, 1.0), (2, 0.5), (10, .25))
 
     def __init__(self, instance, hadj):
-        GObject.GObject.__init__(self)
+        Gtk.DrawingArea.__init__(self)
         Zoomable.__init__(self)
         Loggable.__init__(self)
         self.log("Creating new ScaleRuler")
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index ea3ad75..c7a844a 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -500,7 +500,7 @@ class TimelineControls(Gtk.VBox, Loggable):
        }
 
     def __init__(self, instance):
-        GObject.GObject.__init__(self)
+        Gtk.VBox.__init__(self)
         Loggable.__init__(self)
         self.app = instance
         self._layer_controls = {}
@@ -877,7 +877,7 @@ class InfoStub(Gtk.HBox, Loggable):
     """
 
     def __init__(self):
-        GObject.GObject.__init__(self)
+        Gtk.HBox.__init__(self)
         Loggable.__init__(self)
         self.errors = []
         self._scroll_pos_ns = 0
@@ -1162,7 +1162,7 @@ class Timeline(Gtk.Table, Loggable, Zoomable):
         try:
             if mod & Gdk.ModifierType.CONTROL_MASK:
                 now = self._project.pipeline.getPosition()
-                ltime, rtime = self._project.timeline.edGES.closest(now)
+                ltime, rtime = self._project.timeline.edges.closest(now)
 
             if kv == Gdk.KEY_Left:
                 if mod & Gdk.ModifierType.SHIFT_MASK:
@@ -1906,7 +1906,7 @@ class Timeline(Gtk.Table, Loggable, Zoomable):
         layer = timeline.get_layers()[0]  # FIXME Get the longest layer
 
         # Set the duration of the clip if it is an image
-        if hasattr(source,"is_image") and source.is_image():
+        if hasattr(source, "is_image") and source.is_image():
             source.set_duration(long(self._settings.imageClipLength) * Gst.SECOND / 1000)
 
         # Handle the case where we just inserted the first clip
diff --git a/pitivi/titleeditor.py b/pitivi/titleeditor.py
index 17262b6..8fdc000 100644
--- a/pitivi/titleeditor.py
+++ b/pitivi/titleeditor.py
@@ -219,7 +219,7 @@ class PangoBuffer(Gtk.TextBuffer):
     def __init__(self):
         self.tagdict = {}
         self.tags = {}
-        GObject.GObject.__init__(self)
+        Gtk.TextBuffer.__init__(self)
 
     def set_text(self, txt):
         Gtk.TextBuffer.set_text(self, "")
diff --git a/pitivi/transitions.py b/pitivi/transitions.py
index 09b460e..5c947da 100644
--- a/pitivi/transitions.py
+++ b/pitivi/transitions.py
@@ -44,7 +44,7 @@ from pitivi.utils.ui import SPACING, PADDING
 class TransitionsListWidget(Signallable, Gtk.VBox, Loggable):
 
     def __init__(self, instance, uiman):
-        GObject.GObject.__init__(self)
+        Gtk.VBox.__init__(self)
         Loggable.__init__(self)
         Signallable.__init__(self)
 
diff --git a/pitivi/utils/widgets.py b/pitivi/utils/widgets.py
index efac183..cdc7837 100644
--- a/pitivi/utils/widgets.py
+++ b/pitivi/utils/widgets.py
@@ -32,6 +32,7 @@ import sys
 from gi.repository import Gtk
 from gi.repository import Gdk
 from gi.repository import Gst
+from gi.repository import GES
 from gi.repository import Pango
 from gi.repository import GObject
 
@@ -75,7 +76,7 @@ class DefaultWidget(Gtk.Label, DynamicWidget):
     """When all hope fails...."""
 
     def __init__(self, default=None, *unused, **kw_unused):
-        GObject.GObject.__init__(self, _("Implement Me"))
+        Gtk.Label.__init__(self, _("Implement Me"))
         DynamicWidget.__init__(self, default)
 
     def connectValueChanged(self, callback, *args):
@@ -110,7 +111,7 @@ class TextWidget(Gtk.HBox, DynamicWidget):
             # In the case of text widgets, a blank default is an empty string
             default = ""
 
-        GObject.GObject.__init__(self)
+        Gtk.HBox.__init__(self)
         DynamicWidget.__init__(self, default)
 
         self.set_border_width(0)
@@ -191,7 +192,7 @@ class NumericWidget(Gtk.HBox, DynamicWidget):
     lower and upper bounds are defined"""
 
     def __init__(self, upper=None, lower=None, default=None):
-        GObject.GObject.__init__(self)
+        Gtk.HBox.__init__(self)
         DynamicWidget.__init__(self, default)
 
         self.spacing = SPACING
@@ -214,7 +215,7 @@ class NumericWidget(Gtk.HBox, DynamicWidget):
         self.adjustment.props.lower = lower
         self.adjustment.props.upper = upper
         self.spinner = Gtk.SpinButton(adjustment=self.adjustment)
-        self.pack_end(self.spinner, fille=True, expand=not hasattr(self, 'slider'), padding=0)
+        self.pack_end(self.spinner, fill=True, expand=not hasattr(self, 'slider'), padding=0)
         self.spinner.show()
 
     def connectValueChanged(self, callback, *args):
@@ -375,7 +376,7 @@ class ToggleWidget(Gtk.CheckButton, DynamicWidget):
     """A Gtk.CheckButton which supports the DynamicWidget interface."""
 
     def __init__(self, default=None):
-        GObject.GObject.__init__(self)
+        Gtk.CheckButton.__init__(self)
         DynamicWidget.__init__(self, default)
 
     def connectValueChanged(self, callback, *args):
@@ -395,7 +396,7 @@ class ChoiceWidget(Gtk.HBox, DynamicWidget):
     implementation uses a Gtk.ComboBoxText for simplicity."""
 
     def __init__(self, choices, default=None):
-        GObject.GObject.__init__(self)
+        Gtk.HBox.__init__(self)
         DynamicWidget.__init__(self, default)
         self.choices = None
         self.values = None
@@ -470,7 +471,7 @@ class PresetChoiceWidget(Gtk.HBox, DynamicWidget):
             return [w.getWidgetValue() for w in self.widgets if w]
 
     def __init__(self, presets, default=None):
-        GObject.GObject.__init__(self)
+        Gtk.HBox.__init__(self)
         DynamicWidget.__init__(self, default)
         self._block_update = False
         self._widget_map = None
@@ -576,7 +577,7 @@ class PathWidget(Gtk.FileChooserButton, DynamicWidget):
             buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_CLOSE,
              Gtk.ResponseType.CLOSE))
         self.dialog.set_default_response(Gtk.ResponseType.OK)
-        GObject.GObject.__init__(self, self.dialog)
+        Gtk.FileChooserButton.__init__(self, self.dialog)
         self.set_title(_("Choose..."))
         self.dialog.connect("response", self._responseCb)
         self.uri = ""
@@ -601,7 +602,7 @@ class PathWidget(Gtk.FileChooserButton, DynamicWidget):
 class ColorWidget(Gtk.ColorButton, DynamicWidget):
 
     def __init__(self, value_type=str, default=None):
-        GObject.GObject.__init__(self)
+        Gtk.ColorButton.__init__(self)
         DynamicWidget.__init__(self, default)
         self.value_type = value_type
         self.set_use_alpha(True)
@@ -641,7 +642,7 @@ class ColorWidget(Gtk.ColorButton, DynamicWidget):
 class FontWidget(Gtk.FontButton, DynamicWidget):
 
     def __init__(self, default=None):
-        GObject.GObject.__init__(self)
+        Gtk.FontButton.__init__(self)
         DynamicWidget.__init__(self, default)
         self.set_use_font(True)
 
@@ -658,7 +659,7 @@ class FontWidget(Gtk.FontButton, DynamicWidget):
 class ResolutionWidget(Gtk.HBox, DynamicWidget):
 
     def __init__(self, default=None):
-        GObject.GObject.__init__(self)
+        Gtk.HBox.__init__(self)
         DynamicWidget.__init__(self, default)
         self.props.spacing = SPACING
 
@@ -782,7 +783,7 @@ class GstElementSettingsWidget(Gtk.VBox, Loggable):
     """
 
     def __init__(self):
-        GObject.GObject.__init__(self)
+        Gtk.VBox.__init__(self)
         Loggable.__init__(self)
         self.element = None
         self.ignore = None
@@ -810,7 +811,7 @@ class GstElementSettingsWidget(Gtk.VBox, Loggable):
         "No properties."
         """
         is_effect = False
-        if isinstance(self.element, ges.TrackParseLaunchEffect):
+        if isinstance(self.element, GES.TrackParseLaunchEffect):
             is_effect = True
             props = [prop for prop in self.element.list_children_properties() if not prop.name in self.ignore]
         else:
@@ -967,7 +968,7 @@ class GstElementSettingsDialog(Loggable):
 class BaseTabs(Gtk.Notebook):
     def __init__(self, app, hide_hpaned=False):
         """ initialize """
-        GObject.GObject.__init__(self)
+        Gtk.Notebook.__init__(self)
         self.set_border_width(SPACING)
 
         self.connect("create-window", self._createWindowCb)
diff --git a/pitivi/viewer.py b/pitivi/viewer.py
index 07f8f75..759d99f 100644
--- a/pitivi/viewer.py
+++ b/pitivi/viewer.py
@@ -88,7 +88,7 @@ class PitiviViewer(Gtk.VBox, Loggable):
     INHIBIT_REASON = _("Currently playing")
 
     def __init__(self, app, undock_action=None):
-        GObject.GObject.__init__(self)
+        Gtk.VBox.__init__(self)
         self.set_border_width(SPACING)
         self.app = app
         self.settings = app.settings
@@ -961,7 +961,7 @@ class PlayPauseButton(Gtk.Button, Loggable):
         }
 
     def __init__(self):
-        GObject.GObject.__init__(self)
+        Gtk.Button.__init__(self)
         Loggable.__init__(self)
         self.image = Gtk.Image()
         self.add(self.image)



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