add config entry and preferences GUI

This commit is contained in:
Matt Rose 2020-10-19 17:14:40 -04:00
parent 657c45abb7
commit 1822d6ccb1
4 changed files with 46 additions and 8 deletions

View File

@ -121,6 +121,7 @@ DEFAULTS = {
'putty_paste_style' : False,
'putty_paste_style_source_clipboard': False,
'smart_copy' : True,
'clear_select_on_copy' : False,
'line_height' : 1.0,
},
'keybindings': {

View File

@ -605,7 +605,7 @@
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="left_attach">2</property>
<property name="top_attach">0</property>
<property name="width">2</property>
</packing>
@ -638,7 +638,7 @@
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="left_attach">2</property>
<property name="top_attach">1</property>
<property name="width">2</property>
</packing>
@ -673,7 +673,6 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="width">3</property>
</packing>
</child>
<child>
@ -754,7 +753,7 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">6</property>
<property name="width">3</property>
<property name="width">4</property>
</packing>
</child>
<child>
@ -770,7 +769,7 @@
<signal name="toggled" handler="on_putty_paste_style_source_clipboard_toggled" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="left_attach">2</property>
<property name="top_attach">2</property>
</packing>
</child>
@ -788,10 +787,43 @@
<signal name="toggled" handler="on_putty_paste_style_source_clipboard_toggled" swapped="no"/>
</object>
<packing>
<property name="left_attach">2</property>
<property name="left_attach">3</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton">
<property name="label" translatable="yes">Clear selection on copy</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_clear_select_on_copy_toggled" swapped="no"/>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">3</property>
<property name="width">2</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">True</property>

View File

@ -824,6 +824,11 @@ class PrefsEditor:
self.config['smart_copy'] = widget.get_active()
self.config.save()
def on_clear_select_on_copy_toggled(self,widget):
"""Clear selection on smart copy"""
self.config['clear_select_on_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

@ -1757,7 +1757,7 @@ class Terminal(Gtk.VBox):
if rv:
alloc.x, alloc.y = rv
return alloc
# There now begins a great list of keyboard event handlers
def key_zoom_in(self):
self.zoom_in()
@ -1773,7 +1773,7 @@ class Terminal(Gtk.VBox):
def key_copy(self):
self.vte.copy_clipboard()
if self.config['smart_copy']:
if self.config['clear_select_on_copy']:
self.vte.unselect_all()
def key_paste(self):