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

  • Committer: Jelmer Vernooij
  • Date: 2006-09-30 10:21:43 UTC
  • Revision ID: jelmer@samba.org-20060930102143-c0ef64d6ca860c21
Merge some files from Olive and bzr-gtk.

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
 
try:
25
 
    import gtk
26
 
    import gtk.glade
27
 
except:
28
 
    sys.exit(1)
 
24
 
 
25
import gtk
 
26
import gtk.glade
29
27
 
30
28
import bzrlib.errors as errors
31
29
 
 
30
from olive import gladefile
 
31
 
32
32
class OliveCheckout:
33
33
    """ Display checkout dialog and perform the needed operations. """
34
 
    def __init__(self, gladefile, comm):
 
34
    def __init__(self, path=None):
35
35
        """ Initialize the Checkout dialog. """
36
 
        self.gladefile = gladefile
37
 
        self.glade = gtk.glade.XML(self.gladefile, 'window_checkout', 'olive-gtk')
38
 
        
39
 
        # Communication object
40
 
        self.comm = comm
 
36
        self.glade = gtk.glade.XML(gladefile, 'window_checkout', 'olive-gtk')
41
37
        
42
38
        self.window = self.glade.get_widget('window_checkout')
43
39
        
50
46
        
51
47
        # Save FileChooser state
52
48
        self.filechooser = self.glade.get_widget('filechooserbutton_checkout')
53
 
        self.filechooser.set_filename(self.comm.get_path())
 
49
        if path is not None:
 
50
            self.filechooser.set_filename(path)
54
51
 
55
52
    def display(self):
56
53
        """ Display the Checkout dialog. """
73
70
        checkbutton_lightweight = self.glade.get_widget('checkbutton_checkout_lightweight')
74
71
        lightweight = checkbutton_lightweight.get_active()
75
72
        
76
 
        self.comm.set_busy(self.window)
77
73
        try:
78
74
            source = Branch.open(location)
79
75
            
114
110
        except errors.NotBranchError, errmsg:
115
111
            error_dialog(_('Location is not a branch'),
116
112
                                     _('The specified location has to be a branch.'))
117
 
            self.comm.set_busy(self.window, False)
118
113
            return
119
114
        except errors.TargetAlreadyExists, errmsg:
120
115
            error_dialog(_('Target already exists'),
121
116
                                     _('Target directory (%s)\nalready exists. Please select another target.') % errmsg)
122
 
            self.comm.set_busy(self.window, False)
123
117
            return
124
118
        except errors.NonExistingParent, errmsg:
125
119
            error_dialog(_('Non existing parent directory'),
126
120
                                     _("The parent directory (%s)\ndoesn't exist.") % errmsg)
127
 
            self.comm.set_busy(self.window, False)
128
121
            return
129
 
        except:
130
 
            raise
131
122
        
132
123
        self.close()
133
124
        self.comm.refresh_right()