Openembedded Bitbake Development
 help / color / mirror / Atom feed
From: Joshua Lock <josh@linux.intel.com>
To: bitbake-devel@lists.openembedded.org
Subject: Re: [PATCH 04/32] Hob: fixed the issue in the brought-in-by dialog.
Date: Wed, 29 Feb 2012 13:28:37 -0800	[thread overview]
Message-ID: <4F4E9885.6090705@linux.intel.com> (raw)
In-Reply-To: <660576fe6e84608bbf4d7237f5804cfd244029cd.1330523904.git.shane.wang@intel.com>



On 29/02/12 06:15, Shane Wang wrote:
> When typing any thing in the search entry, the brough-in-by dialog will be shown. That is because we call back "selection-changed" signal to pop up the dialog, which is not correct.
> This patch is to fix the problem by using "row-activated" signal.
>
> Signed-off-by: Liming An<limingx.l.an@intel.com>
> Signed-off-by: Shane Wang<shane.wang@intel.com>

I point out some incorrect padding below but other than that:
Signed-off-by: Joshua Lock <josh@linux.intel.com>

> ---
>   bitbake/lib/bb/ui/crumbs/hig.py                  |    5 +---
>   bitbake/lib/bb/ui/crumbs/hobwidget.py            |   30 ++++++++++++---------
>   bitbake/lib/bb/ui/crumbs/packageselectionpage.py |   12 ++------
>   bitbake/lib/bb/ui/crumbs/recipeselectionpage.py  |   13 ++-------
>   4 files changed, 24 insertions(+), 36 deletions(-)
>
> diff --git a/bitbake/lib/bb/ui/crumbs/hig.py b/bitbake/lib/bb/ui/crumbs/hig.py
> index 2de7b2a..74f4f7b 100644
> --- a/bitbake/lib/bb/ui/crumbs/hig.py
> +++ b/bitbake/lib/bb/ui/crumbs/hig.py
> @@ -89,15 +89,12 @@ class BinbDialog(gtk.Dialog):
>           self.set_resizable(False)
>           self.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(HobColors.DARK))
>
> -        hbox = gtk.HBox(False, 0)
> -        self.vbox.pack_start(hbox, expand=False, fill=False, padding=10)
> -
>           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))
>
> -        hbox.pack_start(label, expand=False, fill=False, padding=10)
> +        self.vbox.pack_start(label, expand=True, fill=True, padding=10)

Padding needs fixing at some point. Perhaps one series can focus on that?

