Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.7, 0.7.1, and 0.7.2

rename: tie button sensitivity to row selection

Changeset aa0194800f44

Parent f6d8076f2a45

by Steve Borho

Changes to one file · Browse files at aa0194800f44 Showing diff from parent f6d8076f2a45 Diff from another changeset...

Change 1 of 5 Show Entire File hggtk/​rename.py Stacked
 
80
81
82
 
 
83
84
85
 
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
 
132
133
134
 
170
171
172
173
 
 
 
 
 
 
 
 
174
175
176
 
306
307
308
309
 
310
311
 
312
313
 
 
 
 
 
 
 
 
314
 
 
 
 
315
316
317
 
319
320
321
322
323
324
325
 
80
81
82
83
84
85
86
87
 
115
116
117
 
118
119
120
121
122
 
123
124
125
 
 
 
126
127
128
129
130
131
132
 
168
169
170
 
171
172
173
174
175
176
177
178
179
180
181
 
311
312
313
 
314
315
 
316
317
 
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
 
335
336
337
 
338
339
340
@@ -80,6 +80,8 @@
  hbox.pack_start(fr, True, True, 2)   hbox.pack_start(fc, True, True, 2)   vbox.pack_start(hbox, False, False, 2) + fr.set_sensitive(False) + fc.set_sensitive(False)     unknownframe = gtk.Frame('Unrevisioned Files')   unknownframe.add(vbox) @@ -113,22 +115,18 @@
  col.set_resizable(True)   ctree.append_column(col)   - ctree.connect('row-activated', self.candidate_row_act, unknowntree)   scroller = gtk.ScrolledWindow()   scroller.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)   scroller.add(ctree)     stbar = gtklib.StatusBar() - args = (unknowntree, ctree, adjustment, stbar)   vbox = gtk.VBox()   vbox.pack_start(scroller, True, True, 2)   ac = gtk.Button('Accept Match') - fc.connect('pressed', self.find_copies, *args) - fr.connect('pressed', self.find_renames, *args) - ac.connect('pressed', self.accept_match, *args)   hbox = gtk.HBox()   hbox.pack_start(ac, False, False, 2)   vbox.pack_start(hbox, False, False, 2) + ac.set_sensitive(False)     candidateframe = gtk.Frame('Candidate Matches')   candidateframe.add(vbox) @@ -170,7 +168,14 @@
  vbox.pack_start(stbar, False, False, 2)   self.add(vbox)   - ctree.connect('cursor-changed', self.show_diff, buffer) + args = (unknowntree, ctree, adjustment, stbar) + fc.connect('pressed', self.find_copies, *args) + fr.connect('pressed', self.find_renames, *args) + ac.connect('pressed', self.accept_match, *args) + + unknowntree.get_selection().connect('changed', self.unknown_sel_change, fr, fc) + ctree.connect('row-activated', self.candidate_row_act, unknowntree, stbar) + ctree.get_selection().connect('changed', self.show_diff, buffer, ac)   self.connect('map_event', self.on_window_map_event, unkmodel)   self.connect('delete-event', self.save_settings,   settings, hpaned, vpaned, adjustment) @@ -306,12 +311,23 @@
  row[3] = False   self.refresh(unktree.get_model())   - def candidate_row_act(self, ctree, path, column, unktree): + def candidate_row_act(self, ctree, path, column, unktree, stbar):   'User activated row of candidate list' - self.accept_match(ctree, unktree, ctree, None) + self.accept_match(ctree, unktree, ctree, None, stbar)   - def show_diff(self, tree, buffer): + def unknown_sel_change(self, selection, fr, fc): + 'User selected a row in the unknown tree' + model, paths = selection.get_selected_rows() + sensitive = paths and True or False + fr.set_sensitive(sensitive) + fc.set_sensitive(sensitive) + + def show_diff(self, selection, buffer, ac):   'User selected a row in the candidate tree' + model, paths = selection.get_selected_rows() + sensitive = paths and True or False + ac.set_sensitive(sensitive) +   try:   repo = hg.repository(ui.ui(), self.root)   except RepoError: @@ -319,7 +335,6 @@
    buffer.set_text('')   iter = buffer.get_start_iter() - model, paths = tree.get_selection().get_selected_rows()   for path in paths:   row = model[path]   src, dest, percent, sensitive = row