/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 push.py

Add options to viz treeview to not show the line graph, and to only show the main line.
Set the revision browser to use these options.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
from bzrlib.config import LocationConfig
31
31
import bzrlib.errors as errors
32
32
 
33
 
from bzrlib.plugins.gtk import _i18n
34
33
from dialog import error_dialog, info_dialog, question_dialog
35
34
 
36
35
from history import UrlHistory
50
49
        self.branch = branch
51
50
        
52
51
        # Create the widgets
53
 
        self._label_location = gtk.Label(_i18n("Location:"))
 
52
        self._label_location = gtk.Label(_("Location:"))
54
53
        self._combo = gtk.ComboBoxEntry()
55
 
        self._button_push = gtk.Button(_i18n("_Push"), use_underline=True)
 
54
        self._button_push = gtk.Button(_("_Push"), use_underline=True)
56
55
        self._hbox_location = gtk.HBox()
57
56
        
58
57
        # Set callbacks
94
93
        """ Push button clicked handler. """
95
94
        location = self._combo.get_child().get_text()
96
95
        revs = 0
97
 
        
 
96
        if self.branch is not None and self.branch.get_push_location() is None:
 
97
            response = question_dialog(_('Set default push location'),
 
98
                                       _('There is no default push location set.\nSet %r as default now?') % location)
 
99
            if response == gtk.RESPONSE_OK:
 
100
                self.branch.set_push_location(location)
 
101
 
98
102
        try:
99
103
            revs = do_push(self.branch, location=location, overwrite=False)
100
104
        except errors.DivergedBranches:
101
 
            response = question_dialog(_i18n('Branches have been diverged'),
102
 
                                       _i18n('You cannot push if branches have diverged.\nOverwrite?'))
 
105
            response = question_dialog(_('Branches have been diverged'),
 
106
                                       _('You cannot push if branches have diverged.\nOverwrite?'))
103
107
            if response == gtk.RESPONSE_YES:
104
108
                revs = do_push(self.branch, location=location, overwrite=True)
105
109
        
106
 
        if self.branch is not None and self.branch.get_push_location() is None:
107
 
            self.branch.set_push_location(location)
108
 
        
109
110
        self._history.add_entry(location)
110
 
        info_dialog(_i18n('Push successful'),
111
 
                    _i18n("%d revision(s) pushed.") % revs)
 
111
        info_dialog(_('Push successful'),
 
112
                    _("%d revision(s) pushed.") % revs)
112
113
        
113
114
        self.response(gtk.RESPONSE_OK)
114
115
 
141
142
            relurl = transport.relpath(location_url)
142
143
            transport.mkdir(relurl)
143
144
        except errors.NoSuchFile:
144
 
            response = question_dialog(_i18n('Non existing parent directory'),
145
 
                         _i18n("The parent directory (%s)\ndoesn't exist. Create?") % location)
 
145
            response = question_dialog(_('Non existing parent directory'),
 
146
                         _("The parent directory (%s)\ndoesn't exist. Create?") % location)
146
147
            if response == gtk.RESPONSE_OK:
147
148
                _create_prefix(transport)
148
149
            else: