[Xfce4-commits] <terminal:master> Add encoding support.

Nick Schermer noreply at xfce.org
Wed Dec 19 21:54:08 CET 2012


Updating branch refs/heads/master
         to 4150b0dae1636205663869b56a1a939fd7c5b4bc (commit)
       from 056e72e59069347749bce53b5c753acb83334842 (commit)

commit 4150b0dae1636205663869b56a1a939fd7c5b4bc
Author: Nick Schermer <nick at xfce.org>
Date:   Wed Dec 19 21:53:07 2012 +0100

    Add encoding support.

 Terminal.glade                         |  535 ++++++++++++++++++++++++--------
 po/POTFILES.in                         |    1 +
 terminal/Makefile.am                   |    2 +
 terminal/terminal-accel-map.c          |    4 +-
 terminal/terminal-encoding-action.c    |  438 ++++++++++++++++++++++++++
 terminal/terminal-encoding-action.h    |   57 ++++
 terminal/terminal-preferences-dialog.c |   50 +++
 terminal/terminal-preferences.c        |   11 +
 terminal/terminal-screen.c             |   33 ++
 terminal/terminal-screen.h             |    5 +
 terminal/terminal-window-ui.xml        |    3 +
 terminal/terminal-window.c             |   38 +++
 12 files changed, 1052 insertions(+), 125 deletions(-)

diff --git a/Terminal.glade b/Terminal.glade
index 7f2da16..5bfd672 100644
--- a/Terminal.glade
+++ b/Terminal.glade
@@ -1,6 +1,6 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <interface>
-  <requires lib="gtk+" version="2.14"/>
+  <requires lib="gtk+" version="2.24"/>
   <!-- interface-requires libxfce4ui 4.5 -->
   <!-- interface-naming-policy project-wide -->
   <object class="GtkAdjustment" id="background-darkness">
@@ -108,16 +108,86 @@
       </row>
     </data>
   </object>
+  <object class="GtkListStore" id="liststore6">
+    <columns>
+      <!-- column-name title -->
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0" translatable="yes">Tiled</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Centered</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Scaled</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Stretched</col>
+      </row>
+    </data>
+  </object>
+  <object class="GtkAdjustment" id="scrolling-line">
+    <property name="lower">48</property>
+    <property name="upper">5242880</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
   <object class="XfceTitledDialog" id="dialog">
+    <property name="can_focus">False</property>
     <property name="title" translatable="yes">Terminal Preferences</property>
     <property name="icon_name">gtk-preferences</property>
     <property name="type_hint">normal</property>
-    <property name="has_separator">False</property>
     <child internal-child="vbox">
       <object class="GtkVBox" id="dialog-vbox1">
         <property name="visible">True</property>
-        <property name="orientation">vertical</property>
+        <property name="can_focus">False</property>
         <property name="spacing">2</property>
+        <child internal-child="action_area">
+          <object class="GtkHButtonBox" id="dialog-action_area1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="button-help">
+                <property name="label">gtk-help</property>
+                <property name="use_action_appearance">False</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+                <property name="secondary">True</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="button-close">
+                <property name="label">gtk-close</property>
+                <property name="use_action_appearance">False</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
         <child>
           <object class="GtkNotebook" id="notebook1">
             <property name="visible">True</property>
@@ -126,21 +196,24 @@
             <child>
               <object class="GtkVBox" id="vbox1">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="border_width">6</property>
-                <property name="orientation">vertical</property>
                 <property name="spacing">6</property>
                 <child>
                   <object class="GtkFrame" id="frame1">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="label_xalign">0</property>
                     <property name="shadow_type">none</property>
                     <child>
                       <object class="GtkAlignment" id="alignment1">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="left_padding">12</property>
                         <child>
                           <object class="GtkTable" id="table1">
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
                             <property name="border_width">6</property>
                             <property name="n_rows">2</property>
                             <property name="n_columns">2</property>
@@ -149,6 +222,7 @@
                             <child>
                               <object class="GtkLabel" id="label5">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="xalign">0</property>
                                 <property name="label" translatable="yes">_Initial title:</property>
                                 <property name="use_underline">True</property>
@@ -162,7 +236,11 @@
                               <object class="GtkEntry" id="title-initial">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
-                                <property name="invisible_char">&#x2022;</property>
+                                <property name="invisible_char">•</property>
+                                <property name="primary_icon_activatable">False</property>
+                                <property name="secondary_icon_activatable">False</property>
+                                <property name="primary_icon_sensitive">True</property>
+                                <property name="secondary_icon_sensitive">True</property>
                               </object>
                               <packing>
                                 <property name="left_attach">1</property>
@@ -172,6 +250,7 @@
                             <child>
                               <object class="GtkLabel" id="label6">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="xalign">0</property>
                                 <property name="label" translatable="yes">_Dynamically-set title:</property>
                                 <property name="use_underline">True</property>
@@ -186,6 +265,7 @@
                             <child>
                               <object class="GtkComboBox" id="title-mode">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="model">liststore1</property>
                                 <child>
                                   <object class="GtkCellRendererText" id="cellrenderertext1"/>
@@ -208,6 +288,7 @@
                     <child type="label">
                       <object class="GtkLabel" id="label4">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="label" translatable="yes">Title</property>
                         <property name="use_markup">True</property>
                         <attributes>
@@ -218,27 +299,31 @@
                   </object>
                   <packing>
                     <property name="expand">False</property>
+                    <property name="fill">True</property>
                     <property name="position">0</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkFrame" id="frame2">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="label_xalign">0</property>
                     <property name="shadow_type">none</property>
                     <child>
                       <object class="GtkAlignment" id="alignment2">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="left_padding">12</property>
                         <child>
                           <object class="GtkVBox" id="vbox2">
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
                             <property name="border_width">6</property>
-                            <property name="orientation">vertical</property>
                             <property name="spacing">6</property>
                             <child>
                               <object class="GtkCheckButton" id="command-login-shell">
                                 <property name="label" translatable="yes">_Run command as login shell</property>
+                                <property name="use_action_appearance">False</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
@@ -247,12 +332,15 @@
                                 <property name="draw_indicator">True</property>
                               </object>
                               <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
                                 <property name="position">0</property>
                               </packing>
                             </child>
                             <child>
                               <object class="GtkCheckButton" id="command-update-records">
                                 <property name="label" translatable="yes">_Update utmp/wtmp records when command is launched</property>
+                                <property name="use_action_appearance">False</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
@@ -260,6 +348,8 @@
                                 <property name="draw_indicator">True</property>
                               </object>
                               <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
                                 <property name="position">1</property>
                               </packing>
                             </child>
@@ -270,6 +360,7 @@
                     <child type="label">
                       <object class="GtkLabel" id="label7">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="label" translatable="yes">Command</property>
                         <property name="use_markup">True</property>
                         <attributes>
@@ -280,27 +371,31 @@
                   </object>
                   <packing>
                     <property name="expand">False</property>
+                    <property name="fill">True</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkFrame" id="frame3">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="label_xalign">0</property>
                     <property name="shadow_type">none</property>
                     <child>
                       <object class="GtkAlignment" id="alignment3">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="left_padding">12</property>
                         <child>
                           <object class="GtkVBox" id="vbox3">
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
                             <property name="border_width">6</property>
-                            <property name="orientation">vertical</property>
                             <property name="spacing">6</property>
                             <child>
                               <object class="GtkCheckButton" id="scrolling-single-line">
                                 <property name="label" translatable="yes">Scroll single _line using Shift-Up/-Down keys</property>
+                                <property name="use_action_appearance">False</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
@@ -309,17 +404,21 @@
                                 <property name="draw_indicator">True</property>
                               </object>
                               <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
                                 <property name="position">0</property>
                               </packing>
                             </child>
                             <child>
                               <object class="GtkHBox" id="hbox1">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="spacing">12</property>
                                 <property name="homogeneous">True</property>
                                 <child>
                                   <object class="GtkCheckButton" id="scrolling-on-output">
                                     <property name="label" translatable="yes">Scroll on ou_tput</property>
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">False</property>
@@ -328,12 +427,15 @@
                                     <property name="draw_indicator">True</property>
                                   </object>
                                   <packing>
+                                    <property name="expand">True</property>
+                                    <property name="fill">True</property>
                                     <property name="position">0</property>
                                   </packing>
                                 </child>
                                 <child>
                                   <object class="GtkCheckButton" id="scrolling-on-keystroke">
                                     <property name="label" translatable="yes">Scroll on _keystroke</property>
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">False</property>
@@ -342,17 +444,22 @@
                                     <property name="draw_indicator">True</property>
                                   </object>
                                   <packing>
+                                    <property name="expand">True</property>
+                                    <property name="fill">True</property>
                                     <property name="position">1</property>
                                   </packing>
                                 </child>
                               </object>
                               <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
                                 <property name="position">1</property>
                               </packing>
                             </child>
                             <child>
                               <object class="GtkTable" id="table2">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="n_rows">2</property>
                                 <property name="n_columns">2</property>
                                 <property name="column_spacing">12</property>
@@ -360,6 +467,7 @@
                                 <child>
                                   <object class="GtkLabel" id="label9">
                                     <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
                                     <property name="xalign">0</property>
                                     <property name="label" translatable="yes">Scr_ollbar is:</property>
                                     <property name="use_underline">True</property>
