Collection of changes that don't add/remove anything, but needed for next checkin to work

This commit is contained in:
Stephen Boddy 2012-06-24 20:36:39 +02:00
parent 11eb98f2e3
commit b85f7c402c
3 changed files with 24 additions and 10 deletions

View File

@ -107,6 +107,7 @@ class Terminal(gtk.VBox):
composite_support = None composite_support = None
cnxids = None cnxids = None
targets_for_new_group = None
def __init__(self): def __init__(self):
"""Class initialiser""" """Class initialiser"""
@ -119,6 +120,7 @@ class Terminal(gtk.VBox):
# FIXME: Surely these should happen in Terminator::register_terminal()? # FIXME: Surely these should happen in Terminator::register_terminal()?
self.connect('enumerate', self.terminator.do_enumerate) self.connect('enumerate', self.terminator.do_enumerate)
self.connect('focus-in', self.terminator.focus_changed) self.connect('focus-in', self.terminator.focus_changed)
self.connect('focus-out', self.terminator.focus_left)
self.matches = {} self.matches = {}
self.cnxids = Signalman() self.cnxids = Signalman()

View File

@ -349,19 +349,21 @@ class Terminator(Borg):
idx = terminals.index(term) idx = terminals.index(term)
term.feed(numstr % (idx + 1)) term.feed(numstr % (idx + 1))
def get_sibling_terms(self, widget):
termset = []
for term in self.terminals:
if term.group == widget.group:
termset.append(term)
return(termset)
def get_target_terms(self, widget): def get_target_terms(self, widget):
"""Get the terminals we should currently be broadcasting to""" """Get the terminals we should currently be broadcasting to"""
if self.groupsend == self.groupsend_type['all']: if self.groupsend == self.groupsend_type['all']:
return(self.terminals) return(self.terminals)
elif self.groupsend == self.groupsend_type['group']: elif self.groupsend == self.groupsend_type['group']:
termset = [] if widget.group != None:
for term in self.terminals: return(self.get_sibling_terms(widget))
if term == widget or (term.group != None and term.group == return([widget])
widget.group):
termset.append(term)
return(termset)
else:
return([widget])
def get_focussed_terminal(self): def get_focussed_terminal(self):
"""iterate over all the terminals to find which, if any, has focus""" """iterate over all the terminals to find which, if any, has focus"""
@ -376,6 +378,9 @@ class Terminator(Borg):
terminal.titlebar.update(widget) terminal.titlebar.update(widget)
return return
def focus_left(self, widget):
self.last_focused_term=widget
def describe_layout(self): def describe_layout(self):
"""Describe our current layout""" """Describe our current layout"""
layout = {} layout = {}

View File

@ -93,7 +93,7 @@ class Titlebar(gtk.EventBox):
def connect_icon(self, func): def connect_icon(self, func):
"""Connect the supplied function to clicking on the group icon""" """Connect the supplied function to clicking on the group icon"""
self.ebox.connect('button-release-event', func) self.ebox.connect('button-press-event', func)
def update(self, other=None): def update(self, other=None):
"""Update our contents""" """Update our contents"""
@ -252,7 +252,14 @@ class Titlebar(gtk.EventBox):
groupname = self.groupentry.get_text() groupname = self.groupentry.get_text()
dbg('Titlebar::groupentry_activate: creating group: %s' % groupname) dbg('Titlebar::groupentry_activate: creating group: %s' % groupname)
self.groupentry_cancel(None, None) self.groupentry_cancel(None, None)
self.emit('create-group', groupname) last_focused_term=self.terminator.last_focused_term
if self.terminal.targets_for_new_group:
[term.titlebar.emit('create-group', groupname) for term in self.terminal.targets_for_new_group]
self.terminal.targets_for_new_group = None
else:
self.emit('create-group', groupname)
last_focused_term.grab_focus()
self.terminator.focus_changed(last_focused_term)
def groupentry_keypress(self, widget, event): def groupentry_keypress(self, widget, event):
"""Handle keypresses on the entry widget""" """Handle keypresses on the entry widget"""