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
114
115
self.committed_revision_id = None # Nothing has been committed yet
116
117
self.setup_params()
228
229
bus = dbus.SystemBus()
229
proxy_obj = bus.get_object('org.freedesktop.NetworkManager',
230
'/org/freedesktop/NetworkManager')
231
proxy_obj = bus.get_object('org.freedesktop.NetworkManager',
232
'/org/freedesktop/NetworkManager')
233
except dbus.DBusException:
234
mutter("networkmanager not available.")
235
self._check_local.show()
231
238
dbus_iface = dbus.Interface(proxy_obj,
232
239
'org.freedesktop.NetworkManager')
250
257
self._enable_per_file_commits = True
251
258
if not self._enable_per_file_commits:
252
259
self._file_message_expander.hide()
260
self._global_message_label.set_markup(_('<b>Commit Message</b>'))
254
262
def _compute_delta(self):
255
263
self._delta = self._wt.changes_from(self._basis_tree)
353
361
def _construct_file_list(self):
354
362
self._files_box = gtk.VBox(homogeneous=False, spacing=0)
355
363
file_label = gtk.Label(_('Files'))
357
365
self._files_box.pack_start(file_label, expand=False)
367
self._commit_all_files_radio = gtk.RadioButton(
368
None, _("Commit all changes"))
369
self._files_box.pack_start(self._commit_all_files_radio, expand=False)
370
self._commit_all_files_radio.show()
371
self._commit_all_files_radio.connect('toggled',
372
self._toggle_commit_selection)
373
self._commit_selected_radio = gtk.RadioButton(
374
self._commit_all_files_radio, _("Only commit selected changes"))
375
self._files_box.pack_start(self._commit_selected_radio, expand=False)
376
self._commit_selected_radio.show()
377
self._commit_selected_radio.connect('toggled',
378
self._toggle_commit_selection)
380
self._commit_all_files_radio.set_label(_('Commit all changes*'))
381
self._commit_all_files_radio.set_sensitive(False)
382
self._commit_selected_radio.set_sensitive(False)
359
384
scroller = gtk.ScrolledWindow()
360
385
scroller.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
361
386
self._treeview_files = gtk.TreeView()
382
407
self._files_store = liststore
383
408
self._treeview_files.set_model(liststore)
384
409
crt = gtk.CellRendererToggle()
385
crt.set_active(not bool(self._pending))
410
crt.set_property('activatable', not bool(self._pending))
386
411
crt.connect("toggled", self._toggle_commit, self._files_store)
387
412
if self._pending:
388
413
name = _('Commit*')
390
415
name = _('Commit')
391
self._treeview_files.append_column(gtk.TreeViewColumn(name,
416
commit_col = gtk.TreeViewColumn(name, crt, active=2)
417
commit_col.set_visible(False)
418
self._treeview_files.append_column(commit_col)
393
419
self._treeview_files.append_column(gtk.TreeViewColumn(_('Path'),
394
420
gtk.CellRendererText(), text=3))
395
421
self._treeview_files.append_column(gtk.TreeViewColumn(_('Type'),
406
432
model[path][2] = not model[path][2]
434
def _toggle_commit_selection(self, button):
435
all_files = self._commit_all_files_radio.get_active()
436
if self._commit_all_changes != all_files:
437
checked_col = self._treeview_files.get_column(0)
438
self._commit_all_changes = all_files
440
checked_col.set_visible(False)
442
checked_col.set_visible(True)
443
renderer = checked_col.get_cell_renderers()[0]
444
renderer.set_property('activatable', not all_files)
408
446
def _construct_pending_list(self):
409
447
# Pending information defaults to hidden, we put it all in 1 box, so
410
448
# that we can show/hide all of them at once
449
487
def _construct_diff_view(self):
450
488
from diff import DiffView
490
# TODO: jam 2007-10-30 The diff label is currently disabled. If we
491
# decide that we really don't ever want to display it, we should
492
# actually remove it, and other references to it, along with the
493
# tests that it is set properly.
452
494
self._diff_label = gtk.Label(_('Diff for whole tree'))
453
495
self._diff_label.set_alignment(0, 0)
454
496
self._right_pane_table.set_row_spacing(self._right_pane_table_row, 0)
455
497
self._add_to_right_table(self._diff_label, 1, False)
456
self._diff_label.show()
498
# self._diff_label.show()
458
500
self._diff_view = DiffView()
459
501
self._add_to_right_table(self._diff_view, 4, True)
482
524
def _construct_global_message(self):
483
525
self._global_message_label = gtk.Label(_('Global Commit Message'))
526
self._global_message_label.set_markup(_('<b>Global Commit Message</b>'))
484
527
self._global_message_label.set_alignment(0, 0)
485
528
self._right_pane_table.set_row_spacing(self._right_pane_table_row, 0)
486
529
self._add_to_right_table(self._global_message_label, 1, False)
581
624
for record in records:
582
if record[2]: # [2] checkbox
625
if self._commit_all_changes or record[2]:# [2] checkbox
583
626
file_id = record[0] # [0] file_id
584
627
path = record[1] # [1] real path
585
628
file_message = record[5] # [5] commit message