[pitivi] render: Properly parent the advanced codec settings dialogs



commit b295b6ab0de6453fc029289fcfb9a0dff9c1a24e
Author: Jean-FranÃois Fortin Tam <nekohayo gmail com>
Date:   Fri Sep 7 10:44:23 2012 -0400

    render: Properly parent the advanced codec settings dialogs
    
    Some codecs didn't have their window properly focused when shown,
    probably because of the timing at which we did the parenting.

 pitivi/render.py        |    5 ++---
 pitivi/utils/widgets.py |    4 +++-
 2 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/pitivi/render.py b/pitivi/render.py
index 18dbacf..f4852df 100644
--- a/pitivi/render.py
+++ b/pitivi/render.py
@@ -853,10 +853,9 @@ class RenderDialog(Loggable):
         @type settings_attr: str
         """
         properties = getattr(self.settings, settings_attr)
-        self.dialog = GstElementSettingsDialog(factory, properties=properties)
-        self.dialog.window.set_transient_for(self.window)
+        self.dialog = GstElementSettingsDialog(factory, properties=properties,
+                                                parent_window=self.window)
         self.dialog.ok_btn.connect("clicked", self._okButtonClickedCb, settings_attr)
-        self.dialog.window.run()
 
     def startAction(self):
         """ Start the render process """
diff --git a/pitivi/utils/widgets.py b/pitivi/utils/widgets.py
index 0b6ab43..94ad2ce 100644
--- a/pitivi/utils/widgets.py
+++ b/pitivi/utils/widgets.py
@@ -910,7 +910,7 @@ class GstElementSettingsDialog(Loggable):
     Dialog window for viewing/modifying properties of a Gst.Element
     """
 
-    def __init__(self, elementfactory, properties={}):
+    def __init__(self, elementfactory, properties={}, parent_window=None):
         Loggable.__init__(self)
         self.debug("factory:%s, properties:%s", elementfactory, properties)
 
@@ -946,6 +946,8 @@ class GstElementSettingsDialog(Loggable):
             default_height = 600
         self.window.set_default_size(300, default_height)
 
+        if parent_window:
+            self.window.set_transient_for(parent_window)
         self.window.show()
 
     def _fillWindow(self):



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