30
30
import olive.backend.errors as errors
32
from add import OliveAdd
33
from branch import OliveBranch
34
from checkout import OliveCheckout
35
from commit import OliveCommit
36
32
from dialog import OliveDialog
37
from diff import OliveDiff
38
33
from menu import OliveMenu
39
from push import OlivePush
40
from remove import OliveRemove
41
from status import OliveStatus
43
35
class OliveHandler:
44
36
""" Signal handler class for Olive. """
56
48
def on_menuitem_add_files_activate(self, widget):
57
49
""" Add file(s)... menu handler. """
50
from add import OliveAdd
58
51
add = OliveAdd(self.gladefile, self.comm)
61
54
def on_menuitem_branch_get_activate(self, widget):
62
55
""" Branch/Get... menu handler. """
56
from branch import OliveBranch
63
57
branch = OliveBranch(self.gladefile, self.comm)
66
60
def on_menuitem_branch_checkout_activate(self, widget):
67
61
""" Branch/Checkout... menu handler. """
62
from checkout import OliveCheckout
68
63
checkout = OliveCheckout(self.gladefile, self.comm)
71
66
def on_menuitem_branch_commit_activate(self, widget):
72
67
""" Branch/Commit... menu handler. """
68
from commit import OliveCommit
73
69
commit = OliveCommit(self.gladefile, self.comm)
72
def on_menuitem_branch_pull_activate(self, widget):
73
""" Branch/Pull menu handler. """
74
import olive.backend.update as update
76
self.comm.set_busy(self.comm.window_main)
79
ret = update.pull(self.comm.get_path())
80
except errors.NotBranchError:
81
self.dialog.error_dialog('Directory is not a branch.')
82
except errors.NoLocationKnown:
83
self.dialog.error_dialog('Parent location is unknown.')
85
self.dialog.info_dialog('%d revision(s) pulled.' % ret)
87
self.comm.set_busy(self.comm.window_main, False)
76
89
def on_menuitem_branch_push_activate(self, widget):
77
90
""" Branch/Push... menu handler. """
91
from push import OlivePush
78
92
push = OlivePush(self.gladefile, self.comm)
81
95
def on_menuitem_branch_status_activate(self, widget):
82
96
""" Branch/Status... menu handler. """
97
from status import OliveStatus
83
98
status = OliveStatus(self.gladefile, self.comm)
100
115
def on_menuitem_remove_file_activate(self, widget):
101
116
""" Remove (unversion) selected file. """
117
from remove import OliveRemove
102
118
remove = OliveRemove(self.gladefile, self.comm)
105
121
def on_menuitem_stats_diff_activate(self, widget):
106
122
""" Statistics/Differences... menu handler. """
123
from diff import OliveDiff
107
124
diff = OliveDiff(self.gladefile, self.comm)