summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorCristian Iorga <cristian.iorga@intel.com>2012-08-21 18:21:23 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-08-22 13:59:55 +0100
commit164083d31f7b8d1ea96b31ed3c13bddcc42961f6 (patch)
treec953d6dba3126da2f4f7047aedf24e2dcbf30284 /bitbake
parent2a6818eea1d73a66204e4a903300c9794f277efe (diff)
downloadpoky-164083d31f7b8d1ea96b31ed3c13bddcc42961f6.tar.gz
bitbake: Hob wizard-like reorganization
Hob is now more context-sensitive regarding user changes/options. Also, the workflow have been streamlined and resembles more of a wizard. Beautified some hardcoded values. Fixed typo. New streamlined Image Configuration page. Build and/or Edit image buttons presence is context sensitive. Recipes and packages tabs selected automatically based on custom image or pre-defined target image (included or all). Context sensitive Back button. Fixes [YOCTO 2165] (Bitbake rev: b48cd7dcf57b1abc8c5b46ced11d4f57bf06e557) Signed-off-by: Cristian Iorga <cristian.iorga@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/builddetailspage.py2
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/builder.py23
-rw-r--r--bitbake/lib/bb/ui/crumbs/hoblistmodel.py5
-rw-r--r--bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py68
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/packageselectionpage.py16
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/recipeselectionpage.py15
6 files changed, 69 insertions, 60 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/builddetailspage.py b/bitbake/lib/bb/ui/crumbs/builddetailspage.py
index 30eab29508..4d2d947d21 100755
--- a/bitbake/lib/bb/ui/crumbs/builddetailspage.py
+++ b/bitbake/lib/bb/ui/crumbs/builddetailspage.py
@@ -165,7 +165,7 @@ class BuildDetailsPage (HobPage):
165 self.builder.handler.build.model.connect_after("row-changed", self.scroll_to_present_row, self.scrolled_view_build.get_vadjustment(), self.build_tv) 165 self.builder.handler.build.model.connect_after("row-changed", self.scroll_to_present_row, self.scrolled_view_build.get_vadjustment(), self.build_tv)
166 166
167 self.button_box = gtk.HBox(False, 6) 167 self.button_box = gtk.HBox(False, 6)
168 self.back_button = HobAltButton("<< Back to image configuration") 168 self.back_button = HobAltButton('<< Back')
169 self.back_button.connect("clicked", self.back_button_clicked_cb) 169 self.back_button.connect("clicked", self.back_button_clicked_cb)
170 self.button_box.pack_start(self.back_button, expand=False, fill=False) 170 self.button_box.pack_start(self.back_button, expand=False, fill=False)
171 171
diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index 611024aae3..7de47986bb 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -41,7 +41,7 @@ from bb.ui.crumbs.hig import CrumbsMessageDialog, ImageSelectionDialog, \
41from bb.ui.crumbs.persistenttooltip import PersistentTooltip 41from bb.ui.crumbs.persistenttooltip import PersistentTooltip
42import bb.ui.crumbs.utils 42import bb.ui.crumbs.utils
43 43
44hobVer = 20120530 44hobVer = 20120808
45 45
46class Configuration: 46class Configuration:
47 '''Represents the data structure of configuration.''' 47 '''Represents the data structure of configuration.'''
@@ -640,16 +640,28 @@ class Builder(gtk.Window):
640 self.image_configuration_page.show_baseimg_selected() 640 self.image_configuration_page.show_baseimg_selected()
641 641
642 elif next_step == self.RECIPE_SELECTION: 642 elif next_step == self.RECIPE_SELECTION:
643 pass 643 if self.recipe_model.get_selected_image() == self.recipe_model.__custom_image__:
644 self.recipe_details_page.set_recipe_curr_tab(self.recipe_details_page.ALL)
645 else:
646 self.recipe_details_page.set_recipe_curr_tab(self.recipe_details_page.INCLUDED)
644 647
645 elif next_step == self.PACKAGE_SELECTION: 648 elif next_step == self.PACKAGE_SELECTION:
649 if self.recipe_model.get_selected_image() == self.recipe_model.__custom_image__:
650 self.package_details_page.set_packages_curr_tab(self.package_details_page.ALL)
651 else:
652 self.package_details_page.set_packages_curr_tab(self.package_details_page.INCLUDED)
646 self.package_details_page.show_page(self.current_logfile) 653 self.package_details_page.show_page(self.current_logfile)
647 654
655
648 elif next_step == self.PACKAGE_GENERATING or next_step == self.FAST_IMAGE_GENERATING: 656 elif next_step == self.PACKAGE_GENERATING or next_step == self.FAST_IMAGE_GENERATING:
649 # both PACKAGE_GENEATING and FAST_IMAGE_GENERATING share the same page 657 # both PACKAGE_GENERATING and FAST_IMAGE_GENERATING share the same page
650 self.build_details_page.show_page(next_step) 658 self.build_details_page.show_page(next_step)
651 659
652 elif next_step == self.PACKAGE_GENERATED: 660 elif next_step == self.PACKAGE_GENERATED:
661 if self.recipe_model.get_selected_image() == self.recipe_model.__custom_image__:
662 self.package_details_page.set_packages_curr_tab(self.package_details_page.ALL)
663 else:
664 self.package_details_page.set_packages_curr_tab(self.package_details_page.INCLUDED)
653 self.package_details_page.show_page(self.current_logfile) 665 self.package_details_page.show_page(self.current_logfile)
654 666
655 elif next_step == self.IMAGE_GENERATING: 667 elif next_step == self.IMAGE_GENERATING:
@@ -781,8 +793,6 @@ class Builder(gtk.Window):
781 self.image_configuration_page.layer_button.set_sensitive(sensitive) 793 self.image_configuration_page.layer_button.set_sensitive(sensitive)
782 self.image_configuration_page.layer_info_icon.set_sensitive(sensitive) 794 self.image_configuration_page.layer_info_icon.set_sensitive(sensitive)
783 self.image_configuration_page.toolbar.set_sensitive(sensitive) 795 self.image_configuration_page.toolbar.set_sensitive(sensitive)
784 self.image_configuration_page.view_recipes_button.set_sensitive(sensitive)
785 self.image_configuration_page.view_packages_button.set_sensitive(sensitive)
786 self.image_configuration_page.config_build_button.set_sensitive(sensitive) 796 self.image_configuration_page.config_build_button.set_sensitive(sensitive)
787 797
788 self.recipe_details_page.set_sensitive(sensitive) 798 self.recipe_details_page.set_sensitive(sensitive)
@@ -1270,6 +1280,9 @@ class Builder(gtk.Window):
1270 def show_recipes(self): 1280 def show_recipes(self):
1271 self.switch_page(self.RECIPE_SELECTION) 1281 self.switch_page(self.RECIPE_SELECTION)
1272 1282
1283 def show_image_details(self):
1284 self.switch_page(self.IMAGE_GENERATED)
1285
1273 def show_configuration(self): 1286 def show_configuration(self):
1274 self.switch_page(self.BASEIMG_SELECTED) 1287 self.switch_page(self.BASEIMG_SELECTED)
1275 1288
diff --git a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py
index 37cee78325..3de9e5bb56 100644
--- a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py
+++ b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py
@@ -566,9 +566,8 @@ class RecipeListModel(gtk.ListStore):
566 566
567 # dummy image for prompt 567 # dummy image for prompt
568 self.set(self.append(), self.COL_NAME, self.__custom_image__, 568 self.set(self.append(), self.COL_NAME, self.__custom_image__,
569 self.COL_DESC, "Use the 'View recipes' and 'View packages' " \ 569 self.COL_DESC, "Use 'Edit image' to customize recipes and packages " \
570 "options to select what you want to include " \ 570 "to be included in your image ",
571 "in your image.",
572 self.COL_LIC, "", self.COL_GROUP, "", 571 self.COL_LIC, "", self.COL_GROUP, "",
573 self.COL_DEPS, "", self.COL_BINB, "", 572 self.COL_DEPS, "", self.COL_BINB, "",
574 self.COL_TYPE, "image", self.COL_INC, False, 573 self.COL_TYPE, "image", self.COL_INC, False,
diff --git a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
index 80332feaba..6aeb6dc82f 100644
--- a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
+++ b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py
@@ -135,8 +135,10 @@ class ImageConfigurationPage (HobPage):
135 self._pack_components(pack_config_build_button = True) 135 self._pack_components(pack_config_build_button = True)
136 self.set_config_machine_layout(show_progress_bar = False) 136 self.set_config_machine_layout(show_progress_bar = False)
137 self.set_config_baseimg_layout() 137 self.set_config_baseimg_layout()
138 self.set_rcppkg_layout()
139 self.show_all() 138 self.show_all()
139 if self.builder.recipe_model.get_selected_image() == self.builder.recipe_model.__custom_image__:
140 self.just_bake_button.hide()
141 self.or_label.hide()
140 142
141 def create_config_machine(self): 143 def create_config_machine(self):
142 self.machine_title = gtk.Label() 144 self.machine_title = gtk.Label()
@@ -207,22 +209,6 @@ class ImageConfigurationPage (HobPage):
207 self.image_desc.set_justify(gtk.JUSTIFY_LEFT) 209 self.image_desc.set_justify(gtk.JUSTIFY_LEFT)
208 self.image_desc.set_line_wrap(True) 210 self.image_desc.set_line_wrap(True)
209 211
210 # button to view recipes
211 icon_file = hic.ICON_RCIPE_DISPLAY_FILE
212 hover_file = hic.ICON_RCIPE_HOVER_FILE
213 self.view_recipes_button = HobImageButton("View recipes",
214 "Add/remove recipes and tasks",
215 icon_file, hover_file)
216 self.view_recipes_button.connect("clicked", self.view_recipes_button_clicked_cb)
217
218 # button to view packages
219 icon_file = hic.ICON_PACKAGES_DISPLAY_FILE
220 hover_file = hic.ICON_PACKAGES_HOVER_FILE
221 self.view_packages_button = HobImageButton("View packages",
222 "Add/remove previously built packages",
223 icon_file, hover_file)
224 self.view_packages_button.connect("clicked", self.view_packages_button_clicked_cb)
225
226 self.image_separator = gtk.HSeparator() 212 self.image_separator = gtk.HSeparator()
227 213
228 def set_config_baseimg_layout(self): 214 def set_config_baseimg_layout(self):
@@ -232,29 +218,27 @@ class ImageConfigurationPage (HobPage):
232 self.gtable.attach(self.image_desc, 13, 38, 23, 28) 218 self.gtable.attach(self.image_desc, 13, 38, 23, 28)
233 self.gtable.attach(self.image_separator, 0, 40, 35, 36) 219 self.gtable.attach(self.image_separator, 0, 40, 35, 36)
234 220
235 def set_rcppkg_layout(self):
236 self.gtable.attach(self.view_recipes_button, 0, 20, 28, 33)
237 self.gtable.attach(self.view_packages_button, 20, 40, 28, 33)
238
239 def create_config_build_button(self): 221 def create_config_build_button(self):
240 # Create the "Build packages" and "Build image" buttons at the bottom 222 # Create the "Build packages" and "Build image" buttons at the bottom
241 button_box = gtk.HBox(False, 6) 223 button_box = gtk.HBox(False, 6)
242 224
243 # create button "Build image" 225 # create button "Build image"
244 just_bake_button = HobButton("Build image") 226 self.just_bake_button = HobButton("Build image")
245 just_bake_button.set_size_request(205, 49) 227 self.just_bake_button.set_size_request(205, 49)
246 just_bake_button.set_tooltip_text("Build target image") 228 self.just_bake_button.set_tooltip_text("Build target image")
247 just_bake_button.connect("clicked", self.just_bake_button_clicked_cb) 229 self.just_bake_button.connect("clicked", self.just_bake_button_clicked_cb)
248 button_box.pack_end(just_bake_button, expand=False, fill=False) 230 button_box.pack_end(self.just_bake_button, expand=False, fill=False)
249 231
250 label = gtk.Label(" or ") 232 # create separator label
251 button_box.pack_end(label, expand=False, fill=False) 233 self.or_label = gtk.Label(" or ")
252 234 button_box.pack_end(self.or_label, expand=False, fill=False)
253 # create button "Build Packages" 235
254 build_packages_button = HobAltButton("Build packages") 236 # create button "Edit Image"
255 build_packages_button.connect("clicked", self.build_packages_button_clicked_cb) 237 self.edit_image_button = HobButton("Edit image")
256 build_packages_button.set_tooltip_text("Build recipes into packages") 238 self.edit_image_button.set_size_request(205, 49)
257 button_box.pack_end(build_packages_button, expand=False, fill=False) 239 self.edit_image_button.set_tooltip_text("Edit target image")
240 self.edit_image_button.connect("clicked", self.edit_image_button_clicked_cb)
241 button_box.pack_end(self.edit_image_button, expand=False, fill=False)
258 242
259 return button_box 243 return button_box
260 244
@@ -347,6 +331,10 @@ class ImageConfigurationPage (HobPage):
347 331
348 self.show_baseimg_selected() 332 self.show_baseimg_selected()
349 333
334 if selected_image == self.builder.recipe_model.__custom_image__:
335 self.just_bake_button.hide()
336 self.or_label.hide()
337
350 glib.idle_add(self.image_combo_changed_idle_cb, selected_image, selected_recipes, selected_packages) 338 glib.idle_add(self.image_combo_changed_idle_cb, selected_image, selected_recipes, selected_packages)
351 339
352 def _image_combo_connect_signal(self): 340 def _image_combo_connect_signal(self):
@@ -426,17 +414,11 @@ class ImageConfigurationPage (HobPage):
426 # Create a layer selection dialog 414 # Create a layer selection dialog
427 self.builder.show_layer_selection_dialog() 415 self.builder.show_layer_selection_dialog()
428 416
429 def view_recipes_button_clicked_cb(self, button):
430 self.builder.show_recipes()
431
432 def view_packages_button_clicked_cb(self, button):
433 self.builder.show_packages()
434
435 def just_bake_button_clicked_cb(self, button): 417 def just_bake_button_clicked_cb(self, button):
436 self.builder.just_bake() 418 self.builder.just_bake()
437 419
438 def build_packages_button_clicked_cb(self, button): 420 def edit_image_button_clicked_cb(self, button):
439 self.builder.build_packages() 421 self.builder.show_recipes()
440 422
441 def template_button_clicked_cb(self, button): 423 def template_button_clicked_cb(self, button):
442 response, path = self.builder.show_load_template_dialog() 424 response, path = self.builder.show_load_template_dialog()
diff --git a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
index d1015352f1..3576ed5bc1 100755
--- a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
+++ b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
@@ -98,9 +98,12 @@ class PackageSelectionPage (HobPage):
98 }] 98 }]
99 } 99 }
100 ] 100 ]
101
102 (INCLUDED,
103 ALL) = range(2)
101 104
102 def __init__(self, builder): 105 def __init__(self, builder):
103 super(PackageSelectionPage, self).__init__(builder, "Packages") 106 super(PackageSelectionPage, self).__init__(builder, "Edit packages")
104 107
105 # set invisiable members 108 # set invisiable members
106 self.recipe_model = self.builder.recipe_model 109 self.recipe_model = self.builder.recipe_model
@@ -110,7 +113,7 @@ class PackageSelectionPage (HobPage):
110 self.create_visual_elements() 113 self.create_visual_elements()
111 114
112 def included_clicked_cb(self, button): 115 def included_clicked_cb(self, button):
113 self.ins.set_current_page(0) 116 self.ins.set_current_page(self.INCLUDED)
114 117
115 def create_visual_elements(self): 118 def create_visual_elements(self):
116 self.label = gtk.Label("Packages included: 0\nSelected packages size: 0 MB") 119 self.label = gtk.Label("Packages included: 0\nSelected packages size: 0 MB")
@@ -154,7 +157,7 @@ class PackageSelectionPage (HobPage):
154 self.build_image_button.connect("clicked", self.build_image_clicked_cb) 157 self.build_image_button.connect("clicked", self.build_image_clicked_cb)
155 self.button_box.pack_end(self.build_image_button, expand=False, fill=False) 158 self.button_box.pack_end(self.build_image_button, expand=False, fill=False)
156 159
157 self.back_button = HobAltButton("<< Back to image configuration") 160 self.back_button = HobAltButton('<< Back')
158 self.back_button.connect("clicked", self.back_button_clicked_cb) 161 self.back_button.connect("clicked", self.back_button_clicked_cb)
159 self.button_box.pack_start(self.back_button, expand=False, fill=False) 162 self.button_box.pack_start(self.back_button, expand=False, fill=False)
160 163
@@ -189,7 +192,10 @@ class PackageSelectionPage (HobPage):
189 self.builder.build_image() 192 self.builder.build_image()
190 193
191 def back_button_clicked_cb(self, button): 194 def back_button_clicked_cb(self, button):
192 self.builder.show_configuration() 195 if self.builder.current_step == self.builder.PACKAGE_GENERATED:
196 self.builder.show_recipes()
197 elif self.builder.previous_step == self.builder.IMAGE_GENERATED:
198 self.builder.show_image_details()
193 199
194 def _expand_all(self): 200 def _expand_all(self):
195 for tab in self.tables: 201 for tab in self.tables:
@@ -294,3 +300,5 @@ class PackageSelectionPage (HobPage):
294 child_path = self.package_model.convert_vpath_to_path(model, paths[0]) 300 child_path = self.package_model.convert_vpath_to_path(model, paths[0])
295 self.package_model.foreach(self.foreach_cell_change_font, child_path) 301 self.package_model.foreach(self.foreach_cell_change_font, child_path)
296 302
303 def set_packages_curr_tab(self, curr_page):
304 self.ins.set_current_page(curr_page)
diff --git a/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py b/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py
index af68f2a751..d8e71b0979 100755
--- a/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py
+++ b/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py
@@ -124,18 +124,22 @@ class RecipeSelectionPage (HobPage):
124 }] 124 }]
125 } 125 }
126 ] 126 ]
127
128 (INCLUDED,
129 ALL,
130 TASKS) = range(3)
127 131
128 def __init__(self, builder = None): 132 def __init__(self, builder = None):
129 super(RecipeSelectionPage, self).__init__(builder, "Recipes") 133 super(RecipeSelectionPage, self).__init__(builder, "Edit recipes")
130 134
131 # set invisiable members 135 # set invisible members
132 self.recipe_model = self.builder.recipe_model 136 self.recipe_model = self.builder.recipe_model
133 137
134 # create visual elements 138 # create visual elements
135 self.create_visual_elements() 139 self.create_visual_elements()
136 140
137 def included_clicked_cb(self, button): 141 def included_clicked_cb(self, button):
138 self.ins.set_current_page(0) 142 self.ins.set_current_page(self.INCLUDED)
139 143
140 def create_visual_elements(self): 144 def create_visual_elements(self):
141 self.eventbox = self.add_onto_top_bar(None, 73) 145 self.eventbox = self.add_onto_top_bar(None, 73)
@@ -180,7 +184,7 @@ class RecipeSelectionPage (HobPage):
180 self.build_packages_button.connect("clicked", self.build_packages_clicked_cb) 184 self.build_packages_button.connect("clicked", self.build_packages_clicked_cb)
181 button_box.pack_end(self.build_packages_button, expand=False, fill=False) 185 button_box.pack_end(self.build_packages_button, expand=False, fill=False)
182 186
183 self.back_button = HobAltButton("<< Back to image configuration") 187 self.back_button = HobAltButton('<< Back')
184 self.back_button.connect("clicked", self.back_button_clicked_cb) 188 self.back_button.connect("clicked", self.back_button_clicked_cb)
185 button_box.pack_start(self.back_button, expand=False, fill=False) 189 button_box.pack_start(self.back_button, expand=False, fill=False)
186 190
@@ -261,3 +265,6 @@ class RecipeSelectionPage (HobPage):
261 265
262 def after_fadeout_checkin_include(self, table, ctrl, cell, tree): 266 def after_fadeout_checkin_include(self, table, ctrl, cell, tree):
263 tree.set_model(self.recipe_model.tree_model(self.pages[0]['filter'])) 267 tree.set_model(self.recipe_model.tree_model(self.pages[0]['filter']))
268
269 def set_recipe_curr_tab(self, curr_page):
270 self.ins.set_current_page(curr_page)