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

View File

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

View File

@ -93,7 +93,7 @@ class Titlebar(gtk.EventBox):
def connect_icon(self, func):
"""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):
"""Update our contents"""
@ -252,7 +252,14 @@ class Titlebar(gtk.EventBox):
groupname = self.groupentry.get_text()
dbg('Titlebar::groupentry_activate: creating group: %s' % groupname)
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):
"""Handle keypresses on the entry widget"""