/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: Szilveszter Farkas (Phanatic)
  • Date: 2006-09-30 11:01:59 UTC
  • mto: (0.14.3 main)
  • mto: This revision was merged to the branch mainline in revision 86.
  • Revision ID: Szilveszter.Farkas@gmail.com-20060930110159-d1d716766985f3dd
Fix Move, Rename and glade file.

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
 
17
19
try:
18
20
    import pygtk
19
21
    pygtk.require("2.0")
22
24
 
23
25
import gtk
24
26
import gtk.glade
 
27
import gobject
 
28
import pango
25
29
 
26
30
import bzrlib.errors as errors
27
31
 
28
 
from bzrlib.plugins.gtk import _i18n
29
 
from bzrlib.plugins.gtk.dialog import error_dialog
30
 
from guifiles import GLADEFILENAME
31
 
 
 
32
from olive import gladefile
32
33
 
33
34
def info(location):
34
35
    """ Get info about branch, working tree, and repository
80
81
    try:
81
82
        a_bzrdir = bzrdir.BzrDir.open_containing(location)[0]
82
83
    except errors.NotBranchError:
83
 
        raise errors.NotBranchError(location)
 
84
        raise NotBranchError(location)
84
85
 
85
86
    try:
86
87
        working = a_bzrdir.open_workingtree()
109
110
 
110
111
    try:
111
112
        branch = a_bzrdir.open_branch()
112
 
        repository = branch.repository
113
 
        control = a_bzrdir
114
113
        branch.lock_read()
115
114
        try:
116
115
            ret['location'] = info_helper.get_location_info(repository, branch)
145
144
 
146
145
class OliveInfo:
147
146
    """ Display Informations window and perform the needed actions. """
148
 
    def __init__(self, branch):
 
147
    def __init__(self, wt):
149
148
        """ Initialize the Informations window. """
150
 
        self.glade = gtk.glade.XML(GLADEFILENAME, 'window_info', 'olive-gtk')
 
149
        self.glade = gtk.glade.XML(gladefile, 'window_info', 'olive-gtk')
151
150
        
152
151
        # Get the Informations window widget
153
152
        self.window = self.glade.get_widget('window_info')
155
154
        # Check if current location is a branch
156
155
        self.notbranch = False
157
156
        try:
158
 
            self.ret = info(branch.base)
 
157
            self.ret = info(wt.basedir)
159
158
        except errors.NotBranchError:
160
159
            self.notbranch = True
161
160
            return
554
553
    def display(self):
555
554
        """ Display the Informations window. """
556
555
        if self.notbranch:
557
 
            error_dialog(_i18n('Directory is not a branch'),
558
 
                         _i18n('You can perform this action only in a branch.'))
 
556
            error_dialog(_('Directory is not a branch'),
 
557
                                     _('You can perform this action only in a branch.'))
559
558
            self.close()
560
559
        else:
561
560
            self.window.show()