@@ -372,6 +480,7 @@
                                 <child>
                                   <object class="GtkLabel" id="label10">
                                     <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
                                     <property name="xalign">0</property>
                                     <property name="label" translatable="yes">Scroll_back:</property>
                                     <property name="use_underline">True</property>
@@ -388,7 +497,11 @@
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="tooltip_text" translatable="yes">Specifies the number of lines that you can scroll back using the scrollbar.</property>
-                                    <property name="invisible_char">&#x2022;</property>
+                                    <property name="invisible_char">•</property>
+                                    <property name="primary_icon_activatable">False</property>
+                                    <property name="secondary_icon_activatable">False</property>
+                                    <property name="primary_icon_sensitive">True</property>
+                                    <property name="secondary_icon_sensitive">True</property>
                                     <property name="adjustment">scrolling-line</property>
                                     <property name="numeric">True</property>
                                     <property name="update_policy">if-valid</property>
@@ -403,6 +516,7 @@
                                 <child>
                                   <object class="GtkComboBox" id="scrolling-bar">
                                     <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
                                     <property name="model">liststore2</property>
                                     <child>
                                       <object class="GtkCellRendererText" id="cellrenderertext2"/>
@@ -418,6 +532,8 @@
                                 </child>
                               </object>
                               <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
                                 <property name="position">2</property>
                               </packing>
                             </child>
@@ -428,6 +544,7 @@
                     <child type="label">
                       <object class="GtkLabel" id="label8">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="label" translatable="yes">Scrolling</property>
                         <property name="use_markup">True</property>
                         <attributes>
@@ -438,6 +555,7 @@
                   </object>
                   <packing>
                     <property name="expand">False</property>
+                    <property name="fill">True</property>
                     <property name="position">2</property>
                   </packing>
                 </child>
@@ -446,6 +564,7 @@
             <child type="tab">
               <object class="GtkLabel" id="label1">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="label" translatable="yes">_General</property>
                 <property name="use_underline">True</property>
               </object>
@@ -456,26 +575,29 @@
             <child>
               <object class="GtkVBox" id="vbox4">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="border_width">6</property>
-                <property name="orientation">vertical</property>
                 <property name="spacing">6</property>
                 <child>
                   <object class="GtkFrame" id="frame4">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="label_xalign">0</property>
                     <property name="shadow_type">none</property>
                     <child>
                       <object class="GtkAlignment" id="alignment4">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="border_width">6</property>
                         <property name="left_padding">12</property>
                         <child>
                           <object class="GtkVBox" id="vbox5">
                             <property name="visible">True</property>
-                            <property name="orientation">vertical</property>
+                            <property name="can_focus">False</property>
                             <property name="spacing">6</property>
                             <child>
                               <object class="GtkFontButton" id="font-name">
+                                <property name="use_action_appearance">False</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">True</property>
@@ -484,12 +606,15 @@
                                 <property name="use_font">True</property>
                               </object>
                               <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
                                 <property name="position">0</property>
                               </packing>
                             </child>
                             <child>
                               <object class="GtkCheckButton" id="font-allow-bold">
                                 <property name="label" translatable="yes">Allow bold te_xt</property>
+                                <property name="use_action_appearance">False</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
@@ -498,6 +623,8 @@
                                 <property name="draw_indicator">True</property>
                               </object>
                               <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
                                 <property name="position">1</property>
                               </packing>
                             </child>
@@ -508,6 +635,7 @@
                     <child type="label">
                       <object class="GtkLabel" id="label11">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="label" translatable="yes">Font</property>
                         <property name="use_markup">True</property>
                         <attributes>
@@ -518,27 +646,31 @@
                   </object>
                   <packing>
                     <property name="expand">False</property>
+                    <property name="fill">True</property>
                     <property name="position">0</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkFrame" id="frame5">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="label_xalign">0</property>
                     <property name="shadow_type">none</property>
                     <child>
                       <object class="GtkAlignment" id="alignment5">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="left_padding">12</property>
                         <child>
                           <object class="GtkVBox" id="vbox6">
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
                             <property name="border_width">6</property>
-                            <property name="orientation">vertical</property>
                             <property name="spacing">6</property>
                             <child>
                               <object class="GtkComboBox" id="background-mode">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="model">liststore3</property>
                                 <child>
                                   <object class="GtkCellRendererText" id="cellrenderertext3"/>
@@ -548,12 +680,15 @@
                                 </child>
                               </object>
                               <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
                                 <property name="position">0</property>
                               </packing>
                             </child>
                             <child>
                               <object class="GtkTable" id="box-file">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="n_rows">2</property>
                                 <property name="n_columns">2</property>
                                 <property name="column_spacing">12</property>
@@ -561,6 +696,7 @@
                                 <child>
                                   <object class="GtkLabel" id="file-label">
                                     <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
                                     <property name="xalign">0</property>
                                     <property name="label" translatable="yes">_File:</property>
                                     <property name="use_underline">True</property>
@@ -573,6 +709,7 @@
                                 <child>
                                   <object class="GtkLabel" id="style-label">
                                     <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
                                     <property name="xalign">0</property>
                                     <property name="label" translatable="yes">St_yle:</property>
                                     <property name="use_underline">True</property>
@@ -587,6 +724,7 @@
                                 <child>
                                   <object class="GtkComboBox" id="background-image-style">
                                     <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
                                     <property name="model">liststore6</property>
                                     <child>
                                       <object class="GtkCellRendererText" id="cellrenderertext6"/>
@@ -605,6 +743,7 @@
                                 <child>
                                   <object class="GtkFileChooserButton" id="background-image-file">
                                     <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
                                     <property name="title" translatable="yes">Select Background Image File</property>
                                   </object>
                                   <packing>
@@ -614,16 +753,20 @@
                                 </child>
                               </object>
                               <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
                                 <property name="position">1</property>
                               </packing>
                             </child>
                             <child>
                               <object class="GtkHBox" id="box-opacity">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="spacing">12</property>
                                 <child>
                                   <object class="GtkLabel" id="opacity-label">
                                     <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
                                     <property name="xalign">0</property>
                                     <property name="label" translatable="yes">Transpare_ncy:</property>
                                     <property name="use_underline">True</property>
@@ -631,6 +774,7 @@
                                   </object>
                                   <packing>
                                     <property name="expand">False</property>
+                                    <property name="fill">True</property>
                                     <property name="position">0</property>
                                   </packing>
                                 </child>
@@ -644,11 +788,15 @@
                                     <property name="value_pos">right</property>
                                   </object>
                                   <packing>
+                                    <property name="expand">True</property>
+                                    <property name="fill">True</property>
                                     <property name="position">1</property>
                                   </packing>
                                 </child>
                               </object>
                               <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
                                 <property name="position">2</property>
                               </packing>
                             </child>
@@ -659,6 +807,7 @@
                     <child type="label">
                       <object class="GtkLabel" id="label12">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="label" translatable="yes">Background</property>
                         <property name="use_markup">True</property>
                         <attributes>
@@ -669,27 +818,31 @@
                   </object>
                   <packing>
                     <property name="expand">False</property>
+                    <property name="fill">True</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkFrame" id="frame6">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="label_xalign">0</property>
                     <property name="shadow_type">none</property>
                     <child>
                       <object class="GtkAlignment" id="alignment6">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="left_padding">12</property>
                         <child>
                           <object class="GtkVBox" id="vbox7">
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
                             <property name="border_width">6</property>
-                            <property name="orientation">vertical</property>
                             <property name="spacing">6</property>
                             <child>
                               <object class="GtkCheckButton" id="misc-menubar-default">
                                 <property name="label" translatable="yes">Display _menubar in new windows</property>
+                                <property name="use_action_appearance">False</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
@@ -698,12 +851,15 @@
                                 <property name="draw_indicator">True</property>
                               </object>
                               <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
                                 <property name="position">0</property>
                               </packing>
                             </child>
                             <child>
                               <object class="GtkCheckButton" id="misc-toolbars-default">
                                 <property name="label" translatable="yes">Display _toolbars in new windows</property>
+                                <property name="use_action_appearance">False</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
@@ -712,12 +868,15 @@
                                 <property name="draw_indicator">True</property>
                               </object>
                               <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
                                 <property name="position">1</property>
                               </packing>
                             </child>
                             <child>
                               <object class="GtkCheckButton" id="misc-borders-default">
                                 <property name="label" translatable="yes">Display _borders around new windows</property>
+                                <property name="use_action_appearance">False</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
@@ -726,6 +885,8 @@
                                 <property name="draw_indicator">True</property>
                               </object>
                               <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
                                 <property name="position">2</property>
                               </packing>
                             </child>
@@ -736,6 +897,7 @@
                     <child type="label">
                       <object class="GtkLabel" id="label13">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="label" translatable="yes">Opening New Windows</property>
                         <property name="use_markup">True</property>
                         <attributes>
@@ -746,9 +908,95 @@
                   </object>
                   <packing>
                     <property name="expand">False</property>
+                    <property name="fill">True</property>
                     <property name="position">2</property>
                   </packing>
                 </child>
