Fix various bugs (Stephen Boddy)

This commit is contained in:
Chris Jones 2011-08-20 16:34:05 +01:00
commit ae4a8a65ed
3 changed files with 10 additions and 4 deletions

View File

@ -5,6 +5,7 @@ terminator 0.96:
by regular expression (Roberto Aguilar #709018) by regular expression (Roberto Aguilar #709018)
* Optimise various low level components so they are dramatically * Optimise various low level components so they are dramatically
faster (Stephen Boddy) faster (Stephen Boddy)
* Fix various bugs (Stephen Boddy)
terminator 0.95: terminator 0.95:
* Add a configuration option to enable a DBus server * Add a configuration option to enable a DBus server

View File

@ -10,7 +10,7 @@ import gtk
from borg import Borg from borg import Borg
from config import Config from config import Config
from keybindings import Keybindings from keybindings import Keybindings
from util import dbg, err from util import dbg, err, enumerate_descendants
from factory import Factory from factory import Factory
from cwd import get_pid_cwd from cwd import get_pid_cwd
from version import APP_NAME, APP_VERSION from version import APP_NAME, APP_VERSION
@ -50,7 +50,7 @@ class Terminator(Borg):
self.terminals = [] self.terminals = []
if not self.groups: if not self.groups:
self.groups = [] self.groups = []
if not self.groupsend: if self.groupsend == None:
self.groupsend = self.groupsend_type['group'] self.groupsend = self.groupsend_type['group']
if not self.config: if not self.config:
self.config = Config() self.config = Config()
@ -322,8 +322,13 @@ class Terminator(Borg):
else: else:
numstr = '%d' numstr = '%d'
terminals = []
for window in self.windows:
containers, win_terminals = enumerate_descendants(window)
terminals.extend(win_terminals)
for term in self.get_target_terms(widget): for term in self.get_target_terms(widget):
idx = self.terminals.index(term) idx = terminals.index(term)
term.feed(numstr % (idx + 1)) term.feed(numstr % (idx + 1))
def get_target_terms(self, widget): def get_target_terms(self, widget):

View File

@ -264,7 +264,7 @@ def enumerate_descendants(parent):
terminals.append(descendant) terminals.append(descendant)
while len(containerstmp) > 0: while len(containerstmp) > 0:
child = containerstmp.pop() child = containerstmp.pop(0)
for descendant in child.get_children(): for descendant in child.get_children():
if maker.isinstance(descendant, 'Container'): if maker.isinstance(descendant, 'Container'):
containerstmp.append(descendant) containerstmp.append(descendant)