Source

vpackager / src / vpackager / guitools.py

Diff from to

src/vpackager/guitools.py

 __author_email__ = 'moc.liamg@xnl.E0M'[::-1]
 __version__ = '0.1'
 
+class SearchBox(gtk.Entry):
+    """ Search box packed into the history viewer to filter the history.
+    This is useful to search for a certain application in the job history"""
+    def __init__(self):
+        gtk.Entry.__init__(self)
+        # Add the find button
+
+        self.set_icon_from_stock(gtk.ENTRY_ICON_PRIMARY,
+                                 gtk.STOCK_FIND)
+        self.set_icon_from_stock(gtk.ENTRY_ICON_SECONDARY,
+                                 gtk.STOCK_CLEAR)
+
 class PrefsDialog(gtk.Dialog):
     """vpackager preferences dialog."""
     def __init__(self, parent=None):
 class TabIcon(gtk.VBox):
     """ Custom widget composed of a gtk.VBox that shows an image and label
     and is used for the tabstrip label widgets"""
-    def __init__(self, label='', stock=None):
+    def __init__(self, label='', stock=None, icon=None):
         gtk.VBox.__init__(self)
         lb = gtk.Label()
         lb.set_use_markup(True)
         lb.set_markup(label)
         lb.set_property('xalign', 0.5)
-        img = gtk.Image()
-        img.set_from_stock(stock, gtk.ICON_SIZE_BUTTON)
+        if stock:
+            img = gtk.Image()
+            #pb = gtk.gdk.pixbuf_new_from_file_at_size(
+            #    icon, 24, 24)
+            #img.set_from_pixbuf(pb)
+            img.set_from_stock(stock, gtk.ICON_SIZE_BUTTON)
+        elif icon:
+            img = gtk.Image()
+            pb = gtk.gdk.pixbuf_new_from_file_at_size(
+                icon, 24, 24)
+            img.set_from_pixbuf(pb)
+            #img.set_from_file(icon)
         self.pack_start(lb, False, False, 2)
         self.pack_start(img, False, False, 2)
         self.show_all()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.