/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: 2007-02-03 11:52:13 UTC
  • Revision ID: jelmer@samba.org-20070203115213-qz5549tkrt2wsz05
Move more code to top-level directory. 
Import (last proposed) logo for Bazaar.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
 
import sys
18
 
 
19
17
try:
20
18
    import pygtk
21
19
    pygtk.require("2.0")
22
20
except:
23
21
    pass
24
 
try:
25
 
    import gtk
26
 
    import gtk.glade
27
 
    import gobject
28
 
    import pango
29
 
except:
30
 
    sys.exit(1)
31
 
 
32
 
import bzrlib
33
 
import bzrlib.errors as errors
34
 
 
35
 
from bzrlib.status import show_tree_status
36
 
from bzrlib.workingtree import WorkingTree
37
 
 
38
 
from dialog import OliveDialog
 
22
 
 
23
import gtk
 
24
import gtk.glade
 
25
 
 
26
from guifiles import GLADEFILENAME
 
27
 
39
28
 
40
29
class OliveStatus:
41
30
    """ Display Status window and perform the needed actions. """
42
 
    def __init__(self, gladefile, wt, wtpath):
 
31
    def __init__(self, wt, wtpath):
43
32
        """ Initialize the Status window. """
44
 
        self.gladefile = gladefile
45
 
        self.glade = gtk.glade.XML(self.gladefile, 'window_status')
 
33
        self.glade = gtk.glade.XML(GLADEFILENAME, 'window_status')
46
34
        
47
35
        # Get the Status window widget
48
36
        self.window = self.glade.get_widget('window_status')
 
37
        
49
38
        self.wt = wt
50
39
        self.wtpath = wtpath
51
40
        
52
41
        # Check if current location is a branch
53
 
        try:
54
 
            branch = wt.branch
55
 
        except errors.NotBranchError:
56
 
            self.notbranch = True
57
 
            return
58
 
        except:
59
 
            raise
60
 
        
61
42
        file_id = self.wt.path2id(wtpath)
62
43
 
63
 
        self.notbranch = False
64
 
        if file_id is None:
65
 
            self.notbranch = True
66
 
            return
67
 
        
68
44
        # Set the old working tree
69
45
        self.old_tree = self.wt.branch.repository.revision_tree(self.wt.branch.last_revision())
70
46
        
134
110
    
135
111
    def display(self):
136
112
        """ Display the Diff window. """
137
 
        if self.notbranch:
138
 
            error_dialog(_('Directory is not a branch'),
139
 
                                     _('You can perform this action only in a branch.'))
140
 
            self.close()
141
 
        else:
142
 
            self.window.show_all()
 
113
        self.window.show_all()
143
114
 
144
115
    def close(self, widget=None):
145
116
        self.window.destroy()