/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-11-02 22:08:54 UTC
  • mto: (330.3.3 trunk)
  • mto: This revision was merged to the branch mainline in revision 368.
  • Revision ID: john@arbash-meinel.com-20071102220854-thegr866sz1tbwob
Finish connecting the 'Commit all changes' radio buttons.

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()
361
362
            None, _("Commit all changes"))
362
363
        self._files_box.pack_start(self._commit_all_files_radio, expand=False)
363
364
        self._commit_all_files_radio.show()
 
365
        self._commit_all_files_radio.connect('toggled',
 
366
            self._toggle_commit_selection)
364
367
        self._commit_selected_radio = gtk.RadioButton(
365
368
            self._commit_all_files_radio, _("Only commit selected changes"))
366
369
        self._files_box.pack_start(self._commit_selected_radio, expand=False)
367
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)
368
377
 
369
378
        scroller = gtk.ScrolledWindow()
370
379
        scroller.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
398
407
            name = _('Commit*')
399
408
        else:
400
409
            name = _('Commit')
401
 
        self._treeview_files.append_column(gtk.TreeViewColumn(name,
402
 
                                           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)
403
413
        self._treeview_files.append_column(gtk.TreeViewColumn(_('Path'),
404
414
                                           gtk.CellRendererText(), text=3))
405
415
        self._treeview_files.append_column(gtk.TreeViewColumn(_('Type'),
415
425
        else:
416
426
            model[path][2] = not model[path][2]
417
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
 
418
440
    def _construct_pending_list(self):
419
441
        # Pending information defaults to hidden, we put it all in 1 box, so
420
442
        # that we can show/hide all of them at once
594
616
 
595
617
        file_info = []
596
618
        for record in records:
597
 
            if record[2]:           # [2] checkbox
 
619
            if self._commit_all_changes or record[2]:# [2] checkbox
598
620
                file_id = record[0] # [0] file_id
599
621
                path = record[1]    # [1] real path
600
622
                file_message = record[5] # [5] commit message