merging changes from trunk to drag-and-drop

This commit is contained in:
Emmanuel Bretelle 2008-02-25 16:49:44 +00:00
commit 2b354af88f
1 changed files with 41 additions and 35 deletions

View File

@ -64,7 +64,6 @@ def openurl (url):
class TerminatorTerm:
# Our settings
# FIXME: Add commandline and/or gconf options to change these
defaults = {
'gt_dir' : '/apps/gnome-terminal',
'_profile_dir' : '%s/profiles',
@ -390,8 +389,8 @@ class TerminatorTerm:
if ret == None:
print >> sys.stderr, _('Unknown value requested. Unable to find in gconf profile or default settings: ') + property
sys.exit (1)
return ret
return (ret)
def reconfigure_vte (self):
# Set our emulation
@ -447,25 +446,6 @@ class TerminatorTerm:
else:
fg_color = gtk.gdk.color_parse (self.reconf ('foreground_color'))
bg_color = gtk.gdk.color_parse (self.reconf ('background_color'))
# Set our background image, transparency and type
background_type = self.reconf ('background_type')
if background_type == "solid":
self._vte.set_background_image_file ('')
self._vte.set_background_transparent (False)
if background_type == "image":
self._vte.set_background_image_file (self.reconf ('background_image'))
self._vte.set_scroll_background (self.reconf ('scroll_background'))
self._vte.set_background_transparent (False)
if background_type == "transparent":
darkness = self.reconf ('background_darkness')
if self._vte.is_composited():
self._vte.set_background_transparent (False)
self._vte.set_opacity(int(darkness * 65535))
else:
self._vte.set_background_transparent (True)
self._vte.set_background_saturation (1 - darkness)
colors = palette.split (':')
palette = []
@ -474,6 +454,32 @@ class TerminatorTerm:
palette.append (gtk.gdk.color_parse (color))
self._vte.set_colors (fg_color, bg_color, palette)
# Set our background image, transparency and type
# Many thanks to the authors of gnome-terminal, on which this code is based.
background_type = self.reconf ('background_type')
# set background image settings
if background_type == "image":
self._vte.set_background_image_file (self.reconf ('background_image'))
self._vte.set_scroll_background (self.reconf('scroll_background'))
else:
self._vte.set_background_image_file('')
self._vte.set_scroll_background(False)
# set transparency for the background (image)
if background_type in ("image", "transparent"):
self._vte.set_background_tint_color (bg_color)
self._vte.set_background_saturation(1 - (self.reconf ('background_darkness')))
self._vte.set_opacity(int(self.reconf('background_darkness') * 65535))
else:
self._vte.set_background_saturation(1)
self._vte.set_opacity(65535)
if not self._vte.is_composited():
self._vte.set_background_transparent (background_type == "transparent")
else:
self._vte.set_background_transparent (False)
# Set our cursor blinkiness
self._vte.set_cursor_blinks = (self.reconf ('cursor_blink'))
@ -822,11 +828,13 @@ class Terminator:
parent.add (pane)
position = (vertical) and parent.allocation.height or parent.allocation.width
position = (vertical) and parent.allocation.height \
or parent.allocation.width
if isinstance (parent, gtk.Paned):
# We are inside a split term
position = (vertical) and widget.get_box().allocation.height or widget.get_box().allocation.width
position = (vertical) and widget.get_box().allocation.height \
or widget.get_box().allocation.width
if (widget.get_box () == parent.get_child1 ()):
widget.get_box ().reparent (pane)
@ -967,20 +975,18 @@ class Terminator:
elif isinstance (parent, gtk.HPaned) and not vertical:
return parent
return self.get_first_parent_paned(parent, vertical)
def execute_cb (option, opt, value, parser):
assert value is None
value = []
while parser.rargs:
arg = parser.rargs[0]
value.append (arg)
del (parser.rargs[0])
setattr(parser.values, option.dest, value)
if __name__ == '__main__':
def execute_cb (option, opt, value, parser):
assert value is None
value = []
while parser.rargs:
arg = parser.rargs[0]
value.append (arg)
del (parser.rargs[0])
setattr(parser.values, option.dest, value)
usage = "usage: %prog [options]"
parser = OptionParser (usage)
parser.add_option ("-d", "--debug", action="store_true", dest="debug", help="Enable debugging information")