+                <child>
+                  <object class="GtkFrame" id="frame14">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label_xalign">0</property>
+                    <property name="shadow_type">none</property>
+                    <child>
+                      <object class="GtkAlignment" id="alignment17">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="left_padding">12</property>
+                        <child>
+                          <object class="GtkHBox" id="hbox4">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="border_width">6</property>
+                            <property name="spacing">12</property>
+                            <child>
+                              <object class="GtkLabel" id="label28">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="label" translatable="yes">Reset tab activity _indicator after</property>
+                                <property name="use_underline">True</property>
+                                <property name="mnemonic_widget">spinbutton2</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkSpinButton" id="spinbutton2">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="invisible_char">•</property>
+                                <property name="invisible_char_set">True</property>
+                                <property name="primary_icon_activatable">False</property>
+                                <property name="secondary_icon_activatable">False</property>
+                                <property name="primary_icon_sensitive">True</property>
+                                <property name="secondary_icon_sensitive">True</property>
+                                <property name="adjustment">tab-activity-timeout</property>
+                                <property name="numeric">True</property>
+                                <property name="update_policy">if-valid</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkLabel" id="label29">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="label" translatable="yes">seconds</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">2</property>
+                              </packing>
+                            </child>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
+                    <child type="label">
+                      <object class="GtkLabel" id="label27">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">Tab Activity Indicator</property>
+                        <property name="use_markup">True</property>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                        </attributes>
+                      </object>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">3</property>
+                  </packing>
+                </child>
               </object>
               <packing>
                 <property name="position">1</property>
@@ -757,6 +1005,7 @@
             <child type="tab">
               <object class="GtkLabel" id="label2">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="label" translatable="yes">_Appearance</property>
                 <property name="use_underline">True</property>
               </object>
@@ -768,27 +1017,31 @@
             <child>
               <object class="GtkVBox" id="vbox8">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="border_width">6</property>
-                <property name="orientation">vertical</property>
                 <property name="spacing">6</property>
                 <child>
                   <object class="GtkFrame" id="frame7">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="label_xalign">0</property>
                     <property name="shadow_type">none</property>
                     <child>
                       <object class="GtkAlignment" id="alignment7">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="left_padding">12</property>
                         <child>
                           <object class="GtkHBox" id="hbox2">
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
                             <property name="border_width">6</property>
                             <property name="spacing">12</property>
                             <property name="homogeneous">True</property>
                             <child>
                               <object class="GtkTable" id="table3">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="n_rows">2</property>
                                 <property name="n_columns">2</property>
                                 <property name="column_spacing">12</property>
@@ -796,6 +1049,7 @@
                                 <child>
                                   <object class="GtkLabel" id="label15">
                                     <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
                                     <property name="xalign">0</property>
                                     <property name="label" translatable="yes">_Text color:</property>
                                     <property name="use_underline">True</property>
@@ -807,6 +1061,7 @@
                                 </child>
                                 <child>
                                   <object class="GtkColorButton" id="color-foreground">
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
@@ -828,6 +1083,7 @@
                                 <child>
                                   <object class="GtkLabel" id="label38">
                                     <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
                                     <property name="xalign">0</property>
                                     <property name="label" translatable="yes">_Background color:</property>
                                     <property name="use_underline">True</property>
@@ -841,6 +1097,7 @@
                                 </child>
                                 <child>
                                   <object class="GtkColorButton" id="color-background">
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
@@ -864,18 +1121,21 @@
                               </object>
                               <packing>
                                 <property name="expand">False</property>
+                                <property name="fill">True</property>
                                 <property name="position">0</property>
                               </packing>
                             </child>
                             <child>
                               <object class="GtkTable" id="table6">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="n_rows">2</property>
                                 <property name="n_columns">2</property>
                                 <property name="column_spacing">12</property>
                                 <property name="row_spacing">6</property>
                                 <child>
                                   <object class="GtkColorButton" id="tab-activity-color">
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
@@ -899,6 +1159,7 @@
                                 <child>
                                   <object class="GtkLabel" id="label37">
                                     <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
                                     <property name="xalign">0</property>
                                     <property name="label" translatable="yes">Tab activit_y color:</property>
                                     <property name="use_underline">True</property>
@@ -913,6 +1174,7 @@
                                 <child>
                                   <object class="GtkLabel" id="label35">
                                     <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
                                     <property name="xalign">0</property>
                                     <property name="label" translatable="yes">Cu_rsor color:</property>
                                     <property name="use_underline">True</property>
@@ -924,6 +1186,7 @@
                                 </child>
                                 <child>
                                   <object class="GtkColorButton" id="color-cursor">
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
@@ -945,6 +1208,7 @@
                               </object>
                               <packing>
                                 <property name="expand">False</property>
+                                <property name="fill">True</property>
                                 <property name="position">1</property>
                               </packing>
                             </child>
@@ -955,6 +1219,7 @@
                     <child type="label">
                       <object class="GtkLabel" id="label14">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="label" translatable="yes">General</property>
                         <property name="use_markup">True</property>
                         <attributes>
@@ -965,27 +1230,31 @@
                   </object>
                   <packing>
                     <property name="expand">False</property>
+                    <property name="fill">True</property>
                     <property name="position">0</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkFrame" id="frame8">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="label_xalign">0</property>
                     <property name="shadow_type">none</property>
                     <child>
                       <object class="GtkAlignment" id="alignment11">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="left_padding">12</property>
                         <child>
                           <object class="GtkVBox" id="vbox9">
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
                             <property name="border_width">6</property>
-                            <property name="orientation">vertical</property>
                             <property name="spacing">6</property>
                             <child>
                               <object class="GtkRadioButton" id="color-selection-use-default">
                                 <property name="label" translatable="yes">Use _default color</property>
+                                <property name="use_action_appearance">False</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
@@ -995,16 +1264,20 @@
                                 <property name="draw_indicator">True</property>
                               </object>
                               <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
                                 <property name="position">0</property>
                               </packing>
                             </child>
                             <child>
                               <object class="GtkHBox" id="hbox3">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="spacing">12</property>
                                 <child>
                                   <object class="GtkRadioButton" id="color-selection-use-color">
                                     <property name="label" translatable="yes">Use c_ustom color:</property>
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">False</property>
@@ -1015,11 +1288,13 @@
                                   </object>
                                   <packing>
                                     <property name="expand">False</property>
+                                    <property name="fill">True</property>
                                     <property name="position">0</property>
                                   </packing>
                                 </child>
                                 <child>
                                   <object class="GtkColorButton" id="color-selection">
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
@@ -1034,11 +1309,14 @@
                                   </object>
                                   <packing>
                                     <property name="expand">False</property>
+                                    <property name="fill">True</property>
                                     <property name="position">1</property>
                                   </packing>
                                 </child>
                               </object>
                               <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
                                 <property name="position">1</property>
                               </packing>
                             </child>
@@ -1049,6 +1327,7 @@
                     <child type="label">
                       <object class="GtkLabel" id="label18">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="label" translatable="yes">Text Selection</property>
                         <property name="use_markup">True</property>
                         <attributes>
@@ -1059,42 +1338,50 @@
                   </object>
                   <packing>
                     <property name="expand">False</property>
+                    <property name="fill">True</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkFrame" id="frame9">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="label_xalign">0</property>
                     <property name="shadow_type">none</property>
                     <child>
                       <object class="GtkAlignment" id="alignment12">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="left_padding">12</property>
                         <child>
                           <object class="GtkVBox" id="vbox10">
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
                             <property name="border_width">6</property>
-                            <property name="orientation">vertical</property>
                             <property name="spacing">6</property>
                             <child>
                               <object class="GtkLabel" id="label20">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="xalign">0</property>
                                 <property name="label" translatable="yes">Terminal applications have this color palette available to them:</property>
                               </object>
                               <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
                                 <property name="position">0</property>
                               </packing>
                             </child>
                             <child>
                               <object class="GtkTable" id="table4">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="n_rows">2</property>
                                 <property name="n_columns">8</property>
                                 <property name="homogeneous">True</property>
                                 <child>
                                   <object class="GtkColorButton" id="color-palette1">
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
@@ -1110,6 +1397,7 @@
                                 </child>
                                 <child>
                                   <object class="GtkColorButton" id="color-palette2">
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
@@ -1129,6 +1417,7 @@
                                 </child>
                                 <child>
                                   <object class="GtkColorButton" id="color-palette12">
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
@@ -1150,6 +1439,7 @@
                                 </child>
                                 <child>
                                   <object class="GtkColorButton" id="color-palette9">
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
@@ -1169,6 +1459,7 @@
                                 </child>
                                 <child>
                                   <object class="GtkColorButton" id="color-palette10">
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
@@ -1190,6 +1481,7 @@
                                 </child>
                                 <child>
                                   <object class="GtkColorButton" id="color-palette11">
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
@@ -1211,6 +1503,7 @@
                                 </child>
                                 <child>
                                   <object class="GtkColorButton" id="color-palette3">
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
@@ -1230,6 +1523,7 @@
                                 </child>
                                 <child>
                                   <object class="GtkColorButton" id="color-palette4">
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
@@ -1249,6 +1543,7 @@
                                 </child>
                                 <child>
                                   <object class="GtkColorButton" id="color-palette5">
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
@@ -1268,6 +1563,7 @@
                                 </child>
                                 <child>
                                   <object class="GtkColorButton" id="color-palette13">
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
@@ -1289,6 +1585,7 @@
                                 </child>
                                 <child>
                                   <object class="GtkColorButton" id="color-palette14">
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
@@ -1310,6 +1607,7 @@
                                 </child>
                                 <child>
                                   <object class="GtkColorButton" id="color-palette6">
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
@@ -1329,6 +1627,7 @@
                                 </child>
                                 <child>
                                   <object class="GtkColorButton" id="color-palette7">
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
@@ -1348,6 +1647,7 @@
                                 </child>
                                 <child>
                                   <object class="GtkColorButton" id="color-palette15">
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
@@ -1369,6 +1669,7 @@
                                 </child>
                                 <child>
                                   <object class="GtkColorButton" id="color-palette16">
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
@@ -1390,6 +1691,7 @@
                                 </child>
                                 <child>
                                   <object class="GtkColorButton" id="color-palette8">
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
@@ -1409,6 +1711,8 @@
                                 </child>
                               </object>
                               <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
                                 <property name="position">1</property>
                               </packing>
                             </child>
