/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to olive/menu.py

  • Committer: Jelmer Vernooij
  • Date: 2006-09-30 10:21:43 UTC
  • Revision ID: jelmer@samba.org-20060930102143-c0ef64d6ca860c21
Merge some files from Olive and bzr-gtk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
        # Set default values
57
57
        self.path = path
58
58
        self.selected = selected
 
59
        print "DEBUG: path =", self.path
 
60
        print "DEBUG: selected =", self.selected
59
61
        
60
62
        # Create the file list context menu
61
63
        self.ui = gtk.UIManager()
203
205
 
204
206
    def commit(self, action):
205
207
        """ Right context menu -> Commit """
206
 
        from commit import CommitDialog
 
208
        from commit import OliveCommit
207
209
        wt, path = WorkingTree.open_containing(self.path)
208
 
        commit = CommitDialog(wt, path)
 
210
        commit = OliveCommit(wt, path)
209
211
        commit.display()
210
212
    
211
213
    def diff(self, action):
212
214
        """ Right context menu -> Diff """
213
 
        from bzrlib.plugins.gtk.viz.diffwin import DiffWindow
214
 
        
215
 
        try:
216
 
            wt = WorkingTree.open_containing(self.path)[0]
217
 
        except errors.NotBranchError:
218
 
            error_dialog(_('File is not in a branch'),
219
 
                         _('The selected file is not in a branch.'))
220
 
            return
221
 
        
222
 
        window = DiffWindow()
223
 
        parent_tree = wt.branch.repository.revision_tree(wt.branch.last_revision())
224
 
        window.set_diff(wt.branch.nick, wt, parent_tree)
225
 
        window.show()
 
215
        from diff import OliveDiff
 
216
        diff = OliveDiff(self.comm)
 
217
        diff.display()
226
218
    
227
219
    def bookmark(self, action):
228
220
        """ Right context menu -> Bookmark """
229
 
        if self.pref.add_bookmark(self.path):
 
221
        if self.pref.add_bookmark(self.comm.get_path()):
230
222
            info_dialog(_('Bookmark successfully added'),
231
223
                        _('The current directory was bookmarked. You can reach\nit by selecting it from the left panel.'))
232
 
            self.pref.write()
233
224
        else:
234
225
            warning_dialog(_('Location already bookmarked'),
235
226
                           _('The current directory is already bookmarked.\nSee the left panel for reference.'))