/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-10-01 01:56:17 UTC
  • mfrom: (0.8.98 merge)
  • Revision ID: jelmer@samba.org-20061001015617-9827cc403415cbf0
[merge] more changes from Szilveszter

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
61
59
        
62
60
        # Create the file list context menu
63
61
        self.ui = gtk.UIManager()
212
210
    
213
211
    def diff(self, action):
214
212
        """ Right context menu -> Diff """
215
 
        from diff import OliveDiff
216
 
        diff = OliveDiff(self.comm)
217
 
        diff.display()
 
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()
218
226
    
219
227
    def bookmark(self, action):
220
228
        """ Right context menu -> Bookmark """
221
 
        if self.pref.add_bookmark(self.comm.get_path()):
 
229
        if self.pref.add_bookmark(self.path):
222
230
            info_dialog(_('Bookmark successfully added'),
223
231
                        _('The current directory was bookmarked. You can reach\nit by selecting it from the left panel.'))
 
232
            self.pref.write()
224
233
        else:
225
234
            warning_dialog(_('Location already bookmarked'),
226
235
                           _('The current directory is already bookmarked.\nSee the left panel for reference.'))