(trunk-1667) Added smart copy mode switch to prefs

This commit is contained in:
Stephen Boddy 2015-12-01 00:35:06 +01:00
parent 680cfd2278
commit 9115b62928
5 changed files with 60 additions and 29 deletions

View File

@ -34,7 +34,7 @@ These are the options Terminator currently supports in the global_config section
.TP
.B dbus
Control whether or not Terminator will load its DBus server. When this server is loaded, running Terminator multiple times will cause the first Terminator process to open additional windows. If this configuration item is set to False, or the python dbus module is unavailable, running Terminator multiple times will run a separate Terminator process for each invocation.
Default value: \fBFalse\fR
Default value: \fBTrue\fR
.TP
.B focus
Control how focus is given to terminals. 'click' means the focus only moves to a terminal after you click in it. 'sloppy' means the focus will follow the mouse pointer. 'system' means the focus will match that used by a GNOME window manager.
@ -46,7 +46,7 @@ Default value: \fB-1\fR
.TP
.B geometry_hinting
If True the window will resize in step with font sizes, if False it will follow pixels
Default value: \fBTrue\fR
Default value: \fBFalse\fR
.TP
.B window_state
When set to 'normal' the Terminator window opens normally. 'maximise' opens the window in a maximised state, 'fullscreen' in a fullscreen state and 'hidden' will make it not shown by default.
@ -140,6 +140,10 @@ Default value: \fBFalse\fR
If set to True, right-click will paste the Primary selection, middle-click will popup the context menu.
Default value: \fBFalse\fR
.TP
.B smart_copy \fR(boolean)
If set to True, and there is no selection, the shortcut is allowed to pass through. This is useful for overloading Ctrl-C to copy a selection, or send the SIGINT to the current process if there is no selection. If False the shortcut does not pass through at all, and the SIGINT does not get sent.
Default value: \fBTrue\fR
.TP
.B enabled_plugins
A list of plugins which should be loaded by default. All other plugin classes will be ignored. The default value includes two
plugins related to Launchpad, which are enabled by default to provide continuity with earlier releases where these were the

View File

@ -124,6 +124,7 @@ DEFAULTS = {
'title_use_system_font' : True,
'title_font' : 'Sans 9',
'putty_paste_style' : False,
'smart_copy' : True,
},
'keybindings': {
'zoom_in' : '<Control>plus',

View File

@ -434,7 +434,7 @@
<object class="GtkTable" id="table8">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="n_rows">6</property>
<property name="n_rows">7</property>
<property name="n_columns">2</property>
<property name="column_spacing">12</property>
<property name="row_spacing">6</property>
@ -565,6 +565,25 @@
<property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="dbuscheck">
<property name="label" translatable="yes">DBus server</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_dbuscheck_toggled" swapped="no"/>
</object>
<packing>
<property name="right_attach">2</property>
<property name="top_attach">6</property>
<property name="bottom_attach">7</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"/>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
@ -665,6 +684,22 @@
<property name="bottom_attach">3</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="smart_copy">
<property name="label" translatable="yes">Smart copy</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_smart_copy_toggled" swapped="no"/>
</object>
<packing>
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="always_split_with_profile">
<property name="label" translatable="yes">Re-use profiles for new terminals</property>
@ -678,8 +713,8 @@
</object>
<packing>
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"/>
</packing>
@ -696,8 +731,8 @@
</object>
<packing>
<property name="right_attach">2</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"/>
</packing>
@ -746,25 +781,6 @@
</object>
</child>
</object>
<packing>
<property name="right_attach">2</property>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"/>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="dbuscheck">
<property name="label" translatable="yes">DBus server</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_dbuscheck_toggled" swapped="no"/>
</object>
<packing>
<property name="right_attach">2</property>
<property name="top_attach">6</property>

View File

@ -289,6 +289,12 @@ class PrefsEditor:
#Always split with profile
widget = guiget('always_split_with_profile')
widget.set_active(self.config['always_split_with_profile'])
# Putty paste style
widget = guiget('putty_paste_style')
widget.set_active(self.config['putty_paste_style'])
# Smart copy
widget = guiget('smart_copy')
widget.set_active(self.config['smart_copy'])
#Titlebar font selector
# Use system font
widget = guiget('title_system_font_checkbutton')
@ -421,9 +427,6 @@ class PrefsEditor:
# Copy on selection
widget = guiget('copy_on_selection')
widget.set_active(self.config['copy_on_selection'])
# Putty paste style
widget = guiget('putty_paste_style')
widget.set_active(self.config['putty_paste_style'])
# Rewrap on resize
widget = guiget('rewrap_on_resize_checkbutton')
widget.set_active(self.config['rewrap_on_resize'])
@ -718,6 +721,11 @@ class PrefsEditor:
self.config['putty_paste_style'] = widget.get_active()
self.config.save()
def on_smart_copy_toggled(self, widget):
"""Putty paste style setting changed"""
self.config['smart_copy'] = widget.get_active()
self.config.save()
def on_cursor_blink_toggled(self, widget):
"""Cursor blink setting changed"""
self.config['cursor_blink'] = widget.get_active()

View File

@ -895,6 +895,8 @@ class Terminal(Gtk.VBox):
if self.vte.get_has_selection ():
getattr(self, "key_" + mapping)()
return(True)
elif not self.config['smart_copy']:
return(True)
else:
getattr(self, "key_" + mapping)()
return(True)