merging drag-and-drop to trunk tree

This commit is contained in:
Emmanuel Bretelle 2008-02-25 01:03:39 +00:00
commit 95059747fb
3 changed files with 129 additions and 95 deletions

149
ChangeLog
View File

@ -1,102 +1,103 @@
terminator 0.9: terminator 0.9:
* Added support for ~/.terminatorrc * Added support for ~/.terminatorrc
* Added kwybindings for terms size and scrollbar manipulation. Thanks * Added kwybindings for terms size and scrollbar manipulation. Thanks
Emmanuel Bretelle. Emmanuel Bretelle.
terminator 0.8.1: terminator 0.8.1:
* Fixed ChangeLog * Fixed ChangeLog
* Revert URI matching behaviour to the same as gnome-terminal * Revert URI matching behaviour to the same as gnome-terminal
* Close LP #179315 with a fuller fix that provides proper colour support
terminator 0.8: terminator 0.8:
* Make dependency on python-gnome optional. Non-gnome users can now reap * Make dependency on python-gnome optional. Non-gnome users can now reap
the glorious benefits of Terminator and will only lose the ability to the glorious benefits of Terminator and will only lose the ability to
open email URLs (assuming their browser won't handle this for them). open email URLs (assuming their browser won't handle this for them).
Closes LP #184809 Closes LP #184809
* Remove blank translations from .desktop file to fix empty menu entries * Remove blank translations from .desktop file to fix empty menu entries.
Closes LP #187187 Closes LP #187187
* Add application icon at various sizes including a window icon * Add application icon at various sizes including a window icon
* New options parser allowing -x support. Closes LP191124 * New options parser allowing -x support. Closes LP191124
* More translations (thanks!) * More translations (thanks!)
terminator 0.7: terminator 0.7:
* Fullscreen support, via a patch from Thomas Meire. Closes LP #178914 * Fullscreen support, via a patch from Thomas Meire. Closes LP #178914
* Improved behaviour when closing terminals/window. Result of work by * Improved behaviour when closing terminals/window. Result of work by
Thomas Meire. Closes LP #161121 Thomas Meire. Closes LP #161121
* Freedesktop .desktop file and appropriate setup.py entry for * Freedesktop .desktop file and appropriate setup.py entry for
installing it. Closes LP #178943 installing it. Closes LP #178943
* Translation support, with Spanish, Dutch, Italian and Romanian * Translation support, with Spanish, Dutch, Italian and Romanian
translations. Closes LP #161120 translations. Closes LP #161120
* Stop clashing with gnome-terminal's paste shortcut key, move * Stop clashing with gnome-terminal's paste shortcut key, move
horizontal splitting shortcut too, and add support for horizontal splitting shortcut too, and add support for
gnome-terminal's copy/paste shortcuts. Closes LP #179310 gnome-terminal's copy/paste shortcuts. Closes LP #179310
* Borderless support (tell your window manager not to decorate * Borderless support (tell your window manager not to decorate
Terminator) Terminator)
* Font zooming support. Closes LP #178792 * Font zooming support. Closes LP #178792
* Set the VTE widget to have a tooltip of its window title. This may be * Set the VTE widget to have a tooltip of its window title. This may be
reverted if it is annoying reverted if it is annoying
* Support GNOME Terminal profile settings for backgrounds. * Support GNOME Terminal profile settings for backgrounds.
Closes LP #180717 Closes LP #180717
* Use our own default values if there is no gnome-terminal profile. * Use our own default values if there is no gnome-terminal profile.
Closes LP #179315 Closes LP #179315
terminator 0.6: terminator 0.6:
* Use new gnome-terminal gconf key to find available profiles * Use new gnome-terminal gconf key to find available profiles
* Move a few more hardcoded items to our settings array (not that * Move a few more hardcoded items to our settings array (not that
it can be overridden yet) it can be overridden yet)
* Fix handling of exiting child processes to properly track * Fix handling of exiting child processes to properly track
gnome-terminal settings gnome-terminal settings
* Add Ctrl-Tab and Ctrl-Shift-Tab as options for switching terminals * Add Ctrl-Tab and Ctrl-Shift-Tab as options for switching terminals
(patch from Kees Cook) (patch from Kees Cook)
* Stop using parent.show_all() when removing/adding a terminal and * Stop using parent.show_all() when removing/adding a terminal and
instead show the actual widgets that have been created. This instead show the actual widgets that have been created. This
prevents scrollbars from re-appearing after they have been hidden prevents scrollbars from re-appearing after they have been hidden
terminator 0.5: terminator 0.5:
* The terminator window is now able to resize smaller, * The terminator window is now able to resize smaller,
thanks to Kees Cook for the fix. thanks to Kees Cook for the fix.
* Email addresses are now matched and opened correctly. * Email addresses are now matched and opened correctly.
Closes LP #139015 Closes LP #139015
* Double clicking a URL now selects the whole URL. Closes LP #129533 * Double clicking a URL now selects the whole URL. Closes LP #129533
* The default behaviour is now to open a single 80x24 terminal rather * The default behaviour is now to open a single 80x24 terminal rather
than four terminals in a maximised window. Closes LP #126219 and than four terminals in a maximised window. Closes LP #126219 and
should force me to fix LP #87720 should force me to fix LP #87720
* There are now hotkeys for switching between terminals, splitting * There are now hotkeys for switching between terminals, splitting
terminals and closing them. Closes LP #149931 and #148622(thanks terminals and closing them. Closes LP #149931 and #148622(thanks
to Huanghe for patches for this) to Huanghe for patches for this)
* If there is only one terminal, closing it will not produce a quit * If there is only one terminal, closing it will not produce a quit
message message
terminator 0.4: terminator 0.4:
* Architecture should be all, not any * Architecture should be all, not any
* Fix section * Fix section
* Add AUTHORS file * Add AUTHORS file
* Rename script to drop the .py * Rename script to drop the .py
* Handle the gnome-terminal profile better by offering command options * Handle the gnome-terminal profile better by offering command options
* Fudge around some resizing issues * Fudge around some resizing issues
* Fix child spawning to avoid segfaulting zsh * Fix child spawning to avoid segfaulting zsh
* Misc. code formatting/style improvements * Misc. code formatting/style improvements
* Refactor terminal splitting into one axis agnostic function * Refactor terminal splitting into one axis agnostic function
* Flesh out setup.py a tiny bit more * Flesh out setup.py a tiny bit more
terminator 0.3: terminator 0.3:
* Implemented terminal closing, which correctly reparents its sibling * Implemented terminal closing, which correctly reparents its sibling
(if any) (if any)
* Updated documentation to reflect a serious bug with shells that aren't * Updated documentation to reflect a serious bug with shells that aren't
bash (or at least zsh) bash (or at least zsh)
terminator 0.2: terminator 0.2:
* Support dynamically splitting terminals * Support dynamically splitting terminals
terminator 0.1: terminator 0.1:
* Fixed some distribution wording * Fixed some distribution wording
* Fix build-depends * Fix build-depends
* Initial release * Initial release

