From 02c1a482df0ed5904f7fa5ba3d3d4d7efcf754f7 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Wed, 13 Jan 2010 23:02:17 +0000 Subject: [PATCH] Add a get_profile() to Config and use it in Terminal::set_profile() to make sure we don't set a profile that already is --- terminatorlib/config.py | 4 ++++ terminatorlib/terminal.py | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/terminatorlib/config.py b/terminatorlib/config.py index 14adcb85..099cd981 100755 --- a/terminatorlib/config.py +++ b/terminatorlib/config.py @@ -204,6 +204,10 @@ class Config(object): """Set a particular configuration item""" return(self.base.set_item(key, value, self.profile)) + def get_profile(self): + """Get our profile""" + return(self.profile) + def set_profile(self, profile): """Set our profile (which usually means change it)""" dbg('Config::set_profile: Changing profile to %s' % profile) diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index ee27ebf1..f9420cc6 100755 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -142,8 +142,9 @@ class Terminal(gtk.VBox): def set_profile(self, widget, profile): """Set our profile""" - self.config.set_profile(profile) - self.reconfigure() + if profile != self.config.get_profile(): + self.config.set_profile(profile) + self.reconfigure() def get_profile(self): """Return our profile name"""