/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-27 20:30:59 UTC
  • mto: (0.12.2 olive)
  • mto: This revision was merged to the branch mainline in revision 83.
  • Revision ID: jelmer@samba.org-20060927203059-85792ae0a81db524
Bunch of small fixes, cleanups and simplifications.

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 error_dialog
 
36
from dialog import OliveDialog
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, wt, wtpath):
 
42
    def __init__(self, gladefile, 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
        
52
58
        file_id = self.wt.path2id(wtpath)
53
59
 
 
60
        self.notbranch = False
 
61
        if file_id is None:
 
62
            self.notbranch = True
 
63
            return
 
64
        
54
65
        # Set the old working tree
55
66
        self.old_tree = self.wt.branch.repository.revision_tree(self.wt.branch.last_revision())
56
67
        
120
131
    
121
132
    def display(self):
122
133
        """ Display the Diff window. """
123
 
        self.window.show_all()
 
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()
124
140
 
125
141
    def close(self, widget=None):
126
142
        self.window.destroy()