diff options
| author | Cristiana Voicu <cristiana.voicu@intel.com> | 2013-07-25 07:40:49 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-08-06 13:02:25 +0100 |
| commit | 3bef5a75d6dd06412157582de131e9b0e4ebfc7e (patch) | |
| tree | 0bea86420b1f3b4564497b0849c2076762f94b76 /bitbake/lib | |
| parent | bb8a265b0fa61a502c95b830ac82715e6685e2ab (diff) | |
| download | poky-3bef5a75d6dd06412157582de131e9b0e4ebfc7e.tar.gz | |
bitbake: hob: change the name and description for the saveimagedialog
The image name and description should be saved for a future
save.
[YOCTO #4193]
(Bitbake rev: 6dc0fc243ac6046714523d08df4d8f88c48698cc)
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
| -rw-r--r-- | bitbake/lib/bb/ui/crumbs/hig/saveimagedialog.py | 8 | ||||
| -rwxr-xr-x | bitbake/lib/bb/ui/crumbs/imagedetailspage.py | 6 |
2 files changed, 11 insertions, 3 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/hig/saveimagedialog.py b/bitbake/lib/bb/ui/crumbs/hig/saveimagedialog.py index 9ea512f214..a20afcd50f 100644 --- a/bitbake/lib/bb/ui/crumbs/hig/saveimagedialog.py +++ b/bitbake/lib/bb/ui/crumbs/hig/saveimagedialog.py | |||
| @@ -29,10 +29,12 @@ class SaveImageDialog (CrumbsDialog): | |||
| 29 | This class is used to create a dialog that permits to save | 29 | This class is used to create a dialog that permits to save |
| 30 | a custom image in a predefined directory. | 30 | a custom image in a predefined directory. |
| 31 | """ | 31 | """ |
| 32 | def __init__(self, directory, title, parent, flags, buttons=None): | 32 | def __init__(self, directory, name, description, title, parent, flags, buttons=None): |
| 33 | super(SaveImageDialog, self).__init__(title, parent, flags, buttons) | 33 | super(SaveImageDialog, self).__init__(title, parent, flags, buttons) |
| 34 | self.directory = directory | 34 | self.directory = directory |
| 35 | self.builder = parent | 35 | self.builder = parent |
| 36 | self.name_field = name | ||
| 37 | self.description_field = description | ||
| 36 | 38 | ||
| 37 | # create visual elements on the dialog | 39 | # create visual elements on the dialog |
| 38 | self.create_visual_elements() | 40 | self.create_visual_elements() |
| @@ -52,6 +54,7 @@ class SaveImageDialog (CrumbsDialog): | |||
| 52 | content += "characters. The only special character you can use is the ASCII hyphen (-)." | 54 | content += "characters. The only special character you can use is the ASCII hyphen (-)." |
| 53 | sub_label.set_markup(content) | 55 | sub_label.set_markup(content) |
| 54 | self.name_entry = gtk.Entry() | 56 | self.name_entry = gtk.Entry() |
| 57 | self.name_entry.set_text(self.name_field) | ||
| 55 | self.name_entry.set_size_request(350,30) | 58 | self.name_entry.set_size_request(350,30) |
| 56 | self.name_entry.connect("changed", self.name_entry_changed) | 59 | self.name_entry.connect("changed", self.name_entry_changed) |
| 57 | sub_vbox.pack_start(label, expand=False, fill=False) | 60 | sub_vbox.pack_start(label, expand=False, fill=False) |
| @@ -67,6 +70,7 @@ class SaveImageDialog (CrumbsDialog): | |||
| 67 | sub_label.set_alignment(0, 0) | 70 | sub_label.set_alignment(0, 0) |
| 68 | sub_label.set_markup("The description should be less than 150 characters long.") | 71 | sub_label.set_markup("The description should be less than 150 characters long.") |
| 69 | self.description_entry = gtk.TextView() | 72 | self.description_entry = gtk.TextView() |
| 73 | self.description_entry.get_buffer().set_text(self.description_field) | ||
| 70 | self.description_entry.set_wrap_mode(gtk.WRAP_WORD) | 74 | self.description_entry.set_wrap_mode(gtk.WRAP_WORD) |
| 71 | self.description_entry.set_size_request(350,150) | 75 | self.description_entry.set_size_request(350,150) |
| 72 | sub_vbox.pack_start(label, expand=False, fill=False) | 76 | sub_vbox.pack_start(label, expand=False, fill=False) |
| @@ -124,6 +128,8 @@ class SaveImageDialog (CrumbsDialog): | |||
| 124 | self.builder.recipe_model.set_in_list(text, description) | 128 | self.builder.recipe_model.set_in_list(text, description) |
| 125 | self.builder.recipe_model.set_selected_image(text) | 129 | self.builder.recipe_model.set_selected_image(text) |
| 126 | self.builder.image_details_page.show_page(self.builder.IMAGE_GENERATED) | 130 | self.builder.image_details_page.show_page(self.builder.IMAGE_GENERATED) |
| 131 | self.builder.image_details_page.name_field_template = text | ||
| 132 | self.builder.image_details_page.description_field_template = description | ||
| 127 | self.destroy() | 133 | self.destroy() |
| 128 | else: | 134 | else: |
| 129 | self.show_invalid_input_error_dialog() | 135 | self.show_invalid_input_error_dialog() |
diff --git a/bitbake/lib/bb/ui/crumbs/imagedetailspage.py b/bitbake/lib/bb/ui/crumbs/imagedetailspage.py index eaa45889c3..f50552fbbd 100755 --- a/bitbake/lib/bb/ui/crumbs/imagedetailspage.py +++ b/bitbake/lib/bb/ui/crumbs/imagedetailspage.py | |||
| @@ -191,6 +191,8 @@ class ImageDetailsPage (HobPage): | |||
| 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.image_saved = False |
| 193 | self.create_visual_elements() | 193 | self.create_visual_elements() |
| 194 | self.name_field_template = "" | ||
| 195 | self.description_field_template = "" | ||
| 194 | 196 | ||
| 195 | def create_visual_elements(self): | 197 | def create_visual_elements(self): |
| 196 | # create visual elements | 198 | # create visual elements |
| @@ -632,8 +634,8 @@ class ImageDetailsPage (HobPage): | |||
| 632 | images_dir = topdir + "/recipes/images/" | 634 | images_dir = topdir + "/recipes/images/" |
| 633 | self.builder.ensure_dir(images_dir) | 635 | self.builder.ensure_dir(images_dir) |
| 634 | 636 | ||
| 635 | dialog = SaveImageDialog(images_dir, "Save image recipe", self.builder, | 637 | dialog = SaveImageDialog(images_dir, self.name_field_template, self.description_field_template, |
| 636 | gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT) | 638 | "Save image recipe", self.builder, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT) |
| 637 | response = dialog.run() | 639 | response = dialog.run() |
| 638 | dialog.destroy() | 640 | dialog.destroy() |
| 639 | 641 | ||
