/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: Gary van der Merwe
  • Date: 2007-08-10 10:45:06 UTC
  • mto: This revision was merged to the branch mainline in revision 256.
  • Revision ID: garyvdm@gmail.com-20070810104506-wo2mp9zfkh338axe
Make icon locations consistant between source and installed version. Let glade nkow where to find the icons with a project file.

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