[d-feet] Set transient parent for GtkDialog



commit 3c4f25ee2c19412f53a8d11b20b57043730bd1e8
Author: Thomas Bechtold <tbechtold suse com>
Date:   Sun Jun 21 14:08:02 2015 +0200

    Set transient parent for GtkDialog
    
    Thanks to Ritesh Khadgaray for the patch suggestion.
    
    Partly solves https://bugzilla.gnome.org/show_bug.cgi?id=734514

 src/dfeet/addconnectiondialog.py |    2 +-
 src/dfeet/application.py         |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/dfeet/addconnectiondialog.py b/src/dfeet/addconnectiondialog.py
index 3facf9d..4953287 100644
--- a/src/dfeet/addconnectiondialog.py
+++ b/src/dfeet/addconnectiondialog.py
@@ -9,7 +9,7 @@ class AddConnectionDialog:
         ui = UILoader(data_dir, UILoader.UI_ADDCONNECTIONDIALOG)
 
         self.dialog = ui.get_root_widget()
-
+        self.dialog.set_transient_for(parent)
         # get the hbox and add address combo box with model
         hbox1 = ui.get_widget('hbox1')
         self.address_combo_box_store = Gtk.ListStore(str)
diff --git a/src/dfeet/application.py b/src/dfeet/application.py
index 246670a..c8e02ee 100644
--- a/src/dfeet/application.py
+++ b/src/dfeet/application.py
@@ -17,7 +17,7 @@ class DFeetApp(Gtk.Application):
 
     # Note that the function in C activate() becomes do_activate() in Python
     def do_activate(self):
-        win = DFeetWindow(self, self.package, self.version, self.data_dir)
+        self._main_win = DFeetWindow(self, self.package, self.version, self.data_dir)
 
     # Note that the function in C startup() becomes do_startup() in Python
     def do_startup(self):
@@ -45,6 +45,7 @@ class DFeetApp(Gtk.Application):
 
     def action_about_cb(self, action, parameter):
         aboutdialog = DFeetAboutDialog(self.package, self.version)
+        aboutdialog.set_transient_for(self._main_win)
         aboutdialog.show()
 
     def action_help_cb(self, action, parameter):


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