diff options
author | Joshua Lock <josh@linux.intel.com> | 2011-07-28 15:24:03 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-08-02 22:31:42 +0100 |
commit | 5f33a63fea9fc5de9e78eb6587f65b51d5450846 (patch) | |
tree | 63302568d2e770861ea1f808c8d47273ff36d727 | |
parent | 15689067a45f7d9eb30c379ad2c83c92f2067c9d (diff) | |
download | ast2050-yocto-poky-5f33a63fea9fc5de9e78eb6587f65b51d5450846.zip ast2050-yocto-poky-5f33a63fea9fc5de9e78eb6587f65b51d5450846.tar.gz |
ui/hob: show error and exit if we receive the fatal-error signal
If we receive the fatal-error signal from the handler display a dialog
informing the user of an error and displaying the error message. Dismissing
the dialog quits the application.
Fixes [YOCTO #1279]
(Bitbake rev: 04dbd80bbc9ffe2a566b8cc488f0feebadcdde60)
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 | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/bitbake/lib/bb/ui/hob.py b/bitbake/lib/bb/ui/hob.py index 750ab28..919c06e 100644 --- a/bitbake/lib/bb/ui/hob.py +++ b/bitbake/lib/bb/ui/hob.py @@ -115,6 +115,21 @@ class MainWindow (gtk.Window): self.set_busy_cursor(False) gtk.main_quit() + + """ + In the case of a fatal error give the user as much information as possible + and then exit. + """ + def fatal_error_cb(self, handler, errormsg, phase): + lbl = "<b>Error!</b>\nThere was an unrecoverable error during the" + lbl = lbl + " <i>%s</i> phase of BitBake. This must be" % phase + lbl = lbl + " rectified before the GUI will function. The error" + lbl = lbl + " message which which caused this is:\n\n\"%s\"" % errormsg + dialog = CrumbsDialog(self, lbl, gtk.STOCK_DIALOG_ERROR) + dialog.add_button("Exit", gtk.RESPONSE_OK) + response = dialog.run() + dialog.destroy() + self.set_busy_cursor(False) gtk.main_quit() def scroll_tv_cb(self, model, path, it, view): @@ -963,6 +978,7 @@ def main (server, eventHandler): configurator.connect("layers-loaded", layers.load_current_layers) configurator.connect("layers-changed", handler.reload_data) handler.connect("config-found", configurator.configFound) + handler.connect("fatal-error", window.fatal_error_cb) try: # kick the while thing off |