@@ -1419,6 +1723,7 @@
                     <child type="label">
                       <object class="GtkLabel" id="label19">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="label" translatable="yes">Palette</property>
                         <property name="use_markup">True</property>
                         <attributes>
@@ -1429,6 +1734,7 @@
                   </object>
                   <packing>
                     <property name="expand">False</property>
+                    <property name="fill">True</property>
                     <property name="position">2</property>
                   </packing>
                 </child>
@@ -1440,6 +1746,7 @@
             <child type="tab">
               <object class="GtkLabel" id="label3">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="label" translatable="yes">_Colors</property>
                 <property name="use_underline">True</property>
               </object>
@@ -1451,17 +1758,19 @@
             <child>
               <object class="GtkVBox" id="vbox11">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="border_width">6</property>
-                <property name="orientation">vertical</property>
                 <property name="spacing">6</property>
                 <child>
                   <object class="GtkFrame" id="frame10">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="label_xalign">0</property>
                     <property name="shadow_type">none</property>
                     <child>
                       <object class="GtkAlignment" id="alignment13">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="left_padding">12</property>
                         <child>
                           <object class="GtkScrolledWindow" id="editor-container">
@@ -1481,6 +1790,7 @@
                     <child type="label">
                       <object class="GtkLabel" id="label23">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="label" translatable="yes">Shortcut Keys</property>
                         <property name="use_markup">True</property>
                         <attributes>
@@ -1490,27 +1800,32 @@
                     </child>
                   </object>
                   <packing>
+                    <property name="expand">True</property>
+                    <property name="fill">True</property>
                     <property name="position">0</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkFrame" id="frame11">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="label_xalign">0</property>
                     <property name="shadow_type">none</property>
                     <child>
                       <object class="GtkAlignment" id="alignment14">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="left_padding">12</property>
                         <child>
                           <object class="GtkVBox" id="vbox12">
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
                             <property name="border_width">6</property>
-                            <property name="orientation">vertical</property>
                             <property name="spacing">6</property>
                             <child>
                               <object class="GtkCheckButton" id="shortcuts-no-mnemonics">
                                 <property name="label" translatable="yes">Disable all me_nu access keys (such as Alt+f)</property>
+                                <property name="use_action_appearance">False</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
@@ -1518,12 +1833,15 @@
                                 <property name="draw_indicator">True</property>
                               </object>
                               <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
                                 <property name="position">0</property>
                               </packing>
                             </child>
                             <child>
                               <object class="GtkCheckButton" id="shortcuts-no-menukey">
                                 <property name="label" translatable="yes">Disable m_enu shortcut keys (F10 by default)</property>
+                                <property name="use_action_appearance">False</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
@@ -1531,6 +1849,8 @@
                                 <property name="draw_indicator">True</property>
                               </object>
                               <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
                                 <property name="position">1</property>
                               </packing>
                             </child>
@@ -1541,6 +1861,7 @@
                     <child type="label">
                       <object class="GtkLabel" id="label24">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="label" translatable="yes">Menubar Access</property>
                         <property name="use_markup">True</property>
                         <attributes>
@@ -1551,6 +1872,7 @@
                   </object>
                   <packing>
                     <property name="expand">False</property>
+                    <property name="fill">True</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
@@ -1562,6 +1884,7 @@
             <child type="tab">
               <object class="GtkLabel" id="label21">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="label" translatable="yes">_Shortcuts</property>
                 <property name="use_underline">True</property>
               </object>
@@ -1573,21 +1896,24 @@
             <child>
               <object class="GtkVBox" id="vbox13">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="border_width">6</property>
-                <property name="orientation">vertical</property>
                 <property name="spacing">6</property>
                 <child>
                   <object class="GtkFrame" id="frame12">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="label_xalign">0</property>
                     <property name="shadow_type">none</property>
                     <child>
                       <object class="GtkAlignment" id="alignment15">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="left_padding">12</property>
                         <child>
                           <object class="GtkTable" id="table5">
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
                             <property name="border_width">6</property>
                             <property name="n_rows">5</property>
                             <property name="n_columns">2</property>
@@ -1596,6 +1922,7 @@
                             <child>
                               <object class="GtkLabel" id="label31">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="xalign">0</property>
                                 <property name="label" translatable="yes">_Backspace key generates:</property>
                                 <property name="use_underline">True</property>
@@ -1610,6 +1937,7 @@
                             <child>
                               <object class="GtkLabel" id="label32">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="xalign">0</property>
                                 <property name="label" translatable="yes">_Delete key generates:</property>
                                 <property name="use_underline">True</property>
@@ -1624,6 +1952,7 @@
                             <child>
                               <object class="GtkLabel" id="label33">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="xalign">0</property>
                                 <property name="label" translatable="yes">$TERM s_etting:</property>
                                 <property name="use_underline">True</property>
@@ -1638,11 +1967,13 @@
                             <child>
                               <object class="GtkAlignment" id="alignment18">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="xalign">0</property>
                                 <property name="xscale">0</property>
                                 <child>
                                   <object class="GtkButton" id="reset-compatibility">
                                     <property name="label" translatable="yes">_Reset compatibility options to defaults</property>
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
@@ -1659,6 +1990,7 @@
                             <child>
                               <object class="GtkComboBox" id="binding-delete">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="model">liststore5</property>
                                 <child>
                                   <object class="GtkCellRendererText" id="cellrenderertext5"/>
@@ -1677,6 +2009,7 @@
                             <child>
                               <object class="GtkComboBox" id="binding-backspace">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="model">liststore4</property>
                                 <child>
                                   <object class="GtkCellRendererText" id="cellrenderertext4"/>
@@ -1697,7 +2030,11 @@
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="tooltip_text" translatable="yes">This specifies the value the $TERM environment variable is set to, when a new terminal tab or terminal window is opened. The default should be ok for most systems. If you have problems with colors in some applications, try xterm-color here.</property>
-                                <property name="invisible_char">&#x2022;</property>
+                                <property name="invisible_char">•</property>
+                                <property name="primary_icon_activatable">False</property>
+                                <property name="secondary_icon_activatable">False</property>
+                                <property name="primary_icon_sensitive">True</property>
+                                <property name="secondary_icon_sensitive">True</property>
                               </object>
                               <packing>
                                 <property name="left_attach">1</property>
@@ -1709,6 +2046,7 @@
                             <child>
                               <object class="GtkLabel" id="label34">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="xalign">0</property>
                                 <property name="label" translatable="yes">These options may cause some applications to behave
 incorrectly. They are only here to allow you to work around
@@ -1727,6 +2065,7 @@ different terminal behavior.</property>
                     <child type="label">
                       <object class="GtkLabel" id="label25">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="label" translatable="yes">Compatibility</property>
                         <property name="use_markup">True</property>
                         <attributes>
@@ -1737,27 +2076,31 @@ different terminal behavior.</property>
                   </object>
                   <packing>
                     <property name="expand">False</property>
+                    <property name="fill">True</property>
                     <property name="position">0</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkFrame" id="frame13">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="label_xalign">0</property>
                     <property name="shadow_type">none</property>
                     <child>
                       <object class="GtkAlignment" id="alignment16">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="left_padding">12</property>
                         <child>
                           <object class="GtkVBox" id="vbox14">
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
                             <property name="border_width">6</property>
-                            <property name="orientation">vertical</property>
                             <property name="spacing">6</property>
                             <child>
                               <object class="GtkLabel" id="label30">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="xalign">0</property>
                                 <property name="label" translatable="yes">Consider the following characters part of a _word
 when double clicking:</property>
@@ -1765,6 +2108,8 @@ when double clicking:</property>
                                 <property name="mnemonic_widget">word-chars</property>
                               </object>
                               <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
                                 <property name="position">0</property>
                               </packing>
                             </child>
@@ -1772,21 +2117,29 @@ when double clicking:</property>
                               <object class="GtkEntry" id="word-chars">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
