/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: 2006-09-13 20:19:31 UTC
  • mfrom: (0.8.79 main)
  • mto: (0.8.83 merge)
  • mto: This revision was merged to the branch mainline in revision 83.
  • Revision ID: jelmer@samba.org-20060913201931-23adba246d4d6529
Merge main branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
    pygtk.require("2.0")
22
22
except:
23
23
    pass
24
 
 
25
 
import gtk
26
 
import gtk.glade
27
 
import gobject
28
 
import pango
 
24
try:
 
25
    import gtk
 
26
    import gtk.glade
 
27
    import gobject
 
28
    import pango
 
29
except:
 
30
    sys.exit(1)
29
31
 
30
32
import bzrlib.errors as errors
31
33
 
32
 
from olive import gladefile
33
 
 
34
34
def info(location):
35
35
    """ Get info about branch, working tree, and repository
36
36
    
144
144
 
145
145
class OliveInfo:
146
146
    """ Display Informations window and perform the needed actions. """
147
 
    def __init__(self, wt):
 
147
    def __init__(self, gladefile, comm, dialog):
148
148
        """ Initialize the Informations window. """
149
 
        self.glade = gtk.glade.XML(gladefile, 'window_info', 'olive-gtk')
 
149
        self.gladefile = gladefile
 
150
        self.glade = gtk.glade.XML(self.gladefile, 'window_info', 'olive-gtk')
 
151
        
 
152
        # Communication object
 
153
        self.comm = comm
 
154
        # Dialog object
 
155
        self.dialog = dialog
150
156
        
151
157
        # Get the Informations window widget
152
158
        self.window = self.glade.get_widget('window_info')
154
160
        # Check if current location is a branch
155
161
        self.notbranch = False
156
162
        try:
157
 
            self.ret = info(wt.basedir)
 
163
            self.ret = info(self.comm.get_path())
158
164
        except errors.NotBranchError:
159
165
            self.notbranch = True
160
166
            return
553
559
    def display(self):
554
560
        """ Display the Informations window. """
555
561
        if self.notbranch:
556
 
            error_dialog(_('Directory is not a branch'),
 
562
            self.dialog.error_dialog(_('Directory is not a branch'),
557
563
                                     _('You can perform this action only in a branch.'))
558
564
            self.close()
559
565
        else: