Make prefs_profile.auto_add more robust, add some more global reconfiguration

This commit is contained in:
Chris Jones 2008-11-16 02:42:09 +00:00
parent 2ccd5962c1
commit 68529502e7
2 changed files with 34 additions and 5 deletions

View File

@ -169,7 +169,8 @@ class ProfileEditor:
filter.add_mime_type ('image/*') filter.add_mime_type ('image/*')
widget.add_filter (filter) widget.add_filter (filter)
widget.set_local_only (True) widget.set_local_only (True)
widget.set_filename (value) if value:
widget.set_filename (value)
elif key == 'tab_position': elif key == 'tab_position':
widget = gtk.combo_box_new_text() widget = gtk.combo_box_new_text()
for item in self.tab_position: for item in self.tab_position:
@ -268,6 +269,24 @@ class ProfileEditor:
for changer in changed: for changer in changed:
if changer == "fullscreen": if changer == "fullscreen":
self.term.fullscreen_absolute(values[changer]) 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() self.term.reconfigure_vtes()

View File

@ -236,10 +236,7 @@ class Terminator:
# Set RGBA colormap if possible so VTE can use real alpha # Set RGBA colormap if possible so VTE can use real alpha
# channels for transparency. # channels for transparency.
if self.conf.enable_real_transparency: if self.conf.enable_real_transparency:
screen = self.window.get_screen() self.rgba_control(True)
colormap = screen.get_rgba_colormap()
if colormap:
self.window.set_colormap(colormap)
# Start out with just one terminal # Start out with just one terminal
# FIXME: This should be really be decided from some kind of profile # FIXME: This should be really be decided from some kind of profile
@ -251,6 +248,15 @@ class Terminator:
self.window.show () self.window.show ()
term.spawn_child () term.spawn_child ()
self.save_yourself () 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): def die(self, *args):
gtk.main_quit () gtk.main_quit ()
@ -305,6 +311,10 @@ class Terminator:
""" Maximize the Terminator window.""" """ Maximize the Terminator window."""
self.window.maximize () self.window.maximize ()
def unmaximize (self):
""" Unmaximize the Terminator window."""
self.window.unmaximize ()
def fullscreen_toggle (self): def fullscreen_toggle (self):
""" Toggle the fullscreen state of the window. If it is in """ Toggle the fullscreen state of the window. If it is in
fullscreen state, it will be unfullscreened. If it is not, it fullscreen state, it will be unfullscreened. If it is not, it