diff options
author | Dongxiao Xu <dongxiao.xu@intel.com> | 2012-03-13 17:10:26 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-03-15 10:35:17 +0000 |
commit | ea8a7a82da8fa1fa3ff89877fa31dad33407d734 (patch) | |
tree | 630dbc72caa876b00f6addfd415b68688c7280ab /bitbake/lib | |
parent | a957dbd0a92642362757a9af3660f693851d9b5c (diff) | |
download | poky-ea8a7a82da8fa1fa3ff89877fa31dad33407d734.tar.gz |
Hob: Add stop button for parsing progress
Add a Stop button to allow user to quit the parsing process.
(Bitbake rev: a1936ff544f21cde0765f24dc9b0af126ca98752)
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rwxr-xr-x | bitbake/lib/bb/ui/crumbs/builder.py | 22 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/hobeventhandler.py | 3 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py | 14 |
3 files changed, 37 insertions, 2 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py index 1363475d3b..1d255acd25 100755 --- a/bitbake/lib/bb/ui/crumbs/builder.py +++ b/bitbake/lib/bb/ui/crumbs/builder.py | |||
@@ -443,7 +443,20 @@ class Builder(gtk.Window): | |||
443 | self.switch_page(self.MACHINE_SELECTION) | 443 | self.switch_page(self.MACHINE_SELECTION) |
444 | 444 | ||
445 | def window_sensitive(self, sensitive): | 445 | def window_sensitive(self, sensitive): |
446 | self.set_sensitive(sensitive) | 446 | self.image_configuration_page.machine_combo.set_sensitive(sensitive) |
447 | self.image_configuration_page.image_combo.set_sensitive(sensitive) | ||
448 | self.image_configuration_page.layer_button.set_sensitive(sensitive) | ||
449 | self.image_configuration_page.layer_info_icon.set_sensitive(sensitive) | ||
450 | self.image_configuration_page.toolbar.set_sensitive(sensitive) | ||
451 | self.image_configuration_page.view_recipes_button.set_sensitive(sensitive) | ||
452 | self.image_configuration_page.view_packages_button.set_sensitive(sensitive) | ||
453 | self.image_configuration_page.config_build_button.set_sensitive(sensitive) | ||
454 | |||
455 | self.recipe_details_page.set_sensitive(sensitive) | ||
456 | self.package_details_page.set_sensitive(sensitive) | ||
457 | self.build_details_page.set_sensitive(sensitive) | ||
458 | self.image_details_page.set_sensitive(sensitive) | ||
459 | |||
447 | if sensitive: | 460 | if sensitive: |
448 | self.get_root_window().set_cursor(gtk.gdk.Cursor(gtk.gdk.LEFT_PTR)) | 461 | self.get_root_window().set_cursor(gtk.gdk.Cursor(gtk.gdk.LEFT_PTR)) |
449 | else: | 462 | else: |
@@ -482,6 +495,10 @@ class Builder(gtk.Window): | |||
482 | fraction = 0 | 495 | fraction = 0 |
483 | if message["eventname"] == "TreeDataPreparationStarted": | 496 | if message["eventname"] == "TreeDataPreparationStarted": |
484 | fraction = 0.6 + fraction | 497 | fraction = 0.6 + fraction |
498 | self.image_configuration_page.stop_button.set_sensitive(False) | ||
499 | else: | ||
500 | self.image_configuration_page.stop_button.set_sensitive(True) | ||
501 | |||
485 | self.image_configuration_page.update_progress_bar(message["title"], fraction) | 502 | self.image_configuration_page.update_progress_bar(message["title"], fraction) |
486 | 503 | ||
487 | def handler_parsing_cb(self, handler, message): | 504 | def handler_parsing_cb(self, handler, message): |
@@ -836,6 +853,9 @@ class Builder(gtk.Window): | |||
836 | def show_configuration(self): | 853 | def show_configuration(self): |
837 | self.switch_page(self.BASEIMG_SELECTED) | 854 | self.switch_page(self.BASEIMG_SELECTED) |
838 | 855 | ||
856 | def stop_parse(self): | ||
857 | self.handler.cancel_parse() | ||
858 | |||
839 | def stop_build(self): | 859 | def stop_build(self): |
840 | if self.stopping: | 860 | if self.stopping: |
841 | lbl = "<b>Force Stop build?</b>\nYou've already selected Stop once," | 861 | lbl = "<b>Force Stop build?</b>\nYou've already selected Stop once," |
diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py index cd257548e4..790e2ef819 100644 --- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py +++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py | |||
@@ -371,6 +371,9 @@ class HobHandler(gobject.GObject): | |||
371 | self.commands_async = [] | 371 | self.commands_async = [] |
372 | self.building = False | 372 | self.building = False |
373 | 373 | ||
374 | def cancel_parse(self): | ||
375 | self.server.runCommand(["stateStop"]) | ||
376 | |||
374 | def cancel_build(self, force=False): | 377 | def cancel_build(self, force=False): |
375 | if force: | 378 | if force: |
376 | # Force the cooker to stop as quickly as possible | 379 | # Force the cooker to stop as quickly as possible |
diff --git a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py index f386281947..a73eab160e 100644 --- a/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py +++ b/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py | |||
@@ -150,7 +150,13 @@ class ImageConfigurationPage (HobPage): | |||
150 | markup += "poky-ref-manual.html#usingpoky-changes-layers\">reference manual</a>." | 150 | markup += "poky-ref-manual.html#usingpoky-changes-layers\">reference manual</a>." |
151 | self.layer_info_icon = HobInfoButton(markup, self.get_parent()) | 151 | self.layer_info_icon = HobInfoButton(markup, self.get_parent()) |
152 | 152 | ||
153 | self.progress_box = gtk.HBox(False, 6) | ||
153 | self.progress_bar = HobProgressBar() | 154 | self.progress_bar = HobProgressBar() |
155 | self.progress_box.pack_start(self.progress_bar, expand=True, fill=True) | ||
156 | self.stop_button = gtk.LinkButton("Stop the parsing process", "Stop") | ||
157 | self.stop_button.connect("clicked", self.stop_button_clicked_cb) | ||
158 | self.progress_box.pack_end(self.stop_button, expand=False, fill=False) | ||
159 | |||
154 | self.machine_separator = gtk.HSeparator() | 160 | self.machine_separator = gtk.HSeparator() |
155 | 161 | ||
156 | def set_config_machine_layout(self, show_progress_bar = False): | 162 | def set_config_machine_layout(self, show_progress_bar = False): |
@@ -160,7 +166,7 @@ class ImageConfigurationPage (HobPage): | |||
160 | self.gtable.attach(self.layer_button, 12, 36, 6, 10) | 166 | self.gtable.attach(self.layer_button, 12, 36, 6, 10) |
161 | self.gtable.attach(self.layer_info_icon, 36, 40, 6, 9) | 167 | self.gtable.attach(self.layer_info_icon, 36, 40, 6, 9) |
162 | if show_progress_bar == True: | 168 | if show_progress_bar == True: |
163 | self.gtable.attach(self.progress_bar, 0, 40, 13, 17) | 169 | self.gtable.attach(self.progress_box, 0, 40, 13, 17) |
164 | self.gtable.attach(self.machine_separator, 0, 40, 12, 13) | 170 | self.gtable.attach(self.machine_separator, 0, 40, 12, 13) |
165 | 171 | ||
166 | def create_config_baseimg(self): | 172 | def create_config_baseimg(self): |
@@ -242,8 +248,14 @@ class ImageConfigurationPage (HobPage): | |||
242 | 248 | ||
243 | return button_box | 249 | return button_box |
244 | 250 | ||
251 | def stop_button_clicked_cb(self, button): | ||
252 | self.builder.stop_parse() | ||
253 | |||
245 | def machine_combo_changed_cb(self, machine_combo): | 254 | def machine_combo_changed_cb(self, machine_combo): |
246 | combo_item = machine_combo.get_active_text() | 255 | combo_item = machine_combo.get_active_text() |
256 | if not combo_item: | ||
257 | return | ||
258 | |||
247 | self.builder.configuration.curr_mach = combo_item | 259 | self.builder.configuration.curr_mach = combo_item |
248 | # Do reparse recipes | 260 | # Do reparse recipes |
249 | self.builder.switch_page(self.builder.RCPPKGINFO_POPULATING) | 261 | self.builder.switch_page(self.builder.RCPPKGINFO_POPULATING) |