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

  • Committer: David Planella
  • Date: 2010-08-21 09:32:13 UTC
  • mto: This revision was merged to the branch mainline in revision 719.
  • Revision ID: david.planella@ubuntu.com-20100821093213-njpqd5sploa8n71m
Adapted desktop entries for translation

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
from bzrlib.config import GlobalConfig
25
25
import gtk
26
26
from history import UrlHistory
27
 
from olive import Preferences
28
27
import gobject
29
28
 
30
29
class BranchSelectionBox(gtk.HBox):
31
30
    def __init__(self, path=None):
32
 
        super(BranchSelectionBox, self).__init__()
 
31
        gobject.GObject.__init__(self)
33
32
        self._combo = gtk.ComboBoxEntry()
34
33
        self._combo.child.connect('focus-out-event', self._on_combo_changed)
35
34
        
39
38
 
40
39
        self.add(self._combo)
41
40
 
42
 
        gobject.signal_new('branch-changed', BranchSelectionBox, 
43
 
                           gobject.SIGNAL_RUN_LAST,
44
 
                           gobject.TYPE_NONE, (gobject.TYPE_OBJECT,))
45
 
 
46
41
        if path is not None:
47
42
            self.set_url(path)
48
43
 
62
57
        for item in self._history.get_entries():
63
58
            self._combo_model.append([ item ])
64
59
        
65
 
        pref = Preferences()
66
 
        for item in pref.get_bookmarks():
67
 
            self._combo_model.append([ item ])
68
 
        
69
60
        self._combo.set_model(self._combo_model)
70
61
        self._combo.set_text_column(0)
71
62
 
72
63
    def _on_combo_changed(self, widget, event):
73
64
        self.emit('branch-changed', widget)
74
 
    
 
65
 
 
66
gobject.signal_new('branch-changed', BranchSelectionBox, 
 
67
                   gobject.SIGNAL_RUN_LAST,
 
68
                   gobject.TYPE_NONE, (gobject.TYPE_OBJECT,))
 
69
gobject.type_register(BranchSelectionBox)