Beispiel #1
0
	def update_history_model(self):
		self.history_model.clear()
		index = 0
		item = glipper.get_history_item(index)
		while(item):
			self.history_model.append ([item])
			index = index + 1
			item = glipper.get_history_item(index)
Beispiel #2
0
 def update_history_model(self):
     self.history_model.clear()
     index = 0
     item = glipper.get_history_item(index)
     while (item):
         self.history_model.append([item])
         index = index + 1
         item = glipper.get_history_item(index)
Beispiel #3
0
def layout_decode(menu, from_layout, to_layout):
  string = glipper.get_history_item(0)
  result = []
  for ch in string:
    try:
      idx = layouts[from_layout].index(ch)
      result.append(layouts[to_layout][idx])
    except:
      result.append(ch)
  plaintext = ''.join(result)
  glipper.set_history_item(0, plaintext)
  glipper.add_history_item(plaintext)
Beispiel #4
0
def update_menu():
   global immediately
   global menu
   global menu_item
   
   cf = confFile("r")
   immediately = cf.getImmediately()
   model = cf.getActionModel()
   
   menu.destroy()
   menu = gtk.Menu()
   
   #read informations from model and create menu items:
   menu_items = []
   item = glipper.get_history_item(0)

   if item != None:
      for action in model:
         regex = re.compile(action[0])
         if regex.match(item) != None:
            for cmd in action.iterchildren():
               item = gtk.MenuItem(cmd[3])
               item.connect("activate", commandActivated, cmd[0])
               menu_items.append(item)

   if len(menu_items) == 0:
      empty_item = gtk.MenuItem(_("No actions available"))
      menu.append(empty_item)
   else:
      for item in menu_items:
         menu.append(item)
               
   
   menu.show_all()
   menu_item.set_submenu(menu)
   
   cf.close()
Beispiel #5
0
def on_activate(menuitem, lang):
   cf = confFile("r")
   pastie = Pastie(lang, cf.getNick(), _("pasted by Glipper"), glipper.get_history_item(0))
   cf.close()
   pastie.start()
Beispiel #6
0
def activated(menu):
   languageList = ("C89", "C", "C++", "C#", "Java", "Pascal", "Perl", "PHP", 
         "PL/I", "Python", "Ruby", "SQL", "VB", "Plain Text")
   cf = confFile("r")
   rafbnet = RafbNet(languageList[cf.getLang()], cf.getNick(), _("pasted by Glipper"), glipper.get_history_item(0))
   cf.close()
   rafbnet.start()
Beispiel #7
0
def activated(menu):
    sp = Portapapel(glipper.get_history_item(0))
    sp.start()
Beispiel #8
0
def commandActivated(menu, cmd):
   command = cmd.replace("%s", glipper.get_history_item(0))
   os.system(command)