From 038e4956109cd4893132cd70efec844f2af2c402 Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Mon, 22 Oct 2012 14:25:37 +0200 Subject: [PATCH] Don't overwrite existing groups --- terminatorlib/titlebar.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/terminatorlib/titlebar.py b/terminatorlib/titlebar.py index 9150f9b0..c8bf192f 100755 --- a/terminatorlib/titlebar.py +++ b/terminatorlib/titlebar.py @@ -234,15 +234,18 @@ class Titlebar(gtk.EventBox): def create_group(self): """Create a new group""" - defaultgroups=set(['Alpha','Beta','Gamma','Delta','Epsilon','Zeta','Eta', - 'Theta','Iota','Kappa','Lambda','Mu','Nu','Xi', - 'Omnicron','Pi','Rho','Sigma','Tau','Upsilon','Phi', - 'Chi','Psi','Omega']) - currentgroups=set(self.terminator.groups) - freegroups = list(defaultgroups-currentgroups) - random.shuffle(freegroups) - if self.groupentry.get_text()=='' and freegroups: - self.groupentry.set_text(freegroups.pop()) + if self.terminal.group: + self.groupentry.set_text(self.terminal.group) + else: + defaultgroups=set(['Alpha','Beta','Gamma','Delta','Epsilon','Zeta','Eta', + 'Theta','Iota','Kappa','Lambda','Mu','Nu','Xi', + 'Omnicron','Pi','Rho','Sigma','Tau','Upsilon','Phi', + 'Chi','Psi','Omega']) + currentgroups=set(self.terminator.groups) + freegroups = list(defaultgroups-currentgroups) + random.shuffle(freegroups) + if self.groupentry.get_text()=='' and freegroups: + self.groupentry.set_text(freegroups.pop()) self.groupentry.show() self.groupentry.grab_focus() self.update_visibility()