From dee393cd70a1bcb33ce7d14ff90b35cd6d86c7bc Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Thu, 11 Dec 2008 08:07:28 +0000 Subject: [PATCH] suggestion from Kees Cook - a menu option to instantly group all terminals --- terminatorlib/terminatorterm.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/terminatorlib/terminatorterm.py b/terminatorlib/terminatorterm.py index bebb6e90..95082e2f 100755 --- a/terminatorlib/terminatorterm.py +++ b/terminatorlib/terminatorterm.py @@ -1015,6 +1015,8 @@ text/plain submenu = gtk.Menu () item.set_submenu (submenu) self.populate_grouping_menu (submenu) + if len (self.terminator.term_list) == 1: + item.set_sensitive (False) item = gtk.MenuItem () menu.append (item) @@ -1051,6 +1053,13 @@ text/plain item.connect ("activate", self.create_group) widget.append (item) + item = gtk.MenuItem () + widget.append (item) + + item = gtk.MenuItem (_("_Group all")) + item.connect ("activate", self.group_all) + widget.append (item) + def create_group (self, item): win = gtk.Window () vbox = gtk.VBox () @@ -1101,13 +1110,21 @@ text/plain self._group = data else: # We were previously in a group + self._group = data if data == None: # We have been removed from a group - self._group = data if not self.conf.titlebars and not self._want_titlebar: self._titlebox.hide () self.terminator.group_hoover () + def group_all (self, widget): + allname = _("All") + if not allname in self.terminator.groupings: + self.terminator.groupings.append (allname) + for term in self.terminator.term_list: + term.set_group (None, allname) + self.terminator.group_hoover () + def on_encoding_change (self, widget, encoding): current = self._vte.get_encoding () if current != encoding: