Merge in Chris James' quake branch.

This commit is contained in:
Chris Jones 2009-01-25 14:26:20 +00:00
commit 4236e44e5f
6 changed files with 56 additions and 3 deletions

View File

@ -33,6 +33,10 @@ Place the Terminator window in its fullscreen state when it starts
Instruct the window manager not to render borders/decoration on the
Terminator window (good with \-m)
.TP
.B \-H, \-\-hidden
Hide the Terminator window by default. Its visibility can be toggled
with the \fBquake\fR keyboard shortcut (Ctrl-Shift-Alt-a by default)
.TP
.B \-\-no_gconf
Ignore the gconf settings of gnome-terminal
.TP

View File

@ -168,6 +168,10 @@ Default value: \fBFalse\fR
Controls whether the Terminator window will be started without window borders
Default value: \fBFalse\fR
.TP
.B hidden \fR(boolean)
Hides the Terminator window by default. Its visibility can be toggled with the \fBquake\fR keybinding (Ctrl-Shift-Alt-a by default)
Default value: \fBFalse\fR
.TP
.B handle_size
Controls the width of the separator between terminals. Anything outside the range 0-5 (inclusive) will be ignored and use your default theme value.
Default value: \fB-1\fR

View File

@ -88,6 +88,8 @@ if __name__ == '__main__':
dest="fullscreen", help="Set the window into fullscreen mode")
parser.add_option ("-b", "--borderless", action="store_true",
dest="borderless", help="Turn off the window's borders")
parser.add_option("-H", "--hidden", action="store_true", dest="hidden",
help="Open the %s window hidden"%APP_NAME.capitalize())
parser.add_option ("-n", "--no-gconf", dest="no_gconf", action="store_true",
help="ignore gnome-terminal gconf settings")
parser.add_option ("-p", "--profile", dest="profile", action="callback",
@ -153,7 +155,7 @@ See the following bug report for more details:
dbg ('profile_cb: settled on profile: "%s"' % options.profile)
term = Terminator (options.profile, command, options.fullscreen,
options.maximise, options.borderless, options.no_gconf,
options.geometry)
options.geometry, options.hidden)
if options.debug > 1:
import terminatorlib.debugserver as debugserver

View File

@ -96,6 +96,7 @@ Defaults = {
'fullscreen' : False,
'borderless' : False,
'maximise' : False,
'hidden' : False,
'handle_size' : -1,
'focus_on_close' : 'auto',
'f11_modifier' : False,
@ -139,6 +140,7 @@ Defaults = {
'full_screen' : 'F11',
'reset' : '<Ctrl><Shift>R',
'reset_clear' : '<Ctrl><Shift>G',
'quake' : '<Ctrl><Shift><Alt>a',
}
}

View File

@ -31,6 +31,14 @@ from terminatorlib.keybindings import TerminatorKeybindings
from terminatorlib.terminatorterm import TerminatorTerm
from terminatorlib.prefs_profile import ProfileEditor
# import keybinder for quake mode
try:
import deskbar.core.keybinder as bindkey
except:
print (_("Unable to find python bindings for deskbar, "\
"QUAKE mode is not available."))
pass
class TerminatorNotebookTabLabel(gtk.HBox):
_terminator = None
_notebook = None
@ -124,7 +132,7 @@ class Terminator:
def __init__ (self, profile = None, command = None, fullscreen = False,
maximise = False, borderless = False, no_gconf = False,
geometry = None):
geometry = None, hidden = False):
self.profile = profile
self.command = command
@ -134,6 +142,7 @@ class Terminator:
self._geometry = geometry
self.debugaddress = None
self.start_cwd = os.getcwd()
self._hidden = False
self.term_list = []
self.gnome_client = None
stores = []
@ -200,7 +209,6 @@ class Terminator:
import webbrowser
self.url_show = webbrowser.open
self.icon_theme = gtk.IconTheme ()
self.keybindings = TerminatorKeybindings()
@ -261,6 +269,14 @@ class Terminator:
term.spawn_child ()
self.save_yourself ()
if hidden or self.conf.hidden:
self.hide()
try:
bindkey.tomboy_keybinder_bind(self.conf.keybindings['quake'],self.cbkeyCloak,term)
except:
pass
def set_handle_size (self, size):
if size in xrange (0,6):
gtk.rc_parse_string("""
@ -339,6 +355,28 @@ class Terminator:
c.set_clone_command(len(args), args)
return True
def show(self):
"""Show the terminator window"""
# restore window position
self.window.move(self.pos[0],self.pos[1])
#self.window.present()
self.window.show_now()
self._hidden = False
def hide(self):
"""Hide the terminator window"""
# save window position
self.pos = self.window.get_position()
self.window.hide()
self._hidden = True
def cbkeyCloak(self, data):
"""Callback event for show/hide keypress"""
if self._hidden:
self.show()
else:
self.hide()
def maximize (self):
""" Maximize the Terminator window."""
self.window.maximize ()

View File

@ -730,6 +730,9 @@ text/plain
dbg ('on_vte_key_press: Called on %s with no event' % term)
return False
mapping = self.terminator.keybindings.lookup(event)
if mapping == "quake":
return False
if mapping and mapping not in self.UnhandledKeybindings:
dbg("on_vte_key_press: lookup found %r" % mapping)