1. Moises Henriquez
  2. vpackager

Source

vpackager / src / vpackager / dbviews.py

Diff from to

File src/vpackager/dbviews.py

  • Ignore whitespace
     def connect_item(self, item, callback):
         return self.menu_actions[item].connect('activate', callback)
 
-
-
 class QueueView(gtk.VBox):
     """ Job manager container"""
     def __init__(self):
         self.pack_start(bottombar, False, True, 2)
         self._selectedjob = None
 
-    def connect_item(self, item, callback):
-        self.exposed_widgets[item].connect('clicked', callback)
+    def connect_item(self, item, callback, *kwargs):
+        if type(item) is gtk.RadioButton:
+            return self.exposed_widgets[item].connect(
+                'toggled', callback, *kwargs)
+        else:
+            return self.exposed_widgets[item].connect('clicked', callback, *kwargs)
 
     def _get_treeview(self):
         _model = gtk.ListStore(int, str, str, str)
             self.exposed_widgets['about_job']):
             button.set_property('sensitive', self._selectedjob is not None)
 
-
 class HistoryView(QueueView):
     """ History manager tree view """
     def __init__(self):
             stock = gtk.STOCK_INFO, label = 'About Task')
         self.exposed_widgets['wipe_history'] = guitools.vButton(
             stock = gtk.STOCK_DELETE, label='Delete History')
+        filters = []
+        self.exposed_widgets['filter_all'] = gtk.RadioButton(
+            label='All')
+        self.exposed_widgets['filter_successful'] = gtk.RadioButton(
+            group = self.exposed_widgets['filter_all'], label='Successful')
+        self.exposed_widgets['filter_failed'] = gtk.RadioButton(
+            group = self.exposed_widgets['filter_all'], label='Failed')
+        lb = gtk.Label('Filter: ')
 
-        for button in self.exposed_widgets.values():
-            box.pack_start(button, False, False, 2)
+        box.pack_start(self.exposed_widgets['wipe_history'], False, False, 2)
+        box.pack_end(self.exposed_widgets['filter_failed'], False, False, 2)
+        box.pack_end(self.exposed_widgets['filter_successful'], False, False, 2)
+        box.pack_end(self.exposed_widgets['filter_all'], False, False, 2)
+        box.pack_end(lb, False, False, False)
 
         return box