>           self.vbox.show_all()
>
>   #
> diff --git a/bitbake/lib/bb/ui/crumbs/hobwidget.py b/bitbake/lib/bb/ui/crumbs/hobwidget.py
> index 4bbbed6..664bf25 100644
> --- a/bitbake/lib/bb/ui/crumbs/hobwidget.py
> +++ b/bitbake/lib/bb/ui/crumbs/hobwidget.py
> @@ -55,16 +55,16 @@ class HobViewTable (gtk.VBox):
>       A VBox to contain the table for different recipe views and package view
>       """
>       __gsignals__ = {
> -         "toggled"      : (gobject.SIGNAL_RUN_LAST,
> -                           gobject.TYPE_NONE,
> -                          (gobject.TYPE_PYOBJECT,
> -                           gobject.TYPE_STRING,
> -                           gobject.TYPE_INT,
> -                           gobject.TYPE_PYOBJECT,)),
> -         "changed"      : (gobject.SIGNAL_RUN_LAST,
> -                           gobject.TYPE_NONE,
> -                          (gobject.TYPE_PYOBJECT,
> -                           gobject.TYPE_PYOBJECT,)),
> +         "toggled"       : (gobject.SIGNAL_RUN_LAST,
> +                            gobject.TYPE_NONE,
> +                           (gobject.TYPE_PYOBJECT,
> +                            gobject.TYPE_STRING,
> +                            gobject.TYPE_INT,
> +                            gobject.TYPE_PYOBJECT,)),
> +         "row-activated" : (gobject.SIGNAL_RUN_LAST,
> +                            gobject.TYPE_NONE,
> +                           (gobject.TYPE_PYOBJECT,
> +                            gobject.TYPE_PYOBJECT,)),
>       }
>
>       def __init__(self, columns):
> @@ -75,7 +75,8 @@ class HobViewTable (gtk.VBox):
>           self.table_tree.set_enable_search(True)
>           self.table_tree.set_rules_hint(True)
>           self.table_tree.get_selection().set_mode(gtk.SELECTION_SINGLE)
> -        self.table_tree.get_selection().connect("changed", self.selection_changed_cb, self.table_tree)
> +        self.toggle_columns = []
> +        self.table_tree.connect("row-activated", self.row_activated_cb)
>
>           for i in range(len(columns)):
>               col = gtk.TreeViewColumn(columns[i]['col_name'])
> @@ -99,6 +100,7 @@ class HobViewTable (gtk.VBox):
>                   self.toggle_id = i
>                   col.pack_end(cell, True)
>                   col.set_attributes(cell, active=columns[i]['col_id'])
> +                self.toggle_columns.append(columns[i]['col_name'])
>               elif columns[i]['col_style'] == 'radio toggle':
>                   cell = gtk.CellRendererToggle()
>                   cell.set_property('activatable', True)
> @@ -107,6 +109,7 @@ class HobViewTable (gtk.VBox):
>                   self.toggle_id = i
>                   col.pack_end(cell, True)
>                   col.set_attributes(cell, active=columns[i]['col_id'])
> +                self.toggle_columns.append(columns[i]['col_name'])
>
>           scroll = gtk.ScrolledWindow()
>           scroll.set_policy(gtk.POLICY_NEVER, gtk.POLICY_ALWAYS)
> @@ -133,8 +136,9 @@ class HobViewTable (gtk.VBox):
>       def toggled_cb(self, cell, path, columnid, tree):
>           self.emit("toggled", cell, path, columnid, tree)
>
> -    def selection_changed_cb(self, selection, tree):
> -        self.emit("changed", selection, tree)
> +    def row_activated_cb(self, tree, path, view_column):
> +        if not view_column.get_title() in self.toggle_columns:
> +            self.emit("row-activated", tree.get_model(), path)
>
>   class HobViewBar (gtk.EventBox):
>       """
> diff --git a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
> index 280d480..a3c4acd 100755
> --- a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
> +++ b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
> @@ -116,7 +116,7 @@ class PackageSelectionPage (HobPage):
>               tab.set_model(self.package_model.tree_model(filter))
>               tab.connect("toggled", self.table_toggled_cb)
>               if self.pages[i]['name'] == "Included":
> -                tab.connect("changed", self.tree_selection_cb)
> +                tab.connect("row-activated", self.tree_row_activated_cb)
>
>               reset_button = gtk.Button("Reset")
>               reset_button.connect("clicked", self.reset_clicked_cb)
> @@ -161,14 +161,8 @@ class PackageSelectionPage (HobPage):
>           self.back_button.connect("clicked", self.back_button_clicked_cb)
>           button_box.pack_start(self.back_button, expand=False, fill=False)
>
> -    def tree_selection_cb(self, table, tree_selection, tree_view):
> -        tree_model = tree_view.get_model()
> -        path, column = tree_view.get_cursor()
> -        if not path or column == tree_view.get_column(2):
> -            return
> -
> -        it = tree_model.get_iter(path)
> -        binb = tree_model.get_value(it, PackageListModel.COL_BINB)
> +    def tree_row_activated_cb(self, table, tree_model, path):
> +        binb = tree_model.get_value(tree_model.get_iter(path), PackageListModel.COL_BINB)
>           if binb:
>               self.builder.show_binb_dialog(binb)
>
> diff --git a/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py b/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py
> index cf8504a..ee36f8c 100755
> --- a/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py
> +++ b/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py
> @@ -140,8 +140,7 @@ class RecipeSelectionPage (HobPage):
>               tab.set_model(self.recipe_model.tree_model(filter))
>               tab.connect("toggled", self.table_toggled_cb)
>               if self.pages[i]['name'] == "Included":
> -                tab.connect("changed", self.tree_selection_cb)
> -
> +                tab.connect("row-activated", self.tree_row_activated_cb)
>               reset_button = gtk.Button("Reset")
>               reset_button.connect("clicked", self.reset_clicked_cb)
>               hbox = gtk.HBox(False, 5)
> @@ -185,14 +184,8 @@ class RecipeSelectionPage (HobPage):
>           self.back_button.connect("clicked", self.back_button_clicked_cb)
>           button_box.pack_start(self.back_button, expand=False, fill=False)
>
> -    def tree_selection_cb(self, table, tree_selection, tree_view):
> -        tree_model = tree_view.get_model()
> -        path, column = tree_view.get_cursor()
> -        if not path or column == tree_view.get_column(2):
> -            return
> -
> -        it = tree_model.get_iter(path)
> -        binb = tree_model.get_value(it, RecipeListModel.COL_BINB)
> +    def tree_row_activated_cb(self, table, tree_model, path):
> +        binb = tree_model.get_value(tree_model.get_iter(path), RecipeListModel.COL_BINB)
>           if binb:
>               self.builder.show_binb_dialog(binb)
>

