Merge updates from trunk

This commit is contained in:
Stephen Boddy 2012-07-23 15:30:03 +02:00
commit a4c0eb453d
11 changed files with 754 additions and 21 deletions

View File

@ -56,10 +56,22 @@ Set the terminal's working directory
.B \-r, \-\-role=ROLE
Set a custom WM_WINDOW_ROLE property on the window
.TP
.B \-c, \-\-classname=CLASSNAME
Set a custom name (WM_CLASS) property on the window
.TP
.B \-l, \-\-layout=LAYOUT
Start Terminator with a specific layout. The argument here is the name
of a saved layout.
.TP
.B \-p, \-\-profile=PROFILE
Use a different profile as the default
.TP
.B \-i, \-\-icon=FORCEDICON
Set a custom icon for the window (by file or name)
.TP
.B \-u, \-\-no-dbus
Disable DBus
.TP
.B \-d, \-\-debug
Enable debugging output (please use this when reporting bugs). This
can be specified twice to enable a built-in python debugging server.

View File

@ -8,14 +8,14 @@ msgstr ""
"Project-Id-Version: terminator\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-08-21 01:31+0100\n"
"PO-Revision-Date: 2011-05-10 15:42+0000\n"
"Last-Translator: boracasli <Unknown>\n"
"PO-Revision-Date: 2012-07-10 19:05+0000\n"
"Last-Translator: Youssef Habri <Unknown>\n"
"Language-Team: Arabic <ar@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-05-24 10:30+0000\n"
"X-Generator: Launchpad (build 15288)\n"
"X-Launchpad-Export-Date: 2012-07-11 05:12+0000\n"
"X-Generator: Launchpad (build 15593)\n"
#: ../data/terminator.desktop.in.h:1
msgid "Multiple terminals in one window"
@ -23,7 +23,7 @@ msgstr "عدة طرفيات في نافذة واحدة"
#: ../data/terminator.desktop.in.h:2
msgid "Terminator"
msgstr "الماحي"
msgstr "الطرفية"
#: ../terminatorlib/container.py:149
msgid "Close?"
@ -47,7 +47,7 @@ msgstr ""
#: ../terminatorlib/encoding.py:35
msgid "Current Locale"
msgstr "المحلية الحالية"
msgstr "اللغة الحالية"
#: ../terminatorlib/encoding.py:36 ../terminatorlib/encoding.py:49
#: ../terminatorlib/encoding.py:68 ../terminatorlib/encoding.py:91

529
po/la.po Normal file
View File

