Skip to content

Commit

Permalink
Implement GUI for disable_mouse_paste
Browse files Browse the repository at this point in the history
  • Loading branch information
Vulcalien committed Sep 13, 2021
1 parent fa09ba0 commit 2251a34
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 53 deletions.
109 changes: 56 additions & 53 deletions terminatorlib/preferences.glade
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@
</packing>
</child>
<child>
<!-- n-columns=4 n-rows=8 -->
<!-- n-columns=4 n-rows=9 -->
<object class="GtkGrid" id="grid2">
<property name="visible">True</property>
<property name="can-focus">False</property>
Expand Down Expand Up @@ -679,8 +679,8 @@
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
<property name="width">3</property>
<property name="top-attach">5</property>
<property name="width">4</property>
</packing>
</child>
<child>
Expand All @@ -694,53 +694,6 @@
<property name="draw-indicator">True</property>
<signal name="toggled" handler="on_use_custom_url_handler_checkbutton_toggled" swapped="no"/>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">6</property>
<property name="width">3</property>
</packing>
</child>
<child>
<object class="GtkAlignment" id="alignment10">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="left-padding">12</property>
<child>
<object class="GtkBox" id="hbox11">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="spacing">12</property>
<child>
<object class="GtkLabel" id="label33">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Custom URL handler:</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="custom_url_handler_entry">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="invisible-char">•</property>
<property name="primary-icon-activatable">False</property>
<property name="secondary-icon-activatable">False</property>
<signal name="changed" handler="on_custom_url_handler_entry_changed" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">7</property>
Expand Down Expand Up @@ -808,15 +761,65 @@
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">5</property>
<property name="top-attach">6</property>
<property name="width">4</property>
</packing>
</child>
<child>
<placeholder/>
<object class="GtkCheckButton" id="disable_mouse_paste">
<property name="label" translatable="yes">Disable mouse paste</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">False</property>
<property name="xalign">0.5</property>
<property name="draw-indicator">True</property>
<signal name="toggled" handler="on_disable_mouse_paste_toggled" swapped="no"/>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
<property name="width">4</property>
</packing>
</child>
<child>
<placeholder/>
<object class="GtkBox" id="hbox11">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-left">12</property>
<property name="spacing">12</property>
<child>
<object class="GtkLabel" id="label33">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Custom URL handler:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="custom_url_handler_entry">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="invisible-char">•</property>
<property name="primary-icon-activatable">False</property>
<property name="secondary-icon-activatable">False</property>
<signal name="changed" handler="on_custom_url_handler_entry_changed" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">8</property>
<property name="width">4</property>
</packing>
</child>
<child>
<placeholder/>
Expand Down
8 changes: 8 additions & 0 deletions terminatorlib/prefseditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,9 @@ def set_values(self):
# Clear selection on copy
widget = guiget('clear_select_on_copy')
widget.set_active(self.config['clear_select_on_copy'])
# Disable mouse paste
widget = guiget('disable_mouse_paste')
widget.set_active(self.config['disable_mouse_paste'])

## Profile tab
# Populate the profile list
Expand Down Expand Up @@ -842,6 +845,11 @@ def on_clear_select_on_copy_toggled(self,widget):
self.config['clear_select_on_copy'] = widget.get_active()
self.config.save()

def on_disable_mouse_paste_toggled(self, widget):
"""Disable mouse paste"""
self.config['disable_mouse_paste'] = widget.get_active()
self.config.save()

def on_cursor_blink_toggled(self, widget):
"""Cursor blink setting changed"""
self.config['cursor_blink'] = widget.get_active()
Expand Down

0 comments on commit 2251a34

Please sign in to comment.