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

  • Committer: Daniel Schierbeck
  • Date: 2008-01-13 14:12:49 UTC
  • mto: (423.1.2 trunk)
  • mto: This revision was merged to the branch mainline in revision 429.
  • Revision ID: daniel.schierbeck@gmail.com-20080113141249-gd0i2lknr3yik55r
Moved branch view to its own package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
from dialog import error_dialog
33
33
 
34
34
from history import UrlHistory
 
35
from olive import Preferences
35
36
 
36
37
class CheckoutDialog(gtk.Dialog):
37
38
    """ New implementation of the Checkout dialog. """
38
 
    def __init__(self, path=None, parent=None):
 
39
    def __init__(self, path=None, parent=None, remote_path=None):
39
40
        """ Initialize the Checkout dialog. """
40
41
        gtk.Dialog.__init__(self, title="Checkout - Olive",
41
42
                                  parent=parent,
64
65
        # Set callbacks
65
66
        self._button_checkout.connect('clicked', self._on_checkout_clicked)
66
67
        self._button_revision.connect('clicked', self._on_revision_clicked)
67
 
        self._combo.connect('changed', self._on_combo_changed)
 
68
        self._combo.child.connect('focus-out-event', self._on_combo_changed)
68
69
        
69
70
        # Create the table and pack the widgets into it
70
71
        self._table = gtk.Table(rows=3, columns=2)
92
93
        self.vbox.set_spacing(3)
93
94
        if self.path is not None:
94
95
            self._filechooser.set_filename(self.path)
 
96
        if remote_path is not None:
 
97
            self._combo.child.set_text(remote_path)
95
98
        
96
99
        # Pack some widgets
97
100
        self._hbox_revision.pack_start(self._entry_revision, True, True)
109
112
    def _build_history(self):
110
113
        """ Build up the checkout history. """
111
114
        self._combo_model = gtk.ListStore(str)
 
115
        
112
116
        for item in self._history.get_entries():
113
117
            self._combo_model.append([ item ])
 
118
        
 
119
        pref = Preferences()
 
120
        for item in pref.get_bookmarks():
 
121
            self._combo_model.append([ item ])
 
122
        
114
123
        self._combo.set_model(self._combo_model)
115
124
        self._combo.set_text_column(0)
116
125
    
179
188
        
180
189
        self.response(gtk.RESPONSE_OK)
181
190
    
182
 
    def _on_combo_changed(self, widget):
 
191
    def _on_combo_changed(self, widget, event):
183
192
        """ We try to get the last revision if focus lost. """
184
193
        rev = self._get_last_revno()
185
194
        if rev is None: