Patchwork [bitbake-devel,09/12] Hob: fix static variable "self.search" to parameter "search" in signal callback function

login
register
mail settings
Submitter Shane Wang
Date March 16, 2012, 3:10 p.m.
Message ID <3b656a55355058a1b845b675150b0e76ab83c1b2.1331910234.git.shane.wang@intel.com>
Download mbox | patch
Permalink /patch/23677/
State New
Headers show

Comments

Shane Wang - March 16, 2012, 3:10 p.m.
From: Liming An <limingx.l.an@intel.com>

To fix the signal callback function code, and make the temp parameter to replaced the static global variable, as required.

Signed-off-by: Liming An <limingx.l.an@intel.com>
Signed-off-by: Shane Wang <shane.wang@intel.com>
---
 bitbake/lib/bb/ui/crumbs/hobwidget.py |   31 ++++++++++++++-----------------
 1 files changed, 14 insertions(+), 17 deletions(-)
Joshua Lock - March 19, 2012, 11:52 p.m.
On 16/03/12 08:10, Shane Wang wrote:
> From: Liming An<limingx.l.an@intel.com>
>
> To fix the signal callback function code, and make the temp parameter to replaced the static global variable, as required.
>
> Signed-off-by: Liming An<limingx.l.an@intel.com>
> Signed-off-by: Shane Wang<shane.wang@intel.com>

Signed-off-by: Joshua Lock <josh@linux.intel.com>

> ---
>   bitbake/lib/bb/ui/crumbs/hobwidget.py |   31 ++++++++++++++-----------------
>   1 files changed, 14 insertions(+), 17 deletions(-)
>
> diff --git a/bitbake/lib/bb/ui/crumbs/hobwidget.py b/bitbake/lib/bb/ui/crumbs/hobwidget.py
> index 2afa975..e580d50 100644
> --- a/bitbake/lib/bb/ui/crumbs/hobwidget.py
> +++ b/bitbake/lib/bb/ui/crumbs/hobwidget.py
> @@ -658,20 +658,17 @@ class HobNotebook(gtk.VBox):
>
>       def blank_area_resize_cb(self, widget, request_x, request_y, request_width, request_height):
>           self.search.set_size_request(request_width, request_height)
> -        widget.modify_bg(gtk.STATE_SELECTED, gtk.gdk.color_parse(HobColors.YELLOW))
> -
> -    def set_search_entry_editable_cb(self, widget, event):
> -        if self.search:
> -            self.search.set_editable(True)
> -            self.search.set_text("")
> -            style = self.search.get_style()
> -            style.text[gtk.STATE_NORMAL] = self.get_colormap().alloc_color(HobColors.BLACK, False, False)
> -            self.search.set_style(style)
> -
> -    def set_search_entry_reset_cb(self, widget, event):
> -        if self.search:
> -            style = self.search.get_style()
> -            style.text[gtk.STATE_NORMAL] = self.get_colormap().alloc_color(HobColors.GRAY, False, False)
> -            self.search.set_style(style)
> -            self.search.set_text(self.search_name)
> -            self.search.set_editable(False)
> +
> +    def set_search_entry_editable_cb(self, search, event):
> +        search.set_editable(True)
> +        search.set_text("")
> +        style = self.search.get_style()
> +        style.text[gtk.STATE_NORMAL] = self.get_colormap().alloc_color(HobColors.BLACK, False, False)
> +        search.set_style(style)
> +
> +    def set_search_entry_reset_cb(self, search, event):
> +        style = search.get_style()
> +        style.text[gtk.STATE_NORMAL] = self.get_colormap().alloc_color(HobColors.GRAY, False, False)
> +        search.set_style(style)
> +        search.set_text(self.search_name)
> +        search.set_editable(False)

Patch

diff --git a/bitbake/lib/bb/ui/crumbs/hobwidget.py b/bitbake/lib/bb/ui/crumbs/hobwidget.py
index 2afa975..e580d50 100644
--- a/bitbake/lib/bb/ui/crumbs/hobwidget.py
+++ b/bitbake/lib/bb/ui/crumbs/hobwidget.py
@@ -658,20 +658,17 @@  class HobNotebook(gtk.VBox):
 
     def blank_area_resize_cb(self, widget, request_x, request_y, request_width, request_height):
         self.search.set_size_request(request_width, request_height)
-        widget.modify_bg(gtk.STATE_SELECTED, gtk.gdk.color_parse(HobColors.YELLOW))
-
-    def set_search_entry_editable_cb(self, widget, event):
-        if self.search:
-            self.search.set_editable(True)
-            self.search.set_text("")
-            style = self.search.get_style()
-            style.text[gtk.STATE_NORMAL] = self.get_colormap().alloc_color(HobColors.BLACK, False, False)
-            self.search.set_style(style)
-
-    def set_search_entry_reset_cb(self, widget, event):
-        if self.search:
-            style = self.search.get_style()
-            style.text[gtk.STATE_NORMAL] = self.get_colormap().alloc_color(HobColors.GRAY, False, False)
-            self.search.set_style(style)
-            self.search.set_text(self.search_name)
-            self.search.set_editable(False)
+
+    def set_search_entry_editable_cb(self, search, event):
+        search.set_editable(True)
+        search.set_text("")
+        style = self.search.get_style()
+        style.text[gtk.STATE_NORMAL] = self.get_colormap().alloc_color(HobColors.BLACK, False, False)
+        search.set_style(style)
+
+    def set_search_entry_reset_cb(self, search, event):
+        style = search.get_style()
+        style.text[gtk.STATE_NORMAL] = self.get_colormap().alloc_color(HobColors.GRAY, False, False)
+        search.set_style(style)
+        search.set_text(self.search_name)
+        search.set_editable(False)