Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

taskbar: backout exclude path functionality

Changeset 9385bd35a064

Parent 75a9641170d0

by Steve Borho

Changes to 2 files · Browse files at 9385bd35a064 Showing diff from parent 75a9641170d0 Diff from another changeset...

 
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
 
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
 
26
27
28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
30
31
 
64
65
66
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
68
69
@@ -26,48 +26,6 @@
  vbox = gtk.VBox()   self.add(vbox)   - frame = gtk.Frame(_('Exclude Paths')) - frame.set_border_width(2) - vbox.pack_start(frame, True, True, 2) - - tree = gtk.TreeView() - tree.get_selection().set_mode(gtk.SELECTION_SINGLE) - tree.set_enable_search(False) - tree.set_reorderable(False) - cell = gtk.CellRendererText() - cell.set_property('editable', True) - col = gtk.TreeViewColumn(_('Paths'), cell, text=0) - tree.append_column(col) - win = gtk.ScrolledWindow() - win.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) - win.set_border_width(4) - win.add(tree) - model = gtk.ListStore(str) - tree.set_model(model) - tree.set_headers_visible(False) - - fvbox = gtk.VBox() - fvbox.pack_start(win, True, True, 2) - bhbox = gtk.HBox() - apply = gtk.Button(_('Apply')) - add = gtk.Button(_('Add')) - delete = gtk.Button(_('Del')) - apply.connect('clicked', self.applyclicked, model, requestq) - add.connect('clicked', self.addclicked, model, apply) - delete.connect('clicked', self.delclicked, tree, apply) - cell.connect('edited', self.edited, model, apply) - bhbox.pack_start(add, False, False, 2) - bhbox.pack_start(delete, False, False, 2) - bhbox.pack_end(apply, False, False, 2) - fvbox.pack_start(bhbox, False, False, 2) - fvbox.set_border_width(2) - frame.add(fvbox) - - apply.set_sensitive(False) - set = settings.Settings('taskbar') - for path in set.get_value('excludes', []): - model.append([hglib.toutf(path)]) -   frame = gtk.Frame(_('Event Log'))   frame.set_border_width(2)   vbox.pack_start(frame, True, True, 2) @@ -106,33 +64,6 @@
  dlg = about.AboutDialog()   dlg.show_all()   - def applyclicked(self, button, model, requests): - 'apply button clicked' - paths = [hglib.fromutf(r[0]) for r in model] - set = settings.Settings('taskbar') - set.set_value('excludes', paths) - set.write() - button.set_sensitive(False) - requests.put('load-config') - - def edited(self, cell, path, new_text, model, applybutton): - dirty = model[path][0] != new_text - model[path][0] = new_text - if dirty: - applybutton.set_sensitive(True) - - def addclicked(self, button, model, applybutton): - 'add button clicked' - model.append(['C:\\']) - applybutton.set_sensitive(True) - - def delclicked(self, button, tree, applybutton): - 'delete button clicked' - model, pathlist = tree.get_selection().get_selected_rows() - if pathlist: - del model[pathlist[0]] - applybutton.set_sensitive(True) -   def pollq(self, queue, textview):   'Poll the input queue'   buf = textview.get_buffer()
Change 1 of 4 Show Entire File taskbar.py Stacked
 
22
23
24
25
 
26
27
28
 
289
290
291
292
293
294
295
 
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
 
316
317
318
 
331
332
333
334
335
336
337
338
339
 
22
23
24
 
25
26
27
28
 
289
290
291
 
292
293
294
 
296
297
298
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
299
300
301
302
 
315
316
317
 
 
 
318
319
320
@@ -22,7 +22,7 @@
 demandimport.ignore.append('win32com.shell')  demandimport.enable()  from mercurial import ui -from thgutil import thread2, paths, shlib, settings +from thgutil import thread2, paths, shlib    APP_TITLE = "TortoiseHg RPC server"   @@ -289,7 +289,6 @@
   class Updater(threading.Thread):   def run(self): - excludes = []   while True:   req = requests.get()   s = req.split('|') @@ -297,22 +296,7 @@
  if cmd == 'terminate':   logger.msg('Updater thread terminating')   return - if cmd == 'load-config': - logger.msg('Loading configuration') - set = settings.Settings('taskbar') - excludes = set.get_value('excludes', []) - for p in excludes: - logger.msg(' exclude: %s' % p) - continue - ignored = False - for arg in args: - for e in excludes: - if arg.startswith(e): - logger.msg('%s command ignored in %s' % (cmd, e)) - ignored = True - break - if not ignored: - dispatch(req, cmd, args) + dispatch(req, cmd, args)   gc.collect()    Updater().start() @@ -331,9 +315,6 @@
  # And create an event to be used in the OVERLAPPED object.   self.overlapped.hEvent = win32event.CreateEvent(None,0,0,None)   - # Make updater load exclude masks - requests.put('load-config') -   def SvcStop(self):   print 'PipeServer thread terminating'   win32event.SetEvent(self.hWaitStop)