Esempio n. 1
0
 def tree_edited (self, renderer, path_string, text, n, head):
     indices = path_string.split(':')
     path = tuple( map(int, indices))
     iter = self.filteredModel.convert_iter_to_child_iter(self.filteredModel.get_iter(path))
     key = self.treeModel.get_value(iter, self.KEY_COL)
     item = self.treeModel.get_value(iter, self.ITEM_COL)
     children = self.treeModel.iter_children(iter)
     if n==self.KEY_COL and key==text: return
     if n==self.ITEM_COL and item==text: return
     ## make sure they want to make this change
     if not self.dont_ask:
         msg = "Are you sure you want to change the "
         if n==self.KEY_COL: msg += 'key'
         if n==self.ITEM_COL: msg += 'item'
         if item:
             msg += "for \"%s from \"%s\""%(item,key)
         else:
             msg += " from \"%s\" "%key
         msg += " to \"%s\""%text
         if not de.getBoolean(label=msg,
                              dont_ask_cb=self.dont_ask_cb,
                              dont_ask_custom_text="Don't ask me before changing keys and items."):
             return
     if children and n==self.KEY_COL:
         self.change_children(key, text, iter)
     else:
         if n==self.KEY_COL:
             self.changeItem(key, item, new_key=text)
         elif n==self.ITEM_COL:
             self.changeItem(key, item, new_item=text)
     self.treeModel.set_value(iter, n, text)
Esempio n. 2
0
 def tree_edited (self, renderer, path_string, text, n, head):
     indices = path_string.split(':')
     path = tuple( map(int, indices))
     iter = self.filteredModel.convert_iter_to_child_iter(self.filteredModel.get_iter(path))
     key = self.treeModel.get_value(iter, self.KEY_COL)
     item = self.treeModel.get_value(iter, self.ITEM_COL)
     children = self.treeModel.iter_children(iter)
     if n==self.KEY_COL and key==text: return
     if n==self.ITEM_COL and item==text: return
     ## make sure they want to make this change
     if not self.dont_ask:
         msg = "Are you sure you want to change the "
         if n==self.KEY_COL: msg += 'key'
         if n==self.ITEM_COL: msg += 'item'
         if item:
             msg += "for \"%s from \"%s\""%(item,key)
         else:
             msg += " from \"%s\" "%key
         msg += " to \"%s\""%text
         if not de.getBoolean(label=msg,
                              dont_ask_cb=self.dont_ask_cb,
                              dont_ask_custom_text="Don't ask me before changing keys and items."):
             return
     if children and n==self.KEY_COL:
         self.change_children(key, text, iter)
     else:
         if n==self.KEY_COL:
             self.changeItem(key, item, new_key=text)
         elif n==self.ITEM_COL:
             self.changeItem(key, item, new_item=text)
     self.treeModel.set_value(iter, n, text)
Esempio n. 3
0
 def close_cb (self,*args):
     self.stop_annoying()
     if (not self.timer.running) or de.getBoolean(label=_('Stop timer?'),
                                              sublabel=_("You've requested to close a window with an active timer. You can stop the timer, or you can just close the window. If you close the window, it will reappear when your timer goes off."),
                                              custom_yes=_('Stop _timer'),custom_no=_('_Keep timing')
                                              ):
         self.timer.running = False
         self.timerDialog.hide()
         self.timerDialog.destroy()
     else:
         self.timer.connect_timer_hook(self.timerDialog.show,1)
         self.timerDialog.hide()
Esempio n. 4
0
 def clear_recipes (self, *args):
     debug("clear_recipes (self, *args):",5)
     selectedRecs=self.getSelectedRecs()
     if selectedRecs:
         for t in selectedRecs:
             self.recs.__delitem__(t.id)
             debug("clear removed %s"%t,3)
         self.reset()
     elif de.getBoolean(label=_("No recipes selected. Do you want to clear the entire list?")):
         self.recs = {}
         self.extras = []
         self.reset()            
     else:
         debug("clear cancelled",2)
Esempio n. 5
0
 def clear_recipes (self, *args):
     debug("clear_recipes (self, *args):",5)
     selectedRecs=self.getSelectedRecs()
     if selectedRecs:
         for t in selectedRecs:
             self.recs.__delitem__(t.id)
             debug("clear removed %s"%t,3)
         self.reset()
     elif de.getBoolean(label=_("No recipes selected. Do you want to clear the entire list?")):
         self.recs = {}
         self.extras = []
         self.reset()            
     else:
         debug("clear cancelled",2)
Esempio n. 6
0
             print 'Missing dependencies:', dep_error.dependencies
             for row in ls:
                 ps = row[1]
                 if ps.module in dep_error.dependencies and not row[0]:
                     print 'Activate dependency ', ps.module
                     self.do_change_plugin(ps, True, ls)
                     row[0] = True
         self.loader.activate_plugin_set(plugin_set)
     else:
         dependers = self.loader.check_if_depended_upon(plugin_set)
         if dependers:
             if de.getBoolean(label=_(
                     "Plugin is needed for other plugins. Deactivate plugin anyway?"
             ),
                              sublabel=(_(
                                  'The following plugins require %s:' %
                                  plugin_set.name) + '\n' + '\n'.join(
                                      plugin_set.name
                                      for plugin_set in dependers)),
                              custom_yes=_('Deactivate anyway'),
                              custom_no=_('Keep plugin active')):
                 self.loader.deactivate_plugin_set(plugin_set)
                 for row in ls:
                     if row[1] in dependers:
                         row[0] = False
             else:
                 raise Exception("Cancelled")
         else:
             self.loader.deactivate_plugin_set(plugin_set)
 except:
     details = self.loader.errors.get(plugin_set, '')
     if 'ImportError' in details:
Esempio n. 7
0
         except plugin_loader.DependencyError, dep_error:
             print 'Missing dependencies:',dep_error.dependencies
             for row in ls:
                 ps = row[1]
                 if ps.module in dep_error.dependencies and not row[0]:
                     print 'Activate dependency ',ps.module
                     self.do_change_plugin(ps,True, ls)
                     row[0] = True
         self.loader.activate_plugin_set(plugin_set)
     else:
         dependers = self.loader.check_if_depended_upon(plugin_set)
         if dependers:
             if de.getBoolean(
                 label=_("Plugin is needed for other plugins. Deactivate plugin anyway?"),
                 sublabel=(_('The following plugins require %s:'%plugin_set.name) + '\n' +
                           '\n'.join(plugin_set.name for plugin_set in dependers)
                           ),
                 custom_yes=_('Deactivate anyway'),
                 custom_no=_('Keep plugin active')
                 ):
                 self.loader.deactivate_plugin_set(plugin_set)
                 for row in ls:
                     if row[1] in dependers:
                         row[0] = False
             else:
                 raise Exception("Cancelled")
         else:
             self.loader.deactivate_plugin_set(plugin_set)
 except:
     details = self.loader.errors.get(plugin_set,'')
     if 'ImportError' in details:
         modname = details.split()[-1]; n = modname.lower()