Patchwork [bitbake-devel,4/4] lib/bb/ui/crumbs/imagedetails: use secondary button style for 'View files'

login
register
mail settings
Submitter Joshua Lock
Date March 27, 2012, 3:30 a.m.
Message ID <15d2ce9a832995d58e3ace666db791df5e147e06.1332818913.git.josh@linux.intel.com>
Download mbox | patch
Permalink /patch/24599/
State Accepted
Commit 9647c188c0d06ec045c15281eae785e935c25d2b
Headers show

Comments

Joshua Lock - March 27, 2012, 3:30 a.m.
Use HobAltButton, rather than gtk.LinkButton, for the 'View files'
button.

Use xdg-open to display the folders contents.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
 lib/bb/ui/crumbs/imagedetailspage.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

Patch

diff --git a/lib/bb/ui/crumbs/imagedetailspage.py b/lib/bb/ui/crumbs/imagedetailspage.py
index 5a5ec3f..276281d 100755
--- a/lib/bb/ui/crumbs/imagedetailspage.py
+++ b/lib/bb/ui/crumbs/imagedetailspage.py
@@ -185,7 +185,8 @@  class ImageDetailsPage (HobPage):
         image_table.set_model(self.image_store)
         image_size = self._size_to_string(os.stat(os.path.join(image_addr, image_names[0])).st_size)
         image_table.connect("toggled", self.toggled_cb)
-        view_files_button = gtk.LinkButton("file://%s" % image_addr, "View files")
+        view_files_button = HobAltButton("View files")
+        view_files_button.connect("clicked", self.view_files_clicked_cb, image_addr)
         self.box_group_area.pack_start(self.DetailBox(widget=image_table, button=view_files_button), expand=True, fill=True)
 
         # Machine, Base image and Layers
@@ -239,6 +240,9 @@  class ImageDetailsPage (HobPage):
 
         self.show_all()
 
+    def view_files_clicked_cb(self, button, image_addr):
+        os.system("xdg-open /%s" % image_addr)
+
     def refresh_package_detail_box(self, image_size):
         self.package_detail.update_line_widgets("Total image size: ", image_size)