summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2011-07-28 17:28:00 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-08-02 22:31:43 +0100
commite03114b3521cbefa2c8bafa4bbf2dc4661793c31 (patch)
treef48a491a5b16da58ecd0952bb36dfc29d3305531 /bitbake/lib/bb/ui
parent2da73ed3882480978c6c984741612ab0e7fe18db (diff)
downloadast2050-yocto-poky-e03114b3521cbefa2c8bafa4bbf2dc4661793c31.zip
ast2050-yocto-poky-e03114b3521cbefa2c8bafa4bbf2dc4661793c31.tar.gz
ui/crumbs/layereditor: if layer adding fails show an explanatory dialog
When adding a layer fails try to explain why to the user. (Bitbake rev: 2f7eadfdd710f84a299d6fc7be67ddb089f03ecc) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui')
-rw-r--r--bitbake/lib/bb/ui/crumbs/layereditor.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/layereditor.py b/bitbake/lib/bb/ui/crumbs/layereditor.py
index 7c581d6..f5394a5 100644
--- a/bitbake/lib/bb/ui/crumbs/layereditor.py
+++ b/bitbake/lib/bb/ui/crumbs/layereditor.py
@@ -21,6 +21,7 @@
import gobject
import gtk
from bb.ui.crumbs.configurator import Configurator
+from bb.ui.crumbs.hig import CrumbsDialog
class LayerEditor(gtk.Dialog):
"""
@@ -117,6 +118,12 @@ class LayerEditor(gtk.Dialog):
self.find_layer(self)
def find_layer(self, parent):
+ def conf_error(parent, lbl):
+ dialog = CrumbsDialog(parent, lbl)
+ dialog.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK)
+ response = dialog.run()
+ dialog.destroy()
+
dialog = gtk.FileChooserDialog("Add new layer", parent,
gtk.FILE_CHOOSER_ACTION_OPEN,
(gtk.STOCK_CANCEL, gtk.RESPONSE_NO,
@@ -128,10 +135,19 @@ class LayerEditor(gtk.Dialog):
path = dialog.get_filename()
dialog.destroy()
+ lbl = "<b>Error</b>\nUnable to load layer <i>%s</i> because " % path
if response == gtk.RESPONSE_YES:
# FIXME: verify we've actually got a layer conf?
- if path.endswith(".conf"):
+ if path.endswith("layer.conf"):
name, layerpath = self.configurator.addLayerConf(path)
- if name:
+ if name and layerpath:
self.newly_added[name] = layerpath
self.layer_store.append([name, layerpath, True])
+ return
+ elif name:
+ return
+ else:
+ lbl += "there was a problem parsing the layer.conf."
+ else:
+ lbl += "it is not a layer.conf file."
+ conf_error(parent, lbl)
OpenPOWER on IntegriCloud