improve debugging and ensure that we can't register terminals/windows multiple times
This commit is contained in:
parent
39098fdefb
commit
aa531014ef
|
@ -46,6 +46,7 @@ class Terminator(Borg):
|
||||||
|
|
||||||
def register_window(self, window):
|
def register_window(self, window):
|
||||||
"""Register a new window widget"""
|
"""Register a new window widget"""
|
||||||
|
if window not in self.windows:
|
||||||
dbg('Terminator::register_window: registering %s' % window)
|
dbg('Terminator::register_window: registering %s' % window)
|
||||||
self.windows.append(window)
|
self.windows.append(window)
|
||||||
|
|
||||||
|
@ -56,6 +57,7 @@ class Terminator(Borg):
|
||||||
|
|
||||||
def register_terminal(self, terminal):
|
def register_terminal(self, terminal):
|
||||||
"""Register a new terminal widget"""
|
"""Register a new terminal widget"""
|
||||||
|
if terminal not in self.terminals:
|
||||||
dbg('Terminator::register_terminal: registering %s' % terminal)
|
dbg('Terminator::register_terminal: registering %s' % terminal)
|
||||||
self.terminals.append(terminal)
|
self.terminals.append(terminal)
|
||||||
terminal.connect('ungroup-all', self.ungroup_all)
|
terminal.connect('ungroup-all', self.ungroup_all)
|
||||||
|
@ -69,6 +71,9 @@ class Terminator(Borg):
|
||||||
if len(self.terminals) == 0:
|
if len(self.terminals) == 0:
|
||||||
for window in self.windows:
|
for window in self.windows:
|
||||||
window.destroy()
|
window.destroy()
|
||||||
|
else:
|
||||||
|
dbg('Terminator::deregister_terminal: %d terminals remain' %
|
||||||
|
len(self.terminals))
|
||||||
|
|
||||||
def reconfigure_terminals(self):
|
def reconfigure_terminals(self):
|
||||||
"""Tell all terminals to update their configuration"""
|
"""Tell all terminals to update their configuration"""
|
||||||
|
|
Loading…
Reference in New Issue