Added smart copy mode switch to prefs (Steve Boddy, LP#1223129)

This commit is contained in:
Stephen Boddy 2015-10-01 20:53:15 +02:00
parent 2fd279ecf1
commit 78cf6e87ec
15 changed files with 108 additions and 42 deletions

View File

@ -16,6 +16,7 @@ terminator trunk:
* PuTTY paste mode (Nemilya, LP#1416682) with some alterations * PuTTY paste mode (Nemilya, LP#1416682) with some alterations
(Steve Boddy) (Steve Boddy)
* Updated and grouped default shortcuts in man page (Steve Boddy) * Updated and grouped default shortcuts in man page (Steve Boddy)
* Added smart copy mode switch to prefs (Steve Boddy, LP#1223129)
* Bug fixes * Bug fixes
* Fix for those not running IBus, where the IBus workaround caused * Fix for those not running IBus, where the IBus workaround caused
broken keys in other keymaps set with non-IBus tools (Steve broken keys in other keymaps set with non-IBus tools (Steve

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 78 KiB

View File

@ -30,6 +30,8 @@ All contributions and improvements are welcome.
| | | | Add Bug handling flow |br| | | | | | Add Bug handling flow |br| |
| | | | Minor changes/corrections | | | | | Minor changes/corrections |
+--------------+------------+-----------------+-----------------------------------+ +--------------+------------+-----------------+-----------------------------------+
| 0.98, r1667 | 2015-10-01 | Stephen Boddy | Add the new Smart copy mode |br| |
+--------------+------------+-----------------+-----------------------------------+
.. note:: Ideally this documentation should be kept up-to-date with .. note:: Ideally this documentation should be kept up-to-date with
the changes as they go in. This way things don't get missed. the changes as they go in. This way things don't get missed.

View File

@ -74,6 +74,11 @@ Behaviour
get into an argument over what size the window should get into an argument over what size the window should
be. be.
**DBus server** (default: on)
If a Terminator :ref:`dbus` server is not already on the session
bus, try to start one.
**Mouse focus** (default: Click to focus) **Mouse focus** (default: Click to focus)
By what method the mouse pointer sets the focus on a terminal. By what method the mouse pointer sets the focus on a terminal.
@ -99,6 +104,14 @@ Behaviour
will paste the Primary selection, and ``middle-click`` will open will paste the Primary selection, and ``middle-click`` will open
the :ref:`Context Menu <context-menu>`. (For ex-PuTTY users). the :ref:`Context Menu <context-menu>`. (For ex-PuTTY users).
**Smart copy** (default: on)
If enabled 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 not enabled the shortcut does not pass
through at all, and the SIGINT does not get sent.
**Re-use profiles for new terminals** (default: off) **Re-use profiles for new terminals** (default: off)
When creating a new terminal with splitting or new tabs, if this is When creating a new terminal with splitting or new tabs, if this is
@ -117,10 +130,6 @@ Behaviour
If active and set, then URL's will be passed as a command-line parameter If active and set, then URL's will be passed as a command-line parameter
to the given command. to the given command.
**DBus server** (default: on)
If a Terminator :ref:`dbus` server is not already on the session
bus, try to start one.
^^^^^^^^^^ ^^^^^^^^^^
Appearance Appearance

View File

@ -310,6 +310,11 @@ FAQ for other Terminator <br />
Add Bug handling flow <br /> Add Bug handling flow <br />
Minor changes/corrections</td> Minor changes/corrections</td>
</tr> </tr>
<tr class="row-even"><td>0.98, r1667</td>
<td>2015-10-01</td>
<td>Stephen Boddy</td>
<td>Add the new Smart copy mode <br /></td>
</tr>
</tbody> </tbody>
</table> </table>
<div class="admonition note"> <div class="admonition note">

View File

@ -325,6 +325,10 @@ get into an argument over what size the window should
be.</p> be.</p>
</div> </div>
</div></blockquote> </div></blockquote>
<p><strong>DBus server</strong> (default: on)</p>
<blockquote>
<div>If a Terminator <a class="reference internal" href="advancedusage.html#dbus"><span>DBus</span></a> server is not already on the session
bus, try to start one.</div></blockquote>
<p><strong>Mouse focus</strong> (default: Click to focus)</p> <p><strong>Mouse focus</strong> (default: Click to focus)</p>
<blockquote> <blockquote>
<div><p>By what method the mouse pointer sets the focus on a terminal.</p> <div><p>By what method the mouse pointer sets the focus on a terminal.</p>
@ -351,6 +355,13 @@ receive keystrokes.</li>
<div>Make the right mouse button operate like in PuTTY, so <code class="docutils literal"><span class="pre">right-click</span></code> <div>Make the right mouse button operate like in PuTTY, so <code class="docutils literal"><span class="pre">right-click</span></code>
will paste the Primary selection, and <code class="docutils literal"><span class="pre">middle-click</span></code> will open will paste the Primary selection, and <code class="docutils literal"><span class="pre">middle-click</span></code> will open
the <a class="reference internal" href="gettingstarted.html#context-menu"><span>Context Menu</span></a>. (For ex-PuTTY users).</div></blockquote> the <a class="reference internal" href="gettingstarted.html#context-menu"><span>Context Menu</span></a>. (For ex-PuTTY users).</div></blockquote>
<p><strong>Smart copy</strong> (default: on)</p>
<blockquote>
<div>If enabled and there is no selection, the shortcut is allowed to
pass through. This is useful for overloading <code class="docutils literal"><span class="pre">Ctrl</span></code>+<code class="docutils literal"><span class="pre">C</span></code>
to copy a selection, or send the SIGINT to the current process if
there is no selection. If not enabled the shortcut does not pass
through at all, and the SIGINT does not get sent.</div></blockquote>
<p><strong>Re-use profiles for new terminals</strong> (default: off)</p> <p><strong>Re-use profiles for new terminals</strong> (default: off)</p>
<blockquote> <blockquote>
<div>When creating a new terminal with splitting or new tabs, if this is <div>When creating a new terminal with splitting or new tabs, if this is
@ -366,10 +377,6 @@ logic.</div></blockquote>
<blockquote> <blockquote>
<div>If active and set, then URL&#8217;s will be passed as a command-line parameter <div>If active and set, then URL&#8217;s will be passed as a command-line parameter
to the given command.</div></blockquote> to the given command.</div></blockquote>
<p><strong>DBus server</strong> (default: on)</p>
<blockquote>
<div>If a Terminator <a class="reference internal" href="advancedusage.html#dbus"><span>DBus</span></a> server is not already on the session
bus, try to start one.</div></blockquote>
</div></blockquote> </div></blockquote>
</div> </div>
<div class="section" id="appearance"> <div class="section" id="appearance">

File diff suppressed because one or more lines are too long

View File

@ -30,6 +30,8 @@ All contributions and improvements are welcome.
| | | | Add Bug handling flow |br| | | | | | Add Bug handling flow |br| |
| | | | Minor changes/corrections | | | | | Minor changes/corrections |
+--------------+------------+-----------------+-----------------------------------+ +--------------+------------+-----------------+-----------------------------------+
| 0.98, r1667 | 2015-10-01 | Stephen Boddy | Add the new Smart copy mode |br| |
+--------------+------------+-----------------+-----------------------------------+
.. note:: Ideally this documentation should be kept up-to-date with .. note:: Ideally this documentation should be kept up-to-date with
the changes as they go in. This way things don't get missed. the changes as they go in. This way things don't get missed.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 78 KiB

View File

@ -74,6 +74,11 @@ Behaviour
get into an argument over what size the window should get into an argument over what size the window should
be. be.
**DBus server** (default: on)
If a Terminator :ref:`dbus` server is not already on the session
bus, try to start one.
**Mouse focus** (default: Click to focus) **Mouse focus** (default: Click to focus)
By what method the mouse pointer sets the focus on a terminal. By what method the mouse pointer sets the focus on a terminal.
@ -99,6 +104,14 @@ Behaviour
will paste the Primary selection, and ``middle-click`` will open will paste the Primary selection, and ``middle-click`` will open
the :ref:`Context Menu <context-menu>`. (For ex-PuTTY users). the :ref:`Context Menu <context-menu>`. (For ex-PuTTY users).
**Smart copy** (default: on)
If enabled 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 not enabled the shortcut does not pass
through at all, and the SIGINT does not get sent.
**Re-use profiles for new terminals** (default: off) **Re-use profiles for new terminals** (default: off)
When creating a new terminal with splitting or new tabs, if this is When creating a new terminal with splitting or new tabs, if this is
@ -117,10 +130,6 @@ Behaviour
If active and set, then URL's will be passed as a command-line parameter If active and set, then URL's will be passed as a command-line parameter
to the given command. to the given command.
**DBus server** (default: on)
If a Terminator :ref:`dbus` server is not already on the session
bus, try to start one.
^^^^^^^^^^ ^^^^^^^^^^
Appearance Appearance

View File

@ -34,7 +34,7 @@ These are the options Terminator currently supports in the global_config section
.TP .TP
.B dbus .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. 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 .TP
.B focus .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. 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 .TP
.B geometry_hinting .B geometry_hinting
If True the window will resize in step with font sizes, if False it will follow pixels 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 .TP
.B window_state .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. 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. If set to True, right-click will paste the Primary selection, middle-click will popup the context menu.
Default value: \fBFalse\fR Default value: \fBFalse\fR
.TP .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 .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 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 plugins related to Launchpad, which are enabled by default to provide continuity with earlier releases where these were the

View File

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

View File

@ -405,7 +405,7 @@
<object class="GtkTable" id="table8"> <object class="GtkTable" id="table8">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</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="n_columns">2</property>
<property name="column_spacing">12</property> <property name="column_spacing">12</property>
<property name="row_spacing">6</property> <property name="row_spacing">6</property>
@ -536,6 +536,25 @@
<property name="y_options"/> <property name="y_options"/>
</packing> </packing>
</child> </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> </object>
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>
@ -636,6 +655,22 @@
<property name="bottom_attach">3</property> <property name="bottom_attach">3</property>
</packing> </packing>
</child> </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> <child>
<object class="GtkCheckButton" id="always_split_with_profile"> <object class="GtkCheckButton" id="always_split_with_profile">
<property name="label" translatable="yes">Re-use profiles for new terminals</property> <property name="label" translatable="yes">Re-use profiles for new terminals</property>
@ -649,8 +684,8 @@
</object> </object>
<packing> <packing>
<property name="right_attach">2</property> <property name="right_attach">2</property>
<property name="top_attach">3</property> <property name="top_attach">4</property>
<property name="bottom_attach">4</property> <property name="bottom_attach">5</property>
<property name="x_options">GTK_FILL</property> <property name="x_options">GTK_FILL</property>
<property name="y_options"/> <property name="y_options"/>
</packing> </packing>
@ -667,8 +702,8 @@
</object> </object>
<packing> <packing>
<property name="right_attach">2</property> <property name="right_attach">2</property>
<property name="top_attach">4</property> <property name="top_attach">5</property>
<property name="bottom_attach">5</property> <property name="bottom_attach">6</property>
<property name="x_options">GTK_FILL</property> <property name="x_options">GTK_FILL</property>
<property name="y_options"/> <property name="y_options"/>
</packing> </packing>
@ -717,25 +752,6 @@
</object> </object>
</child> </child>
</object> </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> <packing>
<property name="right_attach">2</property> <property name="right_attach">2</property>
<property name="top_attach">6</property> <property name="top_attach">6</property>

View File

@ -290,6 +290,12 @@ class PrefsEditor:
#Always split with profile #Always split with profile
widget = guiget('always_split_with_profile') widget = guiget('always_split_with_profile')
widget.set_active(self.config['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 #Titlebar font selector
# Use system font # Use system font
widget = guiget('title_system_font_checkbutton') widget = guiget('title_system_font_checkbutton')
@ -425,9 +431,6 @@ class PrefsEditor:
# Copy on selection # Copy on selection
widget = guiget('copy_on_selection') widget = guiget('copy_on_selection')
widget.set_active(self.config['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'])
# Word chars # Word chars
widget = guiget('word_chars_entry') widget = guiget('word_chars_entry')
widget.set_text(self.config['word_chars']) widget.set_text(self.config['word_chars'])
@ -730,6 +733,11 @@ class PrefsEditor:
self.config['putty_paste_style'] = widget.get_active() self.config['putty_paste_style'] = widget.get_active()
self.config.save() 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): def on_cursor_blink_toggled(self, widget):
"""Cursor blink setting changed""" """Cursor blink setting changed"""
self.config['cursor_blink'] = widget.get_active() self.config['cursor_blink'] = widget.get_active()

View File

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