/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-06-29 15:54:40 UTC
  • mto: This revision was merged to the branch mainline in revision 519.
  • Revision ID: jelmer@samba.org-20080629155440-iuzfrlfifnplp9jq
Add simple test for linegraph.

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