improve debugging and ensure that we can't register terminals/windows multiple times

This commit is contained in:
Chris Jones 2009-11-20 09:30:28 -06:00
parent 39098fdefb
commit aa531014ef
1 changed files with 11 additions and 6 deletions

View File

@ -46,6 +46,7 @@ class Terminator(Borg):
def register_window(self, window):
"""Register a new window widget"""
if window not in self.windows:
dbg('Terminator::register_window: registering %s' % window)
self.windows.append(window)
@ -56,6 +57,7 @@ class Terminator(Borg):
def register_terminal(self, terminal):
"""Register a new terminal widget"""
if terminal not in self.terminals:
dbg('Terminator::register_terminal: registering %s' % terminal)
self.terminals.append(terminal)
terminal.connect('ungroup-all', self.ungroup_all)
@ -69,6 +71,9 @@ class Terminator(Borg):
if len(self.terminals) == 0:
for window in self.windows:
window.destroy()
else:
dbg('Terminator::deregister_terminal: %d terminals remain' %
len(self.terminals))
def reconfigure_terminals(self):
"""Tell all terminals to update their configuration"""