/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/status.py

  • Committer: Jelmer Vernooij
  • Date: 2006-09-28 06:35:56 UTC
  • mto: (0.12.2 olive)
  • mto: This revision was merged to the branch mainline in revision 83.
  • Revision ID: jelmer@samba.org-20060928063556-62ec354cb06ba38c
Update TODO
integrate the handle and communicator functions into a main class.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
from bzrlib.status import show_tree_status
34
34
from bzrlib.workingtree import WorkingTree
35
35
 
36
 
from dialog import OliveDialog
 
36
from dialog import error_dialog
37
37
 
38
38
from olive import gladefile
39
39
 
40
40
class OliveStatus:
41
41
    """ Display Status window and perform the needed actions. """
42
 
    def __init__(self, gladefile, wt, wtpath):
 
42
    def __init__(self, wt, wtpath):
43
43
        """ Initialize the Status window. """
44
44
        self.glade = gtk.glade.XML(gladefile, 'window_status')
45
45
        
49
49
        self.wtpath = wtpath
50
50
        
51
51
        # Check if current location is a branch
52
 
        try:
53
 
            branch = wt.branch
54
 
        except errors.NotBranchError:
55
 
            self.notbranch = True
56
 
            return
57
 
        
58
52
        file_id = self.wt.path2id(wtpath)
59
53
 
60
 
        self.notbranch = False
61
 
        if file_id is None:
62
 
            self.notbranch = True
63
 
            return
64
 
        
65
54
        # Set the old working tree
66
55
        self.old_tree = self.wt.branch.repository.revision_tree(self.wt.branch.last_revision())
67
56
        
131
120
    
132
121
    def display(self):
133
122
        """ Display the Diff window. """
134
 
        if self.notbranch:
135
 
            error_dialog(_('Directory is not a branch'),
136
 
                                     _('You can perform this action only in a branch.'))
137
 
            self.close()
138
 
        else:
139
 
            self.window.show_all()
 
123
        self.window.show_all()
140
124
 
141
125
    def close(self, widget=None):
142
126
        self.window.destroy()