48
48
def on_menuitem_add_files_activate(self, widget):
49
49
""" Add file(s)... menu handler. """
50
50
from add import OliveAdd
51
add = OliveAdd(self.gladefile, self.comm)
51
add = OliveAdd(self.gladefile, self.comm, self.dialog)
54
54
def on_menuitem_branch_get_activate(self, widget):
55
55
""" Branch/Get... menu handler. """
56
56
from branch import OliveBranch
57
branch = OliveBranch(self.gladefile, self.comm)
57
branch = OliveBranch(self.gladefile, self.comm, self.dialog)
60
60
def on_menuitem_branch_checkout_activate(self, widget):
61
61
""" Branch/Checkout... menu handler. """
62
62
from checkout import OliveCheckout
63
checkout = OliveCheckout(self.gladefile, self.comm)
63
checkout = OliveCheckout(self.gladefile, self.comm, self.dialog)
66
66
def on_menuitem_branch_commit_activate(self, widget):
67
67
""" Branch/Commit... menu handler. """
68
68
from commit import OliveCommit
69
commit = OliveCommit(self.gladefile, self.comm)
69
commit = OliveCommit(self.gladefile, self.comm, self.dialog)
72
72
def on_menuitem_branch_pull_activate(self, widget):
79
79
ret = update.pull(self.comm.get_path())
80
80
except errors.NotBranchError:
81
self.dialog.error_dialog('Directory is not a branch.')
81
self.dialog.error_dialog('Directory is not a branch',
82
'You can perform this action only in a branch.')
82
83
except errors.NoLocationKnown:
83
self.dialog.error_dialog('Parent location is unknown.')
84
self.dialog.error_dialog('Parent location is unknown',
85
'Pulling is not possible until there is no parent location.')
85
self.dialog.info_dialog('%d revision(s) pulled.' % ret)
87
self.dialog.info_dialog('Pull successful',
88
'%d revision(s) pulled.' % ret)
87
90
self.comm.set_busy(self.comm.window_main, False)
89
92
def on_menuitem_branch_push_activate(self, widget):
90
93
""" Branch/Push... menu handler. """
91
94
from push import OlivePush
92
push = OlivePush(self.gladefile, self.comm)
95
push = OlivePush(self.gladefile, self.comm, self.dialog)
95
98
def on_menuitem_branch_status_activate(self, widget):
96
99
""" Branch/Status... menu handler. """
97
100
from status import OliveStatus
98
status = OliveStatus(self.gladefile, self.comm)
101
status = OliveStatus(self.gladefile, self.comm, self.dialog)
101
104
def on_menuitem_branch_initialize_activate(self, widget):
106
109
init.init(self.comm.get_path())
107
110
except errors.AlreadyBranchError, errmsg:
108
self.dialog.error_dialog('Directory is already a branch: %s' % errmsg)
111
self.dialog.error_dialog('Directory is already a branch',
112
'The current directory (%s) is already a branch.\nYou can start using it, or initialize another directory.' % errmsg)
109
113
except errors.BranchExistsWithoutWorkingTree, errmsg:
110
self.dialog.error_dialog('Branch exists without a working tree: %s' % errmsg)
114
self.dialog.error_dialog('Branch without a working tree',
115
'The current directory (%s)\nis a branch without a working tree.' % errmsg)
112
self.dialog.info_dialog('Directory successfully initialized.')
119
self.dialog.info_dialog('Ininialize successful',
120
'Directory successfully initialized.')
113
121
self.comm.refresh_right()
115
123
def on_menuitem_file_make_directory_activate(self, widget):
116
124
""" File/Make directory... menu handler. """
117
125
from mkdir import OliveMkdir
118
mkdir = OliveMkdir(self.gladefile, self.comm)
126
mkdir = OliveMkdir(self.gladefile, self.comm, self.dialog)
121
129
def on_menuitem_file_move_activate(self, widget):
122
130
""" File/Move... menu handler. """
123
131
from move import OliveMove
124
move = OliveMove(self.gladefile, self.comm)
132
move = OliveMove(self.gladefile, self.comm, self.dialog)
127
135
def on_menuitem_file_rename_activate(self, widget):
128
136
""" File/Rename... menu handler. """
129
137
from rename import OliveRename
130
rename = OliveRename(self.gladefile, self.comm)
138
rename = OliveRename(self.gladefile, self.comm, self.dialog)
133
141
def on_menuitem_remove_file_activate(self, widget):
134
142
""" Remove (unversion) selected file. """
135
143
from remove import OliveRemove
136
remove = OliveRemove(self.gladefile, self.comm)
144
remove = OliveRemove(self.gladefile, self.comm, self.dialog)
139
147
def on_menuitem_stats_diff_activate(self, widget):
140
148
""" Statistics/Differences... menu handler. """
141
149
from diff import OliveDiff
142
diff = OliveDiff(self.gladefile, self.comm)
150
diff = OliveDiff(self.gladefile, self.comm, self.dialog)
145
153
def on_menuitem_stats_infos_activate(self, widget):
146
154
""" Statistics/Informations... menu handler. """
147
155
from info import OliveInfo
148
info = OliveInfo(self.gladefile, self.comm)
156
info = OliveInfo(self.gladefile, self.comm, self.dialog)
151
159
def on_menuitem_stats_log_activate(self, widget):
152
160
""" Statistics/Log... menu handler. """
153
161
from log import OliveLog
154
log = OliveLog(self.gladefile, self.comm)
162
log = OliveLog(self.gladefile, self.comm, self.dialog)
157
165
def on_treeview_left_button_press_event(self, widget, event):