Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Diff of /plugins/macro.py [e14689] .. [b96301] Maximize Restore

  Switch to unified view

a/plugins/macro.py b/plugins/macro.py
...
...
23
    def __init__(self, parent, columns):
23
    def __init__(self, parent, columns):
24
        todo.vTodo.__init__(self, parent, columns)
24
        todo.vTodo.__init__(self, parent, columns)
25
        self.parent = parent
25
        self.parent = parent
26
    def Refresh(self):
26
    def Refresh(self):
27
        self.SetItemCount(0)
27
        self.SetItemCount(0)
28
        try:
28
        ## try:
29
            wx.Yield()
29
            ## wx.Yield()
30
        except:
30
        ## except:
31
            pass
31
            ## pass
32
        self.SetItemCount(len(self.data))
32
        self.SetItemCount(len(self.data))
33
        todo.vTodo.Refresh(self)
33
        todo.vTodo.Refresh(self)
34
    def OnGetItemText(self, item, col):
34
    def OnGetItemText(self, item, col):
35
        if col == 0:
35
        if col == 0:
36
            return "%s" % (self.data[item][col],)
36
            return "%s" % (self.data[item][col],)
...
...
173
        
173
        
174
        self.m = []
174
        self.m = []
175
        self.d = {}
175
        self.d = {}
176
        self.hotkeys = {}
176
        self.hotkeys = {}
177
        self.macros.setData(self.m, copy=0)
177
        self.macros.setData(self.m, copy=0)
178
179
        self.t = wx.Timer(self)
180
        
178
        
181
        self.accelerator = ''
179
        self.accelerator = ''
182
        self.acceleratork = ''
180
        self.acceleratork = ''
183
        
181
        
184
        self.macros.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated)
182
        self.macros.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated)
...
...
188
        self.empty.Bind(wx.EVT_BUTTON, self.OnEmpty)
186
        self.empty.Bind(wx.EVT_BUTTON, self.OnEmpty)
189
        self.hotkey.Bind(wx.EVT_BUTTON, self.GetHotkey)
187
        self.hotkey.Bind(wx.EVT_BUTTON, self.GetHotkey)
190
        self.play.Bind(wx.EVT_BUTTON, self.OnPlay)
188
        self.play.Bind(wx.EVT_BUTTON, self.OnPlay)
191
        self.de1.Bind(wx.EVT_BUTTON, self.OnDel)
189
        self.de1.Bind(wx.EVT_BUTTON, self.OnDel)
192
        
190
        
191
        ## self.t = wx.Timer(self)
193
        ## self.t.Bind(wx.EVT_TIMER, self.CheckMacros)
192
        ## self.Bind(wx.EVT_TIMER, self.CheckMacros)
194
        self.Bind(wx.EVT_TIMER, self.CheckMacros)
195
        self.t.Start(1000, wx.TIMER_CONTINUOUS)
193
        ## self.t.Start(1000, wx.TIMER_CONTINUOUS)
194
195
        ## self.t = Timer(self.CheckMacros)
196
        ## self.t.Start(1000, oneShot=False)
196
        
197
        
198
        __main__.CheckMacros = self.CheckMacros
197
        wx.CallAfter(self.CheckMacros, None)
199
        wx.CallAfter(self.CheckMacros, None)
198
    
200
    
199
    def RunMacro(self, hotkey):
201
    def RunMacro(self, hotkey):
200
        if hotkey not in self.hotkeys:
202
        if hotkey not in self.hotkeys:
201
            return 0
203
            return 0
...
...
227
        elif dc == 1:
229
        elif dc == 1:
228
            self.OnEdit(e)
230
            self.OnEdit(e)
229
        elif dc == 2:
231
        elif dc == 2:
230
            self.OnPlay(e)
232
            self.OnPlay(e)
231
    
233
    
232
    def CheckMacros(self, e):
234
    def CheckMacros(self, e=None):
233
        try:
235
        try:
234
            a = os.listdir(macropath)
236
            a = os.listdir(macropath)
235
        except:
237
        except:
236
            return
238
            return
237
        
239
        
...
...
299
                    changed = 1
301
                    changed = 1
300
                    break
302
                    break
301
                else:
303
                else:
302
                    i += 1
304
                    i += 1
303
            else:
305
            else:
304
                print "what?", f
306
                ## print "what?", f
305
                #not in either list?
307
                #not in either list?
306
                pass
308
                pass
307
        
309
        
308
        if changed:
310
        if changed:
309
            self.hotkeys.clear()
311
            self.hotkeys.clear()