/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: 2006-09-27 19:52:46 UTC
  • mto: (0.12.2 olive)
  • mto: This revision was merged to the branch mainline in revision 83.
  • Revision ID: jelmer@samba.org-20060927195246-9354d7ccf56127f5
Don't pass around gladefile all the time. 
Fix bug in status information when files have been removed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
    pygtk.require("2.0")
23
23
except:
24
24
    pass
25
 
try:
26
 
    import gtk
27
 
    import gtk.glade
28
 
except:
29
 
    sys.exit(1)
 
25
 
 
26
import gtk
30
27
 
31
28
import bzrlib.errors as errors
32
29
from dialog import error_dialog
35
32
 
36
33
class OliveMenu:
37
34
    """ This class is responsible for building the context menus. """
38
 
    def __init__(self, gladefile, comm):
 
35
    def __init__(self, comm):
39
36
        # Load the UI file
40
37
        if sys.platform == 'win32':
41
38
            self.uifile = os.path.dirname(sys.executable) + "/share/olive/cmenu.ui"
51
48
                print _('UI description file cannot be found.')
52
49
                sys.exit(1)
53
50
        
54
 
        self.gladefile = gladefile
55
51
        self.comm = comm
56
52
        
57
53
        # Create the file list context menu
205
201
        """ Right context menu -> Commit """
206
202
        from commit import OliveCommit
207
203
        wt, path = WorkingTree.open_containing(self.comm.get_path())
208
 
        commit = OliveCommit(self.gladefile, wt, path)
 
204
        commit = OliveCommit(wt, path)
209
205
        commit.display()
210
206
    
211
207
    def diff(self, action):
212
208
        """ Right context menu -> Diff """
213
209
        from diff import OliveDiff
214
 
        diff = OliveDiff(self.gladefile, self.comm)
 
210
        diff = OliveDiff(self.comm)
215
211
        diff.display()
216
212
    
217
213
    def bookmark(self, action):
230
226
        from bookmark import OliveBookmark
231
227
 
232
228
        if self.comm.get_selected_left() != None:
233
 
            bookmark = OliveBookmark(self.gladefile, self.comm)
 
229
            bookmark = OliveBookmark(self.comm)
234
230
            bookmark.display()
235
231
 
236
232
    def remove_bookmark(self, action):
254
250
    def diff_all(self, action):
255
251
        """ Diff toolbutton -> All... """
256
252
        from diff import OliveDiff
257
 
        diff = OliveDiff(self.gladefile, self.comm)
 
253
        diff = OliveDiff(self.comm)
258
254
        diff.display()