35
35
def __init__(self, gladefile, comm, dialog):
36
36
""" Initialize the Branch dialog. """
37
37
self.gladefile = gladefile
38
self.glade = gtk.glade.XML(self.gladefile, 'window_branch')
38
self.glade = gtk.glade.XML(self.gladefile, 'window_branch', 'olive-gtk')
40
40
# Communication object
63
63
entry_location = self.glade.get_widget('entry_branch_location')
64
64
location = entry_location.get_text()
66
self.dialog.error_dialog('Missing branch location',
67
'You must specify a branch location.')
66
self.dialog.error_dialog(_('Missing branch location'),
67
_('You must specify a branch location.'))
70
70
destination = self.filechooser.get_filename()
79
79
revs = init.branch(location, destination, revno)
80
80
except errors.NonExistingSource, errmsg:
81
self.dialog.error_dialog('Non existing source',
82
"The location (%s)\ndoesn't exist." % errmsg)
81
self.dialog.error_dialog(_('Non existing source'),
82
_("The location (%s)\ndoesn't exist.") % errmsg)
83
83
self.comm.set_busy(self.window, False)
85
85
except errors.TargetAlreadyExists, errmsg:
86
self.dialog.error_dialog('Target already exists',
87
'Target directory (%s)\nalready exists. Please select another target.' % errmsg)
86
self.dialog.error_dialog(_('Target already exists'),
87
_('Target directory (%s)\nalready exists. Please select another target.') % errmsg)
88
88
self.comm.set_busy(self.window, False)
90
90
except errors.NonExistingParent, errmsg:
91
self.dialog.error_dialog("Non existing parent directory",
92
"The parent directory (%s)\ndoesn't exist." % errmsg)
91
self.dialog.error_dialog(_('Non existing parent directory'),
92
_("The parent directory (%s)\ndoesn't exist.") % errmsg)
93
93
self.comm.set_busy(self.window, False)
95
95
except errors.NonExistingRevision:
96
self.dialog.error_dialog('Non existing revision',
97
"The revision you specified doesn't exist.")
96
self.dialog.error_dialog(_('Non existing revision'),
97
_("The revision you specified doesn't exist."))
98
98
self.comm.set_busy(self.window, False)
100
100
except errors.NotBranchError, errmsg:
101
self.dialog.error_dialog('Location is not a branch',
102
'The specified location has to be a branch')
101
self.dialog.error_dialog(_('Location is not a branch'),
102
_('The specified location has to be a branch.'))
103
103
self.comm.set_busy(self.window, False)
109
self.dialog.info_dialog('Branching successful',
110
'%d revision(s) branched.' % revs)
109
self.dialog.info_dialog(_('Branching successful'),
110
_('%d revision(s) branched.') % revs)
111
111
self.comm.refresh_right()
113
113
def close(self, widget=None):