Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.4rc1, 0.4rc2, and 0.4rc3

hggtk/datamine: make stop button more generally useful

Changeset 67c86a6edbbb

Parent ca21a37af375

by Steve Borho

Changes to one file · Browse files at 67c86a6edbbb Showing diff from parent ca21a37af375 Diff from another changeset...

Change 1 of 7 Show Entire File hggtk/​datamine.py Stacked
 
36
37
38
 
 
39
40
41
42
43
 
44
45
46
 
72
73
74
 
75
76
77
 
270
271
272
 
273
274
275
 
303
304
305
 
 
306
307
308
 
500
501
502
 
 
503
504
505
 
524
525
526
527
 
528
529
 
530
531
532
 
545
546
547
 
 
 
548
549
550
 
36
37
38
39
40
41
42
43
 
 
44
45
46
47
 
73
74
75
76
77
78
79
 
272
273
274
275
276
277
278
 
306
307
308
309
310
311
312
313
 
505
506
507
508
509
510
511
512
 
531
532
533
 
534
535
 
536
537
538
539
 
552
553
554
555
556
557
558
559
560
@@ -36,11 +36,12 @@
  pass     def get_tbbuttons(self): + self.stop_button = self.make_toolbutton(gtk.STOCK_STOP, 'Stop', + self._stop_search, tip='Stop operation on current tab')   return [   self.make_toolbutton(gtk.STOCK_FIND, 'New Search',   self._search_clicked, tip='Open new search tab'), - self.make_toolbutton(gtk.STOCK_STOP, 'Stop Search', - self._stop_search, tip='Stop search on current tab') + self.stop_button   ]     def prepare_display(self): @@ -72,6 +73,7 @@
    self.stbar = gtklib.StatusBar()   vbox.pack_start(self.stbar, False, False, 2) + self.stop_button.set_sensitive(False)   return vbox     def grep_context_menu(self): @@ -270,6 +272,7 @@
  thread = thread2.Thread(target=hgcmd_toq, args=args)   thread.start()   frame._mythread = thread + self.stop_button.set_sensitive(True)     model.clear()   search_hbox.set_sensitive(False) @@ -303,6 +306,8 @@
  if thread.isAlive():   return True   else: + if threading.activeCount() == 1: + self.stop_button.set_sensitive(False)   frame._mythread = None   search_hbox.set_sensitive(True)   regexp.grab_focus() @@ -500,6 +505,8 @@
  '--rev', str(rev), path]   thread = threading.Thread(target=hgcmd_toq, args=args)   thread.start() + frame._mythread = thread + self.stop_button.set_sensitive(True)     # date of selected revision   ctx = self.repo.changectx(long(rev)) @@ -524,9 +531,9 @@
  self.notebook.set_tab_label(frame, hbox)     gobject.timeout_add(50, self.annotate_wait, thread, q, model, - curdate, colormap) + curdate, colormap, frame)   - def annotate_wait(self, thread, q, model, curdate, colormap): + def annotate_wait(self, thread, q, model, curdate, colormap, frame):   """   Handle all the messages currently in the queue (if any).   """ @@ -545,6 +552,9 @@
  if thread.isAlive():   return True   else: + if threading.activeCount() == 1: + self.stop_button.set_sensitive(False) + frame._mythread = None   self.stbar.end()   return False