/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to commit.py

  • Committer: John Arbash Meinel
  • Date: 2007-10-30 21:15:13 UTC
  • mfrom: (326 trunk)
  • mto: (330.3.3 trunk)
  • mto: This revision was merged to the branch mainline in revision 368.
  • Revision ID: john@arbash-meinel.com-20071030211513-l8ukdfa81g1y74mi
Merge the latest trunk 326

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
116
115
 
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>'))
255
253
 
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'))
358
 
        # file_label.show()
 
356
        file_label.show()
359
357
        self._files_box.pack_start(file_label, expand=False)
360
358
 
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)
373
 
        if self._pending:
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)
377
 
 
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*')
408
389
        else:
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,
 
392
                                           crt, active=2))
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'),
425
405
        else:
426
406
            model[path][2] = not model[path][2]
427
407
 
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
433
 
            if all_files:
434
 
                checked_col.set_visible(False)
435
 
            else:
436
 
                checked_col.set_visible(True)
437
 
            renderer = checked_col.get_cell_renderers()[0]
438
 
            renderer.set_property('activatable', not all_files)
439
 
 
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
483
451
 
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()
493
457
 
494
458
        self._diff_view = DiffView()
495
459
        self._add_to_right_table(self._diff_view, 4, True)
517
481
 
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)
616
579
 
617
580
        file_info = []
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