diff options
| author | Joshua Lock <josh@linux.intel.com> | 2011-07-19 16:04:38 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-07-25 12:54:15 +0100 |
| commit | 52e0be44e068b53959d9566516486b758be718dc (patch) | |
| tree | 333bb99a3053dcda5230f78f0eac298eeb93c22e | |
| parent | 95d789598653d5b3c6d948a2d96685c15bda230a (diff) | |
| download | poky-52e0be44e068b53959d9566516486b758be718dc.tar.gz | |
ui/hob: if the user clicks Stop a second time only offer 'Force Stop'
Fixes [YOCTO #1264]
(Bitbake rev: 117fb14b93086660ce3f853964536920f916e060)
Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | bitbake/lib/bb/ui/hob.py | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/bitbake/lib/bb/ui/hob.py b/bitbake/lib/bb/ui/hob.py index a8bbd735a9..8e3e7bccef 100644 --- a/bitbake/lib/bb/ui/hob.py +++ b/bitbake/lib/bb/ui/hob.py | |||
| @@ -46,6 +46,7 @@ class MainWindow (gtk.Window): | |||
| 46 | self.files_to_clean = [] | 46 | self.files_to_clean = [] |
| 47 | self.selected_image = None | 47 | self.selected_image = None |
| 48 | self.selected_packages = None | 48 | self.selected_packages = None |
| 49 | self.stopping = False | ||
| 49 | 50 | ||
| 50 | self.model = taskmodel | 51 | self.model = taskmodel |
| 51 | self.model.connect("tasklist-populated", self.update_model) | 52 | self.model.connect("tasklist-populated", self.update_model) |
| @@ -403,6 +404,7 @@ class MainWindow (gtk.Window): | |||
| 403 | self.nb.set_current_page(0) | 404 | self.nb.set_current_page(0) |
| 404 | 405 | ||
| 405 | def build_complete_cb(self, running_build): | 406 | def build_complete_cb(self, running_build): |
| 407 | self.stopping = False | ||
| 406 | self.back.connect("clicked", self.back_button_clicked_cb) | 408 | self.back.connect("clicked", self.back_button_clicked_cb) |
| 407 | self.back.set_sensitive(True) | 409 | self.back.set_sensitive(True) |
| 408 | self.cancel.set_sensitive(False) | 410 | self.cancel.set_sensitive(False) |
| @@ -651,20 +653,32 @@ class MainWindow (gtk.Window): | |||
| 651 | return vbox | 653 | return vbox |
| 652 | 654 | ||
| 653 | def cancel_build(self, button): | 655 | def cancel_build(self, button): |
| 654 | lbl = "<b>Stop build?</b>\n\nAre you sure you want to stop this build?\n" | 656 | if self.stopping: |
| 655 | lbl = lbl + "'Force Stop' will stop the build as quickly as" | 657 | lbl = "<b>Force Stop build?</b>\nYou've already selected Stop once," |
| 656 | lbl = lbl + " possible but may well leave your build directory in an" | 658 | lbl = lbl + " would you like to 'Force Stop' the build?\n\n" |
| 657 | lbl = lbl + " unusable state that requires manual steps to fix.\n" | 659 | lbl = lbl + "This will stop the build as quickly as possible but may" |
| 658 | lbl = lbl + "'Stop' will stop the build as soon as all in" | 660 | lbl = lbl + " well leave your build directory in an unusable state" |
| 659 | lbl = lbl + " progress build tasks are finished. However if a" | 661 | lbl = lbl + " that requires manual steps to fix.\n" |
| 660 | lbl = lbl + " lengthy compilation phase is in progress this may take" | 662 | dialog = CrumbsDialog(self, lbl, gtk.STOCK_DIALOG_WARNING) |
| 661 | lbl = lbl + " some time." | 663 | dialog.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL) |
| 662 | dialog = CrumbsDialog(self, lbl, gtk.STOCK_DIALOG_WARNING) | 664 | dialog.add_button("Force Stop", gtk.RESPONSE_YES) |
| 663 | dialog.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL) | 665 | else: |
| 664 | dialog.add_button("Stop", gtk.RESPONSE_OK) | 666 | lbl = "<b>Stop build?</b>\n\nAre you sure you want to stop this" |
| 665 | dialog.add_button("Force Stop", gtk.RESPONSE_YES) | 667 | lbl = lbl + " build?\n\n'Force Stop' will stop the build as quickly as" |
| 668 | lbl = lbl + " possible but may well leave your build directory in an" | ||
| 669 | lbl = lbl + " unusable state that requires manual steps to fix.\n\n" | ||
| 670 | lbl = lbl + "'Stop' will stop the build as soon as all in" | ||
| 671 | lbl = lbl + " progress build tasks are finished. However if a" | ||
| 672 | lbl = lbl + " lengthy compilation phase is in progress this may take" | ||
| 673 | lbl = lbl + " some time." | ||
| 674 | dialog = CrumbsDialog(self, lbl, gtk.STOCK_DIALOG_WARNING) | ||
| 675 | dialog.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL) | ||
| 676 | dialog.add_button("Stop", gtk.RESPONSE_OK) | ||
| 677 | dialog.add_button("Force Stop", gtk.RESPONSE_YES) | ||
| 666 | response = dialog.run() | 678 | response = dialog.run() |
| 667 | dialog.destroy() | 679 | dialog.destroy() |
| 680 | if response != gtk.RESPONSE_CANCEL: | ||
| 681 | self.stopping = True | ||
| 668 | if response == gtk.RESPONSE_OK: | 682 | if response == gtk.RESPONSE_OK: |
| 669 | self.handler.cancel_build() | 683 | self.handler.cancel_build() |
| 670 | elif response == gtk.RESPONSE_YES: | 684 | elif response == gtk.RESPONSE_YES: |
