From be413d3622e6950bc5f58d3560eb6e2b384d88f1 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Sun, 10 Jan 2010 17:17:31 +0000 Subject: [PATCH] Track a couple of pre-existing connection IDs in Terminal.cnxid --- terminatorlib/terminal.py | 15 ++++++--------- terminatorlib/window.py | 2 +- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index 6905c1ae..cc102f5f 100755 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -79,9 +79,6 @@ class Terminal(gtk.VBox): composite_support = None cnxids = None - # FIXME: These two are old and should be updated to use cnxids[] - confcnxid = None - zoomcnxid = None def __init__(self): """Class initialiser""" @@ -290,7 +287,7 @@ for %s (%s)' % (name, urlplugin.__class__.__name__)) self.vte.connect('enter_notify_event', self.on_vte_notify_enter) - self.confcnxid = self.vte.connect_after('realize', self.reconfigure) + self.cnxids['conf'] = self.vte.connect_after('realize', self.reconfigure) def create_popup_group_menu(self, widget, event = None): """Pop up a menu for the group widget""" @@ -465,9 +462,9 @@ for %s (%s)' % (name, urlplugin.__class__.__name__)) def reconfigure(self, widget=None): """Reconfigure our settings""" dbg('Terminal::reconfigure') - if self.confcnxid: - self.vte.disconnect(self.confcnxid) - self.confcnxid = None + if self.cnxids.has_key('conf'): + self.vte.disconnect(self.cnxids['conf']) + self.cnxids.remove('conf') # FIXME: actually reconfigure our settings pass @@ -772,8 +769,8 @@ for %s (%s)' % (name, urlplugin.__class__.__name__)) def zoom_scale(self, widget, allocation, old_data): """Scale our font correctly based on how big we are not vs before""" - self.disconnect(self.zoomcnxid) - self.zoomcnxid = None + self.disconnect(self.cnxids['zoom']) + self.cnxids.remove('zoom') new_columns = self.vte.get_column_count() new_rows = self.vte.get_row_count() diff --git a/terminatorlib/window.py b/terminatorlib/window.py index 431a5a36..55e7a6f1 100755 --- a/terminatorlib/window.py +++ b/terminatorlib/window.py @@ -275,7 +275,7 @@ class Window(Container, gtk.Window): self.set_property('term_zoomed', True) if font_scale: - widget.zoomcnxid = widget.connect('size-allocate', + widget.cnxids['zoom'] = widget.connect('size-allocate', widget.zoom_scale, self.zoom_data) widget.grab_focus()