Remove encoding from the Preferences menu

This commit is contained in:
Vulcalien 2021-11-06 11:43:23 +01:00
parent 62e111d8df
commit 9f7ed7ee21
3 changed files with 2 additions and 76 deletions

View File

@ -137,14 +137,6 @@
</row>
</data>
</object>
<object class="GtkListStore" id="EncodingListStore">
<columns>
<!-- column-name Encoding -->
<column type="gchararray"/>
<!-- column-name config_value -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkListStore" id="FocusListStore">
<columns>
<!-- column-name focustype -->
@ -2955,7 +2947,7 @@
</packing>
</child>
<child>
<!-- n-columns=2 n-rows=5 -->
<!-- n-columns=2 n-rows=4 -->
<object class="GtkGrid" id="grid15">
<property name="visible">True</property>
<property name="can-focus">False</property>
@ -3051,42 +3043,6 @@
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label13">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes">Encoding:</property>
<property name="use-markup">True</property>
<property name="justify">center</property>
<property name="ellipsize">end</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="encoding_combobox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="hexpand">True</property>
<property name="model">EncodingListStore</property>
<signal name="changed" handler="on_encoding_combobox_changed" swapped="no"/>
<child>
<object class="GtkCellRendererText" id="cellrenderertext17"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkButton" id="reset_compat_defaults_button">
<property name="label" translatable="yes">_Reset Compatibility Options to Defaults</property>
@ -3101,7 +3057,7 @@
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
<property name="top-attach">3</property>
<property name="width">2</property>
</packing>
</child>
@ -4127,7 +4083,6 @@ Much of the behavior of Terminator is based on GNOME Terminal, and we are adding
<widgets>
<widget name="backspace_binding_combobox"/>
<widget name="delete_binding_combobox"/>
<widget name="encoding_combobox"/>
</widgets>
</object>
<object class="GtkAdjustment" id="background_image_shading_adjustment">

View File

@ -14,7 +14,6 @@ from .util import dbg, err
from . import config
from .keybindings import Keybindings, KeymapError
from .translation import _
from .encoding import TerminatorEncoding
from .terminator import Terminator
from .plugin import PluginRegistry
from .version import APP_NAME
@ -687,23 +686,6 @@ class PrefsEditor:
widget.set_active(3)
else:
widget.set_active(0)
# Encoding
rowiter = None
widget = guiget('encoding_combobox')
encodingstore = guiget('EncodingListStore')
value = self.config['encoding']
encodings = TerminatorEncoding().get_list()
encodings.sort(key=lambda x: x[2].lower())
for encoding in encodings:
if encoding[1] is None:
continue
label = "%s %s" % (encoding[2], encoding[1])
rowiter = encodingstore.append([label, encoding[1]])
if encoding[1] == value:
widget.set_active_iter(rowiter)
## Titlebar tab
# Titlebar colors
@ -924,15 +906,6 @@ class PrefsEditor:
self.config['backspace_binding'] = value
self.config.save()
def on_encoding_combobox_changed(self, widget):
"""Encoding setting changed"""
selected = widget.get_active_iter()
liststore = widget.get_model()
value = liststore.get_value(selected, 1)
self.config['encoding'] = value
self.config.save()
def on_scrollback_lines_spinbutton_value_changed(self, widget):
"""Scrollback lines setting changed"""
value = widget.get_value_as_int()

View File

@ -660,8 +660,6 @@ class Terminal(Gtk.VBox):
self.cnxids.new(self.vte, 'child-exited',
lambda x, y: self.emit('close-term'))
if self.custom_encoding != True:
self.vte.set_encoding(self.config['encoding'])
# Word char support was missing from vte 0.38, silently skip this setting
if hasattr(self.vte, 'set_word_char_exceptions'):
self.vte.set_word_char_exceptions(self.config['word_chars'])