diff options
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py')
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py | 54 |
1 files changed, 48 insertions, 6 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py index b94f35c66d..ff773501b0 100644 --- a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py +++ b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py | |||
@@ -46,6 +46,7 @@ class ImageConfigurationPage (HobPage): | |||
46 | # cleared. | 46 | # cleared. |
47 | self.machine_combo_changed_by_manual = True | 47 | self.machine_combo_changed_by_manual = True |
48 | self.stopping = False | 48 | self.stopping = False |
49 | self.warning_shift = 0 | ||
49 | self.create_visual_elements() | 50 | self.create_visual_elements() |
50 | 51 | ||
51 | def create_visual_elements(self): | 52 | def create_visual_elements(self): |
@@ -141,6 +142,37 @@ class ImageConfigurationPage (HobPage): | |||
141 | if self.builder.recipe_model.get_selected_image() == self.builder.recipe_model.__custom_image__: | 142 | if self.builder.recipe_model.get_selected_image() == self.builder.recipe_model.__custom_image__: |
142 | self.just_bake_button.hide() | 143 | self.just_bake_button.hide() |
143 | 144 | ||
145 | def add_warnings_bar(self): | ||
146 | #create the warnings bar shown when recipes parsing generates warnings | ||
147 | color = HobColors.KHAKI | ||
148 | warnings_bar = gtk.EventBox() | ||
149 | warnings_bar.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(color)) | ||
150 | warnings_bar.set_flags(gtk.CAN_DEFAULT) | ||
151 | warnings_bar.grab_default() | ||
152 | |||
153 | build_stop_tab = gtk.Table(10, 20, True) | ||
154 | warnings_bar.add(build_stop_tab) | ||
155 | |||
156 | icon = gtk.Image() | ||
157 | icon_pix_buffer = gtk.gdk.pixbuf_new_from_file(hic.ICON_INDI_ALERT_FILE) | ||
158 | icon.set_from_pixbuf(icon_pix_buffer) | ||
159 | build_stop_tab.attach(icon, 0, 2, 0, 10) | ||
160 | |||
161 | label = gtk.Label() | ||
162 | label.set_alignment(0.0, 0.5) | ||
163 | warnings_nb = len(self.builder.parsing_warnings) | ||
164 | if warnings_nb == 1: | ||
165 | label.set_markup("<span size='x-large'><b>1 recipe parsing warning</b></span>") | ||
166 | else: | ||
167 | label.set_markup("<span size='x-large'><b>%s recipe parsing warnings</b></span>" % warnings_nb) | ||
168 | build_stop_tab.attach(label, 2, 12, 0, 10) | ||
169 | |||
170 | view_warnings_button = HobButton("View warnings") | ||
171 | view_warnings_button.connect('clicked', self.view_warnings_button_clicked_cb) | ||
172 | build_stop_tab.attach(view_warnings_button, 15, 19, 1, 9) | ||
173 | |||
174 | return warnings_bar | ||
175 | |||
144 | def create_config_machine(self): | 176 | def create_config_machine(self): |
145 | self.machine_title = gtk.Label() | 177 | self.machine_title = gtk.Label() |
146 | self.machine_title.set_alignment(0.0, 0.5) | 178 | self.machine_title.set_alignment(0.0, 0.5) |
@@ -187,6 +219,12 @@ class ImageConfigurationPage (HobPage): | |||
187 | #self.gtable.attach(self.progress_box, 0, 40, 15, 18) | 219 | #self.gtable.attach(self.progress_box, 0, 40, 15, 18) |
188 | self.gtable.attach(self.progress_bar, 0, 37, 15, 18) | 220 | self.gtable.attach(self.progress_bar, 0, 37, 15, 18) |
189 | self.gtable.attach(self.stop_button, 37, 40, 15, 18, 0, 0) | 221 | self.gtable.attach(self.stop_button, 37, 40, 15, 18, 0, 0) |
222 | if self.builder.parsing_warnings: | ||
223 | self.warnings_bar = self.add_warnings_bar() | ||
224 | self.gtable.attach(self.warnings_bar, 0, 40, 14, 18) | ||
225 | self.warning_shift = 4 | ||
226 | else: | ||
227 | self.warning_shift = 0 | ||
190 | self.gtable.attach(self.machine_separator, 0, 40, 13, 14) | 228 | self.gtable.attach(self.machine_separator, 0, 40, 13, 14) |
191 | 229 | ||
192 | def create_config_baseimg(self): | 230 | def create_config_baseimg(self): |
@@ -222,12 +260,12 @@ class ImageConfigurationPage (HobPage): | |||
222 | self.image_separator = gtk.HSeparator() | 260 | self.image_separator = gtk.HSeparator() |
223 | 261 | ||
224 | def set_config_baseimg_layout(self): | 262 | def set_config_baseimg_layout(self): |
225 | self.gtable.attach(self.image_title, 0, 40, 15, 17) | 263 | self.gtable.attach(self.image_title, 0, 40, 15+self.warning_shift, 17+self.warning_shift) |
226 | self.gtable.attach(self.image_title_desc, 0, 40, 18, 22) | 264 | self.gtable.attach(self.image_title_desc, 0, 40, 18+self.warning_shift, 22+self.warning_shift) |
227 | self.gtable.attach(self.image_combo, 0, 12, 23, 26) | 265 | self.gtable.attach(self.image_combo, 0, 12, 23+self.warning_shift, 26+self.warning_shift) |
228 | self.gtable.attach(self.image_desc, 0, 12, 27, 33) | 266 | self.gtable.attach(self.image_desc, 0, 12, 27+self.warning_shift, 33+self.warning_shift) |
229 | self.gtable.attach(self.view_adv_configuration_button, 14, 36, 23, 28) | 267 | self.gtable.attach(self.view_adv_configuration_button, 14, 36, 23+self.warning_shift, 28+self.warning_shift) |
230 | self.gtable.attach(self.image_separator, 0, 40, 35, 36) | 268 | self.gtable.attach(self.image_separator, 0, 40, 35+self.warning_shift, 36+self.warning_shift) |
231 | 269 | ||
232 | def create_config_build_button(self): | 270 | def create_config_build_button(self): |
233 | # Create the "Build packages" and "Build image" buttons at the bottom | 271 | # Create the "Build packages" and "Build image" buttons at the bottom |
@@ -255,6 +293,9 @@ class ImageConfigurationPage (HobPage): | |||
255 | self.progress_bar.set_rcstyle("stop") | 293 | self.progress_bar.set_rcstyle("stop") |
256 | self.builder.cancel_parse_sync() | 294 | self.builder.cancel_parse_sync() |
257 | 295 | ||
296 | def view_warnings_button_clicked_cb(self, button): | ||
297 | self.builder.show_warning_dialog() | ||
298 | |||
258 | def machine_combo_changed_cb(self, machine_combo): | 299 | def machine_combo_changed_cb(self, machine_combo): |
259 | self.stopping = False | 300 | self.stopping = False |
260 | combo_item = machine_combo.get_active_text() | 301 | combo_item = machine_combo.get_active_text() |
@@ -435,6 +476,7 @@ class ImageConfigurationPage (HobPage): | |||
435 | self.builder.reparse_post_adv_settings() | 476 | self.builder.reparse_post_adv_settings() |
436 | 477 | ||
437 | def just_bake_button_clicked_cb(self, button): | 478 | def just_bake_button_clicked_cb(self, button): |
479 | self.builder.parsing_warnings = [] | ||
438 | self.builder.just_bake() | 480 | self.builder.just_bake() |
439 | 481 | ||
440 | def edit_image_button_clicked_cb(self, button): | 482 | def edit_image_button_clicked_cb(self, button): |