/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 annotate/gannotate.py

  • Committer: John Arbash Meinel
  • Date: 2007-10-30 20:36:16 UTC
  • mfrom: (322.1.1 trunk)
  • mto: (330.3.3 trunk)
  • mto: This revision was merged to the branch mainline in revision 368.
  • Revision ID: john@arbash-meinel.com-20071030203616-op14zvvmflw6ds1n
Merge in Jelmer's trunk update + conflict resolution.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
from colormap import AnnotateColorMap, AnnotateColorSaturation
31
31
from bzrlib.plugins.gtk.logview import LogView
 
32
from bzrlib.plugins.gtk.window import Window
32
33
 
33
34
 
34
35
(
41
42
) = range(6)
42
43
 
43
44
 
44
 
class GAnnotateWindow(gtk.Window):
 
45
class GAnnotateWindow(Window):
45
46
    """Annotate window."""
46
47
 
47
48
    def __init__(self, all=False, plain=False, parent=None):
48
49
        self.all = all
49
50
        self.plain = plain
50
 
        self._parent = parent
51
51
        
52
 
        gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
53
 
 
54
 
        self.connect("key-press-event", self._on_key_pressed)
 
52
        Window.__init__(self, parent)
55
53
        
56
54
        self.set_icon(self.render_icon(gtk.STOCK_FIND, gtk.ICON_SIZE_BUTTON))
57
55
        self.annotate_colormap = AnnotateColorSaturation()
395
393
            if i + n >= row:
396
394
                return j - i
397
395
 
398
 
    def _on_key_pressed(self, widget, event):
399
 
        """ Key press event handler. """
400
 
        keyname = gtk.gdk.keyval_name(event.keyval)
401
 
        func = getattr(self, '_on_key_press_' + keyname, None)
402
 
        if func:
403
 
            return func(event)
404
 
 
405
 
    def _on_key_press_w(self, event):
406
 
        if event.state & gtk.gdk.CONTROL_MASK:
407
 
            self.destroy()
408
 
            if self._parent is None:
409
 
                gtk.main_quit()
410
 
 
411
 
    def _on_key_press_q(self, event):
412
 
        if event.state & gtk.gdk.CONTROL_MASK:
413
 
            gtk.main_quit()
414
 
    
415
 
 
416
 
 
417
396
 
418
397
class FakeRevision:
419
398
    """ A fake revision.