-                                <property name="invisible_char">&#x2022;</property>
+                                <property name="invisible_char">•</property>
+                                <property name="primary_icon_activatable">False</property>
+                                <property name="secondary_icon_activatable">False</property>
+                                <property name="primary_icon_sensitive">True</property>
+                                <property name="secondary_icon_sensitive">True</property>
                               </object>
                               <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
                                 <property name="position">1</property>
                               </packing>
                             </child>
                             <child>
                               <object class="GtkAlignment" id="alignment8">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="xalign">0</property>
                                 <property name="xscale">0</property>
                                 <property name="yscale">0</property>
                                 <child>
                                   <object class="GtkButton" id="reset-word-chars">
                                     <property name="label" translatable="yes">Rese_t double click options to defaults</property>
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
@@ -1807,6 +2160,7 @@ when double clicking:</property>
                     <child type="label">
                       <object class="GtkLabel" id="label26">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="label" translatable="yes">Double Click</property>
                         <property name="use_markup">True</property>
                         <attributes>
@@ -1817,69 +2171,68 @@ when double clicking:</property>
                   </object>
                   <packing>
                     <property name="expand">False</property>
+                    <property name="fill">True</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkFrame" id="frame14">
+                  <object class="GtkFrame" id="frame15">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="label_xalign">0</property>
                     <property name="shadow_type">none</property>
                     <child>
-                      <object class="GtkAlignment" id="alignment17">
+                      <object class="GtkAlignment" id="alignment9">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="left_padding">12</property>
                         <child>
-                          <object class="GtkHBox" id="hbox4">
+                          <object class="GtkHBox" id="hbox5">
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
                             <property name="border_width">6</property>
-                            <property name="spacing">6</property>
+                            <property name="spacing">12</property>
                             <child>
-                              <object class="GtkLabel" id="label28">
+                              <object class="GtkLabel" id="encoding-label">
                                 <property name="visible">True</property>
-                                <property name="label" translatable="yes">Reset tab activity _indicator after</property>
+                                <property name="can_focus">False</property>
+                                <property name="xalign">0</property>
+                                <property name="label" translatable="yes">Default character e_ncoding:</property>
                                 <property name="use_underline">True</property>
-                                <property name="mnemonic_widget">spinbutton2</property>
+                                <property name="mnemonic_widget">encoding-combo</property>
                               </object>
                               <packing>
                                 <property name="expand">False</property>
+                                <property name="fill">True</property>
                                 <property name="position">0</property>
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkSpinButton" id="spinbutton2">
+                              <object class="GtkComboBox" id="encoding-combo">
                                 <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="invisible_char">&#x2022;</property>
-                                <property name="adjustment">tab-activity-timeout</property>
-                                <property name="numeric">True</property>
-                                <property name="update_policy">if-valid</property>
+                                <property name="can_focus">False</property>
+                                <child>
+                                  <object class="GtkCellRendererText" id="cellrenderertext7"/>
+                                  <attributes>
+                                    <attribute name="text">0</attribute>
+                                  </attributes>
+                                </child>
                               </object>
                               <packing>
-                                <property name="expand">False</property>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
                                 <property name="position">1</property>
                               </packing>
                             </child>
-                            <child>
-                              <object class="GtkLabel" id="label29">
-                                <property name="visible">True</property>
-                                <property name="label" translatable="yes">seconds</property>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">False</property>
-                                <property name="position">2</property>
-                              </packing>
-                            </child>
                           </object>
                         </child>
                       </object>
                     </child>
                     <child type="label">
-                      <object class="GtkLabel" id="label27">
+                      <object class="GtkLabel" id="label16">
                         <property name="visible">True</property>
-                        <property name="label" translatable="yes">Tab Activity Indicator</property>
-                        <property name="use_markup">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">Encoding</property>
                         <attributes>
                           <attribute name="weight" value="bold"/>
                         </attributes>
@@ -1887,7 +2240,8 @@ when double clicking:</property>
                     </child>
                   </object>
                   <packing>
-                    <property name="expand">False</property>
+                    <property name="expand">True</property>
+                    <property name="fill">True</property>
                     <property name="position">2</property>
                   </packing>
                 </child>
@@ -1899,6 +2253,7 @@ when double clicking:</property>
             <child type="tab">
               <object class="GtkLabel" id="label22">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="label" translatable="yes">Ad_vanced</property>
                 <property name="use_underline">True</property>
               </object>
@@ -1909,49 +2264,11 @@ when double clicking:</property>
             </child>
           </object>
           <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
             <property name="position">1</property>
           </packing>
         </child>
-        <child internal-child="action_area">
-          <object class="GtkHButtonBox" id="dialog-action_area1">
-            <property name="visible">True</property>
-            <property name="layout_style">end</property>
-            <child>
-              <object class="GtkButton" id="button-help">
-                <property name="label">gtk-help</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
-                <property name="secondary">True</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkButton" id="button-close">
-                <property name="label">gtk-close</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="pack_type">end</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
       </object>
     </child>
     <action-widgets>
@@ -1959,41 +2276,15 @@ when double clicking:</property>
       <action-widget response="0">button-close</action-widget>
     </action-widgets>
   </object>
-  <object class="GtkAdjustment" id="scrolling-line">
-    <property name="lower">48</property>
-    <property name="upper">5242880</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
-  </object>
-  <object class="GtkAdjustment" id="tab-activity-timeout">
-    <property name="upper">30</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
-  </object>
-  <object class="GtkListStore" id="liststore6">
-    <columns>
-      <!-- column-name title -->
-      <column type="gchararray"/>
-    </columns>
-    <data>
-      <row>
-        <col id="0" translatable="yes">Tiled</col>
-      </row>
-      <row>
-        <col id="0" translatable="yes">Centered</col>
-      </row>
-      <row>
-        <col id="0" translatable="yes">Scaled</col>
-      </row>
-      <row>
-        <col id="0" translatable="yes">Stretched</col>
-      </row>
-    </data>
-  </object>
   <object class="GtkSizeGroup" id="sizegroup1">
     <widgets>
       <widget name="style-label"/>
       <widget name="opacity-label"/>
     </widgets>
   </object>
+  <object class="GtkAdjustment" id="tab-activity-timeout">
+    <property name="upper">30</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
 </interface>
diff --git a/po/POTFILES.in b/po/POTFILES.in
index b93fb54..fb40de3 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -3,6 +3,7 @@ terminal/terminal-accel-map.c
 terminal/terminal-app.c
 terminal/terminal-dbus.c
 terminal/terminal-dialogs.c
+terminal/terminal-encoding-action.c
 terminal/terminal-image-loader.c
 terminal/terminal-options.c
 terminal/terminal-preferences-dialog.c
diff --git a/terminal/Makefile.am b/terminal/Makefile.am
index 4041b86..2e53093 100644
--- a/terminal/Makefile.am
+++ b/terminal/Makefile.am
@@ -25,6 +25,7 @@ Terminal_headers = \
 	terminal-accel-map.h \
 	terminal-app.h \
 	terminal-dialogs.h \
+	terminal-encoding-action.h \
 	terminal-image-loader.h \
 	terminal-options.h \
 	terminal-preferences.h \
@@ -45,6 +46,7 @@ Terminal_SOURCES = \
 	terminal-accel-map.c \
 	terminal-app.c \
 	terminal-dialogs.c \
+	terminal-encoding-action.c \
 	terminal-image-loader.c \
 	terminal-options.c \
 	terminal-preferences.c \
