Patchwork [bitbake-devel,2/2] Hob: add the parent window to 'binb' popup window for managing it

login
register
mail settings
Submitter Shane Wang
Date April 16, 2012, 8:53 a.m.
Message ID <9c0d9fb3aa4a2d2b7c1d69d87a3fd6d8538574a8.1334565351.git.shane.wang@intel.com>
Download mbox | patch
Permalink /patch/25901/
State New
Headers show

Comments

Shane Wang - April 16, 2012, 8:53 a.m.
From: Liming An <limingx.l.an@intel.com>

The 'binb' popup window should be "set transient for" the main application
window which they were spawned from.

Signed-off-by: Liming An <limingx.l.an@intel.com>
---
 bitbake/lib/bb/ui/crumbs/builder.py           |    2 +-
 bitbake/lib/bb/ui/crumbs/persistenttooltip.py |    6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

Patch

diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index bd45016..0f85cf5 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -898,7 +898,7 @@  class Builder(gtk.Window):
 
     def show_binb_dialog(self, binb):
         markup = "<b>Brought in by:</b>\n%s" % binb
-        ptip = PersistentTooltip(markup)
+        ptip = PersistentTooltip(markup, self)
 
         ptip.show()
 
diff --git a/bitbake/lib/bb/ui/crumbs/persistenttooltip.py b/bitbake/lib/bb/ui/crumbs/persistenttooltip.py
index 4db3018..b43d297 100644
--- a/bitbake/lib/bb/ui/crumbs/persistenttooltip.py
+++ b/bitbake/lib/bb/ui/crumbs/persistenttooltip.py
@@ -35,7 +35,7 @@  class PersistentTooltip(gtk.Window):
 
     markup: some Pango text markup to display in the tooltip
     """
-    def __init__(self, markup):
+    def __init__(self, markup, parent_win=None):
         gtk.Window.__init__(self, gtk.WINDOW_POPUP)
 
         # Inherit the system theme for a tooltip
@@ -76,6 +76,10 @@  class PersistentTooltip(gtk.Window):
         # Ensure a reasonable minimum size
         self.set_geometry_hints(self, 100, 50)
 
+        # Set this window as a transient window for parent(main window)
+        if parent_win:
+            self.set_transient_for(parent_win)
+            self.set_destroy_with_parent(True)
         # Draw our label and close buttons
         hbox = gtk.HBox(False, 0)
         hbox.show()