/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: Aaron Bentley
  • Date: 2006-12-20 01:45:49 UTC
  • mfrom: (66.4.3 trunk)
  • mto: This revision was merged to the branch mainline in revision 125.
  • Revision ID: aaron.bentley@utoronto.ca-20061220014549-o8ki5xwkh787j0gi
MergeĀ fromĀ mainline

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
 
35
35
class OliveMenu:
36
36
    """ This class is responsible for building the context menus. """
37
 
    def __init__(self, path, selected):
 
37
    def __init__(self, path, selected, app=None):
38
38
        # Load the UI file
39
39
        from guifiles import UIFILENAME
40
40
 
46
46
        # Set default values
47
47
        self.path = path
48
48
        self.selected = selected
 
49
        self.app = app
49
50
        
50
51
        # Create the file list context menu
51
52
        self.ui = gtk.UIManager()
161
162
            return
162
163
        
163
164
        try:
164
 
            wt, path = WorkingTree.open_containing(directory + os.sep + filename)
 
165
            wt, path = WorkingTree.open_containing(os.path.join(directory, filename))
165
166
            wt.remove(path)
166
167
 
167
168
        except errors.NotBranchError:
173
174
                         _('The selected file is not versioned.'))
174
175
            return
175
176
 
 
177
        self.app.set_path(self.path)
 
178
        self.app.refresh_right()
 
179
 
176
180
    def rename_file(self, action):
177
181
        """ Right context menu -> Rename """
178
182
        from rename import OliveRename
241
245
        else:
242
246
            warning_dialog(_('Location already bookmarked'),
243
247
                           _('The current directory is already bookmarked.\nSee the left panel for reference.'))
 
248
        
 
249
        self.app.refresh_left()
244
250
 
245
251
    def edit_bookmark(self, action):
246
252
        """ Left context menu -> Edit """
247
 
        from bookmark import OliveBookmark
248
 
 
 
253
        from bookmark import OliveBookmarkDialog
 
254
        
249
255
        if self.selected != None:
250
 
            bookmark = OliveBookmark(self.selected)
251
 
            bookmark.display()
 
256
            bookmark = OliveBookmarkDialog(self.selected, self.app.window)
 
257
            response = bookmark.run()
 
258
            
 
259
            if response != gtk.RESPONSE_NONE:
 
260
                bookmark.hide()
 
261
        
 
262
                if response == gtk.RESPONSE_OK:
 
263
                    self.app.refresh_left()
 
264
            
 
265
                bookmark.destroy()
252
266
 
253
267
    def remove_bookmark(self, action):
254
268
        """ Left context menu -> Remove """
256
270
        if self.selected != None:
257
271
            self.pref.remove_bookmark(self.selected)
258
272
            self.pref.write()
 
273
        
 
274
        self.app.refresh_left()
259
275
    
260
276
    def open_folder(self, action):
261
277
        """ Left context menu -> Open Folder """