111
111
# It used to set all changes but this one to False
112
112
self._selected = selected
113
113
self._enable_per_file_commits = True
114
self._commit_all_changes = True
115
114
self.committed_revision_id = None # Nothing has been committed yet
117
116
self.setup_params()
251
250
self._enable_per_file_commits = True
252
251
if not self._enable_per_file_commits:
253
252
self._file_message_expander.hide()
254
self._global_message_label.set_markup(_('<b>Commit Message</b>'))
256
254
def _compute_delta(self):
257
255
self._delta = self._wt.changes_from(self._basis_tree)
355
353
def _construct_file_list(self):
356
354
self._files_box = gtk.VBox(homogeneous=False, spacing=0)
357
355
file_label = gtk.Label(_('Files'))
359
357
self._files_box.pack_start(file_label, expand=False)
361
self._commit_all_files_radio = gtk.RadioButton(
362
None, _("Commit all changes"))
363
self._files_box.pack_start(self._commit_all_files_radio, expand=False)
364
self._commit_all_files_radio.show()
365
self._commit_all_files_radio.connect('toggled',
366
self._toggle_commit_selection)
367
self._commit_selected_radio = gtk.RadioButton(
368
self._commit_all_files_radio, _("Only commit selected changes"))
369
self._files_box.pack_start(self._commit_selected_radio, expand=False)
370
self._commit_selected_radio.show()
371
self._commit_selected_radio.connect('toggled',
372
self._toggle_commit_selection)
374
self._commit_all_files_radio.set_label(_('Commit all changes*'))
375
self._commit_all_files_radio.set_sensitive(False)
376
self._commit_selected_radio.set_sensitive(False)
378
359
scroller = gtk.ScrolledWindow()
379
360
scroller.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
380
361
self._treeview_files = gtk.TreeView()
401
382
self._files_store = liststore
402
383
self._treeview_files.set_model(liststore)
403
384
crt = gtk.CellRendererToggle()
404
crt.set_property('activatable', not bool(self._pending))
385
crt.set_active(not bool(self._pending))
405
386
crt.connect("toggled", self._toggle_commit, self._files_store)
406
387
if self._pending:
407
388
name = _('Commit*')
409
390
name = _('Commit')
410
commit_col = gtk.TreeViewColumn(name, crt, active=2)
411
commit_col.set_visible(False)
412
self._treeview_files.append_column(commit_col)
391
self._treeview_files.append_column(gtk.TreeViewColumn(name,
413
393
self._treeview_files.append_column(gtk.TreeViewColumn(_('Path'),
414
394
gtk.CellRendererText(), text=3))
415
395
self._treeview_files.append_column(gtk.TreeViewColumn(_('Type'),
426
406
model[path][2] = not model[path][2]
428
def _toggle_commit_selection(self, button):
429
all_files = self._commit_all_files_radio.get_active()
430
if self._commit_all_changes != all_files:
431
checked_col = self._treeview_files.get_column(0)
432
self._commit_all_changes = all_files
434
checked_col.set_visible(False)
436
checked_col.set_visible(True)
437
renderer = checked_col.get_cell_renderers()[0]
438
renderer.set_property('activatable', not all_files)
440
408
def _construct_pending_list(self):
441
409
# Pending information defaults to hidden, we put it all in 1 box, so
442
410
# that we can show/hide all of them at once
481
449
def _construct_diff_view(self):
482
450
from diff import DiffView
484
# TODO: jam 2007-10-30 The diff label is currently disabled. If we
485
# decide that we really don't ever want to display it, we should
486
# actually remove it, and other references to it, along with the
487
# tests that it is set properly.
488
452
self._diff_label = gtk.Label(_('Diff for whole tree'))
489
453
self._diff_label.set_alignment(0, 0)
490
454
self._right_pane_table.set_row_spacing(self._right_pane_table_row, 0)
491
455
self._add_to_right_table(self._diff_label, 1, False)
492
# self._diff_label.show()
456
self._diff_label.show()
494
458
self._diff_view = DiffView()
495
459
self._add_to_right_table(self._diff_view, 4, True)
518
482
def _construct_global_message(self):
519
483
self._global_message_label = gtk.Label(_('Global Commit Message'))
520
self._global_message_label.set_markup(_('<b>Global Commit Message</b>'))
521
484
self._global_message_label.set_alignment(0, 0)
522
485
self._right_pane_table.set_row_spacing(self._right_pane_table_row, 0)
523
486
self._add_to_right_table(self._global_message_label, 1, False)
618
581
for record in records:
619
if self._commit_all_changes or record[2]:# [2] checkbox
582
if record[2]: # [2] checkbox
620
583
file_id = record[0] # [0] file_id
621
584
path = record[1] # [1] real path
622
585
file_message = record[5] # [5] commit message