Example #1
0
 def load(self):
     lst = list(PluginsManager.plgs.values())
     self.plgs = [[i.title, ShotcutManager.get(i.title)] for i in lst]
     for i in self.plgs:
         if i[1] == None: i[1] = ''
     self.plgs.sort()
     self.buf = self.plgs
     self.lst_plgs.set_data(self.plgs)
Example #2
0
 def on_run(self, event):
     code = event.GetKeyCode()
     title = self.buf[event.GetIndex()][0]
     txt = self.buf[event.GetIndex()][1]
     if code == wx.WXK_DELETE:
         txt = ''
     elif code == wx.WXK_CONTROL:
         txt = self.ist(txt, 'Ctrl')
     elif code == wx.WXK_ALT:
         txt = self.ist(txt, 'Alt')
     elif code == wx.WXK_SHIFT:
         txt = self.ist(txt, 'Shift')
     elif code in range(340, 352):
         fs = ['F' + str(i) for i in range(1, 13)]
         txt = self.ist(txt, fs[code - 340])
     elif code < 100:
         txt = self.ist(txt, chr(event.GetKeyCode()))
     if len(txt) > 0 and txt[-1] == '-': txt = txt[:-1]
     self.buf[event.GetIndex()][1] = txt
     self.lst_plgs.RefreshItem(event.GetIndex())
     if txt == '': ShotcutManager.rm(title)
     ShotcutManager.set(title, txt)
Example #3
0
 def on_close(self, event):
     ShotcutManager.write()
     self.Destroy()
Example #4
0
 def __del__(self):
     ShotcutManager.write()
Example #5
0
 def close(self):
     print('close')
     ShotcutManager.write()
Example #6
0
 def __del__(self):
     print('hahaha')
     ShotcutManager.write()