default to an icon based terminal bell indication, and add such an icon from Tango.

This commit is contained in:
Chris Jones 2010-02-11 13:05:12 +00:00
parent 07a142c6a0
commit b3eaa85cc9
5 changed files with 26 additions and 4 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 863 B

View File

@ -175,6 +175,8 @@ setup(name=APP_NAME.capitalize(),
('share/icons/hicolor/32x32/apps', glob.glob('data/icons/32x32/apps/*.png')),
('share/icons/hicolor/48x48/apps', glob.glob('data/icons/48x48/apps/*.png')),
('share/icons/hicolor/16x16/actions', glob.glob('data/icons/16x16/actions/*.png')),
('share/icons/hicolor/16x16/status',
glob.glob('data/icons/16x16/status/*.png')),
],
packages=['terminatorlib', 'terminatorlib.configobj',
'terminatorlib.plugins'],

View File

@ -151,8 +151,9 @@ DEFAULTS = {
'default': {
'allow_bold' : True,
'audible_bell' : False,
'visible_bell' : True,
'visible_bell' : False,
'urgent_bell' : False,
'icon_bell' : True,
'background_color' : '#000000000000',
'background_darkness' : 0.5,
'background_type' : 'solid',

View File

@ -632,7 +632,8 @@ for %s (%s)' % (name, urlplugin.__class__.__name__))
self.vte.set_audible_bell(self.config['audible_bell'])
self.vte.set_visible_bell(self.config['visible_bell'])
self.cnxids.remove_signal(self.vte, 'beep')
if self.config['urgent_bell'] == True:
if self.config['urgent_bell'] == True or \
self.config['icon_bell'] == True:
try:
self.cnxids.new(self.vte, 'beep', self.on_beep)
except TypeError:
@ -1181,8 +1182,11 @@ for %s (%s)' % (name, urlplugin.__class__.__name__))
def on_beep(self, widget):
"""Set the urgency hint for our window"""
window = util.get_top_window(self)
window.set_urgency_hint(True)
if self.config['urgent_bell'] == True:
window = util.get_top_window(self)
window.set_urgency_hint(True)
if self.config['icon_bell'] == True:
self.titlebar.icon_bell()
def describe_layout(self, count, parent, global_layout):
"""Describe our layout"""

View File

@ -27,6 +27,7 @@ class Titlebar(gtk.EventBox):
groupicon = None
grouplabel = None
groupentry = None
bellicon = None
__gsignals__ = {
'clicked': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()),
@ -50,6 +51,8 @@ class Titlebar(gtk.EventBox):
grouphbox = gtk.HBox()
self.grouplabel = gtk.Label()
self.groupicon = gtk.Image()
self.bellicon = gtk.Image()
self.bellicon.set_no_show_all(True)
self.groupentry = gtk.Entry()
self.groupentry.set_no_show_all(True)
@ -74,10 +77,12 @@ class Titlebar(gtk.EventBox):
self.ebox.add(grouphbox)
self.ebox.show_all()
self.bellicon.set_from_icon_name('terminal-bell', gtk.ICON_SIZE_MENU)
hbox = gtk.HBox()
hbox.pack_start(self.ebox, False, True, 0)
hbox.pack_start(gtk.VSeparator(), False, True, 0)
hbox.pack_start(self.label, True, True)
hbox.pack_end(self.bellicon, False, False, 2)
self.add(hbox)
hbox.show_all()
@ -218,4 +223,14 @@ class Titlebar(gtk.EventBox):
if key == 'Escape':
self.groupentry_cancel(None, None)
def icon_bell(self):
"""A bell signal requires we display our bell icon"""
self.bellicon.show()
gobject.timeout_add(1000, self.icon_bell_hide)
def icon_bell_hide(self):
"""Handle a timeout which means we now hide the bell icon"""
self.bellicon.hide()
return(False)
gobject.type_register(Titlebar)