/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: 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:
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):
21
 
 
 
18
try:
 
19
    import pygtk
 
20
    pygtk.require("2.0")
 
21
except:
 
22
    pass
 
23
 
 
24
import gtk
 
25
 
 
26
class RevisionSelectionBox(gtk.HBox):
22
27
    def __init__(self, branch):
23
28
        super(RevisionSelectionBox, self).__init__()
24
29
        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))
 
30
        self._entry_revid = gtk.Entry()
 
31
        self._button_revid = gtk.Button('')
 
32
        self._button_revid.set_image(gtk.image_new_from_stock(
 
33
            gtk.STOCK_OPEN, gtk.ICON_SIZE_BUTTON))
29
34
        self.pack_start(self._entry_revid, True, True)
30
 
        self.pack_start(self._button_revid, False, False)
 
35
        self.pack_start(self._button_revid, False, False) 
31
36
 
32
37
        self._button_revid.connect('clicked', self._on_revid_clicked)
33
38
 
34
39
    def _on_revid_clicked(self, widget):
35
40
        """ Browse for revision button clicked handler. """
36
41
        from revbrowser import RevisionBrowser
37
 
 
 
42
        
38
43
        # FIXME: Should specific parent window here - how to get to it?
39
44
        # JRV 20070715
40
45
        revb = RevisionBrowser(self._branch)
41
46
        response = revb.run()
42
 
        if response != Gtk.ResponseType.NONE:
 
47
        if response != gtk.RESPONSE_NONE:
43
48
            revb.hide()
44
 
 
45
 
            if response == Gtk.ResponseType.OK:
 
49
        
 
50
            if response == gtk.RESPONSE_OK:
46
51
                if revb.selected_revno is not None:
47
52
                    self._entry_revid.set_text(revb.selected_revid)
48
 
 
 
53
            
49
54
            revb.destroy()
50
55
 
51
56
    def get_revision_id(self):