From a3d5c7fdcef630a902b62305c2b0c57121e24209 Mon Sep 17 00:00:00 2001
From: Ethan Trewhitt <ethan@trewhitt.org>
Date: Wed, 25 Oct 2017 13:36:33 -0400
Subject: Added parent (aka 'transient for') references to most (if not all)
 dialog boxes. First attempt at fixing #1494.

---
 grc/gui/PropsDialog.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'grc/gui/PropsDialog.py')

diff --git a/grc/gui/PropsDialog.py b/grc/gui/PropsDialog.py
index cfea13e1a8..b299804b47 100644
--- a/grc/gui/PropsDialog.py
+++ b/grc/gui/PropsDialog.py
@@ -55,7 +55,7 @@ class PropsDialog(gtk.Dialog):
     A dialog to set block parameters, view errors, and view documentation.
     """
 
-    def __init__(self, block):
+    def __init__(self, block, parent):
         """
         Properties dialog constructor.
 
@@ -67,6 +67,7 @@ class PropsDialog(gtk.Dialog):
         gtk.Dialog.__init__(
             self,
             title='Properties: %s' % block.get_name(),
+            parent=parent,
             buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT,
                      gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT,
                      gtk.STOCK_APPLY, gtk.RESPONSE_APPLY)
@@ -76,6 +77,7 @@ class PropsDialog(gtk.Dialog):
             (MIN_DIALOG_WIDTH, MIN_DIALOG_HEIGHT)
         ))
         self._block = block
+        self._parent = parent
 
         vpaned = gtk.VPaned()
         self.vbox.pack_start(vpaned)
@@ -190,7 +192,7 @@ class PropsDialog(gtk.Dialog):
                     if param.get_hide() == 'all':
                         continue
                     box_all_valid = box_all_valid and param.is_valid()
-                    input_widget = param.get_input(self._handle_changed, self._activate_apply)
+                    input_widget = param.get_input(self, self._handle_changed, self._activate_apply)
                     vbox.pack_start(input_widget, input_widget.expand)
                 label.set_markup(Utils.parse_template(TAB_LABEL_MARKUP_TMPL, valid=box_all_valid, tab=tab))
                 # show params box with new params
-- 
cgit v1.2.3