/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: Jasper Groenewegen
  • Date: 2008-07-20 22:36:42 UTC
  • mto: This revision was merged to the branch mainline in revision 566.
  • Revision ID: colbrac@xs4all.nl-20080720223642-bk05nf98lcafdrda
Fixes to launch in menu.py
Absolute import in bookmark.py

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):
259
261
            # TODO: how to enter a directory?
260
262
            return
261
263
        else:
262
 
            fullpath = self.path + os.sep + filename
 
264
            fullpath = os.path.join(self.path, filename)
263
265
            if os.path.isdir(fullpath):
264
266
                # selected item is an existant directory
265
267
                # TODO: how to enter a directory?
266
 
                return
 
268
                # Jasper, 21-7-08: Let's just open the folder in a file browser
 
269
                # instead of ignoring the explicit open (when double
 
270
                # clicking suffices for browsing)
 
271
                launch.launch(fullpath)
267
272
            else:
268
 
                launch(fullpath) 
 
273
                launch.launch(fullpath) 
269
274
 
270
275
    def revert(self, action):
271
276
        """ Right context menu -> Revert """
355
360
        path = self.selected
356
361
 
357
362
        if path != None:
358
 
            launch(path)
 
363
            launch.launch(path)
359
364
    
360
365
    def diff_selected(self, action):
361
366
        """ Diff toolbutton -> Selected... """