aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
diff options
context:
space:
mode:
authorCristiana Voicu <cristiana.voicu@intel.com>2013-07-25 07:25:38 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-08-06 13:02:23 +0100
commitee4fe5a229125d01cf8b697c759d0852f9a715a8 (patch)
tree0c00f7f0fcf78db9e3ccb0b44a8cd51ce5685011 /bitbake/lib/bb/ui/crumbs/imagedetailspage.py
parent843ef1083243e1569d6cc429ae26e22dda699149 (diff)
downloadopenembedded-core-contrib-ee4fe5a229125d01cf8b697c759d0852f9a715a8.tar.gz
bitbake: hob: create save image dialog used to save a template
Implemented a new dialog used by Hob. This dialog was desinged in order to permit to save only in a particular directory. Also, it has a field where the user can type a description for the image. Implemented in the handler a method to retrieve the topdir variable, because the changes will be saved in {topdir}/recipes/images directory. [YOCTO #4193] (Bitbake rev: 117d4809a62e28ffe7e9dcda5433993d76f7d934) Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs/imagedetailspage.py')
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/imagedetailspage.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/imagedetailspage.py b/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
index 4b0e7498cd..a02ab610c0 100755
--- a/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
+++ b/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
@@ -27,6 +27,7 @@ from bb.ui.crumbs.hobwidget import hic, HobViewTable, HobAltButton, HobButton
from bb.ui.crumbs.hobpages import HobPage
import subprocess
from bb.ui.crumbs.hig.crumbsdialog import CrumbsDialog
+from bb.ui.crumbs.hig.saveimagedialog import SaveImageDialog
#
# ImageDetailsPage
@@ -259,7 +260,7 @@ class ImageDetailsPage (HobPage):
self.build_result = self.BuildDetailBox(varlist=varlist, vallist=vallist, icon=icon, color=color)
self.box_group_area.pack_start(self.build_result, expand=False, fill=False)
- self.buttonlist = ["Build new image", "Run image", "Deploy image"]
+ self.buttonlist = ["Build new image", "Save image recipe", "Run image", "Deploy image"]
# Name
self.image_store = []
@@ -340,7 +341,7 @@ class ImageDetailsPage (HobPage):
self.setting_detail = None
if self.build_succeeded:
vallist.append(machine)
- if base_image == self.builder.recipe_model.__custom_image__:
+ if self.builder.recipe_model.is_custom_image():
if self.builder.configuration.initial_selected_image == self.builder.recipe_model.__custom_image__:
base_image ="New image recipe"
else:
@@ -579,6 +580,13 @@ class ImageDetailsPage (HobPage):
created = True
is_runnable = True
+ name = "Save image recipe"
+ if name in buttonlist and self.builder.recipe_model.is_custom_image():
+ save_button = HobAltButton("Save image recipe")
+ button_id = save_button.connect("clicked", self.save_button_clicked_cb)
+ self.button_ids[button_id] = save_button
+ self.details_bottom_buttons.pack_end(save_button, expand=False, fill=False)
+
name = "Build new image"
if name in buttonlist:
# create button "Build new image"
@@ -613,6 +621,14 @@ class ImageDetailsPage (HobPage):
else:
self.builder.runqemu_image(self.toggled_image, self.sel_kernel)
+ def save_button_clicked_cb(self, button):
+ topdir = self.builder.get_topdir()
+ images_dir = topdir + "/recipes/images/"
+ dialog = SaveImageDialog(images_dir, "Save image recipe", self.builder,
+ gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT)
+ response = dialog.run()
+ dialog.destroy()
+
def build_new_button_clicked_cb(self, button):
self.builder.initiate_new_build_async()