Patchwork [bitbake-devel,8/9] lib/bb/ui/crumbs: use a PersistentTooltip for the Brought in by information

login
register
mail settings
Submitter Joshua Lock
Date March 24, 2012, 12:23 a.m.
Message ID <4ff611f179da4d3c8953222c053d9cce62505277.1332545580.git.josh@linux.intel.com>
Download mbox | patch
Permalink /patch/24419/
State Accepted
Commit c57a45c64a17f1b9dd89743692c3da130ffd38f4
Headers show

Comments

Joshua Lock - March 24, 2012, 12:23 a.m.
Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
 lib/bb/ui/crumbs/builder.py |   12 +++++++-----
 lib/bb/ui/crumbs/hig.py     |   23 -----------------------
 2 files changed, 7 insertions(+), 28 deletions(-)
Dongxiao Xu - March 24, 2012, 1:04 a.m.
On Fri, 2012-03-23 at 17:23 -0700, Joshua Lock wrote:
> Signed-off-by: Joshua Lock <josh@linux.intel.com>

Acked-by: Dongxiao Xu <dongxiao.xu@intel.com>

> ---
>  lib/bb/ui/crumbs/builder.py |   12 +++++++-----
>  lib/bb/ui/crumbs/hig.py     |   23 -----------------------
>  2 files changed, 7 insertions(+), 28 deletions(-)
> 
> diff --git a/lib/bb/ui/crumbs/builder.py b/lib/bb/ui/crumbs/builder.py
> index 2fe67d9..4eb374c 100755
> --- a/lib/bb/ui/crumbs/builder.py
> +++ b/lib/bb/ui/crumbs/builder.py
> @@ -33,9 +33,10 @@ from bb.ui.crumbs.packageselectionpage import PackageSelectionPage
>  from bb.ui.crumbs.builddetailspage import BuildDetailsPage
>  from bb.ui.crumbs.imagedetailspage import ImageDetailsPage
>  from bb.ui.crumbs.hobwidget import hwc
> -from bb.ui.crumbs.hig import CrumbsMessageDialog, BinbDialog, \
> +from bb.ui.crumbs.hig import CrumbsMessageDialog, ImageSelectionDialog, \
>                               AdvancedSettingDialog, LayerSelectionDialog, \
> -                             DeployImageDialog, ImageSelectionDialog
> +                             DeployImageDialog
> +from bb.ui.crumbs.persistenttooltip import PersistentTooltip
>  
>  class Configuration:
>      '''Represents the data structure of configuration.'''
> @@ -659,9 +660,10 @@ class Builder(gtk.Window):
>          self.switch_page(self.FAST_IMAGE_GENERATING)
>  
>      def show_binb_dialog(self, binb):
> -        binb_dialog = BinbDialog("Brought in by:", binb, self)
> -        binb_dialog.run()
> -        binb_dialog.destroy()
> +        markup = "<b>Brought in by:</b>\n%s" % binb
> +        ptip = PersistentTooltip(markup)
> +
> +        ptip.show()
>  
>      def show_layer_selection_dialog(self):
>          dialog = LayerSelectionDialog(title = "Layers",
> diff --git a/lib/bb/ui/crumbs/hig.py b/lib/bb/ui/crumbs/hig.py
> index 3a66e7c..6ae682b 100644
> --- a/lib/bb/ui/crumbs/hig.py
> +++ b/lib/bb/ui/crumbs/hig.py
> @@ -92,29 +92,6 @@ class CrumbsMessageDialog(CrumbsDialog):
>          first_row.add(self.label)
>  
>  #
> -# Brought-in-by Dialog
> -#
> -class BinbDialog(CrumbsDialog):
> -    """
> -    A dialog widget to show "brought in by" info when a recipe/package is clicked.
> -    """
> -
> -    def __init__(self, title, content, parent=None):
> -        super(BinbDialog, self).__init__(title, parent, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, ("Close", gtk.RESPONSE_CLOSE))
> -
> -        self.set_position(gtk.WIN_POS_MOUSE)
> -        self.set_resizable(False)
> -        self.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(HobColors.DARK))
> -
> -        label = gtk.Label(content)
> -        label.set_alignment(0, 0)
> -        label.set_line_wrap(True)
> -        label.modify_fg(gtk.STATE_NORMAL, gtk.gdk.Color(HobColors.WHITE))
> -
> -        self.vbox.pack_start(label, expand=True, fill=True, padding=10)
> -        self.vbox.show_all()
> -
> -#
>  # AdvancedSettings Dialog
>  #
>  class AdvancedSettingDialog (CrumbsDialog):

Patch

diff --git a/lib/bb/ui/crumbs/builder.py b/lib/bb/ui/crumbs/builder.py
index 2fe67d9..4eb374c 100755
--- a/lib/bb/ui/crumbs/builder.py
+++ b/lib/bb/ui/crumbs/builder.py
@@ -33,9 +33,10 @@  from bb.ui.crumbs.packageselectionpage import PackageSelectionPage
 from bb.ui.crumbs.builddetailspage import BuildDetailsPage
 from bb.ui.crumbs.imagedetailspage import ImageDetailsPage
 from bb.ui.crumbs.hobwidget import hwc
-from bb.ui.crumbs.hig import CrumbsMessageDialog, BinbDialog, \
+from bb.ui.crumbs.hig import CrumbsMessageDialog, ImageSelectionDialog, \
                              AdvancedSettingDialog, LayerSelectionDialog, \
-                             DeployImageDialog, ImageSelectionDialog
+                             DeployImageDialog
+from bb.ui.crumbs.persistenttooltip import PersistentTooltip
 
 class Configuration:
     '''Represents the data structure of configuration.'''
@@ -659,9 +660,10 @@  class Builder(gtk.Window):
         self.switch_page(self.FAST_IMAGE_GENERATING)
 
     def show_binb_dialog(self, binb):
-        binb_dialog = BinbDialog("Brought in by:", binb, self)
-        binb_dialog.run()
-        binb_dialog.destroy()
+        markup = "<b>Brought in by:</b>\n%s" % binb
+        ptip = PersistentTooltip(markup)
+
+        ptip.show()
 
     def show_layer_selection_dialog(self):
         dialog = LayerSelectionDialog(title = "Layers",
diff --git a/lib/bb/ui/crumbs/hig.py b/lib/bb/ui/crumbs/hig.py
index 3a66e7c..6ae682b 100644
--- a/lib/bb/ui/crumbs/hig.py
+++ b/lib/bb/ui/crumbs/hig.py
@@ -92,29 +92,6 @@  class CrumbsMessageDialog(CrumbsDialog):
         first_row.add(self.label)
 
 #
-# Brought-in-by Dialog
-#
-class BinbDialog(CrumbsDialog):
-    """
-    A dialog widget to show "brought in by" info when a recipe/package is clicked.
-    """
-
-    def __init__(self, title, content, parent=None):
-        super(BinbDialog, self).__init__(title, parent, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, ("Close", gtk.RESPONSE_CLOSE))
-
-        self.set_position(gtk.WIN_POS_MOUSE)
-        self.set_resizable(False)
-        self.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(HobColors.DARK))
-
-        label = gtk.Label(content)
-        label.set_alignment(0, 0)
-        label.set_line_wrap(True)
-        label.modify_fg(gtk.STATE_NORMAL, gtk.gdk.Color(HobColors.WHITE))
-
-        self.vbox.pack_start(label, expand=True, fill=True, padding=10)
-        self.vbox.show_all()
-
-#
 # AdvancedSettings Dialog
 #
 class AdvancedSettingDialog (CrumbsDialog):