[pitivi] filechooserpreview: Make use of our ViewerWidget and main gobject.threads()



commit 22d4c798cd8f628fb44c61bd8b62f864dc7036cb
Author: Thibault Saunier <thibault saunier collabora co uk>
Date:   Thu May 26 14:59:02 2011 -0400

    filechooserpreview: Make use of our ViewerWidget and main gobject.threads()
    
    Fixes: #651157

 pitivi/ui/filechooserpreview.py |    9 +++------
 pitivi/ui/viewer.py             |    2 +-
 2 files changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/pitivi/ui/filechooserpreview.py b/pitivi/ui/filechooserpreview.py
index 8ddaf61..a157827 100644
--- a/pitivi/ui/filechooserpreview.py
+++ b/pitivi/ui/filechooserpreview.py
@@ -1,8 +1,6 @@
 import gobject
-gobject.threads_init()
 import gst
 import gtk
-gtk.gdk.threads_init()
 import pango
 import os
 
@@ -16,6 +14,7 @@ from pitivi.factories.file import PictureFileSourceFactory
 from pitivi.settings import GlobalSettings
 from gettext import gettext as _
 from pitivi.ui.common import SPACING
+from pitivi.ui.viewer import ViewerWidget
 
 DEFAULT_AUDIO_IMAGE = os.path.join(get_pixmap_dir(), "pitivi-sound.png")
 
@@ -84,10 +83,8 @@ class PreviewWidget(gtk.VBox, Loggable):
 
         # Gui elements:
         # Drawing area for video output
-        self.preview_video = gtk.DrawingArea()
+        self.preview_video = ViewerWidget()
         self.preview_video.modify_bg(gtk.STATE_NORMAL, self.preview_video.style.black)
-        self.preview_video.set_size_request(self.settings.FCpreviewWidth, self.settings.FCpreviewHeight)
-        self.preview_video.hide()
         self.pack_start(self.preview_video, expand=False)
 
         # An image for images and audio
@@ -357,7 +354,7 @@ class PreviewWidget(gtk.VBox, Loggable):
                 sink.set_property('force-aspect-ratio', True)
                 sink.set_property("handle-expose", True)
                 gtk.gdk.threads_enter()
-                sink.set_xwindow_id(self.preview_video.window.xid)
+                sink.set_xwindow_id(self.preview_video.window_xid)
                 sink.expose()
                 gtk.gdk.threads_leave()
         return gst.BUS_PASS
diff --git a/pitivi/ui/viewer.py b/pitivi/ui/viewer.py
index 91789e8..a0703ea 100644
--- a/pitivi/ui/viewer.py
+++ b/pitivi/ui/viewer.py
@@ -618,7 +618,7 @@ class ViewerWidget(gtk.DrawingArea, Loggable):
 
     __gsignals__ = {}
 
-    def __init__(self, action):
+    def __init__(self, action=None):
         gtk.DrawingArea.__init__(self)
         Loggable.__init__(self)
         self.action = action # FIXME : Check if it's a view action



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