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

history: allow only a single instance of synchronize tool

Fixes #268

Changeset e1ac414438b0

Parent 5bfcdaa0e034

by Steve Borho

Changes to one file · Browse files at e1ac414438b0 Showing diff from parent 5bfcdaa0e034 Diff from another changeset...

Change 1 of 1 Show Entire File hggtk/​history.py Stacked
 
67
68
69
70
71
72
 
73
74
75
76
 
 
77
78
79
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
81
82
83
 
 
84
85
86
87
88
89
90
91
92
93
94
95
 
96
97
98
 
67
68
69
 
 
 
70
71
72
 
 
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
 
95
96
97
 
 
 
 
 
 
 
 
 
 
 
98
99
100
101
@@ -67,32 +67,35 @@
  gtk.SeparatorToolItem()   ] + self.changeview.get_tbbuttons()   if not self.opts.get('from-synch'): - tbar += [ - gtk.SeparatorToolItem(), - self.make_toolbutton(gtk.STOCK_NETWORK, + self.synctb = self.make_toolbutton(gtk.STOCK_NETWORK,   _('Synchronize'),   self.synch_clicked, - tip=_('Launch synchronize tool')), - ] + tip=_('Launch synchronize tool')) + tbar += [gtk.SeparatorToolItem(), self.synctb]   return tbar     def synch_clicked(self, toolbutton, data): + def sync_closed(dialog): + self.synctb.set_sensitive(True) + + def synch_callback(parents): + self.repo.invalidate() + newparents = [x.node() for x in self.repo.parents()] + if len(self.repo) != self.origtip: + if self.newbutton.get_active(): + self.reload_log() + else: + self.newbutton.set_active(True) + elif not parents == newparents: + self.refresh_model() +   from hggtk import synch   parents = [x.node() for x in self.repo.parents()]   dlg = synch.SynchDialog([], False, True) - dlg.set_notify_func(self.synch_complete, parents) + dlg.set_notify_func(synch_callback, parents) + dlg.connect('destroy', sync_closed)   dlg.show_all() - - def synch_complete(self, parents): - self.repo.invalidate() - newparents = [x.node() for x in self.repo.parents()] - if len(self.repo) != self.origtip: - if self.newbutton.get_active(): - self.reload_log() - else: - self.newbutton.set_active(True) - elif not parents == newparents: - self.refresh_model() + self.synctb.set_sensitive(False)     def toggle_view_column(self, button, property):   active = button.get_active()