Openembedded Bitbake Development
 help / color / mirror / Atom feed
From: Joshua Lock <josh@linux.intel.com>
To: bitbake-devel@lists.openembedded.org
Subject: [PATCH 4/8] ui/hob: show error and exit if we receive the fatal-error signal
Date: Mon,  1 Aug 2011 11:30:46 -0700	[thread overview]
Message-ID: <04dbd80bbc9ffe2a566b8cc488f0feebadcdde60.1312216779.git.josh@linux.intel.com> (raw)
In-Reply-To: <cover.1312216779.git.josh@linux.intel.com>
In-Reply-To: <cover.1312216779.git.josh@linux.intel.com>

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]

Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
 lib/bb/ui/hob.py |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/lib/bb/ui/hob.py b/lib/bb/ui/hob.py
index 750ab28..919c06e 100644
--- a/lib/bb/ui/hob.py
+++ b/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
-- 
1.7.6




  parent reply	other threads:[~2011-08-01 18:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-01 18:30 [PATCH 0/8] hob - handle errors more gracefully Joshua Lock
2011-08-01 18:30 ` [PATCH 1/8] ui/crumbs/hobeventhandler: remove unused code Joshua Lock
2011-08-01 18:30 ` [PATCH 2/8] hob: unset busy cursor on exit Joshua Lock
2011-08-01 18:30 ` [PATCH 3/8] ui/crumbs/hobeventhandler: emit a signal when there's a fatal-error Joshua Lock
2011-08-01 18:30 ` Joshua Lock [this message]
2011-08-01 18:30 ` [PATCH 5/8] ui/crumbs/hobeventhandler: emit a signal when a command fails Joshua Lock
2011-08-01 18:30 ` [PATCH 6/8] ui/crumbs/configurator: tweak addLayerConf return values Joshua Lock
2011-08-01 18:30 ` [PATCH 7/8] ui/crumbs/layereditor: if layer adding fails show an explanatory dialog Joshua Lock
2011-08-01 18:30 ` [PATCH 8/8] hob: remove temporary directory on program shutdown Joshua Lock
2011-08-02 13:48 ` [PATCH 0/8] hob - handle errors more gracefully Richard Purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=04dbd80bbc9ffe2a566b8cc488f0feebadcdde60.1312216779.git.josh@linux.intel.com \
    --to=josh@linux.intel.com \
    --cc=bitbake-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox