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

status, commit: Count number of files selected

Show how many files have a check mark, and the total number of files.

Changeset a1ec75c32e81

Parent 9935bc58af32

by Peer Sommerlund

Changes to 3 files · Browse files at a1ec75c32e81 Showing diff from parent 9935bc58af32 Diff from another changeset...

Change 1 of 2 Show Entire File hggtk/​commit.py Stacked
 
69
70
71
 
72
73
74
 
208
209
210
 
211
212
213
 
69
70
71
72
73
74
75
 
209
210
211
212
213
214
215
@@ -69,6 +69,7 @@
  for entry in self.model :   if entry[1] in 'MAR':   entry[0] = True + self._update_check_count()       def save_settings(self): @@ -208,6 +209,7 @@
  for entry in self.model:   if entry[1] in 'MARD':   entry[0] = True + self._update_check_count()     # pre-fill commit message   self.text.get_buffer().set_text('merge')
Change 1 of 1 Show Entire File hggtk/​gdialog.py Stacked
 
302
303
304
305
306
307
308
309
310
 
311
312
313
 
302
303
304
 
 
 
 
 
 
305
306
307
308
@@ -302,12 +302,7 @@
  # Subclass provides extra stuff in bottom hbox   extras = self.get_extras()   if extras: - hbox = gtk.HBox(False, 0) - hbox.set_border_width(6) - hbox.pack_start(extras, False, False) - # Hack! this prevents mysterious silent crashes. - hbox.pack_start(gtk.Label(''), True, True) - vbox.pack_end(hbox, False, False, 0) + vbox.pack_end(extras, False, False, 0)     self.connect('destroy', self._destroying)   self.connect('delete_event', self.should_live)
Change 1 of 5 Show Entire File hggtk/​status.py Stacked
 
47
48
49
 
50
51
52
 
286
287
288
289
 
 
 
 
 
 
 
290
 
 
 
 
 
 
 
 
 
 
291
292
293
 
352
353
354
 
 
355
356
357
 
391
392
393
 
394
395
396
 
670
671
672
 
673
674
675
 
47
48
49
50
51
52
53
 
287
288
289
 
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
 
369
370
371
372
373
374
375
376
 
410
411
412
413
414
415
416
 
690
691
692
693
694
695
696
@@ -47,6 +47,7 @@
  def auto_check(self):   if self.test_opt('check'):   for entry in self.model : entry[0] = True + self._update_check_count()       def get_menu_info(self): @@ -286,8 +287,24 @@
  self._show_checks[type] = check   col += row   row = not row - return table + + self.counter = gtk.Label('') + self.counter.set_alignment(1.0, 0.0) # right up + + hbox = gtk.HBox() + hbox.pack_start(table, expand=False) + hbox.pack_end(self.counter, expand=True, padding=2)   + return hbox + + def _update_check_count(self): + file_count = 0 + check_count = 0 + for row in self.model: + file_count = file_count + 1 + if row[0]: + check_count = check_count + 1 + self.counter.set_text(_('%d selected, %d total') % (check_count, file_count))     def prepare_display(self):   self._ready = True @@ -352,6 +369,8 @@
  file = util.localpath(file)   self.model.append([file in recheck, char, toutf(file), file])   + self._update_check_count() +   selection = self.tree.get_selection()   selected = False   for row in self.model: @@ -391,6 +410,7 @@
    def _select_toggle(self, cellrenderer, path):   self.model[path][0] = not self.model[path][0] + self._update_check_count()   return True     @@ -670,6 +690,7 @@
    def _sel_desel_clicked(self, toolbutton, state):   for entry in self.model : entry[0] = state + self._update_check_count()   return True