diff --git a/terminal/terminal-accel-map.c b/terminal/terminal-accel-map.c
index 02a2ce5..ee75338 100644
--- a/terminal/terminal-accel-map.c
+++ b/terminal/terminal-accel-map.c
@@ -1,7 +1,5 @@
 /*-
- * Copyright (c) 2004-2007 os-cillation e.K.
- *
- * Written by Benedikt Meurer <benny at xfce.org>.
+ * Copyright (C) 2012 Nick Schermer <nick at xfce.org>
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
diff --git a/terminal/terminal-encoding-action.c b/terminal/terminal-encoding-action.c
new file mode 100644
index 0000000..3a6be6b
--- /dev/null
+++ b/terminal/terminal-encoding-action.c
@@ -0,0 +1,438 @@
+/*-
+ * Copyright (C) 2012 Nick Schermer <nick at xfce.org>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef HAVE_MEMORY_H
+#include <memory.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include <gtk/gtk.h>
+#include <libxfce4util/libxfce4util.h>
+
+#include <terminal/terminal-encoding-action.h>
+#include <terminal/terminal-private.h>
+
+
+
+/* Signal identifiers */
+enum
+{
+  ENCODING_CHANGED,
+  LAST_SIGNAL,
+};
+
+
+
+static void       terminal_encoding_action_finalize          (GObject                *object);
+static GtkWidget *terminal_encoding_action_create_menu_item  (GtkAction              *action);
+static void       terminal_encoding_action_menu_shown        (GtkWidget              *menu,
+                                                              TerminalEncodingAction *encoding_action);
+
+
+
+struct _TerminalEncodingActionClass
+{
+  GtkActionClass __parent__;
+};
+
+struct _TerminalEncodingAction
+{
+  GtkAction  __parent__;
+  
+  gchar *current;
+};
+
+
+
+/* group names for the charsets below, order matters! */
+static const gchar *terminal_encodings_names[] =
+{
+  N_("Western European"),
+  N_("Central European"),
+  N_("Baltic"),
+  N_("South-Eastern Europe"),
+  N_("Turkish"),
+  N_("Cyrillic"),
+  N_("Chinese Traditional"),
+  N_("Chinese Simplified"),
+  N_("Korean"),
+  N_("Japanese"),
+  N_("Greek"),
+  N_("Arabic"),
+  N_("Hebrew"),
+  N_("Thai"),
+  N_("Vietnamese"),
+  N_("Unicode"),
+  N_("Other"),
+};
+
+/* charsets for the groups above, order matters! */
+static const gchar *terminal_encodings_charsets[][6] =
+{
+  /* Western European */
+  { "ISO-8859-1", "ISO-8859-15", "ISO-8859-14", "WINDOWS-1252", "IBM850", NULL },
+  /* Central European */
+  { "ISO-8859-2", "ISO-8859-3", "WINDOWS-1250", NULL },
+  /* Baltic */
+  { "ISO-8859-4", "ISO-8859-13", "WINDOWS-1257", NULL },
+  /* South-Eastern Europe */
+  { "ISO-8859-16", NULL },
+  /* Turkish */
+  { "ISO-8859-9", "WINDOWS-1254", NULL },
+  /* Cyrillic */
+  { "KOI8-R", "ISO-8859-5", "WINDOWS-1251", "KOI8-U", "IBM855", NULL },
+  /* Chinese Traditional */
+  { "BIG5", "BIG5-HKSCS", NULL },
+  /* Chinese Simplified */
+  { "GB18030", "GBK", "GB2312", NULL },
+  /* Korean */
+  { "EUC-KR", NULL },
+  /* Japanese */
+  { "SHIFT_JIS", "JIS7", "EUC-JP", NULL },
+  /* Greek */
+  { "ISO-8859-7", "WINDOWS-1253", NULL },
+  /* Arabic */
+  { "ISO-8859-6", "IBM864", "WINDOWS-1256", NULL },
+  /* Hebrew */
+  { "ISO-8859-8", "ISO-8859-8-I", "IBM862", "WINDOWS-1255", NULL },
+  /* Thai */
+  { "TIS-620", "ISO-8859-11", NULL },
+  /* Vietnamese */
+  { "WINDOWS-1258", NULL },
+  /* Unicode */
+  { "UTF-8", "UTF-16", "UTF-7", "UCS-2", NULL },
+  /* Other */
+  { "IBM874", "WINDOWS-1258", "TSCII", NULL },
+};
+
+
+
+static guint  encoding_action_signals[LAST_SIGNAL];
+static GQuark encoding_action_quark = 0;
+
+
+
+G_DEFINE_TYPE (TerminalEncodingAction, terminal_encoding_action, GTK_TYPE_ACTION)
+
+
+
+static void
+terminal_encoding_action_class_init (TerminalEncodingActionClass *klass)
+{
+  GtkActionClass *gtkaction_class;
+  GObjectClass   *gobject_class;
+  
+  gobject_class = G_OBJECT_CLASS (klass);
+  gobject_class->finalize = terminal_encoding_action_finalize;
+
+  gtkaction_class = GTK_ACTION_CLASS (klass);
+  gtkaction_class->create_menu_item = terminal_encoding_action_create_menu_item;
+
+  encoding_action_quark = g_quark_from_static_string ("encoding-action-quark");
+
+  encoding_action_signals[ENCODING_CHANGED] =
+    g_signal_new ("encoding-changed",
+                  G_TYPE_FROM_CLASS (klass),
+                  G_SIGNAL_RUN_LAST,
+                  0, NULL, NULL,
+                  g_cclosure_marshal_VOID__STRING,
+                  G_TYPE_NONE, 1, G_TYPE_STRING);
+}
+
+
+
+static void
+terminal_encoding_action_init (TerminalEncodingAction *action)
+{
+
+}
+
+
+
+static void
+terminal_encoding_action_finalize (GObject *object)
+{
+  TerminalEncodingAction *action = TERMINAL_ENCODING_ACTION (object);
+
+  g_free (action->current);
+
+  (*G_OBJECT_CLASS (terminal_encoding_action_parent_class)->finalize) (object);
+}
+
+
+
+static GtkWidget *
+terminal_encoding_action_create_menu_item (GtkAction *action)
+{
+  GtkWidget *item;
+  GtkWidget *menu;
+
+  terminal_return_val_if_fail (TERMINAL_IS_ENCODING_ACTION (action), NULL);
+
+  /* let GtkAction allocate the menu item */
+  item = (*GTK_ACTION_CLASS (terminal_encoding_action_parent_class)->create_menu_item) (action);
+
+  /* associate an empty submenu with the item (will be filled when shown) */
+  menu = gtk_menu_new ();
+  g_signal_connect (G_OBJECT (menu), "show", G_CALLBACK (terminal_encoding_action_menu_shown), action);
+  gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), menu);
+
+  return item;
+}
+
+
+
+static void
+terminal_encoding_action_activated (GtkWidget              *item,
+                                    TerminalEncodingAction *encoding_action)
+{
+  const gchar *charset;
+  
+  terminal_return_if_fail (GTK_IS_CHECK_MENU_ITEM (item));
+  
+  if (!gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (item)))
+    return;
+
+  /* menu charset or null to reset */
+  charset = g_object_get_qdata (G_OBJECT (item), encoding_action_quark);
+  g_signal_emit (G_OBJECT (encoding_action), 
+                 encoding_action_signals[ENCODING_CHANGED], 0, charset);
+}
+
+
+
+static void
+terminal_encoding_action_menu_shown (GtkWidget              *menu,
+                                     TerminalEncodingAction *action)
+{
+  GList         *children;
+  guint          n, k;
+  GtkWidget     *item;
+  GtkWidget     *item2;
+  GtkWidget     *submenu;
+  const gchar   *charset;
+  GSList        *groups = NULL;
+  gboolean       found;
+  GtkWidget     *label;
+  GtkWidget     *bold_item = NULL;
+  PangoAttrList *attrs;
+  const gchar   *default_charset;
+  gchar         *default_label;
+
+  terminal_return_if_fail (TERMINAL_IS_ENCODING_ACTION (action));
+  terminal_return_if_fail (GTK_IS_MENU_SHELL (menu));
+
+  /* drop all existing children of the menu first */
+  children = gtk_container_get_children (GTK_CONTAINER (menu));
+  g_list_free_full (children, (GDestroyNotify) gtk_widget_destroy);
+
+  g_get_charset (&default_charset);
+  found = (action->current == NULL
+           || g_strcmp0 (default_charset, action->current) == 0);
+
+  /* action to reset to the default */
+  default_label = g_strdup_printf (_("Default (%s)"), default_charset);
+  item = gtk_radio_menu_item_new_with_label (groups, default_label);
+  groups = g_slist_prepend (groups, item);
+  gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+  gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), found);
+  g_signal_connect (G_OBJECT (item), "activate",
+      G_CALLBACK (terminal_encoding_action_activated), action);
+  gtk_widget_show (item);
+  g_free (default_label);
+
+  /*add the groups */
+  for (n = 0; n < G_N_ELEMENTS (terminal_encodings_names); n++)
+    {
+      /* category item */
+      item = gtk_menu_item_new_with_label (_(terminal_encodings_names[n]));
+      gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+      groups = g_slist_prepend (groups, item);
+      gtk_widget_show (item);
+
+      submenu = gtk_menu_new ();
+      gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), submenu);
+
+      /* submenu with charset */
+      for (k = 0; k < G_N_ELEMENTS (*terminal_encodings_charsets); k++)
+        {
+          charset = terminal_encodings_charsets[n][k];
+          if (charset == NULL)
+            break;
+
+          item2 = gtk_radio_menu_item_new_with_label (groups, charset);
+          groups = g_slist_prepend (groups, item2);
+          gtk_menu_shell_append (GTK_MENU_SHELL (submenu), item2);
+          g_object_set_qdata (G_OBJECT (item2), encoding_action_quark, (gchar *) charset);
+          gtk_widget_show (item2);
+
+          if (!found
+              && strcmp (action->current, charset) == 0)
+            {
+              gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item2), TRUE);
+
+              found = TRUE;
+              bold_item = item;
+            }
+
+          g_signal_connect (G_OBJECT (item2), "activate",
+              G_CALLBACK (terminal_encoding_action_activated), action);
+        }
+    }
+
+  if (!found)
+    {
+      /* add an action with the unknown charset */
+      item2 = gtk_radio_menu_item_new_with_label (groups, action->current);
+      groups = g_slist_prepend (groups, item2);
+      g_object_set_qdata_full (G_OBJECT (item2), encoding_action_quark,
+                               g_strdup (action->current), g_free);
+      gtk_menu_shell_append (GTK_MENU_SHELL (submenu), item2);
+      gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item2), TRUE);
+      g_signal_connect (G_OBJECT (item2), "activate",
+        G_CALLBACK (terminal_encoding_action_activated), action);
+      gtk_widget_show (item2);
+
+      /* other group */
+      bold_item = item;
+    }
+
+  if (bold_item != NULL)
+    {
+      attrs = pango_attr_list_new ();
+      pango_attr_list_insert (attrs, pango_attr_weight_new (PANGO_WEIGHT_BOLD));
+      label = gtk_bin_get_child (GTK_BIN (bold_item));
+      gtk_label_set_attributes (GTK_LABEL (label), attrs);
+      pango_attr_list_unref (attrs);
+    }
+}
+
+
+
+GtkAction*
+terminal_encoding_action_new (const gchar *name,
+                              const gchar *label)
+{
+  terminal_return_val_if_fail (name != NULL, NULL);
+  terminal_return_val_if_fail (label != NULL, NULL);
+
+  return g_object_new (TERMINAL_TYPE_ENCODING_ACTION,
+                       "hide-if-empty", FALSE,
+                       "label", label,
+                       "name", name,
+                       NULL);
+}
+
+
+
+void
+terminal_encoding_action_set_charset (GtkAction   *gtkaction,
+                                      const gchar *charset)
+{
+  TerminalEncodingAction *action = TERMINAL_ENCODING_ACTION (gtkaction);
+  
+  terminal_return_if_fail (TERMINAL_IS_ENCODING_ACTION (action));
+  
+  g_free (action->current);
+  action->current = g_strdup (charset);
+}
+
+
+
+
+
+
+
+GtkTreeModel *
+terminal_encoding_model_new (const gchar *current,
+                             GtkTreeIter *current_iter)
+{
+  GtkTreeStore *store;
+  guint         n;
+  guint         k;
+  GtkTreeIter   parent;
+  const gchar  *charset;
+  gboolean      found;
+  GtkTreeIter   iter;
+  gchar        *default_label;
+  
+  store = gtk_tree_store_new (N_ENCODING_COLUMNS,
+                              G_TYPE_STRING,
+                              G_TYPE_BOOLEAN,
+                              G_TYPE_STRING);
+
+  /* default */
+  g_get_charset (&charset);
+  default_label = g_strdup_printf (_("Default (%s)"), charset);
+  gtk_tree_store_insert_with_values (store, &iter, NULL, 0,
+                                     ENCODING_COLUMN_TITLE, default_label,
+                                     ENCODING_COLUMN_VALUE, NULL,
+                                     ENCODING_COLUMN_IS_CHARSET, TRUE,
+                                     -1);
+  g_free (default_label);
+  found = (current == NULL || g_strcmp0 (current, charset) == 0);
+  if (found)
+    *current_iter = iter;
+
+  /*add the groups */
+  for (n = 0; n < G_N_ELEMENTS (terminal_encodings_names); n++)
+    {
+      /* category item */
+      gtk_tree_store_insert_with_values (store, &parent, NULL, n + 1,
+                                         ENCODING_COLUMN_TITLE, _(terminal_encodings_names[n]),
+                                         -1);
+
+      /* submenu with charset */
+      for (k = 0; k < G_N_ELEMENTS (*terminal_encodings_charsets); k++)
+        {
+          charset = terminal_encodings_charsets[n][k];
+          if (charset == NULL)
+            break;
+
+          gtk_tree_store_insert_with_values (store, &iter, &parent, k,
+                                             ENCODING_COLUMN_TITLE, charset,
+                                             ENCODING_COLUMN_VALUE, charset,
+                                             -1);
+          
+          if (!found && g_strcmp0 (charset, current) == 0)
+            {
+              *current_iter = iter;
+              found = TRUE;
+            }
+        }
+    }
+
+  if (!found)
+    {
+      /* add custom in other menu */
+      gtk_tree_store_insert_with_values (store, current_iter, &parent, k,
+                                         ENCODING_COLUMN_TITLE, current,
+                                         ENCODING_COLUMN_IS_CHARSET, TRUE,
+                                         ENCODING_COLUMN_VALUE, current,
+                                         -1);
+    }
+
+  return GTK_TREE_MODEL (store);
+}
+
diff --git a/terminal/terminal-encoding-action.h b/terminal/terminal-encoding-action.h
new file mode 100644
index 0000000..2a072cd
--- /dev/null
+++ b/terminal/terminal-encoding-action.h
@@ -0,0 +1,57 @@
+/*-
+ * Copyright (C) 2012 Nick Schermer <nick at xfce.org>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __TERMINAL_ENCODING_ACTION_H__
+#define __TERMINAL_ENCODING_ACTION_H__
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+typedef struct _TerminalEncodingActionClass TerminalEncodingActionClass;
+typedef struct _TerminalEncodingAction      TerminalEncodingAction;
+
+#define TERMINAL_TYPE_ENCODING_ACTION            (terminal_encoding_action_get_type ())
+#define TERMINAL_ENCODING_ACTION(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), TERMINAL_TYPE_ENCODING_ACTION, TerminalEncodingAction))
+#define TERMINAL_ENCODING_ACTION_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), TERMINAL_TYPE_ENCODING_ACTION, TerminalEncodingActionClass))
+#define TERMINAL_IS_ENCODING_ACTION(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TERMINAL_TYPE_ENCODING_ACTION))
+#define TERMINAL_IS_ENCODING_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TERMINAL_TYPE_ENCODING_ACTION))
+#define TERMINAL_ENCODING_ACTION_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), TERMINAL_TYPE_ENCODING_ACTION, TerminalEncodingActionClass))
+
+GType         terminal_encoding_action_get_type    (void) G_GNUC_CONST;
+             
+GtkAction    *terminal_encoding_action_new         (const gchar *name,
+                                                    const gchar *label) G_GNUC_MALLOC;
+             
+void          terminal_encoding_action_set_charset (GtkAction   *gtkaction,
+                                                    const gchar *charset);
+
+enum
+{
+  ENCODING_COLUMN_TITLE,
+  ENCODING_COLUMN_IS_CHARSET,
+  ENCODING_COLUMN_VALUE,
+  N_ENCODING_COLUMNS
+};
+
+GtkTreeModel *terminal_encoding_model_new          (const gchar *current,
+                                                    GtkTreeIter *current_iter);
+
+G_END_DECLS
+
+#endif /* !__TERMINAL_ENCODING_ACTION_H__ */
diff --git a/terminal/terminal-preferences-dialog.c b/terminal/terminal-preferences-dialog.c
index c6ed4ea..754e9ca 100644
--- a/terminal/terminal-preferences-dialog.c
+++ b/terminal/terminal-preferences-dialog.c
@@ -28,6 +28,7 @@
 #include <terminal/terminal-enum-types.h>
 #include <terminal/terminal-preferences-dialog.h>
 #include <terminal/terminal-shortcut-editor.h>