-- 
Joshua Lock
         Yocto Project "Johannes factotum"
         Intel Open Source Technology Centre



  reply	other threads:[~2012-02-29 21:37 UTC|newest]

Thread overview: 81+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-29 14:11 [PATCH 00/32] Hob related fixes Shane Wang
2012-02-29 14:14 ` [PATCH 01/32] Hob: make HobViewTable more general in hob and make the image selection dialog and the image details page reuse it Shane Wang
2012-02-29 21:28   ` Joshua Lock
2012-03-02  7:19     ` Wang, Shane
2012-02-29 14:14 ` [PATCH 02/32] Hob: avoid the image selection dialog to walk through all directories and its sub-directories, when users click "My images" Shane Wang
2012-02-29 21:30   ` Joshua Lock
2012-02-29 14:15 ` [PATCH 03/32] Hob: cleanup those class methods in HobWidget Shane Wang
2012-02-29 14:15 ` [PATCH 04/32] Hob: fixed the issue in the brought-in-by dialog Shane Wang
2012-02-29 21:28   ` Joshua Lock [this message]
2012-03-02  7:22     ` Wang, Shane
2012-03-02 18:02       ` Joshua Lock
2012-03-07 23:21         ` Wang, Shane
2012-03-07 23:56           ` Joshua Lock
2012-02-29 14:15 ` [PATCH 05/32] Hob: include hddimg and iso into image types Shane Wang
2012-02-29 21:27   ` Joshua Lock
2012-02-29 14:15 ` [PATCH 06/32] Hob: implement a self-defined notebook visual component for Hob Shane Wang
2012-02-29 21:27   ` Joshua Lock
2012-03-02  7:06     ` Wang, Shane
2012-03-02 18:06       ` Joshua Lock
2012-02-29 14:15 ` [PATCH 07/32] Hob: use HobNotebook to enable a notebook in build details page Shane Wang
2012-02-29 21:32   ` Joshua Lock
2012-03-02 13:34     ` Wang, Shane
2012-02-29 14:15 ` [PATCH 08/32] Hob: image configuration page doesn't need dialogs any more Shane Wang
2012-02-29 21:29   ` Joshua Lock
2012-02-29 14:15 ` [PATCH 09/32] Hob: fix a bug in builder.configuration.curr_mach Shane Wang
2012-02-29 21:29   ` Joshua Lock
2012-02-29 14:15 ` [PATCH 10/32] Hob: add ignore_all_errors to avoid showing error dialog multiple times Shane Wang
2012-02-29 21:29   ` Joshua Lock
2012-03-02  7:31     ` Wang, Shane
2012-02-29 14:15 ` [PATCH 11/32] Hob: make the image configuration page not to flash the progress bar Shane Wang
2012-02-29 21:29   ` Joshua Lock
2012-02-29 14:15 ` [PATCH 12/32] Hob: enable indicators on the "Included" tab in the recipe selection page and the package selection page Shane Wang
2012-02-29 14:15 ` [PATCH 13/32] crumbs: Factor common dialogue configuration out Shane Wang
2012-02-29 14:15 ` [PATCH 14/32] crumbs/builder: use the name Hob consistently Shane Wang
2012-02-29 14:15 ` [PATCH 15/32] crumbs: move towards more standard dialogue spacing Shane Wang
2012-02-29 14:15 ` [PATCH 16/32] crumbs: fix button order in several dialogues Shane Wang
2012-02-29 14:15 ` [PATCH 17/32] hig: try to avoid setting explicit dialogue sizes Shane Wang
2012-02-29 14:15 ` [PATCH 18/32] crumbs/hig: tweak UI and layout of LayerSelectionDialog Shane Wang
2012-02-29 14:15 ` [PATCH 19/32] Hob(crumbs/builder.py): remove the code commented out in the builder.py Shane Wang
2012-02-29 21:29   ` Joshua Lock
2012-02-29 14:15 ` [PATCH 20/32] command.py: remove the resolve parameter in generateTargetsTree Shane Wang
2012-02-29 21:28   ` Joshua Lock
2012-02-29 14:15 ` [PATCH 21/32] cooker.py: Fix a bug due to variable name Shane Wang
2012-02-29 21:28   ` Joshua Lock
2012-02-29 14:15 ` [PATCH 22/32] cooker: fix calculating of depends and rdepends Shane Wang
2012-02-29 21:28   ` Joshua Lock
2012-02-29 14:15 ` [PATCH 23/32] Hob(crumbs/hoblistmodel.py): Fix recipe's populate() function Shane Wang
2012-02-29 21:29   ` Joshua Lock
2012-02-29 14:15 ` [PATCH 24/32] Hob(crumbs/hoblistmodel.py): Add mapping for rprovides and pkg Shane Wang
2012-02-29 21:30   ` Joshua Lock
2012-03-01  4:20     ` Xu, Dongxiao
2012-03-02 13:31     ` Wang, Shane
2012-02-29 14:15 ` [PATCH 25/32] Hob: Add an extra 50M space if zypper is selected Shane Wang
2012-02-29 21:29   ` Joshua Lock
2012-03-01  4:19     ` Xu, Dongxiao
2012-03-01 19:22       ` Joshua Lock
2012-02-29 14:15 ` [PATCH 26/32] Hob: fix a bug that the image size is shown incorrectly in the image details page Shane Wang
2012-02-29 21:29   ` Joshua Lock
2012-02-29 14:15 ` [PATCH 27/32] Hob: add "OK" button to "BinbDialog" Shane Wang
2012-02-29 21:29   ` Joshua Lock
2012-03-01  4:20     ` Xu, Dongxiao
2012-03-02 13:29     ` Wang, Shane
2012-02-29 14:15 ` [PATCH 28/32] Hob: allow users to setup the proxy Shane Wang
2012-02-29 21:29   ` Joshua Lock
2012-03-02 13:29     ` Wang, Shane
2012-03-02 18:14       ` Joshua Lock
2012-02-29 14:15 ` [PATCH 29/32] Hob(crumbs/builder.py): adjust the main window's position and ignore the case lower than 1024x768 Shane Wang
2012-02-29 21:29   ` Joshua Lock
2012-02-29 14:15 ` [PATCH 30/32] Hob: Fix pressing "stop" build Shane Wang
2012-02-29 21:29   ` Joshua Lock
2012-02-29 14:15 ` [PATCH 31/32] runqueue.py: initialize rqexe at RunQueue's init function Shane Wang
2012-02-29 21:29   ` Joshua Lock
2012-02-29 14:15 ` [PATCH 32/32] Hob: Disable the handling of "NoProvider" event Shane Wang
2012-03-01 15:23   ` Richard Purdie
2012-03-02  1:24     ` Xu, Dongxiao
2012-02-29 21:27 ` [PATCH 00/32] Hob related fixes Joshua Lock
2012-03-02  6:48   ` Wang, Shane
2012-03-03  3:50     ` Oren Leaffer
2012-03-01 15:32 ` Richard Purdie
2012-03-01 15:35 ` Richard Purdie
2012-03-02  1:23   ` Wang, Shane

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F4E9885.6090705@linux.intel.com \
    --to=josh@linux.intel.com \
    --cc=bitbake-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox