14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
70
72
commit = OliveCommit(self.gladefile, self.comm, self.dialog)
75
def on_menuitem_branch_missing_revisions_activate(self, widget):
76
""" Branch/Missing revisions menu handler. """
77
import olive.backend.update as update
79
self.comm.set_busy(self.comm.window_main)
82
ret = update.missing(self.comm.get_path())
83
except errors.NotBranchError:
84
self.dialog.error_dialog(_('Directory is not a branch'),
85
_('You can perform this action only in a branch.'))
86
except errors.ConnectionError:
87
self.dialog.error_dialog(_('Connection error'),
88
_('Cannot connect to remote location.\nPlease try again later.'))
89
except errors.NoLocationKnown:
90
self.dialog.error_dialog(_('Parent location is unknown'),
91
_('Cannot determine missing revisions if no parent location is known.'))
94
self.dialog.info_dialog(_('There are missing revisions'),
95
_('%d revision(s) missing.') % ret)
97
self.dialog.info_dialog(_('Local branch up to date'),
98
_('There are no missing revisions.'))
100
self.comm.set_busy(self.comm.window_main, False)
73
102
def on_menuitem_branch_pull_activate(self, widget):
74
103
""" Branch/Pull menu handler. """
75
104
import olive.backend.update as update
186
215
def on_treeview_left_button_press_event(self, widget, event):
187
216
""" Occurs when somebody right-clicks in the bookmark list. """
188
217
if event.button == 3:
218
# Don't show context with nothing selected
219
if self.comm.get_selected_left() == None:
189
222
self.menu.left_context_menu().popup(None, None, None, 0,
192
225
def on_treeview_left_row_activated(self, treeview, path, view_column):
193
226
""" Occurs when somebody double-clicks or enters an item in the
194
227
bookmark list. """
229
newdir = self.comm.get_selected_left()
195
233
self.comm.set_busy(treeview)
197
newdir = self.comm.get_selected_left()
198
234
self.comm.set_path(newdir)
200
235
self.comm.refresh_right()
202
236
self.comm.set_busy(treeview, False)
204
238
def on_treeview_right_button_press_event(self, widget, event):
233
267
if newdir == '..':
234
268
self.comm.set_path(os.path.split(self.comm.get_path())[0])
236
fullpath = self.comm.get_path() + '/' + newdir
270
fullpath = self.comm.get_path() + os.sep + newdir
237
271
if os.path.isdir(fullpath):
238
272
# selected item is an existant directory
239
273
self.comm.set_path(fullpath)
241
if sys.platform == 'win32':
242
# open the file with the default application
243
os.startfile(fullpath)
245
# TODO: support other OSes
246
print "DEBUG: double-click on non-Win32 platforms not supported."
248
277
self.comm.refresh_right()