+#include <terminal/terminal-encoding-action.h>
 #include <terminal/terminal-private.h>
 
 
@@ -47,6 +48,8 @@ static void terminal_preferences_dialog_background_notify (GObject
                                                            GObject                   *widget);
 static void terminal_preferences_dialog_background_set    (GtkFileChooserButton      *widget,
                                                            TerminalPreferencesDialog *dialog);
+static void terminal_preferences_dialog_encoding_changed  (GtkComboBox               *combobox,
+                                                           TerminalPreferencesDialog *dialog);
 
 
 
@@ -87,6 +90,9 @@ terminal_preferences_dialog_init (TerminalPreferencesDialog *dialog)
   GtkFileFilter    *filter;
   gchar            *file;
   ExoMutualBinding *binding;
+  GtkTreeModel     *model;
+  gchar            *current;
+  GtkTreeIter       current_iter;
   const gchar      *props_active[] = { "title-mode", "command-login-shell",
                                        "command-update-records", "scrolling-single-line",
                                        "scrolling-on-output", "scrolling-on-keystroke",
@@ -219,6 +225,17 @@ error:
   gtk_file_filter_add_pixbuf_formats (filter);
   gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (object), filter);
   gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (object), filter);
+
+  /* encoding combo */
+  object = gtk_builder_get_object (GTK_BUILDER (dialog), "encoding-combo");
+  g_object_get (dialog->preferences, "encoding", &current, NULL);
+  model = terminal_encoding_model_new (current, &current_iter);
+  gtk_combo_box_set_model (GTK_COMBO_BOX (object), model);
+  gtk_combo_box_set_active_iter (GTK_COMBO_BOX (object), &current_iter);
+  g_signal_connect (G_OBJECT (object), "changed",
+      G_CALLBACK (terminal_preferences_dialog_encoding_changed), dialog);
+  g_object_unref (G_OBJECT (model));
+  g_free (current);
 }
 
 
