All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
To: openembedded-core@lists.openembedded.org,
	Ross Burton <ross.burton@intel.com>
Subject: [PATCH 6/7] oe-pkgdata-browser: Select a matching package when a recipe is selected
Date: Wed,  8 Jan 2020 04:44:54 +0100	[thread overview]
Message-ID: <20200108034455.10101-6-pkj@axis.com> (raw)
In-Reply-To: <20200108034455.10101-1-pkj@axis.com>

When a recipe is selected, automatically select the package that
matches the recipe name (if it exists), otherwise select the first
package.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
 scripts/oe-pkgdata-browser | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/scripts/oe-pkgdata-browser b/scripts/oe-pkgdata-browser
index 75d889271b..8d223185a4 100755
--- a/scripts/oe-pkgdata-browser
+++ b/scripts/oe-pkgdata-browser
@@ -176,12 +176,18 @@ class PkgUi():
             return
 
         recipe = model[it][RecipeColumns.Recipe]
-        for package in packages_in_recipe(self.pkgdata, recipe):
+        packages = packages_in_recipe(self.pkgdata, recipe)
+        for package in packages:
             # TODO also show PKG after debian-renaming?
             data = load_runtime_package(self.pkgdata, package)
             # TODO stash data to avoid reading in on_package_changed
             self.package_iters[package] = self.package_store.append([package, int(data["PKGSIZE"])])
 
+        package = recipe if recipe in packages else sorted(packages)[0]
+        path = self.package_store.get_path(self.package_iters[package])
+        self.package_view.set_cursor(path)
+        self.package_view.scroll_to_cell(path)
+
     def on_package_changed(self, selection):
         self.label.set_text("")
         self.file_store.clear()
-- 
2.21.1



  parent reply	other threads:[~2020-01-08  3:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-08  3:44 [PATCH 1/7] oe-pkgdata-browser: Rename from pkgdataui.py Peter Kjellerstedt
2020-01-08  3:44 ` [PATCH 2/7] oe-pkgdata-browser: Clean the package view properly Peter Kjellerstedt
2020-01-08  3:44 ` [PATCH 3/7] oe-pkgdata-browser: Correct the prefix for kilo to "k" Peter Kjellerstedt
2020-01-08  3:44 ` [PATCH 4/7] oe-pkgdata-browser: Show file sizes in a human readable format Peter Kjellerstedt
2020-01-08  3:44 ` [PATCH 5/7] oe-pkgdata-browser: Avoid an extra space for dependencies without version Peter Kjellerstedt
2020-01-08  3:44 ` Peter Kjellerstedt [this message]
2020-01-08  3:44 ` [PATCH 7/7] oe-pkgdata-browser: Make the window 1200x900 by default Peter Kjellerstedt
2020-01-08 14:11 ` [PATCH 1/7] oe-pkgdata-browser: Rename from pkgdataui.py Ross Burton

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=20200108034455.10101-6-pkj@axis.com \
    --to=peter.kjellerstedt@axis.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=ross.burton@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.