make closing of group terminals work

This commit is contained in:
Chris Jones 2009-11-04 23:42:54 +00:00
parent 830863d711
commit c60aae8bed
2 changed files with 11 additions and 1 deletions

View File

@ -74,6 +74,12 @@ class Terminator(Borg):
terminal.set_group(None, None)
self.groups = []
def closegroupedterms(self, group):
"""Close all terminals in a group"""
for terminal in self.terminals:
if terminal.group == group:
terminal.close()
def group_hoover(self):
"""Clean out unused groups"""

View File

@ -126,6 +126,10 @@ class Terminal(gtk.VBox):
if self.config['http_proxy'] and self.config['http_proxy'] != '':
os.putenv('http_proxy', self.config['http_proxy'])
def close(self):
"""Close ourselves"""
self.emit('close-term')
def create_terminalbox(self):
"""Create a GtkHBox containing the terminal and a scrollbar"""
@ -315,7 +319,7 @@ class Terminal(gtk.VBox):
item = gtk.MenuItem(_('Close group %s') % self.group)
item.connect('activate', lambda x:
self.terminator.closegroupedterms(self))
self.terminator.closegroupedterms(self.group))
menu.append(item)
menu.append(gtk.MenuItem())