From e01d69346fdd9617a2e30c3bacd7b93287669c8a Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Wed, 12 Nov 2008 11:36:18 +0000 Subject: [PATCH] Demonstrate how we can change a global property without a restart --- terminatorlib/prefs_profile.py | 8 +++++++- terminatorlib/terminator.py | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/terminatorlib/prefs_profile.py b/terminatorlib/prefs_profile.py index b8c910d7..66eae2c8 100644 --- a/terminatorlib/prefs_profile.py +++ b/terminatorlib/prefs_profile.py @@ -245,11 +245,12 @@ class ProfileEditor: value = ':'.join (valuebits) else: value = None - err("skipping unknown thingy: %s" % property) + err("skipping unknown property: %s" % property) values[property] = value has_changed = False + changed = [] for source in self.term.conf.sources: if isinstance (source, TerminatorConfValuestoreRC): for property in values: @@ -258,9 +259,14 @@ class ProfileEditor: print "%s changed from %s to %s" % (property, self.source_get_value(property), values[property]) source.values[property] = values[property] has_changed = True + changed.append(property) except KeyError: pass if has_changed: + for changer in changed: + if changer == "fullscreen": + self.term.fullscreen_absolute(values[changer]) + self.term.reconfigure_vtes() def cancel (self, data): diff --git a/terminatorlib/terminator.py b/terminatorlib/terminator.py index 64927d86..dec6a4fe 100755 --- a/terminatorlib/terminator.py +++ b/terminatorlib/terminator.py @@ -315,6 +315,12 @@ class Terminator: else: self.window.fullscreen () + def fullscreen_absolute (self, fullscreen): + """ Explicitly set the fullscreen state of the window. + """ + if self._fullscreen != fullscreen: + self.fullscreen_toggle () + def on_window_state_changed (self, window, event): self._fullscreen = bool (event.new_window_state & gtk.gdk.WINDOW_STATE_FULLSCREEN) self._maximised = bool (event.new_window_state & gtk.gdk.WINDOW_STATE_MAXIMIZED)