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

  • Committer: Jelmer Vernooij
  • Date: 2011-03-23 09:49:44 UTC
  • mfrom: (723.1.1 isearch)
  • Revision ID: jelmer@samba.org-20110323094944-7n5h1vif3xpbze3p
Merge support for interactive substring search in bzr viz and annotate.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# along with this program; if not, write to the Free Software
16
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
17
 
18
 
from gi.repository import Gtk
19
 
 
20
 
class RevisionSelectionBox(Gtk.HBox):
 
18
try:
 
19
    import pygtk
 
20
    pygtk.require("2.0")
 
21
except:
 
22
    pass
 
23
 
 
24
import gtk
 
25
 
 
26
class RevisionSelectionBox(gtk.HBox):
21
27
 
22
28
    def __init__(self, branch):
23
29
        super(RevisionSelectionBox, self).__init__()
24
30
        self._branch = branch
25
 
        self._entry_revid = Gtk.Entry()
26
 
        self._button_revid = Gtk.Button('')
27
 
        self._button_revid.set_image(Gtk.Image.new_from_stock(
28
 
            Gtk.STOCK_OPEN, Gtk.IconSize.BUTTON))
 
31
        self._entry_revid = gtk.Entry()
 
32
        self._button_revid = gtk.Button('')
 
33
        self._button_revid.set_image(gtk.image_new_from_stock(
 
34
            gtk.STOCK_OPEN, gtk.ICON_SIZE_BUTTON))
29
35
        self.pack_start(self._entry_revid, True, True)
30
36
        self.pack_start(self._button_revid, False, False)
31
37
 
39
45
        # JRV 20070715
40
46
        revb = RevisionBrowser(self._branch)
41
47
        response = revb.run()
42
 
        if response != Gtk.ResponseType.NONE:
 
48
        if response != gtk.RESPONSE_NONE:
43
49
            revb.hide()
44
50
 
45
 
            if response == Gtk.ResponseType.OK:
 
51
            if response == gtk.RESPONSE_OK:
46
52
                if revb.selected_revno is not None:
47
53
                    self._entry_revid.set_text(revb.selected_revid)
48
54