/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. """
179
178
                         _i18n('Please select a file from the list,\nor choose the other option.'))
180
179
            return
181
180
        
182
 
        bzrlib.add.smart_add([os.path.join(directory, filename)])
 
181
        wt, path = WorkingTree.open_containing(os.path.join(directory, filename))
 
182
        wt.add([path])
 
183
        
 
184
        self.app.refresh_right()
183
185
    
184
186
    @show_bzr_error
185
187
    def annotate(self, action):
196
198
        
197
199
        branch = wt.branch
198
200
        file_id = wt.path2id(wt.relpath(os.path.join(directory, filename)))
199
 
        
 
201
        if file_id is None:
 
202
            raise errors.NotVersionedError(filename)
200
203
        window = GAnnotateWindow(all=False, plain=False, parent=self.app)
201
204
        window.set_title(os.path.join(directory, filename) + " - Annotate")
202
205
        config = GAnnotateConfig(window)
259
262
            # TODO: how to enter a directory?
260
263
            return
261
264
        else:
262
 
            fullpath = self.path + os.sep + filename
263
 
            if os.path.isdir(fullpath):
264
 
                # selected item is an existant directory
265
 
                # TODO: how to enter a directory?
266
 
                return
267
 
            else:
268
 
                launch(fullpath) 
 
265
            fullpath = os.path.join(self.path, filename)
 
266
            launch.launch(fullpath) 
269
267
 
270
268
    def revert(self, action):
271
269
        """ Right context menu -> Revert """
355
353
        path = self.selected
356
354
 
357
355
        if path != None:
358
 
            launch(path)
 
356
            launch.launch(path)
359
357
    
360
358
    def diff_selected(self, action):
361
359
        """ Diff toolbutton -> Selected... """