(trunk-1663) PuTTY paste mode
This commit is contained in:
parent
9f09d9c334
commit
a04ffed850
|
@ -136,6 +136,10 @@ Controls whether splits/tabs will continue to use the profile of their peer term
|
||||||
the default profile.
|
the default profile.
|
||||||
Default value: \fBFalse\fR
|
Default value: \fBFalse\fR
|
||||||
.TP
|
.TP
|
||||||
|
.B putty_paste_style \fR(boolean)
|
||||||
|
If set to True, right-click will paste the Primary selection, middle-click will popup the context menu.
|
||||||
|
Default value: \fBFalse\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
|
||||||
|
|
|
@ -123,6 +123,7 @@ DEFAULTS = {
|
||||||
'always_split_with_profile': False,
|
'always_split_with_profile': False,
|
||||||
'title_use_system_font' : True,
|
'title_use_system_font' : True,
|
||||||
'title_font' : 'Sans 9',
|
'title_font' : 'Sans 9',
|
||||||
|
'putty_paste_style' : False,
|
||||||
},
|
},
|
||||||
'keybindings': {
|
'keybindings': {
|
||||||
'zoom_in' : '<Control>plus',
|
'zoom_in' : '<Control>plus',
|
||||||
|
|
|
@ -576,7 +576,7 @@
|
||||||
<object class="GtkTable" id="table9">
|
<object class="GtkTable" id="table9">
|
||||||
<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>
|
||||||
|
@ -649,6 +649,22 @@
|
||||||
<property name="y_options"/>
|
<property name="y_options"/>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkCheckButton" id="putty_paste_style">
|
||||||
|
<property name="label" translatable="yes">Putty style paste</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_putty_paste_style_toggled" swapped="no"/>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="right_attach">2</property>
|
||||||
|
<property name="top_attach">2</property>
|
||||||
|
<property name="bottom_attach">3</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>
|
||||||
|
@ -662,8 +678,8 @@
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="right_attach">2</property>
|
<property name="right_attach">2</property>
|
||||||
<property name="top_attach">2</property>
|
<property name="top_attach">3</property>
|
||||||
<property name="bottom_attach">3</property>
|
<property name="bottom_attach">4</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>
|
||||||
|
@ -680,8 +696,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>
|
||||||
|
@ -732,8 +748,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>
|
||||||
|
@ -751,8 +767,8 @@
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="right_attach">2</property>
|
<property name="right_attach">2</property>
|
||||||
<property name="top_attach">5</property>
|
<property name="top_attach">6</property>
|
||||||
<property name="bottom_attach">6</property>
|
<property name="bottom_attach">7</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>
|
||||||
|
|
|
@ -421,6 +421,9 @@ 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'])
|
||||||
# Rewrap on resize
|
# Rewrap on resize
|
||||||
widget = guiget('rewrap_on_resize_checkbutton')
|
widget = guiget('rewrap_on_resize_checkbutton')
|
||||||
widget.set_active(self.config['rewrap_on_resize'])
|
widget.set_active(self.config['rewrap_on_resize'])
|
||||||
|
@ -710,6 +713,11 @@ class PrefsEditor:
|
||||||
self.config['rewrap_on_resize'] = widget.get_active()
|
self.config['rewrap_on_resize'] = widget.get_active()
|
||||||
self.config.save()
|
self.config.save()
|
||||||
|
|
||||||
|
def on_putty_paste_style_toggled(self, widget):
|
||||||
|
"""Putty paste style setting changed"""
|
||||||
|
self.config['putty_paste_style'] = 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()
|
||||||
|
|
|
@ -69,6 +69,10 @@ class Terminal(Gtk.VBox):
|
||||||
|
|
||||||
TARGET_TYPE_VTE = 8
|
TARGET_TYPE_VTE = 8
|
||||||
|
|
||||||
|
MOUSEBUTTON_LEFT = 1
|
||||||
|
MOUSEBUTTON_MIDDLE = 2
|
||||||
|
MOUSEBUTTON_RIGHT = 3
|
||||||
|
|
||||||
terminator = None
|
terminator = None
|
||||||
vte = None
|
vte = None
|
||||||
terminalbox = None
|
terminalbox = None
|
||||||
|
@ -918,17 +922,24 @@ class Terminal(Gtk.VBox):
|
||||||
# Suppress double-click behavior
|
# Suppress double-click behavior
|
||||||
return True
|
return True
|
||||||
|
|
||||||
if event.button == 1:
|
if self.config['putty_paste_style']:
|
||||||
|
btn_to_paste = self.MOUSEBUTTON_RIGHT
|
||||||
|
btn_to_context_menu = self.MOUSEBUTTON_MIDDLE
|
||||||
|
else:
|
||||||
|
btn_to_paste = self.MOUSEBUTTON_MIDDLE
|
||||||
|
btn_to_context_menu = self.MOUSEBUTTON_RIGHT
|
||||||
|
|
||||||
|
if event.button == self.MOUSEBUTTON_LEFT:
|
||||||
# Ctrl+leftclick on a URL should open it
|
# Ctrl+leftclick on a URL should open it
|
||||||
if event.get_state() & Gdk.ModifierType.CONTROL_MASK == Gdk.ModifierType.CONTROL_MASK:
|
if event.get_state() & Gdk.ModifierType.CONTROL_MASK == Gdk.ModifierType.CONTROL_MASK:
|
||||||
url = self.vte.match_check_event(event)
|
url = self.vte.match_check_event(event)
|
||||||
if url[0]:
|
if url[0]:
|
||||||
self.open_url(url, prepare=True)
|
self.open_url(url, prepare=True)
|
||||||
elif event.button == 2:
|
elif event.button == btn_to_paste:
|
||||||
# middleclick should paste the clipboard
|
# middleclick should paste the clipboard
|
||||||
self.paste_clipboard(True)
|
self.paste_clipboard(True)
|
||||||
return(True)
|
return(True)
|
||||||
elif event.button == 3:
|
elif event.button == btn_to_context_menu:
|
||||||
# rightclick should display a context menu if Ctrl is not pressed,
|
# rightclick should display a context menu if Ctrl is not pressed,
|
||||||
# plus either the app is not interested in mouse events or Shift is pressed
|
# plus either the app is not interested in mouse events or Shift is pressed
|
||||||
if event.get_state() & Gdk.ModifierType.CONTROL_MASK == 0:
|
if event.get_state() & Gdk.ModifierType.CONTROL_MASK == 0:
|
||||||
|
|
Loading…
Reference in New Issue