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

  • Committer: Jelmer Vernooij
  • Date: 2008-06-29 18:12:29 UTC
  • mto: This revision was merged to the branch mainline in revision 519.
  • Revision ID: jelmer@samba.org-20080629181229-1l2m4cf7vvbyh8qg
Simplify progress bar code, use embedded progress bar inside viz window.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
import bzrlib.errors as errors
27
27
 
28
 
from olive import gladefile
29
 
from dialog import error_dialog
 
28
from bzrlib.plugins.gtk import _i18n
 
29
from bzrlib.plugins.gtk.dialog import error_dialog
 
30
from guifiles import GLADEFILENAME
 
31
 
30
32
 
31
33
def info(location):
32
34
    """ Get info about branch, working tree, and repository
107
109
 
108
110
    try:
109
111
        branch = a_bzrdir.open_branch()
 
112
        repository = branch.repository
 
113
        control = a_bzrdir
110
114
        branch.lock_read()
111
115
        try:
112
116
            ret['location'] = info_helper.get_location_info(repository, branch)
141
145
 
142
146
class OliveInfo:
143
147
    """ Display Informations window and perform the needed actions. """
144
 
    def __init__(self, wt):
 
148
    def __init__(self, branch):
145
149
        """ Initialize the Informations window. """
146
 
        self.glade = gtk.glade.XML(gladefile, 'window_info', 'olive-gtk')
 
150
        self.glade = gtk.glade.XML(GLADEFILENAME, 'window_info', 'olive-gtk')
147
151
        
148
152
        # Get the Informations window widget
149
153
        self.window = self.glade.get_widget('window_info')
151
155
        # Check if current location is a branch
152
156
        self.notbranch = False
153
157
        try:
154
 
            self.ret = info(wt.basedir)
 
158
            self.ret = info(branch.base)
155
159
        except errors.NotBranchError:
156
160
            self.notbranch = True
157
161
            return
550
554
    def display(self):
551
555
        """ Display the Informations window. """
552
556
        if self.notbranch:
553
 
            error_dialog(_('Directory is not a branch'),
554
 
                         _('You can perform this action only in a branch.'))
 
557
            error_dialog(_i18n('Directory is not a branch'),
 
558
                         _i18n('You can perform this action only in a branch.'))
555
559
            self.close()
556
560
        else:
557
561
            self.window.show()