/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: 2008-07-22 22:40:17 UTC
  • Revision ID: jelmer@samba.org-20080722224017-z0no05hmnpno25bx
Clarify maintainers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
from bzrlib.plugins.gtk.annotate.gannotate import GAnnotateWindow
37
37
from bzrlib.plugins.gtk.annotate.config import GAnnotateConfig
38
38
from bzrlib.plugins.gtk.diff import DiffWindow
39
 
from launch import launch
40
 
from bzrlib.plugins.gtk.olive import Preferences
 
39
from bzrlib.plugins.gtk.olive import Preferences, launch
41
40
 
42
41
class OliveMenu:
43
42
    """ This class is responsible for building the context menus. """
181
180
        
182
181
        wt, path = WorkingTree.open_containing(os.path.join(directory, filename))
183
182
        wt.add([path])
 
183
        
 
184
        self.app.refresh_right()
184
185
    
185
186
    @show_bzr_error
186
187
    def annotate(self, action):
197
198
        
198
199
        branch = wt.branch
199
200
        file_id = wt.path2id(wt.relpath(os.path.join(directory, filename)))
200
 
        
 
201
        if file_id is None:
 
202
            raise errors.NotVersionedError(filename)
201
203
        window = GAnnotateWindow(all=False, plain=False, parent=self.app)
202
204
        window.set_title(os.path.join(directory, filename) + " - Annotate")
203
205
        config = GAnnotateConfig(window)
260
262
            # TODO: how to enter a directory?
261
263
            return
262
264
        else:
263
 
            fullpath = self.path + os.sep + filename
264
 
            if os.path.isdir(fullpath):
265
 
                # selected item is an existant directory
266
 
                # TODO: how to enter a directory?
267
 
                return
268
 
            else:
269
 
                launch(fullpath) 
 
265
            fullpath = os.path.join(self.path, filename)
 
266
            launch.launch(fullpath) 
270
267
 
271
268
    def revert(self, action):
272
269
        """ Right context menu -> Revert """
356
353
        path = self.selected
357
354
 
358
355
        if path != None:
359
 
            launch(path)
 
356
            launch.launch(path)
360
357
    
361
358
    def diff_selected(self, action):
362
359
        """ Diff toolbutton -> Selected... """