Implement urgent bell handler

This commit is contained in:
Chris Jones 2010-01-21 00:13:56 +00:00
parent 29d0414a04
commit e2db10fc09
2 changed files with 12 additions and 5 deletions

View File

@ -566,11 +566,12 @@ for %s (%s)' % (name, urlplugin.__class__.__name__))
else: else:
self.vte.set_audible_bell(self.config['audible_bell']) self.vte.set_audible_bell(self.config['audible_bell'])
self.vte.set_visible_bell(self.config['visible_bell']) self.vte.set_visible_bell(self.config['visible_bell'])
if self.config['urgent_bell'] == True:
# FIXME: Hook up a signal handler here
pass
else:
self.cnxids.remove_signal(self.vte, 'urgent_bell') self.cnxids.remove_signal(self.vte, 'urgent_bell')
if self.config['urgent_bell'] == True:
try:
self.cnxids.new(self.vte, 'beep', self.on_beep)
except TypeError:
err('beep signal unavailable with this version of VTE')
self.vte.set_scrollback_lines(self.config['scrollback_lines']) self.vte.set_scrollback_lines(self.config['scrollback_lines'])
self.vte.set_scroll_on_keystroke(self.config['scroll_on_keystroke']) self.vte.set_scroll_on_keystroke(self.config['scroll_on_keystroke'])
@ -1097,6 +1098,11 @@ for %s (%s)' % (name, urlplugin.__class__.__name__))
"""Return the column/rows of the terminal""" """Return the column/rows of the terminal"""
return((self.vte.get_column_count(), self.vte.get_row_count())) return((self.vte.get_column_count(), self.vte.get_row_count()))
def on_beep(self, widget):
"""Set the urgency hint for our window"""
window = util.get_top_window(self)
window.set_urgency_hint(True)
# There now begins a great list of keyboard event handlers # There now begins a great list of keyboard event handlers
# FIXME: Probably a bunch of these are wrong. TEST! # FIXME: Probably a bunch of these are wrong. TEST!
def key_zoom_in(self): def key_zoom_in(self):

View File

@ -132,7 +132,8 @@ class Window(Container, gtk.Window):
def on_key_press(self, window, event): def on_key_press(self, window, event):
"""Handle a keyboard event""" """Handle a keyboard event"""
maker = Factory() maker = Factory()
# FIXME: We probably want to cancel window urgency here
self.set_urgency_hint(False)
mapping = self.terminator.keybindings.lookup(event) mapping = self.terminator.keybindings.lookup(event)