From c60aae8bedce94a1e50a14e3553e29e30681b6c3 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Wed, 4 Nov 2009 23:42:54 +0000 Subject: [PATCH] make closing of group terminals work --- terminatorlib/newterminator.py | 6 ++++++ terminatorlib/terminal.py | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/terminatorlib/newterminator.py b/terminatorlib/newterminator.py index 74d46c3a..cf6be427 100755 --- a/terminatorlib/newterminator.py +++ b/terminatorlib/newterminator.py @@ -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""" diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index 41b1887a..f0ba5184 100755 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -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())