Moises Henriquez avatar Moises Henriquez committed a980454

Added icons to menu items througout the application

Comments (0)

Files changed (2)

src/vpackager/bot.py

         filem = gtk.MenuItem("File")
         filem.set_submenu(filemenu)
 
-        exit = gtk.MenuItem("Exit")
+        exit = gtk.ImageMenuItem("Exit")
+        exitimg = gtk.image_new_from_stock(gtk.STOCK_QUIT,
+                                           gtk.ICON_SIZE_MENU)
+        exit.set_image(exitimg)
         exit.connect("activate", self._exit)
         filemenu.append(exit)
 
         editmenu = gtk.Menu()
         editm.set_submenu(editmenu)
         mb.append(editm)
-        editprefs = gtk.MenuItem("Preferences")
+        editprefs = gtk.ImageMenuItem("Preferences")
+        editprefsimg = gtk.image_new_from_stock(gtk.STOCK_PREFERENCES,
+                                                gtk.ICON_SIZE_MENU)
+        editprefs.set_image(editprefsimg)
         editmenu.append(editprefs)
         editprefs.connect('activate', self.ShowPrefsWindow)
 
         helpmenu = gtk.Menu()
         helpm.set_submenu(helpmenu)
 
-        about = gtk.MenuItem("About")
+        about = gtk.ImageMenuItem("About")
+        aboutimg = gtk.image_new_from_stock(gtk.STOCK_ABOUT,
+                                            gtk.ICON_SIZE_MENU)
+        about.set_image(aboutimg)
         about.connect("activate", self._show_about)
         helpmenu.append(about)
         mb.append(helpm)

src/vpackager/dbviews.py

         gtk.Menu.__init__(self)
         self.menu_actions = {}
         for item in items:
-            self.menu_actions[
-                item.replace(' ','_').lower()] = gtk.MenuItem(item)
-            mitem = self.menu_actions[item.replace(' ', '_').lower()]
+            #self.menu_actions[
+            #    item.replace(' ','_').lower()] = gtk.ImageMenuItem(item)
+            mitem = gtk.ImageMenuItem(item[0])
+            mimg = gtk.image_new_from_stock(item[1], gtk.ICON_SIZE_MENU)
+            mitem.set_image(mimg)
+            self.menu_actions[item[0].replace(' ','_').lower()] = mitem
+            #mitem = self.menu_actions[item.replace(' ', '_').lower()]
             mitem.show()
             self.append(mitem)
 
     def __init__(self):
         gtk.VBox.__init__(self)
         self.rc_menu = RCMenu(items = [
-            'Job Details', 'Delete Job', 'Edit Job'])
+            ('Job Details', gtk.STOCK_INFO),
+            ('Delete Job', gtk.STOCK_DELETE),
+            ('Edit Job', gtk.STOCK_EDIT)])
         self.exposed_widgets = {}
         self.banner_area = gtk.HBox()
         #self.pack_start(self.banner_area, False, True, 4)
     def __init__(self):
         QueueView.__init__(self)
         self.banner_label.set_label('Job History')
-        self.rc_menu = RCMenu(items=['About Job', 'Rebuild Job',
-                                     'View Build Log', 'View Build Script'])
+        self.rc_menu = RCMenu(items=[
+            ('About Job', gtk.STOCK_INFO),
+            ('Rebuild Job', gtk.STOCK_EXECUTE),
+            ('View Build Log', gtk.STOCK_FILE),
+            ('View Build Script', gtk.STOCK_FILE)])
 
     def tree_click_event(self, tree, event, data=None):
         """ Events triggered with the treeview is clicked """
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.