48
48
self.dialog = dialog
50
self.ui_right = gtk.UIManager()
52
self.actiongroup_right = gtk.ActionGroup('context_right')
53
self.actiongroup_right.add_actions([('add', gtk.STOCK_ADD,
55
'Add the selected file',
57
('remove', gtk.STOCK_REMOVE,
59
'Remove the selected file',
61
('commit', gtk.STOCK_REDO,
67
'Show the diff of the file',
71
'Show the log of the file',
74
self.ui_right.insert_action_group(self.actiongroup_right, 0)
75
self.ui_right.add_ui_from_file(self.uifile)
77
self.cmenu_right = self.ui_right.get_widget('/context_right')
50
# Create the file list context menu
51
self.ui = gtk.UIManager()
53
self.actiongroup = gtk.ActionGroup('context')
54
self.actiongroup.add_actions([('add', gtk.STOCK_ADD,
56
'Add the selected file',
58
('remove', gtk.STOCK_REMOVE,
60
'Remove the selected file',
62
('commit', gtk.STOCK_REDO,
68
'Show the diff of the file',
72
'Show the log of the file',
76
'Bookmark current location',
78
('remove_bookmark', gtk.STOCK_REMOVE,
80
'Remove the selected bookmark',
84
self.ui.insert_action_group(self.actiongroup, 0)
85
self.ui.add_ui_from_file(self.uifile)
87
self.cmenu_right = self.ui.get_widget('/context_right')
89
self.cmenu_left = self.ui.get_widget('/context_left')
79
91
def right_context_menu(self):
80
92
return self.cmenu_right
94
def left_context_menu(self):
95
return self.cmenu_left
82
97
def add_file(self, action):
83
98
""" Right context menu -> Add """
84
99
# Add only the selected file
135
150
def log(self, action):
136
151
""" Right context menu -> Log """
137
152
self.dialog.error_dialog('This feature is not yet implemented.')
154
def bookmark(self, action):
155
""" Right context menu -> Bookmark """
156
if self.comm.pref.add_bookmark(self.comm.get_path()):
157
self.dialog.info_dialog('Bookmark successfully added.')
159
self.dialog.warning_dialog('Location already bookmarked.')
161
self.comm.refresh_left()
163
def remove_bookmark(self, action):
164
""" Left context menu -> Remove """
165
self.comm.pref.remove_bookmark(self.comm.get_selected_left())
167
self.comm.refresh_left()