View File

@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-01-29 23:57+0000\n" "POT-Creation-Date: 2008-01-29 23:57+0000\n"
"PO-Revision-Date: 2008-01-15 00:09+0000\n" "PO-Revision-Date: 2008-02-15 14:25+0000\n"
"Last-Translator: Nicolas Valcárcel <nvalcarcel@ubuntu-pe.org>\n" "Last-Translator: Nicolas Valcárcel <nvalcarcel@ubuntu-pe.org>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n" "Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2008-02-14 23:16+0000\n" "X-Launchpad-Export-Date: 2008-02-19 23:16+0000\n"
"X-Generator: Launchpad (build Unknown)\n" "X-Generator: Launchpad (build Unknown)\n"
#: terminator:44 #: terminator:44
@ -22,23 +22,30 @@ msgid ""
"You need to install the python bindings for gobject, gtk, gconf and pango to " "You need to install the python bindings for gobject, gtk, gconf and pango to "
"run Terminator." "run Terminator."
msgstr "" msgstr ""
"Necesitas instalar los lazos python para gobject, gtk, gconf y pango para "
"ejecutar Terminator"
#: terminator:63 #: terminator:63
msgid "" msgid ""
"You need to install python bindings for libvte (\"python-vte\" in " "You need to install python bindings for libvte (\"python-vte\" in "
"debian/ubuntu)" "debian/ubuntu)"
msgstr "" msgstr ""
"Necesitas instalar lazos python para libvte (\"python-vte\" en debian/ubuntu)"
#: terminator:127 #: terminator:127
#, python-format #, python-format
msgid "Warning: unable to find profile %s. Continue with default values..." msgid "Warning: unable to find profile %s. Continue with default values..."
msgstr "" msgstr ""
"Advertencia: No es posible encontrar perfil %s. Continuar con valores por "
"defecto..."
#: terminator:213 #: terminator:213
msgid "" msgid ""
"Unknown value requested. Unable to find in gconf profile or default " "Unknown value requested. Unable to find in gconf profile or default "
"settings: " "settings: "
msgstr "" msgstr ""
"Valor desconocido requerido. No se pudo encontrar en perfil gconf o valores "
"por defecto "
#: terminator:414 #: terminator:414
msgid "_Open Link" msgid "_Open Link"

