summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
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
parent9c0309449666a4e24ec7d1795822f0c99c037cce (diff)
downloadpoky-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')
-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 7647d2139f..06d936e71b 100644
--- a/bitbake/lib/bb/ui/hob.py
+++ b/bitbake/lib/bb/ui/hob.py
@@ -99,12 +99,15 @@ class MainWindow (gtk.Window):
99 dialog.add_buttons(gtk.STOCK_NO, gtk.RESPONSE_NO, 99 dialog.add_buttons(gtk.STOCK_NO, gtk.RESPONSE_NO,
100 gtk.STOCK_YES, gtk.RESPONSE_YES) 100 gtk.STOCK_YES, gtk.RESPONSE_YES)
101 resp = dialog.run() 101 resp = dialog.run()
102 dialog.destroy()
102 if resp == gtk.RESPONSE_YES: 103 if resp == gtk.RESPONSE_YES:
103 if not self.save_path: 104 if not self.save_path:
104 self.get_save_path() 105 self.get_save_path()
105 self.save_recipe_file() 106
106 rep = self.model.get_build_rep() 107 if self.save_path:
107 rep.writeRecipe(self.save_path, self.model) 108 self.save_recipe_file()
109 rep = self.model.get_build_rep()
110 rep.writeRecipe(self.save_path, self.model)
108 111
109 gtk.main_quit() 112 gtk.main_quit()
110 113
@@ -325,17 +328,22 @@ class MainWindow (gtk.Window):
325 chooser.set_current_name("myimage.bb") 328 chooser.set_current_name("myimage.bb")
326 response = chooser.run() 329 response = chooser.run()
327 if response == gtk.RESPONSE_OK: 330 if response == gtk.RESPONSE_OK:
328 self.save_path = chooser.get_filename() 331 save_path = chooser.get_filename()
332 else:
333 save_path = None
329 chooser.destroy() 334 chooser.destroy()
335 self.save_path = save_path
330 336
331 def save_cb(self, action): 337 def save_cb(self, action):
332 if not self.save_path: 338 if not self.save_path:
333 self.get_save_path() 339 self.get_save_path()
334 self.save_recipe_file() 340 if self.save_path:
341 self.save_recipe_file()
335 342
336 def save_as_cb(self, action): 343 def save_as_cb(self, action):
337 self.get_save_path() 344 self.get_save_path()
338 self.save_recipe_file() 345 if self.save_path:
346 self.save_recipe_file()
339 347
340 def open_cb(self, action): 348 def open_cb(self, action):
341 chooser = gtk.FileChooserDialog(title=None, parent=self, 349 chooser = gtk.FileChooserDialog(title=None, parent=self,