From 68529502e734a16c9662293c88c0fef7e2acd56e Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Sun, 16 Nov 2008 02:42:09 +0000 Subject: [PATCH] Make prefs_profile.auto_add more robust, add some more global reconfiguration --- terminatorlib/prefs_profile.py | 21 ++++++++++++++++++++- terminatorlib/terminator.py | 18 ++++++++++++++---- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/terminatorlib/prefs_profile.py b/terminatorlib/prefs_profile.py index bff1929b..66d0c750 100644 --- a/terminatorlib/prefs_profile.py +++ b/terminatorlib/prefs_profile.py @@ -169,7 +169,8 @@ class ProfileEditor: filter.add_mime_type ('image/*') widget.add_filter (filter) widget.set_local_only (True) - widget.set_filename (value) + if value: + widget.set_filename (value) elif key == 'tab_position': widget = gtk.combo_box_new_text() for item in self.tab_position: @@ -268,6 +269,24 @@ class ProfileEditor: for changer in changed: if changer == "fullscreen": self.term.fullscreen_absolute(values[changer]) + elif changer == "maximise": + if values[changer]: + self.term.maximize() + else: + self.term.unmaximize() + elif changer == "enable_real_transparency": + #self.term.enable_rgba(values[changer]) + # FIXME: This breaks if the window is realised + pass + elif changer == "borderless": + self.term.window.set_decorated (not values[changer]) + elif changer == "handle_size": + # FIXME: How maek work? + pass + elif changer == "tab_position": + # FIXME: maek work + pass + # FIXME: which others? cycle_term_tab, close_button_on_tab, copy_on_selection, extreme_tabs, try_posix_regexp self.term.reconfigure_vtes() diff --git a/terminatorlib/terminator.py b/terminatorlib/terminator.py index dec6a4fe..54729f22 100755 --- a/terminatorlib/terminator.py +++ b/terminatorlib/terminator.py @@ -236,10 +236,7 @@ class Terminator: # Set RGBA colormap if possible so VTE can use real alpha # channels for transparency. if self.conf.enable_real_transparency: - screen = self.window.get_screen() - colormap = screen.get_rgba_colormap() - if colormap: - self.window.set_colormap(colormap) + self.rgba_control(True) # Start out with just one terminal # FIXME: This should be really be decided from some kind of profile @@ -251,6 +248,15 @@ class Terminator: self.window.show () term.spawn_child () self.save_yourself () + + def enable_rgba (self, rgba = False): + screen = self.window.get_screen() + if rgba: + colormap = screen.get_rgba_colormap() + else: + colormap = screen.get_rgb_colormap() + if colormap: + self.window.set_colormap(colormap) def die(self, *args): gtk.main_quit () @@ -305,6 +311,10 @@ class Terminator: """ Maximize the Terminator window.""" self.window.maximize () + def unmaximize (self): + """ Unmaximize the Terminator window.""" + self.window.unmaximize () + def fullscreen_toggle (self): """ Toggle the fullscreen state of the window. If it is in fullscreen state, it will be unfullscreened. If it is not, it