diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-08-12 10:22:40 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-08-12 10:23:32 +0100 |
commit | 712622e2dbfa2559b873730bd1d4d23cc827b295 (patch) | |
tree | e63f46b9f53b46aa6ed3e32787214d837b12e7a3 /bitbake/lib | |
parent | f63e7f4323368c0d6fe7a1d44393a7e15652d4f2 (diff) | |
download | ast2050-yocto-poky-712622e2dbfa2559b873730bd1d4d23cc827b295.zip ast2050-yocto-poky-712622e2dbfa2559b873730bd1d4d23cc827b295.tar.gz |
bitbake: hob: Add missing file from previous commit
This should have been part of 'hob: implement the "retrieve image dialog" +
changes to image combo box' but got lost in the merge process. This adds
the missing file.
(Bitbake rev: 0eadcc073f270c0b323955cf7719b77195cf4890)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/hig/retrieveimagedialog.py | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/hig/retrieveimagedialog.py b/bitbake/lib/bb/ui/crumbs/hig/retrieveimagedialog.py new file mode 100644 index 0000000..060b4fd --- /dev/null +++ b/bitbake/lib/bb/ui/crumbs/hig/retrieveimagedialog.py @@ -0,0 +1,49 @@ +# +# BitBake Graphical GTK User Interface +# +# Copyright (C) 2013 Intel Corporation +# +# Authored by Cristiana Voicu <cristiana.voicu@intel.com> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +import gtk + +class RetrieveImageDialog (gtk.FileChooserDialog): + """ + This class is used to create a dialog that permits to retrieve + a custom image saved previously from Hob. + """ + def __init__(self, directory,title, parent, flags, buttons=None): + super(RetrieveImageDialog, self).__init__(title, None, gtk.FILE_CHOOSER_ACTION_OPEN, + (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,gtk.STOCK_OPEN, gtk.RESPONSE_OK)) + self.directory = directory + + # create visual elements on the dialog + self.create_visual_elements() + + def create_visual_elements(self): + self.set_show_hidden(True) + self.set_default_response(gtk.RESPONSE_OK) + self.set_current_folder(self.directory) + + vbox = self.get_children()[0].get_children()[0].get_children()[0] + for child in vbox.get_children()[0].get_children()[0].get_children()[0].get_children(): + vbox.get_children()[0].get_children()[0].get_children()[0].remove(child) + + label1 = gtk.Label() + label1.set_text("File system: " + self.directory) + label1.show() + vbox.get_children()[0].get_children()[0].get_children()[0].pack_start(label1, expand=False, fill=False, padding=0) + vbox.get_children()[0].get_children()[1].get_children()[0].hide() |