Example #1
0
 def fill_listAssociations(self, obj):
     o = self.builder.get_object
     store = Gtk.ListStore(str,
                           GdkPixbuf.Pixbuf, str,
                           GdkPixbuf.Pixbuf,
                           GdkPixbuf.Pixbuf, str,
                           GdkPixbuf.Pixbuf, bool)
     association_ids = retrieve_association_ids()
     suspended = retrieve_association_ids_suspended()
     arrow = load_pixbuf('right')
     l = o('listAssociation')
     delall_sensitive = False
     for x in association_ids:
         li = retrieve_association(x)
         cond_name = li[0]
         cond_active = bool(x not in suspended)
         cond_active_pixbuf = \
             self.glyph_enabled if cond_active else self.glyph_disabled
         cond_data = retrieve_plugin_data(cond_name)
         cond_pixbuf = load_pixbuf(cond_data['icon'])
         task_name = li[1]
         task_data = retrieve_plugin_data(task_name)
         task_pixbuf = load_pixbuf(task_data['icon'])
         store.append([x,
                       cond_pixbuf, cond_data['name'], arrow,
                       task_pixbuf, task_data['name'],
                       cond_active_pixbuf, cond_active])
         delall_sensitive = True
     l.set_model(store)
     o('btnDeleteAll').set_sensitive(delall_sensitive)
Example #2
0
 def fill_listAssociations(self, obj):
     o = self.builder.get_object
     store = Gtk.ListStore(str,
                           GdkPixbuf.Pixbuf, str,
                           GdkPixbuf.Pixbuf,
                           GdkPixbuf.Pixbuf, str,
                           GdkPixbuf.Pixbuf, bool)
     association_ids = retrieve_association_ids()
     suspended = retrieve_association_ids_suspended()
     arrow = load_pixbuf('right')
     l = o('listAssociation')
     delall_sensitive = False
     for x in association_ids:
         li = retrieve_association(x)
         cond_name = li[0]
         cond_active = bool(x not in suspended)
         cond_active_pixbuf = \
             self.glyph_enabled if cond_active else self.glyph_disabled
         cond_data = retrieve_plugin_data(cond_name)
         cond_pixbuf = load_pixbuf(cond_data['icon'])
         task_name = li[1]
         task_data = retrieve_plugin_data(task_name)
         task_pixbuf = load_pixbuf(task_data['icon'])
         store.append([x,
                       cond_pixbuf, cond_data['name'], arrow,
                       task_pixbuf, task_data['name'],
                       cond_active_pixbuf, cond_active])
         delall_sensitive = True
     l.set_model(store)
     o('btnDeleteAll').set_sensitive(delall_sensitive)
Example #3
0
 def changed_listAssociation(self, sel):
     o = self.builder.get_object
     m, i = sel.get_selected()
     if i is not None:
         self.selected_association = m[i][0]
         enabled = m[i][7]
         li = retrieve_association(self.selected_association)
         data_cond = retrieve_plugin_data(li[0])
         data_task = retrieve_plugin_data(li[1])
         o('txtCondition').set_text(data_cond['summary_description'])
         o('txtConsequence').set_text(data_task['summary_description'])
         o('btnDelete').set_sensitive(True)
         if enabled:
             o('btnEnable').set_sensitive(False)
             o('btnDisable').set_sensitive(True)
         else:
             o('btnEnable').set_sensitive(True)
             o('btnDisable').set_sensitive(False)
     else:
         o('txtCondition').set_text("")
         o('txtConsequence').set_text("")
         o('btnDelete').set_sensitive(False)
         o('btnEnable').set_sensitive(False)
         o('btnDisable').set_sensitive(False)
Example #4
0
 def changed_listAssociation(self, sel):
     o = self.builder.get_object
     m, i = sel.get_selected()
     if i is not None:
         self.selected_association = m[i][0]
         enabled = m[i][7]
         li = retrieve_association(self.selected_association)
         data_cond = retrieve_plugin_data(li[0])
         data_task = retrieve_plugin_data(li[1])
         o('txtCondition').set_text(data_cond['summary_description'])
         o('txtConsequence').set_text(data_task['summary_description'])
         o('btnDelete').set_sensitive(True)
         if enabled:
             o('btnEnable').set_sensitive(False)
             o('btnDisable').set_sensitive(True)
         else:
             o('btnEnable').set_sensitive(True)
             o('btnDisable').set_sensitive(False)
     else:
         o('txtCondition').set_text("")
         o('txtConsequence').set_text("")
         o('btnDelete').set_sensitive(False)
         o('btnEnable').set_sensitive(False)
         o('btnDisable').set_sensitive(False)