/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: Daniel Schierbeck
  • Date: 2007-12-06 23:37:06 UTC
  • mto: This revision was merged to the branch mainline in revision 417.
  • Revision ID: daniel.schierbeck@gmail.com-20071206233706-eeinks66w86r3gfm
Fixed bug in gmissing.

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
114
115
        self.committed_revision_id = None # Nothing has been committed yet
115
116
 
116
117
        self.setup_params()
250
251
            self._enable_per_file_commits = True
251
252
        if not self._enable_per_file_commits:
252
253
            self._file_message_expander.hide()
 
254
            self._global_message_label.set_markup(_('<b>Commit Message</b>'))
253
255
 
254
256
    def _compute_delta(self):
255
257
        self._delta = self._wt.changes_from(self._basis_tree)
353
355
    def _construct_file_list(self):
354
356
        self._files_box = gtk.VBox(homogeneous=False, spacing=0)
355
357
        file_label = gtk.Label(_('Files'))
356
 
        file_label.show()
 
358
        # file_label.show()
357
359
        self._files_box.pack_start(file_label, expand=False)
358
360
 
 
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
 
359
378
        scroller = gtk.ScrolledWindow()
360
379
        scroller.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
361
380
        self._treeview_files = gtk.TreeView()
382
401
        self._files_store = liststore
383
402
        self._treeview_files.set_model(liststore)
384
403
        crt = gtk.CellRendererToggle()
385
 
        crt.set_active(not bool(self._pending))
 
404
        crt.set_property('activatable', not bool(self._pending))
386
405
        crt.connect("toggled", self._toggle_commit, self._files_store)
387
406
        if self._pending:
388
407
            name = _('Commit*')
389
408
        else:
390
409
            name = _('Commit')
391
 
        self._treeview_files.append_column(gtk.TreeViewColumn(name,
392
 
                                           crt, active=2))
 
410
        commit_col = gtk.TreeViewColumn(name, crt, active=2)
 
411
        commit_col.set_visible(False)
 
412
        self._treeview_files.append_column(commit_col)
393
413
        self._treeview_files.append_column(gtk.TreeViewColumn(_('Path'),
394
414
                                           gtk.CellRendererText(), text=3))
395
415
        self._treeview_files.append_column(gtk.TreeViewColumn(_('Type'),
405
425
        else:
406
426
            model[path][2] = not model[path][2]
407
427
 
 
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
 
408
440
    def _construct_pending_list(self):
409
441
        # Pending information defaults to hidden, we put it all in 1 box, so
410
442
        # that we can show/hide all of them at once
449
481
    def _construct_diff_view(self):
450
482
        from diff import DiffView
451
483
 
 
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.
452
488
        self._diff_label = gtk.Label(_('Diff for whole tree'))
453
489
        self._diff_label.set_alignment(0, 0)
454
490
        self._right_pane_table.set_row_spacing(self._right_pane_table_row, 0)
455
491
        self._add_to_right_table(self._diff_label, 1, False)
456
 
        self._diff_label.show()
 
492
        # self._diff_label.show()
457
493
 
458
494
        self._diff_view = DiffView()
459
495
        self._add_to_right_table(self._diff_view, 4, True)
481
517
 
482
518
    def _construct_global_message(self):
483
519
        self._global_message_label = gtk.Label(_('Global Commit Message'))
 
520
        self._global_message_label.set_markup(_('<b>Global Commit Message</b>'))
484
521
        self._global_message_label.set_alignment(0, 0)
485
522
        self._right_pane_table.set_row_spacing(self._right_pane_table_row, 0)
486
523
        self._add_to_right_table(self._global_message_label, 1, False)
579
616
 
580
617
        file_info = []
581
618
        for record in records:
582
 
            if record[2]:           # [2] checkbox
 
619
            if self._commit_all_changes or record[2]:# [2] checkbox
583
620
                file_id = record[0] # [0] file_id
584
621
                path = record[1]    # [1] real path
585
622
                file_message = record[5] # [5] commit message