diff options
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/layereditor.py | 20 |
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 7c581d642f..f5394a5f52 100644 --- a/bitbake/lib/bb/ui/crumbs/layereditor.py +++ b/bitbake/lib/bb/ui/crumbs/layereditor.py | |||
@@ -21,6 +21,7 @@ | |||
21 | import gobject | 21 | import gobject |
22 | import gtk | 22 | import gtk |
23 | from bb.ui.crumbs.configurator import Configurator | 23 | from bb.ui.crumbs.configurator import Configurator |
24 | from bb.ui.crumbs.hig import CrumbsDialog | ||
24 | 25 | ||
25 | class LayerEditor(gtk.Dialog): | 26 | class LayerEditor(gtk.Dialog): |
26 | """ | 27 | """ |
@@ -117,6 +118,12 @@ class LayerEditor(gtk.Dialog): | |||
117 | self.find_layer(self) | 118 | self.find_layer(self) |
118 | 119 | ||
119 | def find_layer(self, parent): | 120 | def find_layer(self, parent): |
121 | def conf_error(parent, lbl): | ||
122 | dialog = CrumbsDialog(parent, lbl) | ||
123 | dialog.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK) | ||
124 | response = dialog.run() | ||
125 | dialog.destroy() | ||
126 | |||
120 | dialog = gtk.FileChooserDialog("Add new layer", parent, | 127 | dialog = gtk.FileChooserDialog("Add new layer", parent, |
121 | gtk.FILE_CHOOSER_ACTION_OPEN, | 128 | gtk.FILE_CHOOSER_ACTION_OPEN, |
122 | (gtk.STOCK_CANCEL, gtk.RESPONSE_NO, | 129 | (gtk.STOCK_CANCEL, gtk.RESPONSE_NO, |
@@ -128,10 +135,19 @@ class LayerEditor(gtk.Dialog): | |||
128 | path = dialog.get_filename() | 135 | path = dialog.get_filename() |
129 | dialog.destroy() | 136 | dialog.destroy() |
130 | 137 | ||
138 | lbl = "<b>Error</b>\nUnable to load layer <i>%s</i> because " % path | ||
131 | if response == gtk.RESPONSE_YES: | 139 | if response == gtk.RESPONSE_YES: |
132 | # FIXME: verify we've actually got a layer conf? | 140 | # FIXME: verify we've actually got a layer conf? |
133 | if path.endswith(".conf"): | 141 | if path.endswith("layer.conf"): |
134 | name, layerpath = self.configurator.addLayerConf(path) | 142 | name, layerpath = self.configurator.addLayerConf(path) |
135 | if name: | 143 | if name and layerpath: |
136 | self.newly_added[name] = layerpath | 144 | self.newly_added[name] = layerpath |
137 | self.layer_store.append([name, layerpath, True]) | 145 | self.layer_store.append([name, layerpath, True]) |
146 | return | ||
147 | elif name: | ||
148 | return | ||
149 | else: | ||
150 | lbl += "there was a problem parsing the layer.conf." | ||
151 | else: | ||
152 | lbl += "it is not a layer.conf file." | ||
153 | conf_error(parent, lbl) | ||