@ -0,0 +1,529 @@
# Latin translation for terminator
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the terminator package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: terminator\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-08-21 01:31+0100\n"
"PO-Revision-Date: 2012-07-15 14:09+0000\n"
"Last-Translator: Janosch Richter <jari.weimar@googlemail.com>\n"
"Language-Team: Latin <la@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-07-16 05:11+0000\n"
"X-Generator: Launchpad (build 15614)\n"
#: ../data/terminator.desktop.in.h:1
msgid "Multiple terminals in one window"
msgstr ""
#: ../data/terminator.desktop.in.h:2
msgid "Terminator"
msgstr ""
#: ../terminatorlib/container.py:149
msgid "Close?"
msgstr ""
#: ../terminatorlib/container.py:156
msgid "Close _Terminals"
msgstr ""
#: ../terminatorlib/container.py:158
msgid "<big><b>Close multiple terminals?</b></big>"
msgstr ""
#: ../terminatorlib/container.py:161
#, python-format
msgid ""
"This %s has several terminals open. Closing the %s will also close all "
"terminals within it."
msgstr ""
#: ../terminatorlib/encoding.py:35
msgid "Current Locale"
msgstr ""
#: ../terminatorlib/encoding.py:36 ../terminatorlib/encoding.py:49
#: ../terminatorlib/encoding.py:68 ../terminatorlib/encoding.py:91
#: ../terminatorlib/encoding.py:102
msgid "Western"
msgstr ""
#: ../terminatorlib/encoding.py:37 ../terminatorlib/encoding.py:69
#: ../terminatorlib/encoding.py:81 ../terminatorlib/encoding.py:100
msgid "Central European"
msgstr ""
#: ../terminatorlib/encoding.py:38
msgid "South European"
msgstr ""
#: ../terminatorlib/encoding.py:39 ../terminatorlib/encoding.py:47
#: ../terminatorlib/encoding.py:107
msgid "Baltic"
msgstr ""
#. [False, "JOHAB", _("Korean") ],
#: ../terminatorlib/encoding.py:40 ../terminatorlib/encoding.py:70
#: ../terminatorlib/encoding.py:76 ../terminatorlib/encoding.py:78
#: ../terminatorlib/encoding.py:83 ../terminatorlib/encoding.py:101
msgid "Cyrillic"
msgstr ""
#: ../terminatorlib/encoding.py:41 ../terminatorlib/encoding.py:73
#: ../terminatorlib/encoding.py:80 ../terminatorlib/encoding.py:106
msgid "Arabic"
msgstr "Arabica"
#: ../terminatorlib/encoding.py:42 ../terminatorlib/encoding.py:86
#: ../terminatorlib/encoding.py:103
msgid "Greek"
msgstr "Lingua Graeca"
#: ../terminatorlib/encoding.py:43
msgid "Hebrew Visual"
msgstr ""
#: ../terminatorlib/encoding.py:44 ../terminatorlib/encoding.py:72
#: ../terminatorlib/encoding.py:89 ../terminatorlib/encoding.py:105
msgid "Hebrew"
msgstr "Lingua Hebraica"
#: ../terminatorlib/encoding.py:45 ../terminatorlib/encoding.py:71
#: ../terminatorlib/encoding.py:93 ../terminatorlib/encoding.py:104
msgid "Turkish"
msgstr "Lingua Turcica"
#: ../terminatorlib/encoding.py:46
msgid "Nordic"
msgstr ""
#: ../terminatorlib/encoding.py:48
msgid "Celtic"
msgstr ""
#: ../terminatorlib/encoding.py:50 ../terminatorlib/encoding.py:92
msgid "Romanian"
msgstr "Lingua Dacoromana"
#. [False, "UTF-7", _("Unicode") ],
#: ../terminatorlib/encoding.py:52
msgid "Unicode"
msgstr "Unicode"
#. [False, "UTF-16", _("Unicode") ],
#. [False, "UCS-2", _("Unicode") ],
#. [False, "UCS-4", _("Unicode") ],
#: ../terminatorlib/encoding.py:56
msgid "Armenian"
msgstr ""
#: ../terminatorlib/encoding.py:57 ../terminatorlib/encoding.py:58
#: ../terminatorlib/encoding.py:62
msgid "Chinese Traditional"
msgstr ""
#: ../terminatorlib/encoding.py:59
msgid "Cyrillic/Russian"
msgstr ""
#: ../terminatorlib/encoding.py:60 ../terminatorlib/encoding.py:74
#: ../terminatorlib/encoding.py:95
msgid "Japanese"
msgstr "Lingua Iaponica"
#: ../terminatorlib/encoding.py:61 ../terminatorlib/encoding.py:75
#: ../terminatorlib/encoding.py:98
msgid "Korean"
msgstr "Lingua Coreana"
#: ../terminatorlib/encoding.py:63 ../terminatorlib/encoding.py:64
#: ../terminatorlib/encoding.py:65 ../terminatorlib/encoding.py:67
msgid "Chinese Simplified"
msgstr ""
#: ../terminatorlib/encoding.py:66
msgid "Georgian"
msgstr ""
#: ../terminatorlib/encoding.py:79 ../terminatorlib/encoding.py:94
msgid "Cyrillic/Ukrainian"
msgstr ""
#: ../terminatorlib/encoding.py:82
msgid "Croatian"
msgstr "Lingua Croatica"
#: ../terminatorlib/encoding.py:84
msgid "Hindi"
msgstr ""
#: ../terminatorlib/encoding.py:85
msgid "Persian"
msgstr ""
#: ../terminatorlib/encoding.py:87
msgid "Gujarati"
msgstr ""
#: ../terminatorlib/encoding.py:88
msgid "Gurmukhi"
msgstr ""
#: ../terminatorlib/encoding.py:90
msgid "Icelandic"
msgstr ""
#: ../terminatorlib/encoding.py:96 ../terminatorlib/encoding.py:99
#: ../terminatorlib/encoding.py:108
msgid "Vietnamese"
msgstr ""
#: ../terminatorlib/encoding.py:97
msgid "Thai"
msgstr ""
#: ../terminatorlib/notebook.py:278
msgid "tab"
msgstr ""
#: ../terminatorlib/notebook.py:439
msgid "Close Tab"
msgstr ""
#: ../terminatorlib/optionparse.py:47
msgid "Display program version"
msgstr ""
#: ../terminatorlib/optionparse.py:49
msgid "Maximise the window"
msgstr ""
#: ../terminatorlib/optionparse.py:51
msgid "Make the window fill the screen"
msgstr ""
#: ../terminatorlib/optionparse.py:53
msgid "Disable window borders"
msgstr ""
#: ../terminatorlib/optionparse.py:55
msgid "Hide the window at startup"
msgstr ""
#: ../terminatorlib/optionparse.py:56
msgid "Specify a title for the window"
msgstr ""
#: ../terminatorlib/optionparse.py:58
msgid "Set the preferred size and position of the window (see X man page)"
msgstr ""
#: ../terminatorlib/optionparse.py:60
msgid "Specify a command to execute inside the terminal"
msgstr ""
#: ../terminatorlib/optionparse.py:63
msgid ""
"Use the rest of the command line as a command to execute inside the "
"terminal, and its arguments"
msgstr ""
#: ../terminatorlib/optionparse.py:66
msgid "Set the working directory"
msgstr ""
#: ../terminatorlib/optionparse.py:67
msgid "Set a custom WM_WINDOW_ROLE property on the window"
msgstr ""
#: ../terminatorlib/optionparse.py:69
msgid "Select a layout"
msgstr ""
#: ../terminatorlib/optionparse.py:70
msgid "Use a different profile as the default"
msgstr ""
#: ../terminatorlib/optionparse.py:73
msgid "Disable DBus"
msgstr ""
#: ../terminatorlib/optionparse.py:75
msgid "Enable debugging information (twice for debug server)"
msgstr ""
#: ../terminatorlib/optionparse.py:77
msgid "Comma separated list of classes to limit debugging to"
msgstr ""
#: ../terminatorlib/optionparse.py:79
msgid "Comma separated list of methods to limit debugging to"
msgstr ""
#: ../terminatorlib/plugins/activitywatch.py:22
msgid "ActivityWatch plugin unavailable: please install python-notify"
msgstr ""
#: ../terminatorlib/plugins/activitywatch.py:45
msgid "Watch for activity"
msgstr ""
#: ../terminatorlib/plugins/activitywatch.py:48
msgid "Stop watching for activity"
msgstr ""
#: ../terminatorlib/plugins/activitywatch.py:106
msgid "Watch for silence"
msgstr ""
#: ../terminatorlib/plugins/activitywatch.py:109
msgid "Stop watching for silence"
msgstr ""
#: ../terminatorlib/plugins/custom_commands.py:50
msgid "Custom Commands"
msgstr ""
#: ../terminatorlib/plugins/custom_commands.py:106
msgid "Custom Commands Configuration"
msgstr ""
#: ../terminatorlib/plugins/custom_commands.py:238
msgid "New Command"
msgstr ""
#: ../terminatorlib/plugins/custom_commands.py:248
msgid "Enabled:"
msgstr ""
#: ../terminatorlib/plugins/custom_commands.py:254
msgid "Name:"
msgstr ""
#: ../terminatorlib/plugins/custom_commands.py:260
msgid "Command:"
msgstr ""
#: ../terminatorlib/plugins/custom_commands.py:296
#: ../terminatorlib/plugins/custom_commands.py:406
msgid "You need to define a name and command"
msgstr ""
#: ../terminatorlib/plugins/custom_commands.py:313
#: ../terminatorlib/plugins/custom_commands.py:425
#, python-format
msgid "Name *%s* already exist"
msgstr ""
#: ../terminatorlib/plugins/terminalshot.py:28
msgid "Terminal screenshot"
msgstr ""
#: ../terminatorlib/prefseditor.py:942 ../terminatorlib/prefseditor.py:947
msgid "New Profile"
msgstr ""
#: ../terminatorlib/prefseditor.py:987 ../terminatorlib/prefseditor.py:992
msgid "New Layout"
msgstr ""
#. Label
#: ../terminatorlib/searchbar.py:50
msgid "Search:"
msgstr ""
#: ../terminatorlib/searchbar.py:66
msgid "Close Search bar"
msgstr ""
#. Next Button
#: ../terminatorlib/searchbar.py:71
msgid "Next"
msgstr ""
#. Previous Button
#: ../terminatorlib/searchbar.py:77
msgid "Prev"
msgstr ""
#: ../terminatorlib/searchbar.py:124
msgid "Searching scrollback"
msgstr ""
#: ../terminatorlib/searchbar.py:135 ../terminatorlib/searchbar.py:156
msgid "No more results"
msgstr ""
#: ../terminatorlib/searchbar.py:171
msgid "Found at row"
msgstr ""
#: ../terminatorlib/terminal_popup_menu.py:51
msgid "_Send email to..."
msgstr ""
#: ../terminatorlib/terminal_popup_menu.py:52
msgid "_Copy email address"
msgstr ""
#: ../terminatorlib/terminal_popup_menu.py:54
msgid "Ca_ll VoIP address"
msgstr ""
#: ../terminatorlib/terminal_popup_menu.py:55
msgid "_Copy VoIP address"
msgstr ""
#: ../terminatorlib/terminal_popup_menu.py:57
msgid "_Open link"
msgstr ""
#: ../terminatorlib/terminal_popup_menu.py:58
msgid "_Copy address"
msgstr ""
#: ../terminatorlib/terminal_popup_menu.py:86
msgid "Split H_orizontally"
msgstr ""
#: ../terminatorlib/terminal_popup_menu.py:96
msgid "Split V_ertically"
msgstr ""
#: ../terminatorlib/terminal_popup_menu.py:106
msgid "Open _Tab"
msgstr ""
#: ../terminatorlib/terminal_popup_menu.py:112
msgid "Open _Debug Tab"
msgstr ""
#: ../terminatorlib/terminal_popup_menu.py:126
msgid "_Zoom terminal"
msgstr ""
#: ../terminatorlib/terminal_popup_menu.py:130
msgid "Ma_ximise terminal"
msgstr ""
#: ../terminatorlib/terminal_popup_menu.py:136
msgid "_Restore all terminals"
msgstr ""
#: ../terminatorlib/terminal_popup_menu.py:143
msgid "Grouping"
msgstr ""
#: ../terminatorlib/terminal_popup_menu.py:150
msgid "Show _scrollbar"
msgstr ""
#: ../terminatorlib/terminal_popup_menu.py:156
msgid "_Preferences"
msgstr ""
#: ../terminatorlib/terminal_popup_menu.py:163
msgid "Profiles"
msgstr ""
#: ../terminatorlib/terminal_popup_menu.py:207
msgid "Encodings"
msgstr ""
#: ../terminatorlib/terminal_popup_menu.py:222
msgid "Default"
msgstr ""
#: ../terminatorlib/terminal_popup_menu.py:225
msgid "User defined"
msgstr ""
#: ../terminatorlib/terminal_popup_menu.py:241
msgid "Other Encodings"
msgstr ""
#: ../terminatorlib/terminal.py:372
msgid "New group..."
msgstr ""
#: ../terminatorlib/terminal.py:377
msgid "None"
msgstr ""
#: ../terminatorlib/terminal.py:393
#, python-format
msgid "Remove group %s"
msgstr ""
#: ../terminatorlib/terminal.py:398
msgid "G_roup all in tab"
msgstr ""
#: ../terminatorlib/terminal.py:403
msgid "Ungr_oup all in tab"
msgstr ""
#: ../terminatorlib/terminal.py:408
msgid "Remove all groups"
msgstr ""
#: ../terminatorlib/terminal.py:415
#, python-format
msgid "Close group %s"
msgstr ""
#: ../terminatorlib/terminal.py:424
msgid "Broadcast all"
msgstr ""
#: ../terminatorlib/terminal.py:425
msgid "Broadcast group"
msgstr ""
#: ../terminatorlib/terminal.py:426
msgid "Broadcast off"
msgstr ""
#: ../terminatorlib/terminal.py:439
msgid "Split to this group"
msgstr ""
#: ../terminatorlib/terminal.py:444
msgid "Autoclean groups"
msgstr ""
#: ../terminatorlib/terminal.py:451
msgid "Insert terminal number"
msgstr ""
#: ../terminatorlib/terminal.py:455
msgid "Insert padded terminal number"
msgstr ""
#: ../terminatorlib/terminal.py:1193
msgid "Unable to find a shell"
msgstr ""
#: ../terminatorlib/terminal.py:1210
msgid "Unable to start shell:"
msgstr ""
#: ../terminatorlib/window.py:242
msgid "window"
msgstr ""
#. FIXME: Why isn't this being done by Terminator() ?
#: ../terminatorlib/window.py:612
msgid "All"
msgstr ""
#: ../terminatorlib/window.py:633
#, python-format
msgid "Tab %d"
msgstr ""

