Changeset a1ec75c32e81…
Parent 9935bc58af32…
by
Changes to 3 files · Browse files at a1ec75c32e81 Showing diff from parent 9935bc58af32 Diff from another changeset...
@@ -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')
|
@@ -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)
|
@@ -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
|
Loading...