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

  • Committer: Jelmer Vernooij
  • Date: 2007-03-09 17:47:28 UTC
  • Revision ID: jelmer@samba.org-20070309174728-gljlmt9b7fu0rrn9
Add simple test for tortoise_bzr

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
from dialog import error_dialog, info_dialog
34
34
 
35
35
from history import UrlHistory
36
 
from olive import Preferences
37
36
 
38
37
class BranchDialog(gtk.Dialog):
39
38
    """ New implementation of the Branch dialog. """
40
 
    def __init__(self, path=None, parent=None, remote_path=None):
 
39
    def __init__(self, path=None, parent=None):
41
40
        """ Initialize the Branch dialog. """
42
41
        gtk.Dialog.__init__(self, title="Branch - Olive",
43
42
                                  parent=parent,
64
63
        # Set callbacks
65
64
        self._button_branch.connect('clicked', self._on_branch_clicked)
66
65
        self._button_revision.connect('clicked', self._on_revision_clicked)
67
 
        self._combo.child.connect('focus-out-event', self._on_combo_changed)
 
66
        self._combo.connect('changed', self._on_combo_changed)
68
67
        
69
68
        # Create the table and pack the widgets into it
70
69
        self._table = gtk.Table(rows=3, columns=2)
91
90
        self.vbox.set_spacing(3)
92
91
        if self.path is not None:
93
92
            self._filechooser.set_filename(self.path)
94
 
        if remote_path is not None:
95
 
            self._combo.child.set_text(remote_path)
96
93
        
97
94
        # Pack some widgets
98
95
        self._hbox_revision.pack_start(self._entry_revision, True, True)
110
107
    def _build_history(self):
111
108
        """ Build up the branch history. """
112
109
        self._combo_model = gtk.ListStore(str)
113
 
        
114
110
        for item in self._history.get_entries():
115
111
            self._combo_model.append([ item ])
116
 
        
117
 
        pref = Preferences()
118
 
        for item in pref.get_bookmarks():
119
 
            self._combo_model.append([ item ])
120
 
        
121
112
        self._combo.set_model(self._combo_model)
122
113
        self._combo.set_text_column(0)
123
114
    
206
197
        
207
198
        self.response(gtk.RESPONSE_OK)
208
199
    
209
 
    def _on_combo_changed(self, widget, event):
 
200
    def _on_combo_changed(self, widget):
210
201
        """ We try to get the last revision if focus lost. """
211
202
        rev = self._get_last_revno()
212
203
        if rev is None: