From: Joshua Lock <josh@linux.intel.com>
To: bitbake-devel@lists.openembedded.org
Subject: Re: [PATCH 26/32] Hob: fix a bug that the image size is shown incorrectly in the image details page.
Date: Wed, 29 Feb 2012 13:29:52 -0800 [thread overview]
Message-ID: <4F4E98D0.2070209@linux.intel.com> (raw)
In-Reply-To: <299485306af5bd05f9cd47185e2ed4fe35b4b3c4.1330523904.git.shane.wang@intel.com>
On 29/02/12 06:15, Shane Wang wrote:
> Originally, the image size shows the last item in the image tree view in the image details page.
> That is not correct. We need to show the size of the image which the user chooses.
>
> Signed-off-by: Shane Wang<shane.wang@intel.com>
Signed-off-by: Joshua Lock <josh@linux.intel.com>
> ---
> bitbake/lib/bb/ui/crumbs/hig.py | 2 +-
> bitbake/lib/bb/ui/crumbs/imagedetailspage.py | 32 +++++++++++++++++++------
> 2 files changed, 25 insertions(+), 9 deletions(-)
>
> diff --git a/bitbake/lib/bb/ui/crumbs/hig.py b/bitbake/lib/bb/ui/crumbs/hig.py
> index 9b96d8d..c5bd27a 100644
> --- a/bitbake/lib/bb/ui/crumbs/hig.py
> +++ b/bitbake/lib/bb/ui/crumbs/hig.py
> @@ -1035,6 +1035,7 @@ class ImageSelectionDialog (CrumbsDialog):
> table.attach(open_button, 9, 10, 0, 1)
>
> self.image_table = HobViewTable(self.__columns__)
> + self.image_table.set_size_request(-1, 300)
> self.image_table.connect("toggled", self.toggled_cb)
> self.vbox.pack_start(self.image_table, expand=True, fill=True)
>
> @@ -1052,7 +1053,6 @@ class ImageSelectionDialog (CrumbsDialog):
>
> model[path][columnid] = True
>
> -
> def select_path_cb(self, action, parent, entry):
> dialog = gtk.FileChooserDialog("", parent,
> gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER,
> diff --git a/bitbake/lib/bb/ui/crumbs/imagedetailspage.py b/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
> index 7f93db7..833c149 100755
> --- a/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
> +++ b/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
> @@ -74,6 +74,7 @@ class ImageDetailsPage (HobPage):
> self.hbox.pack_start(self.table, expand=True, fill=True, padding=15)
>
> colid = 0
> + self.line_widgets = {}
> if icon != None:
> self.table.attach(icon, colid, colid + 2, 0, 1)
> colid = colid + 2
> @@ -81,20 +82,31 @@ class ImageDetailsPage (HobPage):
> self.table.attach(widget, colid, 20, 0, 1)
> elif varlist != None and vallist != None:
> for line in range(0, row):
> - self.table.attach(self.text2label(varlist[line], vallist[line]), colid, 20, line, line + 1)
> + self.line_widgets[varlist[line]] = self.text2label(varlist[line], vallist[line])
> + self.table.attach(self.line_widgets[varlist[line]], colid, 20, line, line + 1)
>
> # pack the button on the right
> if button != None:
> self.hbox.pack_end(button, expand=False, fill=False)
>
> + def update_line_widgets(self, variable, value):
> + if len(self.line_widgets) == 0:
> + return
> + if not isinstance(self.line_widgets[variable], gtk.Label):
> + return
> + self.line_widgets[variable].set_markup(self.format_line(variable, value))
> +
> + def format_line(self, variable, value):
> + markup = "<span weight=\'bold\'>%s</span>" % variable
> + markup += "<span weight=\'normal\' foreground=\'#1c1c1c\' font_desc=\'14px\'>%s</span>" % value
> + return markup
> +
> def text2label(self, variable, value):
> # append the name:value to the left box
> # such as "Name: hob-core-minimal-variant-2011-12-15-beagleboard"
> - markup = "<span weight=\'bold\'>%s</span>" % variable
> - markup += "<span weight=\'normal\' foreground=\'#1c1c1c\' font_desc=\'14px\'>%s</span>" % value
> label = gtk.Label()
> label.set_alignment(0.0, 0.5)
> - label.set_markup(markup)
> + label.set_markup(self.format_line(variable, value))
> return label
>
> def __init__(self, builder):
> @@ -141,8 +153,6 @@ class ImageDetailsPage (HobPage):
> image_addr = self.builder.parameters.image_addr
> image_names = self.builder.parameters.image_names
> if build_succeeded:
> - image_addr = self.builder.parameters.image_addr
> - image_names = self.builder.parameters.image_names
> machine = self.builder.configuration.curr_mach
> base_image = self.builder.recipe_model.get_selected_image()
> layers = self.builder.configuration.layers
> @@ -174,6 +184,7 @@ class ImageDetailsPage (HobPage):
> image_table = HobViewTable(self.__columns__)
> image_table.set_model(self.image_store)
> image_table.toggle_default()
> + image_size = self._size_to_string(os.stat(os.path.join(image_addr, image_names[0])).st_size)
> image_table.connect("toggled", self.toggled_cb)
> view_files_button = gtk.LinkButton("file://%s" % image_addr, "View files")
> self.box_group_area.pack_start(self.DetailBox(widget=image_table, button=view_files_button), expand=True, fill=True)
> @@ -217,8 +228,9 @@ class ImageDetailsPage (HobPage):
> edit_packages_button.connect("clicked", self.edit_packages_button_clicked_cb)
> else: # get to this page from "My images"
> edit_packages_button = None
> - package_detail = self.DetailBox(varlist=varlist, vallist=vallist, button=edit_packages_button)
> - self.box_group_area.pack_start(package_detail, expand=False, fill=False)
> + self.package_detail = self.DetailBox(varlist=varlist, vallist=vallist, button=edit_packages_button)
> + self.box_group_area.pack_start(self.package_detail, expand=False, fill=False)
> +
> if build_succeeded:
> buttonlist = ["Build new image", "Save as template", "Run image", "Deploy image"]
> else: # get to this page from "My images"
> @@ -228,6 +240,9 @@ class ImageDetailsPage (HobPage):
>
> self.show_all()
>
> + def refresh_package_detail_box(self, image_size):
> + self.package_detail.update_line_widgets("Total image size: ", image_size)
> +
> def toggled_cb(self, table, cell, path, columnid, tree):
> model = tree.get_model()
> if not model:
> @@ -239,6 +254,7 @@ class ImageDetailsPage (HobPage):
> iter = model.iter_next(iter)
>
> model[path][columnid] = True
> + self.refresh_package_detail_box(model[path][1])
>
> def create_bottom_buttons(self, buttonlist):
> # Create the buttons at the bottom
--
Joshua Lock
Yocto Project "Johannes factotum"
Intel Open Source Technology Centre
next prev parent reply other threads:[~2012-02-29 21:38 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
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 [this message]
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=4F4E98D0.2070209@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