diff options
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs')
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/hig/saveimagedialog.py | 4 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/hoblistmodel.py | 28 | ||||
-rwxr-xr-x | bitbake/lib/bb/ui/crumbs/imagedetailspage.py | 10 |
3 files changed, 31 insertions, 11 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/hig/saveimagedialog.py b/bitbake/lib/bb/ui/crumbs/hig/saveimagedialog.py index b94e69f61c..9ea512f214 100644 --- a/bitbake/lib/bb/ui/crumbs/hig/saveimagedialog.py +++ b/bitbake/lib/bb/ui/crumbs/hig/saveimagedialog.py | |||
@@ -119,7 +119,11 @@ class SaveImageDialog (CrumbsDialog): | |||
119 | description_buffer = self.description_entry.get_buffer() | 119 | description_buffer = self.description_entry.get_buffer() |
120 | description = description_buffer.get_text(description_buffer.get_start_iter(),description_buffer.get_end_iter()) | 120 | description = description_buffer.get_text(description_buffer.get_start_iter(),description_buffer.get_end_iter()) |
121 | if new_text.islower() and new_text.isalnum(): | 121 | if new_text.islower() and new_text.isalnum(): |
122 | self.builder.image_details_page.image_saved = True | ||
122 | self.builder.generate_new_image(self.directory+text, description) | 123 | self.builder.generate_new_image(self.directory+text, description) |
124 | self.builder.recipe_model.set_in_list(text, description) | ||
125 | self.builder.recipe_model.set_selected_image(text) | ||
126 | self.builder.image_details_page.show_page(self.builder.IMAGE_GENERATED) | ||
123 | self.destroy() | 127 | self.destroy() |
124 | else: | 128 | else: |
125 | self.show_invalid_input_error_dialog() | 129 | self.show_invalid_input_error_dialog() |
diff --git a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py index d8f3256e10..34ff76a9d2 100644 --- a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py +++ b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py | |||
@@ -678,15 +678,8 @@ class RecipeListModel(gtk.ListStore): | |||
678 | self.clear() | 678 | self.clear() |
679 | 679 | ||
680 | # dummy image for prompt | 680 | # dummy image for prompt |
681 | self.set(self.append(), self.COL_NAME, self.__custom_image__, | 681 | self.set_in_list(self.__custom_image__, "Use 'Edit image recipe' to customize recipes and packages " \ |
682 | self.COL_DESC, "Use 'Edit image recipe' to customize recipes and packages " \ | 682 | "to be included in your image ") |
683 | "to be included in your image ", | ||
684 | self.COL_LIC, "", self.COL_GROUP, "", | ||
685 | self.COL_DEPS, "", self.COL_BINB, "", | ||
686 | self.COL_TYPE, "image", self.COL_INC, False, | ||
687 | self.COL_IMG, False, self.COL_INSTALL, "", self.COL_PN, self.__custom_image__, | ||
688 | self.COL_SUMMARY, "", self.COL_VERSION, "", self.COL_REVISION, "", | ||
689 | self.COL_HOMEPAGE, "", self.COL_BUGTRACKER, "") | ||
690 | 683 | ||
691 | for item in event_model["pn"]: | 684 | for item in event_model["pn"]: |
692 | name = item | 685 | name = item |
@@ -732,6 +725,23 @@ class RecipeListModel(gtk.ListStore): | |||
732 | self.pn_path[pn] = path | 725 | self.pn_path[pn] = path |
733 | it = self.iter_next(it) | 726 | it = self.iter_next(it) |
734 | 727 | ||
728 | def set_in_list(self, item, desc): | ||
729 | self.set(self.append(), self.COL_NAME, item, | ||
730 | self.COL_DESC, desc, | ||
731 | self.COL_LIC, "", self.COL_GROUP, "", | ||
732 | self.COL_DEPS, "", self.COL_BINB, "", | ||
733 | self.COL_TYPE, "image", self.COL_INC, False, | ||
734 | self.COL_IMG, False, self.COL_INSTALL, "", self.COL_PN, item, | ||
735 | self.COL_SUMMARY, "", self.COL_VERSION, "", self.COL_REVISION, "", | ||
736 | self.COL_HOMEPAGE, "", self.COL_BUGTRACKER, "") | ||
737 | self.pn_path = {} | ||
738 | it = self.get_iter_first() | ||
739 | while it: | ||
740 | pn = self.get_value(it, self.COL_NAME) | ||
741 | path = self.get_path(it) | ||
742 | self.pn_path[pn] = path | ||
743 | it = self.iter_next(it) | ||
744 | |||
735 | """ | 745 | """ |
736 | Update the model, send out the notification. | 746 | Update the model, send out the notification. |
737 | """ | 747 | """ |
diff --git a/bitbake/lib/bb/ui/crumbs/imagedetailspage.py b/bitbake/lib/bb/ui/crumbs/imagedetailspage.py index f55d43f30d..eaa45889c3 100755 --- a/bitbake/lib/bb/ui/crumbs/imagedetailspage.py +++ b/bitbake/lib/bb/ui/crumbs/imagedetailspage.py | |||
@@ -189,6 +189,7 @@ class ImageDetailsPage (HobPage): | |||
189 | self.image_store = [] | 189 | self.image_store = [] |
190 | self.button_ids = {} | 190 | self.button_ids = {} |
191 | self.details_bottom_buttons = gtk.HBox(False, 6) | 191 | self.details_bottom_buttons = gtk.HBox(False, 6) |
192 | self.image_saved = False | ||
192 | self.create_visual_elements() | 193 | self.create_visual_elements() |
193 | 194 | ||
194 | def create_visual_elements(self): | 195 | def create_visual_elements(self): |
@@ -248,7 +249,7 @@ class ImageDetailsPage (HobPage): | |||
248 | self.pack_start(self.group_align, expand=True, fill=True) | 249 | self.pack_start(self.group_align, expand=True, fill=True) |
249 | 250 | ||
250 | self.build_result = None | 251 | self.build_result = None |
251 | if self.build_succeeded and self.builder.current_step == self.builder.IMAGE_GENERATING: | 252 | if self.image_saved or (self.build_succeeded and self.builder.current_step == self.builder.IMAGE_GENERATING): |
252 | # building is the previous step | 253 | # building is the previous step |
253 | icon = gtk.Image() | 254 | icon = gtk.Image() |
254 | pixmap_path = hic.ICON_INDI_CONFIRM_FILE | 255 | pixmap_path = hic.ICON_INDI_CONFIRM_FILE |
@@ -256,7 +257,10 @@ class ImageDetailsPage (HobPage): | |||
256 | pix_buffer = gtk.gdk.pixbuf_new_from_file(pixmap_path) | 257 | pix_buffer = gtk.gdk.pixbuf_new_from_file(pixmap_path) |
257 | icon.set_from_pixbuf(pix_buffer) | 258 | icon.set_from_pixbuf(pix_buffer) |
258 | varlist = [""] | 259 | varlist = [""] |
259 | vallist = ["Your image is ready"] | 260 | if self.image_saved: |
261 | vallist = ["Your image recipe has been saved"] | ||
262 | else: | ||
263 | vallist = ["Your image is ready"] | ||
260 | self.build_result = self.BuildDetailBox(varlist=varlist, vallist=vallist, icon=icon, color=color) | 264 | self.build_result = self.BuildDetailBox(varlist=varlist, vallist=vallist, icon=icon, color=color) |
261 | self.box_group_area.pack_start(self.build_result, expand=False, fill=False) | 265 | self.box_group_area.pack_start(self.build_result, expand=False, fill=False) |
262 | 266 | ||
@@ -397,6 +401,7 @@ class ImageDetailsPage (HobPage): | |||
397 | self.show_all() | 401 | self.show_all() |
398 | if self.kernel_detail and (not is_runnable): | 402 | if self.kernel_detail and (not is_runnable): |
399 | self.kernel_detail.hide() | 403 | self.kernel_detail.hide() |
404 | self.image_saved = False | ||
400 | 405 | ||
401 | def view_files_clicked_cb(self, button, image_addr): | 406 | def view_files_clicked_cb(self, button, image_addr): |
402 | subprocess.call("xdg-open /%s" % image_addr, shell=True) | 407 | subprocess.call("xdg-open /%s" % image_addr, shell=True) |
@@ -583,6 +588,7 @@ class ImageDetailsPage (HobPage): | |||
583 | name = "Save image recipe" | 588 | name = "Save image recipe" |
584 | if name in buttonlist and self.builder.recipe_model.is_custom_image(): | 589 | if name in buttonlist and self.builder.recipe_model.is_custom_image(): |
585 | save_button = HobAltButton("Save image recipe") | 590 | save_button = HobAltButton("Save image recipe") |
591 | save_button.set_sensitive(not self.image_saved) | ||
586 | button_id = save_button.connect("clicked", self.save_button_clicked_cb) | 592 | button_id = save_button.connect("clicked", self.save_button_clicked_cb) |
587 | self.button_ids[button_id] = save_button | 593 | self.button_ids[button_id] = save_button |
588 | self.details_bottom_buttons.pack_end(save_button, expand=False, fill=False) | 594 | self.details_bottom_buttons.pack_end(save_button, expand=False, fill=False) |