33
33
""" Display branch dialog and perform the needed operations. """
34
def __init__(self, gladefile, comm, dialog):
34
def __init__(self, gladefile, comm):
35
35
""" Initialize the Branch dialog. """
36
36
self.gladefile = gladefile
37
37
self.glade = gtk.glade.XML(self.gladefile, 'window_branch', 'olive-gtk')
39
39
# Communication object
44
42
self.window = self.glade.get_widget('window_branch')
62
60
entry_location = self.glade.get_widget('entry_branch_location')
63
61
location = entry_location.get_text()
65
self.dialog.error_dialog(_('Missing branch location'),
63
error_dialog(_('Missing branch location'),
66
64
_('You must specify a branch location.'))
100
self.dialog.info_dialog(_('Branching successful'),
98
info_dialog(_('Branching successful'),
101
99
_('%d revision(s) branched.') % revs)
102
100
self.comm.refresh_right()
103
101
except errors.NonExistingSource, errmsg:
104
self.dialog.error_dialog(_('Non existing source'),
102
error_dialog(_('Non existing source'),
105
103
_("The location (%s)\ndoesn't exist.") % errmsg)
106
104
self.comm.set_busy(self.window, False)
108
106
except errors.TargetAlreadyExists, errmsg:
109
self.dialog.error_dialog(_('Target already exists'),
107
error_dialog(_('Target already exists'),
110
108
_('Target directory (%s)\nalready exists. Please select another target.') % errmsg)
111
109
self.comm.set_busy(self.window, False)
113
111
except errors.NonExistingParent, errmsg:
114
self.dialog.error_dialog(_('Non existing parent directory'),
112
error_dialog(_('Non existing parent directory'),
115
113
_("The parent directory (%s)\ndoesn't exist.") % errmsg)
116
114
self.comm.set_busy(self.window, False)
118
116
except errors.NonExistingRevision:
119
self.dialog.error_dialog(_('Non existing revision'),
117
error_dialog(_('Non existing revision'),
120
118
_("The revision you specified doesn't exist."))
121
119
self.comm.set_busy(self.window, False)
123
121
except errors.NotBranchError, errmsg:
124
self.dialog.error_dialog(_('Location is not a branch'),
122
error_dialog(_('Location is not a branch'),
125
123
_('The specified location has to be a branch.'))
126
124
self.comm.set_busy(self.window, False)