View File

@ -18,7 +18,7 @@
"""Terminator by Chris Jones <cmsj@tenshu.net>""" """Terminator by Chris Jones <cmsj@tenshu.net>"""
# import standard python libs # import standard python libs
import os, sys, string, time, math import os, platform, sys, string, time, math
from optparse import OptionParser from optparse import OptionParser
import gettext import gettext
@ -85,7 +85,7 @@ class TerminatorTerm:
'scroll_on_output' : False, 'scroll_on_output' : False,
'scrollback_lines' : 100, 'scrollback_lines' : 100,
'focus' : 'sloppy', 'focus' : 'sloppy',
'child_restart' : False, 'exit_action' : 'close',
'palette' : '#000000000000:#CDCD00000000:#0000CDCD0000:#CDCDCDCD0000:#30BF30BFA38E:#A53C212FA53C:#0000CDCDCDCD:#FAFAEBEBD7D7:#404040404040:#FFFF00000000:#0000FFFF0000:#FFFFFFFF0000:#00000000FFFF:#FFFF0000FFFF:#0000FFFFFFFF:#FFFFFFFFFFFF', 'palette' : '#000000000000:#CDCD00000000:#0000CDCD0000:#CDCDCDCD0000:#30BF30BFA38E:#A53C212FA53C:#0000CDCDCDCD:#FAFAEBEBD7D7:#404040404040:#FFFF00000000:#0000FFFF0000:#FFFFFFFF0000:#00000000FFFF:#FFFF0000FFFF:#0000FFFFFFFF:#FFFFFFFFFFFF',
'word_chars' : '-A-Za-z0-9,./?%&#:_', 'word_chars' : '-A-Za-z0-9,./?%&#:_',
'mouse_autohide' : True, 'mouse_autohide' : True,
@ -104,14 +104,15 @@ class TerminatorTerm:
matches = {} matches = {}
def __init__ (self, terminator, profile = None, command = None, cwd = None):
def __init__ (self, terminator, profile = None, command = None):
self.defaults['profile_dir'] = self.defaults['_profile_dir']%(self.defaults['gt_dir']) self.defaults['profile_dir'] = self.defaults['_profile_dir']%(self.defaults['gt_dir'])
self.terminator = terminator self.terminator = terminator
self.gconf_client = gconf.client_get_default () self.gconf_client = gconf.client_get_default ()
self.command = command self.command = command
self.cwd = cwd or os.getcwd();
if profile == None: if profile == None:
profile = self.gconf_client.get_string (self.defaults['gt_dir'] + '/global/default_profile') profile = self.gconf_client.get_string (self.defaults['gt_dir'] + '/global/default_profile')
@ -147,7 +148,7 @@ class TerminatorTerm:
self._box.show () self._box.show ()
self._scrollbar = gtk.VScrollbar (self._vte.get_adjustment ()) self._scrollbar = gtk.VScrollbar (self._vte.get_adjustment ())
if self.scrollbar_position != "hidden": if self.scrollbar_position != "hidden" and self.scrollbar_position != "disabled":
self._scrollbar.show () self._scrollbar.show ()
if self.scrollbar_position == 'right': if self.scrollbar_position == 'right':
@ -171,22 +172,18 @@ class TerminatorTerm:
#for testing purpose: drag-motion #for testing purpose: drag-motion
self._vte.connect("drag-motion", self.on_drag_motion) self._vte.connect("drag-motion", self.on_drag_motion)
self._vte.connect("drag-data-received", self.on_drag_data_received, self) self._vte.connect("drag-data-received", self.on_drag_data_received, self)
self._vte.connect ("composited-changed", self.on_composited_changed)
# self._vte.connect ("window-title-changed", self.on_vte_title_change) # self._vte.connect ("window-title-changed", self.on_vte_title_change)
exit_action = self.gconf_client.get_string (self.profile + "/exit_action") exit_action = self.gconf_client.get_string (self.profile + "/exit_action")
if not exit_action: exit_action = self.reconf ("exit_action")
if self.defaults['child_restart']:
exit_action = "restart"
else:
exit_action = "close"
if exit_action == "restart": if exit_action == "restart":
self._vte.connect ("child-exited", self.spawn_child) self._vte.connect ("child-exited", self.spawn_child)
#gnome-terminal Bug: http://bugzilla.gnome.org/show_bug.cgi?id=518184 # We need to support "left" because some buggy versions of gnome-terminal
#/apps/gnome-terminal/profiles/<profile name>/exit_action might be # set it in some situations
#set to "left" instead of close
# LP#194771
if exit_action in ("close", "left"): if exit_action in ("close", "left"):
self._vte.connect ("child-exited", lambda close_term: self.terminator.closeterm (self)) self._vte.connect ("child-exited", lambda close_term: self.terminator.closeterm (self))
@ -357,7 +354,21 @@ class TerminatorTerm:
shell = pwd.getpwuid (os.getuid ())[6] shell = pwd.getpwuid (os.getuid ())[6]
args = [os.path.basename (shell)] args = [os.path.basename (shell)]
self._vte.fork_command (command = shell, argv = args, envv = [], loglastlog = login, logwtmp = update_records, logutmp = update_records) self._pid = self._vte.fork_command (command = shell, argv = args, envv = [], directory=self.cwd, loglastlog = login, logwtmp = update_records, logutmp = update_records)
def get_cwd (self):
""" Return the current working directory of the subprocess.
This function requires OS specific behaviours
"""
system = platform.system ()
if system == 'Linux':
cwd = os.path.realpath ('/proc/%s/cwd' % self._pid)
else:
# We don't have a child cwd getter for this platform, so let
# TerminatorTerm use its default
cwd = None
return (cwd)
def reconf (self, property): def reconf (self, property):
value = self.gconf_client.get ('%s/%s'%(self.profile, property)) value = self.gconf_client.get ('%s/%s'%(self.profile, property))
@ -448,8 +459,13 @@ class TerminatorTerm:
self._vte.set_scroll_background (self.reconf ('scroll_background')) self._vte.set_scroll_background (self.reconf ('scroll_background'))
self._vte.set_background_transparent (False) self._vte.set_background_transparent (False)
if background_type == "transparent": if background_type == "transparent":
self._vte.set_background_transparent (True) darkness = self.reconf ('background_darkness')
self._vte.set_background_saturation (1 - (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 (':') colors = palette.split (':')
palette = [] palette = []
@ -474,7 +490,7 @@ class TerminatorTerm:
scrollbar_position = self.reconf ('scrollbar_position') scrollbar_position = self.reconf ('scrollbar_position')
if scrollbar_position != self.scrollbar_position: if scrollbar_position != self.scrollbar_position:
if scrollbar_position == 'hidden': if scrollbar_position == 'hidden' or scrollbar_position == 'disabled':
self._scrollbar.hide () self._scrollbar.hide ()
else: else:
self._scrollbar.show () self._scrollbar.show ()
@ -497,6 +513,9 @@ class TerminatorTerm:
def on_gconf_notification (self, client, cnxn_id, entry, what): def on_gconf_notification (self, client, cnxn_id, entry, what):
self.reconfigure_vte () self.reconfigure_vte ()
def on_composited_changed (self, widget):
self.reconfigure_vte ()
def on_vte_button_press (self, term, event): def on_vte_button_press (self, term, event):
# Left mouse button should transfer focus to this vte widget # Left mouse button should transfer focus to this vte widget
if event.button == 1: if event.button == 1:
@ -696,6 +715,13 @@ class Terminator:
self.window.set_property ('allow-shrink', True) self.window.set_property ('allow-shrink', True)
# Set RGBA colormap if possible so VTE can use real alpha
# channels for transparency.
screen = self.window.get_screen()
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
term = (TerminatorTerm (self, self.profile, self.command)) term = (TerminatorTerm (self, self.profile, self.command))
@ -781,7 +807,7 @@ class Terminator:
""" Split the provided widget on the horizontal or vertical axis. """ """ Split the provided widget on the horizontal or vertical axis. """
# create a new terminal and parent pane. # create a new terminal and parent pane.
terminal = TerminatorTerm (self, self.profile, None) terminal = TerminatorTerm (self, self.profile, None, widget.get_cwd())
pane = (vertical) and gtk.VPaned () or gtk.HPaned () pane = (vertical) and gtk.VPaned () or gtk.HPaned ()
# get the parent of the provided terminal # get the parent of the provided terminal