From 53cc2c6cac6961babc283ed8efc34a591c43dbce Mon Sep 17 00:00:00 2001 From: Shane Wang Date: Wed, 29 Feb 2012 22:15:02 +0800 Subject: Hob: include hddimg and iso into image types. For image types, so far we don't include hddimg and iso. Then those files can not be deployed because they are filtered out in the image selection dialog. This patch is to include hddimg and iso (which are "live" in image types). Again, we have a TODO in the code for the future, that is to retrieve image types from the bitbake server instead of to use the walkaround. (Bitbake rev: d565507940be73fb5ea3ae7048d8d143c44c2a95) Signed-off-by: Shane Wang Signed-off-by: Richard Purdie --- bitbake/lib/bb/ui/crumbs/builder.py | 4 ++-- bitbake/lib/bb/ui/crumbs/hig.py | 9 +++++---- bitbake/lib/bb/ui/crumbs/hobeventhandler.py | 9 ++++----- bitbake/lib/bb/ui/crumbs/hobwidget.py | 27 +++++++++++++++++++++++++++ 4 files changed, 38 insertions(+), 11 deletions(-) (limited to 'bitbake/lib/bb/ui/crumbs') diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py index 007167337f..eb38819294 100755 --- a/bitbake/lib/bb/ui/crumbs/builder.py +++ b/bitbake/lib/bb/ui/crumbs/builder.py @@ -758,8 +758,8 @@ class Builder(gtk.Window): flags = gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT | gtk.DIALOG_NO_SEPARATOR, - buttons = ("Close", gtk.RESPONSE_NO, - "Make usb image", gtk.RESPONSE_YES)) + buttons = ("Make usb image", gtk.RESPONSE_YES, + "Close", gtk.RESPONSE_NO)) response = dialog.run() dialog.destroy() diff --git a/bitbake/lib/bb/ui/crumbs/hig.py b/bitbake/lib/bb/ui/crumbs/hig.py index 74f4f7b98a..cbad899ae0 100644 --- a/bitbake/lib/bb/ui/crumbs/hig.py +++ b/bitbake/lib/bb/ui/crumbs/hig.py @@ -28,7 +28,7 @@ import re import subprocess import shlex from bb.ui.crumbs.hobcolor import HobColors -from bb.ui.crumbs.hobwidget import HobViewTable +from bb.ui.crumbs.hobwidget import hcc, HobViewTable from bb.ui.crumbs.progressbar import HobProgressBar """ @@ -1083,9 +1083,10 @@ class ImageSelectionDialog (gtk.Dialog): dirs[:] = [] for f in files: for image_type in self.image_types: - if f.endswith('.' + image_type): - imageset.add(f.rsplit('.' + image_type)[0]) - self.image_list.append(f) + for real_image_type in hcc.SUPPORTED_IMAGE_TYPES[image_type]: + if f.endswith('.' + real_image_type): + imageset.add(f.rsplit('.' + real_image_type)[0]) + self.image_list.append(f) for image in imageset: self.image_store.set(self.image_store.append(), 0, image, 1, False) diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py index b071ad4503..2bf4ed84a1 100644 --- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py +++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py @@ -22,6 +22,7 @@ import gobject import logging from bb.ui.crumbs.runningbuild import RunningBuild +from bb.ui.crumbs.hobwidget import hcc class HobHandler(gobject.GObject): @@ -450,10 +451,8 @@ class HobHandler(gobject.GObject): params["incompat_license"] = self.server.runCommand(["getVariable", "INCOMPATIBLE_LICENSE"]) or "" params["sdk_machine"] = self.server.runCommand(["getVariable", "SDKMACHINE"]) or self.server.runCommand(["getVariable", "SDK_ARCH"]) or "" - #params["image_types"] = self.server.runCommand(["getVariable", "IMAGE_TYPES"]) or "" params["image_fstypes"] = self.server.runCommand(["getVariable", "IMAGE_FSTYPES"]) or "" - """ - A workaround - """ - params["image_types"] = "jffs2 sum.jffs2 cramfs ext2 ext2.gz ext2.bz2 ext3 ext3.gz ext2.lzma btrfs live squashfs squashfs-lzma ubi tar tar.gz tar.bz2 tar.xz cpio cpio.gz cpio.xz cpio.lzma" + + # walkaround + params["image_types"] = " ".join(hcc.SUPPORTED_IMAGE_TYPES.keys()).lstrip(" ") return params diff --git a/bitbake/lib/bb/ui/crumbs/hobwidget.py b/bitbake/lib/bb/ui/crumbs/hobwidget.py index 664bf25560..9afbfdbe96 100644 --- a/bitbake/lib/bb/ui/crumbs/hobwidget.py +++ b/bitbake/lib/bb/ui/crumbs/hobwidget.py @@ -50,6 +50,33 @@ class hic: ICON_INDI_CONFIRM_FILE = os.path.join(HOB_ICON_BASE_DIR, ('indicators/confirmation.png')) ICON_INDI_ERROR_FILE = os.path.join(HOB_ICON_BASE_DIR, ('indicators/error.png')) +class hcc: + + SUPPORTED_IMAGE_TYPES = { + "jffs2" : ["jffs2"], + "sum.jffs2" : ["sum.jffs2"], + "cramfs" : ["cramfs"], + "ext2" : ["ext2"], + "ext2.gz" : ["ext2.gz"], + "ext2.bz2" : ["ext2.bz2"], + "ext3" : ["ext3"], + "ext3.gz" : ["ext3.gz"], + "ext2.lzma" : ["ext2.lzma"], + "btrfs" : ["btrfs"], + "live" : ["hddimg", "iso"], + "squashfs" : ["squashfs"], + "squashfs-lzma" : ["squashfs-lzma"], + "ubi" : ["ubi"], + "tar" : ["tar"], + "tar.gz" : ["tar.gz"], + "tar.bz2" : ["tar.bz2"], + "tar.xz" : ["tar.xz"], + "cpio" : ["cpio"], + "cpio.gz" : ["cpio.gz"], + "cpio.xz" : ["cpio.xz"], + "cpio.lzma" : ["cpio.lzma"], + } + class HobViewTable (gtk.VBox): """ A VBox to contain the table for different recipe views and package view -- cgit v1.2.3-54-g00ecf