View File

@ -8,14 +8,14 @@ msgstr ""
"Project-Id-Version: terminator\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-08-21 01:31+0100\n"
"PO-Revision-Date: 2012-05-27 05:41+0000\n"
"PO-Revision-Date: 2012-07-17 10:14+0000\n"
"Last-Translator: Zhaofeng Li <Unknown>\n"
"Language-Team: Simplified Chinese <zh_CN@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-05-28 05:11+0000\n"
"X-Generator: Launchpad (build 15288)\n"
"X-Launchpad-Export-Date: 2012-07-18 05:09+0000\n"
"X-Generator: Launchpad (build 15637)\n"
#: ../data/terminator.desktop.in.h:1
msgid "Multiple terminals in one window"
@ -463,7 +463,7 @@ msgstr "移除组 %s"
#: ../terminatorlib/terminal.py:398
msgid "G_roup all in tab"
msgstr ""
msgstr "将全部集合到一个选项卡里(_R)"
#: ../terminatorlib/terminal.py:403
msgid "Ungr_oup all in tab"

View File

@ -161,7 +161,10 @@ DEFAULTS = {
'new_terminator' : '<Super>i',
'broadcast_off' : '',
'broadcast_group' : '',
'broadcast_all' : ''
'broadcast_all' : '',
'insert_number' : '',
'insert_padded' : '',
'edit_window_title': ''
},
'profiles': {
'default': {

View File

@ -66,9 +66,13 @@ command to execute inside the terminal, and its arguments'))
dest='working_directory', help=_('Set the working directory'))
parser.add_option('-r', '--role', dest='role', help=_('Set a custom \
WM_WINDOW_ROLE property on the window'))
parser.add_option('-c', '--classname', dest='classname', help=_('Set a \
custom name (WM_CLASS) property on the window'))
parser.add_option('-l', '--layout', dest='layout', help=_('Select a layout'))
parser.add_option('-p', '--profile', dest='profile', help=_('Use a \
different profile as the default'))
parser.add_option('-i', '--icon', dest='forcedicon', help=_('Set a custom \
icon for the window (by file or name)'))
parser.add_option('-u', '--no-dbus', action='store_true', dest='nodbus',
help=_('Disable DBus'))
parser.add_option('-d', '--debug', action='count', dest='debug',

View File

@ -44,6 +44,8 @@ class Paned(Container):
else:
container = HPaned()
self.get_toplevel().set_pos_by_ratio = True
if not sibling:
sibling = self.maker.make('terminal')
sibling.set_cwd(cwd)
@ -61,6 +63,11 @@ class Paned(Container):
self.show_all()
while gtk.events_pending():
gtk.main_iteration_do(False)
self.get_toplevel().set_pos_by_ratio = False
def add(self, widget, metadata=None):
"""Add a widget to the container"""
if len(self.children) == 0:
@ -113,6 +120,92 @@ class Paned(Container):
except TypeError:
err('Paned::add: %s has no signal resize-term' % widget)
def on_button_press(self, widget, event):
"""Handle button presses on a Pane"""
if event.button == 1 and event.type == gtk.gdk._2BUTTON_PRESS:
if event.state & gtk.gdk.MOD4_MASK == gtk.gdk.MOD4_MASK:
recurse_up=True
else:
recurse_up=False
if event.state & gtk.gdk.SHIFT_MASK == gtk.gdk.SHIFT_MASK:
recurse_down=True
else:
recurse_down=False
# FIXME: These idle events are creating a lot of weird issues
for i in range(3):
while gtk.events_pending():
gtk.main_iteration_do(False)
self.do_redistribute(recurse_up, recurse_down)
return True
else:
return False
def do_redistribute(self, recurse_up=False, recurse_down=False):
"""Evenly divide available space between sibling panes"""
#1 Find highest ancestor of the same type => ha
highest_ancestor = self
while type(highest_ancestor.get_parent()) == type(highest_ancestor):
highest_ancestor = highest_ancestor.get_parent()
# (1b) If Super modifier, redistribute higher sections too
if recurse_up:
grandfather=highest_ancestor.get_parent()
if grandfather != self.get_toplevel():
grandfather.do_redistribute(recurse_up, recurse_down)
gobject.idle_add(highest_ancestor._do_redistribute, recurse_up, recurse_down)
while gtk.events_pending():
gtk.main_iteration_do(False)
gobject.idle_add(highest_ancestor._do_redistribute, recurse_up, recurse_down)
def _do_redistribute(self, recurse_up=False, recurse_down=False):
maker = Factory()
#2 Make a list of self + all children of same type
tree = [self, [], 0, None]
toproc = [tree]
number_splits = 1
while toproc:
curr = toproc.pop(0)
for child in curr[0].get_children():
if type(child) == type(curr[0]):
childset = [child, [], 0, curr]
curr[1].append(childset)
toproc.append(childset)
number_splits = number_splits+1
else:
curr[1].append([None,[], 1, None])
p = curr
while p:
p[2] = p[2] + 1
p = p[3]
# (1c) If Shift modifier, redistribute lower sections too
if recurse_down and \
(maker.isinstance(child, 'VPaned') or \
maker.isinstance(child, 'HPaned')):
gobject.idle_add(child.do_redistribute, False, True)
#3 Get ancestor x/y => a, and handle size => hs
avail_pixels=self.get_length()
handle_size = self.style_get_property('handle-size')
#4 Math! eek (a - (n * hs)) / (n + 1) = single size => s
single_size = (avail_pixels - (number_splits * handle_size)) / (number_splits + 1)
arr_sizes = [single_size]*(number_splits+1)
for i in range(avail_pixels % (number_splits + 1)):
arr_sizes[i] = arr_sizes[i] + 1
#5 Descend down setting the handle position to s
# (Has to handle nesting properly)
toproc = [tree]
while toproc:
curr = toproc.pop(0)
for child in curr[1]:
toproc.append(child)
if curr[1].index(child) == 0:
curr[0].set_position((child[2]*single_size)+((child[2]-1)*handle_size))
gobject.idle_add(curr[0].set_position, child[2]*single_size)
def remove(self, widget):
"""Remove a widget from the container"""
gtk.Paned.remove(self, widget)
@ -275,6 +368,12 @@ class Paned(Container):
container.add(child)
def new_size(self, widget, allocation):
if self.get_toplevel().set_pos_by_ratio:
self.set_position_by_ratio()
else:
self.set_position(self.get_position())
def set_position_by_ratio(self):
self.set_pos(int(self.ratio*self.get_length()))
def set_position(self, pos):
@ -288,6 +387,7 @@ class HPaned(Paned, gtk.HPaned):
Paned.__init__(self)
gtk.HPaned.__init__(self)
self.register_signals(HPaned)
self.cnxids.new(self, 'button-press-event', self.on_button_press)
def get_length(self):
return(self.allocation.width)
@ -302,6 +402,7 @@ class VPaned(Paned, gtk.VPaned):
Paned.__init__(self)
gtk.VPaned.__init__(self)
self.register_signals(VPaned)
self.cnxids.new(self, 'button-press-event', self.on_button_press)
def get_length(self):
return(self.allocation.height)

View File

@ -31,7 +31,7 @@ class LaunchpadCodeURLHandler(plugin.URLHandler):
nameopen = "Open Launchpad branch"
namecopy = "Copy branch URL"
lpfilters = {}
lpfilters['project'] = '[a-z0-9]{1}[a-z0-9\.\-\+]+'
lpfilters['project'] = '[a-z0-9]{1}[a-z0-9+.-]+'
lpfilters['group'] = '~%s' % lpfilters['project']
lpfilters['series'] = lpfilters['project']
lpfilters['branch'] = '[a-zA-Z0-9]{1}[a-zA-Z0-9_+@.-]+'

View File

@ -126,7 +126,10 @@ class PrefsEditor:
'new_terminator' : 'Spawn a new Terminator process',
'broadcast_off' : 'Don\'t broadcast key presses',
'broadcast_group' : 'Broadcast key presses to group',
'broadcast_all' : 'Broadcast key events to all'
'broadcast_all' : 'Broadcast key events to all',
'insert_number' : 'Insert terminal number',
'insert_padded' : 'Insert zero padded terminal number',
'edit_window_title': 'Edit window title'
}
def __init__ (self, term):

View File

@ -1662,12 +1662,52 @@ class Terminal(gtk.VBox):
def key_broadcast_off(self):
self.set_groupsend(None, self.terminator.groupsend_type['off'])
self.terminator.focus_changed(self)
def key_broadcast_group(self):
self.set_groupsend(None, self.terminator.groupsend_type['group'])
self.terminator.focus_changed(self)
def key_broadcast_all(self):
self.set_groupsend(None, self.terminator.groupsend_type['all'])
self.terminator.focus_changed(self)
def key_insert_number(self):
self.emit('enumerate', False)
def key_insert_padded(self):
self.emit('enumerate', True)
def key_edit_window_title(self):
window = self.get_toplevel()
dialog = gtk.Dialog(_('Rename Window'), window,
gtk.DIALOG_MODAL,
( gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT,
gtk.STOCK_OK, gtk.RESPONSE_ACCEPT ))
dialog.set_default_response(gtk.RESPONSE_ACCEPT)
dialog.set_has_separator(False)
dialog.set_resizable(False)
dialog.set_border_width(8)
label = gtk.Label(_('Enter a new title for the Terminator window...'))
name = gtk.Entry()
name.set_activates_default(True)
if window.title.text != self.vte.get_window_title():
name.set_text(self.get_toplevel().title.text)
dialog.vbox.pack_start(label, False, False, 6)
dialog.vbox.pack_start(name, False, False, 6)
dialog.show_all()
res = dialog.run()
if res == gtk.RESPONSE_ACCEPT:
if name.get_text():
window.title.force_title(None)
window.title.force_title(name.get_text())
else:
window.title.force_title(None)
dialog.destroy()
return
# End key events

View File

@ -37,6 +37,7 @@ class Window(Container, gtk.Window):
losefocus_time = 0
position = None
ignore_startup_show = None
set_pos_by_ratio = None
zoom_data = None
@ -60,7 +61,7 @@ class Window(Container, gtk.Window):
self.register_signals(Window)
self.set_property('allow-shrink', True)
self.apply_icon()
icon_to_apply=''
self.register_callbacks()
self.apply_config()
@ -76,11 +77,18 @@ class Window(Container, gtk.Window):
if options.role is not None:
self.set_role(options.role)
if options.classname is not None:
self.set_wmclass(options.classname, self.wmclass_class)
if options.forcedicon is not None:
icon_to_apply = options.forcedicon
if options.geometry is not None:
if not self.parse_geometry(options.geometry):
err('Window::__init__: Unable to parse geometry: %s' %
options.geometry)
self.apply_icon(icon_to_apply)
self.pending_set_rough_geometry_hint = False
def do_get_property(self, prop):
@ -155,15 +163,36 @@ class Window(Container, gtk.Window):
else:
self.set_iconified(hidden)
def apply_icon(self):
def apply_icon(self, requested_icon):
"""Set the window icon"""
icon_theme = gtk.IconTheme()
icon = None
try:
icon = icon_theme.load_icon(APP_NAME, 48, 0)
except (NameError, gobject.GError):
dbg('Unable to load 48px Terminator icon')
icon = self.render_icon(gtk.STOCK_DIALOG_INFO, gtk.ICON_SIZE_BUTTON)
if requested_icon:
try:
self.set_icon_from_file(requested_icon)
icon = self.get_icon()
except (NameError, gobject.GError):
dbg('Unable to load 48px %s icon as file' % (repr(requested_icon)))
if requested_icon and icon is None:
try:
icon = icon_theme.load_icon(requested_icon, 48, 0)
except (NameError, gobject.GError):
dbg('Unable to load 48px %s icon' % (repr(requested_icon)))
if icon is None:
try:
icon = icon_theme.load_icon(self.wmclass_name, 48, 0)
except (NameError, gobject.GError):
dbg('Unable to load 48px %s icon' % (self.wmclass_name))
if icon is None:
try:
icon = icon_theme.load_icon(APP_NAME, 48, 0)
except (NameError, gobject.GError):
dbg('Unable to load 48px Terminator icon')
icon = self.render_icon(gtk.STOCK_DIALOG_INFO, gtk.ICON_SIZE_BUTTON)
self.set_icon(icon)
@ -419,6 +448,8 @@ class Window(Container, gtk.Window):
else:
container = maker.make('HPaned')
self.set_pos_by_ratio = True
if not sibling:
sibling = maker.make('Terminal')
sibling.set_cwd(cwd)
@ -434,6 +465,11 @@ class Window(Container, gtk.Window):
container.add(term)
container.show_all()
while gtk.events_pending():
gtk.main_iteration_do(False)
self.set_pos_by_ratio = False
def zoom(self, widget, font_scale=True):
"""Zoom a terminal widget"""
children = self.get_children()
@ -479,6 +515,7 @@ class Window(Container, gtk.Window):
def rotate(self, widget, clockwise):
"""Rotate children in this window"""
self.set_pos_by_ratio = True
maker = Factory()
# collect all paned children in breadth-first order
paned = []
@ -495,6 +532,10 @@ class Window(Container, gtk.Window):
self.show_all()
widget.grab_focus()
while gtk.events_pending():
gtk.main_iteration_do(False)
self.set_pos_by_ratio = False
def get_visible_terminals(self):
"""Walk down the widget tree to find all of the visible terminals.
Mostly using Container::get_visible_terminals()"""