30
import olive.backend.errors as errors
32
from add import OliveAdd
30
33
from branch import OliveBranch
34
from commit import OliveCommit
31
35
from dialog import OliveDialog
36
from push import OlivePush
37
from remove import OliveRemove
33
39
class OliveHandler:
34
40
""" Signal handler class for Olive. """
41
47
def on_about_activate(self, widget):
42
48
self.dialog.about()
50
def on_menuitem_add_files_activate(self, widget):
51
""" Add file(s)... menu handler. """
52
add = OliveAdd(self.gladefile, self.comm)
44
55
def on_menuitem_branch_branch_activate(self, widget):
45
56
""" Branch/Branch... menu handler. """
46
57
branch = OliveBranch(self.gladefile, self.comm)
60
def on_menuitem_branch_commit_activate(self, widget):
61
""" Branch/Commit... menu handler. """
62
commit = OliveCommit(self.gladefile, self.comm)
65
def on_menuitem_branch_push_activate(self, widget):
66
""" Branch/Push... menu handler. """
67
push = OlivePush(self.gladefile, self.comm)
70
def on_menuitem_branch_initialize_activate(self, widget):
71
""" Initialize current directory. """
72
import olive.backend.init as init
75
init.init(self.comm.get_path())
76
except errors.AlreadyBranchError, errmsg:
77
self.dialog.error_dialog('Directory is already a branch: %s' % errmsg)
78
except errors.BranchExistsWithoutWorkingTree, errmsg:
79
self.dialog.error_dialog('Branch exists without a working tree: %s' % errmsg)
81
self.dialog.info_dialog('Directory successfully initialized.')
82
self.comm.refresh_right()
84
def on_menuitem_remove_file_activate(self, widget):
85
""" Remove (unversion) selected file. """
86
remove = OliveRemove(self.gladefile, self.comm)
49
89
def on_treeview_right_row_activated(self, treeview, path, view_column):
50
90
""" Occurs when somebody double-clicks or enters an item in the
54
treeselection = treeview.get_selection()
55
(model, iter) = treeselection.get_selected()
56
newdir = model.get_value(iter, 1)
94
newdir = self.comm.get_selected_right()
59
97
self.comm.set_path(os.path.split(self.comm.get_path())[0])