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

  • Committer: Jelmer Vernooij
  • Date: 2008-06-29 16:11:12 UTC
  • mfrom: (475.2.2 gtk)
  • mto: This revision was merged to the branch mainline in revision 519.
  • Revision ID: jelmer@samba.org-20080629161112-3j4zp0r0e7cv6cds
Merge Chad's progress bar in viz patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
import gtk
26
26
 
 
27
from bzrlib.plugins.gtk import _i18n
27
28
from errors import show_bzr_error
28
29
 
29
30
from bzrlib.branch import Branch
36
37
 
37
38
class CheckoutDialog(gtk.Dialog):
38
39
    """ New implementation of the Checkout dialog. """
39
 
    def __init__(self, path=None, parent=None):
 
40
    def __init__(self, path=None, parent=None, remote_path=None):
40
41
        """ Initialize the Checkout dialog. """
41
42
        gtk.Dialog.__init__(self, title="Checkout - Olive",
42
43
                                  parent=parent,
47
48
        self.path = path
48
49
        
49
50
        # Create the widgets
50
 
        self._button_checkout = gtk.Button(_("Check_out"), use_underline=True)
 
51
        self._button_checkout = gtk.Button(_i18n("Check_out"), use_underline=True)
51
52
        self._button_revision = gtk.Button('')
52
53
        self._image_browse = gtk.Image()
53
 
        self._filechooser = gtk.FileChooserButton(_("Please select a folder"))
 
54
        self._filechooser = gtk.FileChooserButton(_i18n("Please select a folder"))
54
55
        self._combo = gtk.ComboBoxEntry()
55
 
        self._label_location = gtk.Label(_("Branch location:"))
56
 
        self._label_destination = gtk.Label(_("Destination:"))
57
 
        self._label_nick = gtk.Label(_("Branck nick:"))
58
 
        self._label_revision = gtk.Label(_("Revision:"))
 
56
        self._label_location = gtk.Label(_i18n("Branch location:"))
 
57
        self._label_destination = gtk.Label(_i18n("Destination:"))
 
58
        self._label_nick = gtk.Label(_i18n("Branck nick:"))
 
59
        self._label_revision = gtk.Label(_i18n("Revision:"))
59
60
        self._hbox_revision = gtk.HBox()
60
61
        self._entry_revision = gtk.Entry()
61
62
        self._entry_nick = gtk.Entry()
62
 
        self._check_lightweight = gtk.CheckButton(_("_Lightweight checkout"),
 
63
        self._check_lightweight = gtk.CheckButton(_i18n("_Lightweight checkout"),
63
64
                                                  use_underline=True)
64
65
        
65
66
        # Set callbacks
93
94
        self.vbox.set_spacing(3)
94
95
        if self.path is not None:
95
96
            self._filechooser.set_filename(self.path)
 
97
        if remote_path is not None:
 
98
            self._combo.child.set_text(remote_path)
96
99
        
97
100
        # Pack some widgets
98
101
        self._hbox_revision.pack_start(self._entry_revision, True, True)
158
161
        """ Checkout button clicked handler. """
159
162
        location = self._combo.get_child().get_text()
160
163
        if location is '':
161
 
            error_dialog(_('Missing branch location'),
162
 
                         _('You must specify a branch location.'))
 
164
            error_dialog(_i18n('Missing branch location'),
 
165
                         _i18n('You must specify a branch location.'))
163
166
            return
164
167
        
165
168
        destination = self._filechooser.get_filename()
190
193
        """ We try to get the last revision if focus lost. """
191
194
        rev = self._get_last_revno()
192
195
        if rev is None:
193
 
            self._entry_revision.set_text(_('N/A'))
 
196
            self._entry_revision.set_text(_i18n('N/A'))
194
197
            self._button_revision.set_sensitive(False)
195
198
        else:
196
199
            self._entry_revision.set_text(str(rev))