summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/hob.py
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2011-07-07 15:43:27 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-07-08 17:32:42 +0100
commit20e820883927514f1b66288265dd952af5dd5e19 (patch)
tree1e37254c1c5e319e14cb795113d6681055a43172 /bitbake/lib/bb/ui/hob.py
parent9c0309449666a4e24ec7d1795822f0c99c037cce (diff)
downloadast2050-yocto-poky-20e820883927514f1b66288265dd952af5dd5e19.zip
ast2050-yocto-poky-20e820883927514f1b66288265dd952af5dd5e19.tar.gz
lib/bb/ui/hob: don't error when dismissing save as dialog
If the user decides to cancel the save as dialog we should not try and save regardless. Fixes [YOCTO #1220] (Bitbake rev: 3412fbd6a16980e0fba7742c32675eea9d77d6c0) 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/hob.py')
-rw-r--r--bitbake/lib/bb/ui/hob.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/bitbake/lib/bb/ui/hob.py b/bitbake/lib/bb/ui/hob.py
index 7647d21..06d936e 100644
--- a/bitbake/lib/bb/ui/hob.py
+++ b/bitbake/lib/bb/ui/hob.py
@@ -99,12 +99,15 @@ class MainWindow (gtk.Window):
dialog.add_buttons(gtk.STOCK_NO, gtk.RESPONSE_NO,
gtk.STOCK_YES, gtk.RESPONSE_YES)
resp = dialog.run()
+ dialog.destroy()
if resp == gtk.RESPONSE_YES:
if not self.save_path:
self.get_save_path()
- self.save_recipe_file()
- rep = self.model.get_build_rep()
- rep.writeRecipe(self.save_path, self.model)
+
+ if self.save_path:
+ self.save_recipe_file()
+ rep = self.model.get_build_rep()
+ rep.writeRecipe(self.save_path, self.model)
gtk.main_quit()
@@ -325,17 +328,22 @@ class MainWindow (gtk.Window):
chooser.set_current_name("myimage.bb")
response = chooser.run()
if response == gtk.RESPONSE_OK:
- self.save_path = chooser.get_filename()
+ save_path = chooser.get_filename()
+ else:
+ save_path = None
chooser.destroy()
+ self.save_path = save_path
def save_cb(self, action):
if not self.save_path:
self.get_save_path()
- self.save_recipe_file()
+ if self.save_path:
+ self.save_recipe_file()
def save_as_cb(self, action):
self.get_save_path()
- self.save_recipe_file()
+ if self.save_path:
+ self.save_recipe_file()
def open_cb(self, action):
chooser = gtk.FileChooserDialog(title=None, parent=self,
OpenPOWER on IntegriCloud