@@ -371,6 +388,39 @@ terminal_preferences_dialog_background_set (GtkFileChooserButton      *widget,
 
 
 
+static void
+terminal_preferences_dialog_encoding_changed (GtkComboBox               *combobox,
+                                              TerminalPreferencesDialog *dialog)
+{
+  GtkTreeIter   iter;
+  gchar        *encoding;
+  GtkTreeModel *model;
+  gboolean      is_charset;
+  GtkTreeIter   child_iter;
+
+  if (gtk_combo_box_get_active_iter (combobox, &iter))
+    {
+      model = gtk_combo_box_get_model (combobox);
+      gtk_tree_model_get (model, &iter,
+                          ENCODING_COLUMN_IS_CHARSET, &is_charset,
+                          ENCODING_COLUMN_VALUE, &encoding, -1);
+
+      /* select the child if a menu header is clicked */
+      if (encoding == NULL && !is_charset)
+        {
+          if (gtk_tree_model_iter_children (model, &child_iter, &iter))
+            gtk_combo_box_set_active_iter (combobox, &child_iter);
+          return;
+        }
+
+      /* save new default */
+      g_object_set (dialog->preferences, "encoding", encoding, NULL);
+      g_free (encoding);
+    }
+}
+
+
+
 /**
  * terminal_preferences_dialog_new:
  * @parent      : A #GtkWindow or %NULL.
diff --git a/terminal/terminal-preferences.c b/terminal/terminal-preferences.c
index e3f0056..57c7caa 100644
--- a/terminal/terminal-preferences.c
+++ b/terminal/terminal-preferences.c
@@ -100,6 +100,7 @@ enum
   PROP_COLOR_PALETTE16,
   PROP_COMMAND_UPDATE_RECORDS,
   PROP_COMMAND_LOGIN_SHELL,
+  PROP_ENCODING,
   PROP_FONT_ALLOW_BOLD,
   PROP_FONT_NAME,
   PROP_MISC_ALWAYS_SHOW_TABS,
@@ -912,6 +913,16 @@ terminal_preferences_class_init (TerminalPreferencesClass *klass)
                             EXO_PARAM_READWRITE);
 
   /**
+   * TerminalPreferences:encoding:
+   **/
+  preferences_props[PROP_ENCODING] =
+      g_param_spec_string ("encoding",
+                           "encodinge",
+                           "Encoding",
+                           NULL,
+                           EXO_PARAM_READWRITE);
+
+  /**
    * TerminalPreferences:font-allow-bold:
    **/
   preferences_props[PROP_FONT_ALLOW_BOLD] =
diff --git a/terminal/terminal-screen.c b/terminal/terminal-screen.c
index 82a1c91..73f9634 100644
--- a/terminal/terminal-screen.c
+++ b/terminal/terminal-screen.c
@@ -95,6 +95,7 @@ static void       terminal_screen_update_background             (TerminalScreen
 static void       terminal_screen_update_background_fast        (TerminalScreen        *screen);
 static void       terminal_screen_update_binding_backspace      (TerminalScreen        *screen);
 static void       terminal_screen_update_binding_delete         (TerminalScreen        *screen);
+static void       terminal_screen_update_encoding               (TerminalScreen        *screen);
 static void       terminal_screen_update_colors                 (TerminalScreen        *screen);
 static void       terminal_screen_update_font                   (TerminalScreen        *screen);
 static void       terminal_screen_update_misc_bell              (TerminalScreen        *screen);
@@ -305,6 +306,7 @@ terminal_screen_init (TerminalScreen *screen)
   /* apply current settings */
   terminal_screen_update_binding_backspace (screen);
   terminal_screen_update_binding_delete (screen);
+  terminal_screen_update_encoding (screen);
   terminal_screen_update_font (screen);
   terminal_screen_update_misc_bell (screen);
   terminal_screen_update_misc_cursor_blinks (screen);
@@ -792,6 +794,18 @@ terminal_screen_update_binding_delete (TerminalScreen *screen)
 
 
 static void
+terminal_screen_update_encoding (TerminalScreen *screen)
+{
+  gchar *encoding;
+
+  g_object_get (G_OBJECT (screen->preferences), "encoding", &encoding, NULL);
+  vte_terminal_set_encoding (VTE_TERMINAL (screen->terminal), encoding);
+  g_free (encoding);
+}
+
+
+
+static void
 terminal_screen_update_colors (TerminalScreen *screen)
 {
   GdkColor palette[16];
@@ -1986,3 +2000,22 @@ terminal_screen_focus (TerminalScreen *screen)
 
   gtk_widget_grab_focus (GTK_WIDGET (screen->terminal));
 }
+
+
+
+const gchar *
+terminal_screen_get_encoding (TerminalScreen *screen)
+{
+  terminal_return_val_if_fail (TERMINAL_IS_SCREEN (screen), NULL);
+  return vte_terminal_get_encoding (VTE_TERMINAL (screen->terminal));
+}
+
+
+
+void
+terminal_screen_set_encoding (TerminalScreen *screen,
+                              const gchar    *charset)
+{
+  terminal_return_if_fail (TERMINAL_IS_SCREEN (screen));
+  vte_terminal_set_encoding (VTE_TERMINAL (screen->terminal), charset);
+}
diff --git a/terminal/terminal-screen.h b/terminal/terminal-screen.h
index faee251..bea29c8 100644
--- a/terminal/terminal-screen.h
+++ b/terminal/terminal-screen.h
@@ -90,6 +90,11 @@ GtkWidget   *terminal_screen_get_tab_label                (TerminalScreen *scree
 
 void         terminal_screen_focus                        (TerminalScreen *screen);
 
+const gchar *terminal_screen_get_encoding                 (TerminalScreen *screen);
+
+void         terminal_screen_set_encoding                 (TerminalScreen *screen,
+                                                           const gchar    *charset);
+
 G_END_DECLS
 
 #endif /* !__TERMINAL_SCREEN_H__ */
diff --git a/terminal/terminal-window-ui.xml b/terminal/terminal-window-ui.xml
index cf298b3..56405d5 100644
--- a/terminal/terminal-window-ui.xml
+++ b/terminal/terminal-window-ui.xml
@@ -35,6 +35,9 @@
     </menu>
     <menu action="terminal-menu">
       <menuitem action="set-title" />
+      <separator />
+      <menuitem action="set-encoding" />
+      <separator />
       <menuitem action="reset" />
       <menuitem action="reset-and-clear" />
     </menu>
diff --git a/terminal/terminal-window.c b/terminal/terminal-window.c
index 7f390cb..917216b 100644
--- a/terminal/terminal-window.c
+++ b/terminal/terminal-window.c
@@ -51,6 +51,7 @@
 #include <terminal/terminal-private.h>
 #include <terminal/terminal-marshal.h>
 #include <terminal/terminal-toolbars-view.h>
+#include <terminal/terminal-encoding-action.h>
 #include <terminal/terminal-window.h>
 #include <terminal/terminal-window-ui.h>
 #include <terminal/terminal-widget.h>
@@ -138,6 +139,9 @@ static GtkWidget      *terminal_window_get_context_menu              (TerminalSc
 static void            terminal_window_notify_title                  (TerminalScreen         *screen,
                                                                       GParamSpec             *pspec,
                                                                       TerminalWindow         *window);
+static void            terminal_window_action_set_encoding           (GtkAction              *action,
+                                                                      const gchar            *charset,
+                                                                      TerminalWindow         *window);
 static void            terminal_window_action_new_tab                (GtkAction              *action,
                                                                       TerminalWindow         *window);
 static void            terminal_window_action_new_window             (GtkAction              *action,
@@ -204,6 +208,8 @@ struct _TerminalWindow
   GtkWidget           *toolbars;
   GtkWidget           *notebook;
 
+  GtkAction           *encoding_action;
+
   TerminalScreen      *active;
 };
 
@@ -413,6 +419,12 @@ terminal_window_init (TerminalWindow *window)
   role = g_strdup_printf ("Terminal-%p-%d-%d", window, (gint) getpid (), (gint) time (NULL));
   gtk_window_set_role (GTK_WINDOW (window), role);
   g_free (role);
+
+  /* create encoding action */
+  window->encoding_action = terminal_encoding_action_new ("set-encoding", _("Set _Encoding"));
+  gtk_action_group_add_action (window->action_group, window->encoding_action);
+  g_signal_connect (G_OBJECT (window->encoding_action), "encoding-changed",
+      G_CALLBACK (terminal_window_action_set_encoding), window);
 }
 
 
@@ -439,6 +451,7 @@ terminal_window_finalize (GObject *object)
   g_object_unref (G_OBJECT (window->preferences));
   g_object_unref (G_OBJECT (window->action_group));
   g_object_unref (G_OBJECT (window->ui_manager));
+  g_object_unref (G_OBJECT (window->encoding_action));
 
   (*G_OBJECT_CLASS (terminal_window_parent_class)->finalize) (object);
 }
@@ -789,6 +802,7 @@ terminal_window_notebook_page_switched (GtkNotebook     *notebook,
 {
   TerminalScreen *active;
   gboolean        was_null;
+  const gchar    *encoding;
 
   /* get the new active page */
   active = TERMINAL_SCREEN (gtk_notebook_get_nth_page (notebook, page_num));
@@ -813,6 +827,10 @@ terminal_window_notebook_page_switched (GtkNotebook     *notebook,
       /* reset the activity counter */
       terminal_screen_reset_activity (active);
 
+      /* set charset for menu */
+      encoding = terminal_screen_get_encoding (window->active);
+      terminal_encoding_action_set_charset (window->encoding_action, encoding);
+
       /* set the new geometry widget */
       if (G_LIKELY (!was_null))
         terminal_screen_set_window_geometry_hints (active, GTK_WINDOW (window));
@@ -1223,6 +1241,26 @@ terminal_window_notify_title (TerminalScreen *screen,
 
 
 static void
+terminal_window_action_set_encoding (GtkAction      *action,
+                                     const gchar    *charset,
+                                     TerminalWindow *window)
+{
+  const gchar *new;
+
+  if (G_LIKELY (window->active != NULL))
+    {
+      /* set the charset */
+      terminal_screen_set_encoding (window->active, charset);
+
+      /* update menu */
+      new = terminal_screen_get_encoding (window->active);
+      terminal_encoding_action_set_charset (action, new);
+    }
+}
+
+
+
+static void
 terminal_window_action_new_tab (GtkAction       *action,
                                 TerminalWindow  *window)
 {


More information about the Xfce4-commits mailing list