diff --git a/configure.ac b/configure.ac
index 8313fab9..2036ed68 100644
--- a/configure.ac
+++ b/configure.ac
@@ -38,8 +38,8 @@ AM_GLIB_GNU_GETTEXT
 
 AX_PTHREAD([],[AC_MSG_ERROR([pthreads are required])])
 
-GLIB_REQUIRED=2.42.0
-GLIB_MIN_REQUIRED=2.42
+GLIB_REQUIRED=2.44.0
+GLIB_MIN_REQUIRED=2.44
 GLIB_MAX_ALLOWED=2.50
 
 GIO_REQUIRED=2.34.0
@@ -60,8 +60,8 @@ AC_MSG_RESULT([$with_gtk])
 
 case "$with_gtk" in
   3.0) GTK_API_VERSION=3.0
-       GTK_REQUIRED=3.12.0
-       GTK_MIN_REQUIRED=3.8
+       GTK_REQUIRED=3.16.0
+       GTK_MIN_REQUIRED=3.16
        GTK_MAX_ALLOWED=3.20
        VTE_API_VERSION=2.91
        VTE_REQUIRED=0.51.2
diff --git a/src/preferences.ui b/src/preferences.ui
index 33776470..009ededb 100644
--- a/src/preferences.ui
+++ b/src/preferences.ui
@@ -42,33 +42,270 @@
       </row>
     </data>
   </object>
+  <object class="GtkAdjustment" id="adjustment1">
+    <property name="lower">16</property>
+    <property name="upper">511</property>
+    <property name="value">80</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment2">
+    <property name="lower">4</property>
+    <property name="upper">511</property>
+    <property name="value">24</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment4">
+    <property name="lower">1</property>
+    <property name="upper">2147483647</property>
+    <property name="value">1</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">100</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment5">
+    <property name="lower">1.0</property>
+    <property name="upper">2.0</property>
+    <property name="value">1.0</property>
+    <property name="step_increment">0.05</property>
+    <property name="page_increment">0.25</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment6">
+    <property name="lower">1.0</property>
+    <property name="upper">2.0</property>
+    <property name="value">1.0</property>
+    <property name="step_increment">0.05</property>
+    <property name="page_increment">0.25</property>
+  </object>
+  <object class="GtkListStore" id="cjk-ambiguous-width-model">
+    <columns>
+      <!-- column-name gchararray -->
+      <column type="gchararray"/>
+      <!-- column-name gchararray1 -->
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0" translatable="yes" comments="ambiguous-width characers are">Narrow</col>
+        <col id="1">narrow</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes" comments="ambiguous-width characers are">Wide</col>
+        <col id="1">wide</col>
+      </row>
+    </data>
+  </object>
+  <object class="GtkListStore" id="model1">
+    <columns>
+      <!-- column-name gchararray -->
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0" translatable="yes" comments="Cursor shape">Block</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes" comments="Cursor shape">I-Beam</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes" comments="Cursor shape">Underline</col>
+      </row>
+    </data>
+  </object>
+  <object class="GtkListStore" id="model7">
+    <columns>
+      <!-- column-name gchararray -->
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0" translatable="yes" comments="Cursor blink mode">Default</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes" comments="Cursor blink mode">Enabled</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes" comments="Cursor blink mode">Disabled</col>
+      </row>
+    </data>
+  </object>
+  <object class="GtkListStore" id="model5">
+    <columns>
+      <!-- column-name gchararray -->
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0" translatable="yes" comments="Text blink mode">Never</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes" comments="Text blink mode">When focused</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes" comments="Text blink mode">When unfocused</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes" comments="Text blink mode">Always</col>
+      </row>
+    </data>
+  </object>
+  <object class="GtkListStore" id="model2">
+    <columns>
+      <!-- column-name gchararray -->
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0" translatable="yes" comments="When terminal commands set their own titles">Replace initial title</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes" comments="When terminal commands set their own titles">Append initial title</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes" comments="When terminal commands set their own titles">Prepend initial title</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes" comments="When terminal commands set their own titles">Keep initial title</col>
+      </row>
+    </data>
+  </object>
+  <object class="GtkListStore" id="model3">
+    <columns>
+      <!-- column-name gchararray -->
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0" translatable="yes" comments="When command exits">Exit the terminal</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes" comments="When command exits">Restart the command</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes" comments="When command exits">Hold the terminal open</col>
+      </row>
+    </data>
+  </object>
+  <object class="GtkListStore" id="model4">
+    <columns>
+      <!-- column-name gchararray -->
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0" translatable="yes" comments="This is the name of a colour scheme">Tango</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes" comments="This is the name of a colour scheme">Linux console</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes" comments="This is the name of a colour scheme">XTerm</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes" comments="This is the name of a colour scheme">Rxvt</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes" comments="This is the name of a colour scheme">Solarized</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes" comments="This is the name of a colour scheme">Custom</col>
+      </row>
+    </data>
+  </object>
+  <object class="GtkListStore" id="model6">
+    <columns>
+      <!-- column-name gchararray -->
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0" translatable="yes" comments="This refers to the Delete keybinding option">Automatic</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes" comments="This refers to the Delete keybinding option">Control-H</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes" comments="This refers to the Delete keybinding option">ASCII DEL</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes" comments="This refers to the Delete keybinding option">Escape sequence</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes" comments="This refers to the Delete keybinding option">TTY Erase</col>
+      </row>
+    </data>
+  </object>
   <object class="GtkApplicationWindow" id="preferences-dialog">
     <property name="can_focus">False</property>
     <property name="show_menubar">False</property>
-    <property name="border_width">0</property>
-    <property name="title" translatable="yes">Preferences</property>
+    <property name="title" translatable="yes">GNOME Terminal Preferences</property>
     <property name="role">gnome-terminal-preferences</property>
+    <property name="resizable">False</property>
     <child>
       <object class="GtkBox" id="dialogue-content-box">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
-        <property name="margin_left">12</property>
-        <property name="margin_right">12</property>
+        <property name="margin_start">12</property>
+        <property name="margin_end">12</property>
         <property name="margin_top">12</property>
         <property name="margin_bottom">12</property>
         <property name="orientation">vertical</property>
         <property name="spacing">12</property>
+
         <child>
-          <object class="GtkNotebook" id="notebook1">
+          <object class="GtkHBox" id="main-hbox">
             <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="border_width">0</property>
+            <property name="can_focus">False</property>
+            <property name="spacing">12</property>
+
+              <child>
+                <object class="GtkListBox" id="the-listbox">
+                  <property name="visible">True</property>
+                  <child>
+                    <object class="GtkListBoxRow" id="preferences-old-profiles-unused">
+                        <property name="visible">True</property>
+                        <child>
+                          <object class="GtkLabel">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">Legacy list glade</property>
+                            <property name="use_underline">True</property>
+                            <property name="xalign">0</property>
+                            <property name="margin_start">6</property>
+                            <property name="margin_end">6</property>
+                            <property name="margin_top">6</property>
+                            <property name="margin_bottom">6</property>
+                          </object>
+                        </child>
+                    </object>
+                  </child>
+                </object>
+              </child>
+
+<!--
+              <child>
+                <object class="GtkVSeparator">
+                  <property name="visible">True</property>
+                </object>
+              </child>
+-->
+
+              <child>
+                <object class="GtkStack" id="the-stack">
+                  <property name="visible">True</property>
+
+
+<!-- general prefs begin here -->
             <child>
-              <object class="GtkBox" id="general">
+              <object class="GtkFrame" id="general">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+            <child>
+              <object class="GtkBox">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="border_width">12</property>
                 <property name="orientation">vertical</property>
+                <property name="border_width">12</property>
                 <property name="spacing">6</property>
                 <child>
                   <object class="GtkCheckButton" id="default-show-menubar-checkbutton">
@@ -136,8 +373,21 @@
                         <property name="xalign">0</property>
                       </object>
                       <packing>
+                        <property name="left_attach">0</property>
                         <property name="top_attach">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="new-terminal-mode-label">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">Open _new terminals in:</property>
+                        <property name="use_underline">True</property>
+                        <property name="mnemonic_widget">new-terminal-mode-combobox</property>
+                      </object>
+                      <packing>
                         <property name="left_attach">0</property>
+                        <property name="top_attach">1</property>
                       </packing>
                     </child>
                     <child>
@@ -147,28 +397,15 @@
                         <property name="model">theme-variant-liststore</property>
                         <property name="id_column">1</property>
                         <child>
-                          <object class="GtkCellRendererText" id="renderer1"/>
+                          <object class="GtkCellRendererText" id="renderer1a"/>
                           <attributes>
                             <attribute name="text">0</attribute>
                           </attributes>
                         </child>
                       </object>
                       <packing>
-                        <property name="top_attach">0</property>
                         <property name="left_attach">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="new-terminal-mode-label">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="label" translatable="yes">Open _new terminals in:</property>
-                        <property name="use_underline">True</property>
-                        <property name="mnemonic_widget">new-terminal-mode-combobox</property>
-                      </object>
-                      <packing>
-                        <property name="top_attach">1</property>
-                        <property name="left_attach">0</property>
+                        <property name="top_attach">0</property>
                       </packing>
                     </child>
                     <child>
@@ -178,15 +415,15 @@
                         <property name="model">new-terminal-mode-liststore</property>
                         <property name="id_column">1</property>
                         <child>
-                          <object class="GtkCellRendererText" id="renderer2"/>
+                          <object class="GtkCellRendererText" id="renderer2a"/>
                           <attributes>
                             <attribute name="text">0</attribute>
                           </attributes>
                         </child>
                       </object>
                       <packing>
-                        <property name="top_attach">1</property>
                         <property name="left_attach">1</property>
+                        <property name="top_attach">1</property>
                       </packing>
                     </child>
                   </object>
@@ -198,18 +435,21 @@
                 </child>
               </object>
             </child>
-            <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>
               </object>
               <packing>
-                <property name="tab_fill">False</property>
+                <property name="name">general-prefs</property>
               </packing>
             </child>
+<!-- general prefs end here -->
+
+
+<!-- shortcuts begin here -->
             <child>
-              <object class="GtkGrid" id="keybindings">
+              <object class="GtkFrame" id="keybindings">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+            <child>
+              <object class="GtkGrid">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="border_width">12</property>
@@ -256,27 +496,31 @@
                   </packing>
                 </child>
               </object>
-              <packing>
-                <property name="position">1</property>
-              </packing>
             </child>
-            <child type="tab">
-              <object class="GtkLabel" id="label2">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="yes">Shortcuts</property>
               </object>
               <packing>
-                <property name="position">1</property>
-                <property name="tab_fill">False</property>
+                <property name="name">shortcut-prefs</property>
               </packing>
             </child>
+<!-- shortcuts end here -->
+
+
+<!-- legacy profile list begin -->
             <child>
               <object class="GtkVBox" id="profiles">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="border_width">12</property>
                 <property name="spacing">6</property>
+                <child>
+                  <object class="GtkLabel">
+                    <property name="visible">True</property>
+                    <property name="label">THIS PAGE WILL BE REMOVED</property>
+                    <attributes>
+                      <attribute name="weight" value="bold"/>
+                    </attributes>
+                  </object>
+                </child>
                 <child>
                   <object class="GtkHBox" id="hbox25">
                     <property name="visible">True</property>
@@ -409,27 +653,1731 @@
                 </child>
               </object>
               <packing>
-                <property name="position">2</property>
+                <property name="name">old-profiles-list</property>
               </packing>
             </child>
-            <child type="tab">
-              <object class="GtkLabel" id="label3">
+<!-- legacy profile list end -->
+
+
+<!-- profile prefs begins here -->
+        <child>
+          <object class="GtkNotebook" id="profile-editor-notebook">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <child>
+              <object class="GtkVBox" id="vbox3">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="label" translatable="yes">Profiles</property>
-              </object>
-              <packing>
-                <property name="position">2</property>
-                <property name="tab_fill">False</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">True</property>
-            <property name="fill">True</property>
-            <property name="position">0</property>
-          </packing>
+                <property name="border_width">12</property>
+                <property name="spacing">6</property>
+                <child>
+                  <object class="GtkGrid" id="general-table">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="column_spacing">12</property>
+                    <property name="row_spacing">6</property>
+                    <child>
+                      <object class="GtkLabel" id="profile-name-label">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">_Profile name:</property>
+                        <property name="use_underline">True</property>
+                        <property name="justify">center</property>
+                        <property name="mnemonic_widget">profile-name-entry</property>
+                        <property name="xalign">0</property>
+                      </object>
+                      <packing>
+                        <property name="top_attach">0</property>
+                        <property name="left_attach">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkEntry" id="profile-name-entry">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="invisible_char">•</property>
+                      </object>
+                      <packing>
+                        <property name="top_attach">0</property>
+                        <property name="left_attach">1</property>
+                        <property name="width">3</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="profile-uuid-label">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">Profile ID:</property>
+                        <property name="xalign">0</property>
+                      </object>
+                      <packing>
+                        <property name="top_attach">1</property>
+                        <property name="left_attach">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="profile-uuid">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="selectable">True</property>
+                        <property name="xalign">0</property>
+                      </object>
+                      <packing>
+                        <property name="top_attach">1</property>
+                        <property name="left_attach">1</property>
+                        <property name="width">3</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="default-size-label">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">Initial terminal si_ze:</property>
+                        <property name="use_underline">True</property>
+                        <property name="mnemonic_widget">default-size-columns-spinbutton</property>
+                        <property name="xalign">0</property>
+                      </object>
+                      <packing>
+                        <property name="top_attach">2</property>
+                        <property name="left_attach">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkHBox" id="default-size-columns-box">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="spacing">6</property>
+                        <child>
+                          <object class="GtkSpinButton" id="default-size-columns-spinbutton">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="adjustment">adjustment1</property>
+                            <property name="climb_rate">1</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="default-size-columns-label">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">columns</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="top_attach">2</property>
+                        <property name="left_attach">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkHBox" id="default-size-rows-box">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="spacing">6</property>
+                        <child>
+                          <object class="GtkSpinButton" id="default-size-rows-spinbutton">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="adjustment">adjustment2</property>
+                            <property name="climb_rate">1</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="default-size-rows-label">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">rows</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="top_attach">2</property>
+                        <property name="left_attach">2</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkButtonBox" id="buttonbox1">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="layout_style">end</property>
+                        <child>
+                          <object class="GtkButton" id="default-size-reset-button">
+                            <property name="label" translatable="yes">Rese_t</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">True</property>
+                            <property name="use_underline">True</property>
+                            <property name="focus_on_click">False</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="top_attach">2</property>
+                        <property name="left_attach">3</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="label480">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">Cursor _shape:</property>
+                        <property name="use_underline">True</property>
+                        <property name="mnemonic_widget">cursor-shape-combobox</property>
+                        <property name="xalign">0</property>
+                      </object>
+                      <packing>
+                        <property name="top_attach">3</property>
+                        <property name="left_attach">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkComboBox" id="cursor-shape-combobox">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="model">model1</property>
+                        <property name="focus_on_click">False</property>
+                        <child>
+                          <object class="GtkCellRendererText" id="renderer1"/>
+                          <attributes>
+                            <attribute name="text">0</attribute>
+                          </attributes>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="top_attach">3</property>
+                        <property name="left_attach">1</property>
+                        <property name="width">3</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">Cursor blin_king:</property>
+                        <property name="use_underline">True</property>
+                        <property name="mnemonic_widget">cursor-blink-mode-combobox</property>
+                        <property name="xalign">0</property>
+                      </object>
+                      <packing>
+                        <property name="top_attach">4</property>
+                        <property name="left_attach">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkComboBox" id="cursor-blink-mode-combobox">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="model">model7</property>
+                        <property name="focus_on_click">False</property>
+                        <child>
+                          <object class="GtkCellRendererText" id="renderer5"/>
+                          <attributes>
+                            <attribute name="text">0</attribute>
+                          </attributes>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="top_attach">4</property>
+                        <property name="left_attach">1</property>
+                        <property name="width">3</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkCheckButton" id="bell-checkbutton">
+                        <property name="label" translatable="yes">Terminal _bell</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="use_underline">True</property>
+                        <property name="xalign">0.5</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="top_attach">5</property>
+                        <property name="left_attach">0</property>
+                        <property name="width">4</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="text-appearance-heading">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="margin_top">12</property>
+                        <property name="label" translatable="yes">Text Appearance</property>
+                        <property name="xalign">0</property>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                        </attributes>
+                      </object>
+                      <packing>
+                        <property name="top_attach">6</property>
+                        <property name="left_attach">0</property>
+                        <property name="width">4</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="label481">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">Allow b_linking text:</property>
+                        <property name="use_underline">True</property>
+                        <property name="margin_start">12</property>
+                        <property name="mnemonic_widget">text-blink-mode-combobox</property>
+                        <property name="xalign">0</property>
+                      </object>
+                      <packing>
+                        <property name="top_attach">7</property>
+                        <property name="left_attach">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkComboBox" id="text-blink-mode-combobox">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="model">model5</property>
+                        <property name="focus_on_click">False</property>
+                        <child>
+                          <object class="GtkCellRendererText" id="renderer2"/>
+                          <attributes>
+                            <attribute name="text">0</attribute>
+                          </attributes>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="top_attach">7</property>
+                        <property name="left_attach">1</property>
+                        <property name="width">3</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkCheckButton" id="rewrap-on-resize-checkbutton">
+                        <property name="label" translatable="yes">_Rewrap on resize</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="margin_start">12</property>
+                        <property name="use_underline">True</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="top_attach">8</property>
+                        <property name="left_attach">0</property>
+                        <property name="width">4</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkCheckButton" id="custom-font-checkbutton">
+                        <property name="label" translatable="yes">_Custom font:</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="margin_start">12</property>
+                        <property name="use_underline">True</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="top_attach">9</property>
+                        <property name="left_attach">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkFontButton" id="font-selector">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="focus_on_click">False</property>
+                        <property name="font">Sans 12</property>
+                        <property name="title" translatable="yes">Choose A Terminal Font</property>
+                      </object>
+                      <packing>
+                        <property name="top_attach">9</property>
+                        <property name="left_attach">1</property>
+                        <property name="width">3</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">Cell spaci_ng:</property>
+                        <property name="use_underline">True</property>
+                        <property name="margin_start">12</property>
+                        <property name="mnemonic_widget">cell-width-scale-spinbutton</property>
+                        <property name="xalign">0</property>
+                      </object>
+                      <packing>
+                        <property name="top_attach">10</property>
+                        <property name="left_attach">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkHBox">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="spacing">6</property>
+                        <child>
+                          <object class="GtkSpinButton" id="cell-width-scale-spinbutton">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="adjustment">adjustment5</property>
+                            <property name="digits">2</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">× width</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="top_attach">10</property>
+                        <property name="left_attach">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkHBox">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="spacing">6</property>
+                        <child>
+                          <object class="GtkSpinButton" id="cell-height-scale-spinbutton">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="adjustment">adjustment6</property>
+                            <property name="digits">2</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">× height</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="top_attach">10</property>
+                        <property name="left_attach">2</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkButtonBox">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="layout_style">end</property>
+                        <child>
+                          <object class="GtkButton" id="cell-scale-reset-button">
+                            <property name="label" translatable="yes">R_eset</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">True</property>
+                            <property name="use_underline">True</property>
+                            <property name="focus_on_click">False</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="top_attach">10</property>
+                        <property name="left_attach">3</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+              </object>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="label32">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">General</property>
+                <property name="use_underline">True</property>
+                <property name="justify">center</property>
+              </object>
+              <packing>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkVBox" id="vbox91">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="border_width">12</property>
+                <property name="spacing">18</property>
+                <child>
+                  <object class="GtkVBox" id="vbox80">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="spacing">6</property>
+                    <child>
+                      <object class="GtkVBox" id="vbox81">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <child>
+                          <object class="GtkVBox" id="vbox92">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="spacing">6</property>
+                            <child>
+                              <object class="GtkCheckButton" id="login-shell-checkbutton">
+                                <property name="label" translatable="yes">_Run command as a login shell</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="use_underline">True</property>
+                                <property name="xalign">0.5</property>
+                                <property name="draw_indicator">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkCheckButton" id="use-custom-command-checkbutton">
+                                <property name="label" translatable="yes">Ru_n a custom command instead of my shell</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="use_underline">True</property>
+                                <property name="xalign">0.5</property>
+                                <property name="draw_indicator">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkAlignment" id="custom-command-box">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="left_padding">12</property>
+                                <child>
+                                  <object class="GtkHBox" id="hbox134">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="spacing">12</property>
+                                    <child>
+                                      <object class="GtkLabel" id="custom-command-entry-label">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="label" translatable="yes">Custom co_mmand:</property>
+                                        <property name="use_underline">True</property>
+                                        <property name="justify">center</property>
+                                        <property name="mnemonic_widget">custom-command-entry</property>
+                                        <property name="xalign">0</property>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">False</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkEntry" id="custom-command-entry">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">True</property>
+                                        <property name="fill">True</property>
+                                        <property name="position">1</property>
+                                      </packing>
+                                    </child>
+                                  </object>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">2</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkHBox" id="hbox27">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="spacing">12</property>
+                                <child>
+                                  <object class="GtkLabel" id="exit-action-combobox-label">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="label" translatable="yes">When command _exits:</property>
+                                    <property name="use_underline">True</property>
+                                    <property name="justify">center</property>
+                                    <property name="mnemonic_widget">exit-action-combobox</property>
+                                    <property name="xalign">0</property>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkComboBox" id="exit-action-combobox">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="model">model3</property>
+                                    <property name="focus_on_click">False</property>
+                                    <child>
+                                      <object class="GtkCellRendererText" id="renderer3"/>
+                                      <attributes>
+                                        <attribute name="text">0</attribute>
+                                      </attributes>
+                                    </child>
+                                  </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">False</property>
+                                <property name="position">3</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">True</property>
+                        <property name="fill">True</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="label38">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Command</property>
+                <property name="use_underline">True</property>
+                <property name="justify">center</property>
+              </object>
+              <packing>
+                <property name="position">1</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkVBox" id="vbox90">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="border_width">12</property>
+                <property name="spacing">18</property>
+                <child>
+                  <object class="GtkVBox" id="vbox82">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="spacing">6</property>
+                    <child>
+                      <object class="GtkLabel" id="label39">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">Text and Background Color</property>
+                        <property name="xalign">0</property>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                        </attributes>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkAlignment" id="alignment10105">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="left_padding">12</property>
+                        <child>
+                          <object class="GtkVBox" id="vbox94">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="spacing">6</property>
+                            <child>
+                              <object class="GtkCheckButton" id="use-theme-colors-checkbutton">
+                                <property name="label" translatable="yes">_Use colors from system theme</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="use_underline">True</property>
+                                <property name="xalign">0.5</property>
+                                <property name="draw_indicator">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkBox" id="colors-box">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="orientation">vertical</property>
+                                <property name="spacing">6</property>
+                                <child>
+                                  <object class="GtkHBox" id="builtin-color-schemes-box">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="spacing">12</property>
+                                    <child>
+                                      <object class="GtkLabel" id="color-scheme-combobox-label">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="label" translatable="yes">Built-in sche_mes:</property>
+                                        <property name="use_underline">True</property>
+                                        <property name="justify">center</property>
+                                        <property name="mnemonic_widget">color-scheme-combobox</property>
+                                        <property name="xalign">0</property>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">False</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkComboBox" id="color-scheme-combobox">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="focus_on_click">False</property>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">True</property>
+                                        <property name="position">1</property>
+                                      </packing>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkGrid">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="row_spacing">6</property>
+                                    <property name="column_spacing">12</property>
+                                    <child>
+                                      <object class="GtkLabel">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="label" translatable="yes">Text</property>
+                                        <property name="xalign">0</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">0</property>
+                                        <property name="left_attach">1</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkLabel">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="label" translatable="yes">Background</property>
+                                        <property name="xalign">0</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">0</property>
+                                        <property name="left_attach">2</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkLabel" id="foreground-colorpicker-label">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="halign">start</property>
+                                        <property name="label" translatable="yes">_Default color:</property>
+                                        <property name="use_underline">True</property>
+                                        <property name="justify">center</property>
+                                        <property name="mnemonic_widget">foreground-colorpicker</property>
+                                        <property name="xalign">0</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">1</property>
+                                        <property name="left_attach">0</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkColorButton" id="foreground-colorpicker">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                        <property name="halign">start</property>
+                                        <property name="title" translatable="yes">Choose Terminal Text Color</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">1</property>
+                                        <property name="left_attach">1</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkColorButton" id="background-colorpicker">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                        <property name="halign">start</property>
+                                        <property name="title" translatable="yes">Choose Terminal Background Color</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">1</property>
+                                        <property name="left_attach">2</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkCheckButton" id="bold-color-checkbutton">
+                                        <property name="label" translatable="yes">Bo_ld color:</property>
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                        <property name="halign">start</property>
+                                        <property name="use_underline">True</property>
+                                        <property name="xalign">0</property>
+                                        <property name="draw_indicator">True</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">2</property>
+                                        <property name="left_attach">0</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkColorButton" id="bold-colorpicker">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                        <property name="halign">start</property>
+                                        <property name="title" translatable="yes">Choose Terminal Bold Text Color</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">2</property>
+                                        <property name="left_attach">1</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkCheckButton" id="underline-color-checkbutton">
+                                        <property name="label" translatable="yes">_Underline color:</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                        <property name="halign">start</property>
+                                        <property name="use_underline">True</property>
+                                        <property name="xalign">0</property>
+                                        <property name="draw_indicator">True</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">3</property>
+                                        <property name="left_attach">0</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkColorButton" id="underline-colorpicker">
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                        <property name="halign">start</property>
+                                        <property name="title" translatable="yes">Choose Terminal Underlined Text Color</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">3</property>
+                                        <property name="left_attach">1</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkCheckButton" id="cursor-colors-checkbutton">
+                                        <property name="label" translatable="yes">Cu_rsor color:</property>
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                        <property name="halign">start</property>
+                                        <property name="use_underline">True</property>
+                                        <property name="xalign">0</property>
+                                        <property name="draw_indicator">True</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">4</property>
+                                        <property name="left_attach">0</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkColorButton" id="cursor-foreground-colorpicker">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">True</property>
+                                        <property name="halign">start</property>
+                                        <property name="title" translatable="yes">Choose Terminal Cursor Foreground Color</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">4</property>
+                                        <property name="left_attach">1</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkColorButton" id="cursor-background-colorpicker">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">True</property>
+                                        <property name="halign">start</property>
+                                        <property name="title" translatable="yes">Choose Terminal Cursor Background Color</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">4</property>
+                                        <property name="left_attach">2</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkCheckButton" id="highlight-colors-checkbutton">
+                                        <property name="label" translatable="yes">_Highlight color:</property>
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                        <property name="halign">start</property>
+                                        <property name="use_underline">True</property>
+                                        <property name="draw_indicator">True</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">5</property>
+                                        <property name="left_attach">0</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkColorButton" id="highlight-foreground-colorpicker">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">True</property>
+                                        <property name="halign">start</property>
+                                        <property name="title" translatable="yes">Choose Terminal Highlight Foreground Color</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">5</property>
+                                        <property name="left_attach">1</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkColorButton" id="highlight-background-colorpicker">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">True</property>
+                                        <property name="halign">start</property>
+                                        <property name="title" translatable="yes">Choose Terminal Highlight Background Color</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">5</property>
+                                        <property name="left_attach">2</property>
+                                      </packing>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                          </object>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkVBox" id="palette-box">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="spacing">6</property>
+                    <child>
+                      <object class="GtkLabel" id="label42">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">Palette</property>
+                        <property name="xalign">0</property>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                        </attributes>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkAlignment" id="alignment10106">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="left_padding">12</property>
+                        <child>
+                          <object class="GtkVBox" id="vbox8">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="spacing">6</property>
+                            <child>
+                              <object class="GtkGrid" id="table25">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="column_spacing">12</property>
+                                <property name="row_spacing">6</property>
+                                <child>
+                                  <object class="GtkLabel" id="palette-optionmenu-label">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="label" translatable="yes">Built-in _schemes:</property>
+                                    <property name="use_underline">True</property>
+                                    <property name="justify">center</property>
+                                    <property name="mnemonic_widget">palette-combobox</property>
+                                    <property name="xalign">0</property>
+                                  </object>
+                                  <packing>
+                                    <property name="top_attach">0</property>
+                                    <property name="left_attach">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkComboBox" id="palette-combobox">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="model">model4</property>
+                                    <property name="focus_on_click">False</property>
+                                    <child>
+                                      <object class="GtkCellRendererText" id="renderer4"/>
+                                      <attributes>
+                                        <attribute name="text">0</attribute>
+                                      </attributes>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="top_attach">0</property>
+                                    <property name="left_attach">1</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkLabel" id="label43">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="label" translatable="yes">Color p_alette:</property>
+                                    <property name="use_underline">True</property>
+                                    <property name="justify">center</property>
+                                    <property name="mnemonic_widget">palette-colorpicker-0</property>
+                                    <property name="xalign">0</property>
+                                    <property name="yalign">0</property>
+                                  </object>
+                                  <packing>
+                                    <property name="top_attach">1</property>
+                                    <property name="left_attach">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkGrid" id="palette-table">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="column_spacing">6</property>
+                                    <property name="row_spacing">6</property>
+                                    <child>
+                                      <object class="GtkColorButton" id="palette-colorpicker-0">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                        <property name="tooltip_text">dummy</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">0</property>
+                                        <property name="left_attach">0</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkColorButton" id="palette-colorpicker-1">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                        <property name="tooltip_text">dummy</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">0</property>
+                                        <property name="left_attach">1</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkColorButton" id="palette-colorpicker-2">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                        <property name="tooltip_text">dummy</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">0</property>
+                                        <property name="left_attach">2</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkColorButton" id="palette-colorpicker-3">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                        <property name="tooltip_text">dummy</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">0</property>
+                                        <property name="left_attach">3</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkColorButton" id="palette-colorpicker-4">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                        <property name="tooltip_text">dummy</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">0</property>
+                                        <property name="left_attach">4</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkColorButton" id="palette-colorpicker-5">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                        <property name="tooltip_text">dummy</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">0</property>
+                                        <property name="left_attach">5</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkColorButton" id="palette-colorpicker-6">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                        <property name="tooltip_text">dummy</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">0</property>
+                                        <property name="left_attach">6</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkColorButton" id="palette-colorpicker-7">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                        <property name="tooltip_text">dummy</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">0</property>
+                                        <property name="left_attach">7</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkColorButton" id="palette-colorpicker-8">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                        <property name="tooltip_text">dummy</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">1</property>
+                                        <property name="left_attach">0</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkColorButton" id="palette-colorpicker-9">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                        <property name="tooltip_text">dummy</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">1</property>
+                                        <property name="left_attach">1</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkColorButton" id="palette-colorpicker-10">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                        <property name="tooltip_text">dummy</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">1</property>
+                                        <property name="left_attach">2</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkColorButton" id="palette-colorpicker-11">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                        <property name="tooltip_text">dummy</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">1</property>
+                                        <property name="left_attach">3</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkColorButton" id="palette-colorpicker-12">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                        <property name="tooltip_text">dummy</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">1</property>
+                                        <property name="left_attach">4</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkColorButton" id="palette-colorpicker-13">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                        <property name="tooltip_text">dummy</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">1</property>
+                                        <property name="left_attach">5</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkColorButton" id="palette-colorpicker-14">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                        <property name="tooltip_text">dummy</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">1</property>
+                                        <property name="left_attach">6</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkColorButton" id="palette-colorpicker-15">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">False</property>
+                                        <property name="tooltip_text">dummy</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">1</property>
+                                        <property name="left_attach">7</property>
+                                      </packing>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="top_attach">1</property>
+                                    <property name="left_attach">1</property>
+                                  </packing>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkCheckButton" id="bold-is-bright-checkbutton">
+                                <property name="label" translatable="yes">Show _bold text in bright colors</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="use_underline">True</property>
+                                <property name="xalign">0.5</property>
+                                <property name="draw_indicator">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                          </object>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="position">2</property>
+              </packing>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="label45">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Colors</property>
+                <property name="use_underline">True</property>
+                <property name="justify">center</property>
+              </object>
+              <packing>
+                <property name="position">2</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkGrid" id="table27">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="border_width">12</property>
+                <property name="column_spacing">12</property>
+                <property name="row_spacing">6</property>
+                <child>
+                  <object class="GtkCheckButton" id="scrollbar-checkbutton">
+                    <property name="label" translatable="yes">_Show scrollbar</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="use_underline">True</property>
+                    <property name="xalign">0.5</property>
+                    <property name="draw_indicator">True</property>
+                    <property name="hexpand">True</property>
+                  </object>
+                  <packing>
+                    <property name="top_attach">0</property>
+                    <property name="left_attach">0</property>
+                    <property name="width">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkCheckButton" id="scroll-on-output-checkbutton">
+                    <property name="label" translatable="yes">Scroll on _output</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="use_underline">True</property>
+                    <property name="xalign">0.5</property>
+                    <property name="draw_indicator">True</property>
+                    <property name="hexpand">True</property>
+                  </object>
+                  <packing>
+                    <property name="top_attach">1</property>
+                    <property name="left_attach">0</property>
+                    <property name="width">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkCheckButton" id="scroll-on-keystroke-checkbutton">
+                    <property name="label" translatable="yes">Scroll on _keystroke</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="use_underline">True</property>
+                    <property name="xalign">0.5</property>
+                    <property name="draw_indicator">True</property>
+                    <property name="hexpand">True</property>
+                  </object>
+                  <packing>
+                    <property name="top_attach">2</property>
+                    <property name="left_attach">0</property>
+                    <property name="width">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkCheckButton" id="scrollback-limited-checkbutton">
+                    <property name="label" translatable="yes">_Limit scrollback to:</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="use_underline">True</property>
+                    <property name="xalign">0.5</property>
+                    <property name="draw_indicator">True</property>
+                    <property name="hexpand">False</property>
+                  </object>
+                  <packing>
+                    <property name="top_attach">3</property>
+                    <property name="left_attach">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkHBox" id="scrollback-box">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="spacing">6</property>
+                    <property name="hexpand">True</property>
+                    <child>
+                      <object class="GtkSpinButton" id="scrollback-lines-spinbutton">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="adjustment">adjustment4</property>
+                        <property name="climb_rate">1</property>
+                        <property name="numeric">True</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="scrollback-lines-spinbutton-label">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">lines</property>
+                        <property name="justify">center</property>
+                        <property name="mnemonic_widget">scrollback-lines-spinbutton</property>
+                        <property name="xalign">0</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="top_attach">3</property>
+                    <property name="left_attach">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="position">3</property>
+              </packing>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="label60">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Scrolling</property>
+                <property name="use_underline">True</property>
+              </object>
+              <packing>
+                <property name="position">3</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkVBox" id="vbox4">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="border_width">12</property>
+                <property name="spacing">12</property>
+                <child>
+                  <object class="GtkLabel" id="label51">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">&lt;b&gt;Note:&lt;/b&gt; These options may cause some applications to behave incorrectly.  They are only here to allow you to work around certain applications and operating systems that expect different terminal behavior.</property>
+                    <property name="wrap">True</property>
+                    <property name="xalign">0</property>
+                    <property name="yalign">7.4505801528346183e-09</property>
+                    <attributes>
+                      <attribute name="style" value="italic"/>
+                      <attribute name="size" value="0"/>
+                    </attributes>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkGrid" id="table30">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="column_spacing">12</property>
+                    <property name="row_spacing">6</property>
+                    <child>
+                      <object class="GtkLabel" id="backspace-binding-combobox-label">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">_Backspace key generates:</property>
+                        <property name="use_underline">True</property>
+                        <property name="justify">center</property>
+                        <property name="mnemonic_widget">backspace-binding-combobox</property>
+                        <property name="xalign">0</property>
+                      </object>
+                      <packing>
+                        <property name="top_attach">0</property>
+                        <property name="left_attach">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkComboBox" id="backspace-binding-combobox">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="model">model6</property>
+                        <property name="focus_on_click">False</property>
+                        <child>
+                          <object class="GtkCellRendererText" id="renderer6"/>
+                          <attributes>
+                            <attribute name="text">0</attribute>
+                          </attributes>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="top_attach">0</property>
+                        <property name="left_attach">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="delete-binding-combobox-label">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">_Delete key generates:</property>
+                        <property name="use_underline">True</property>
+                        <property name="justify">center</property>
+                        <property name="mnemonic_widget">delete-binding-combobox</property>
+                        <property name="xalign">0</property>
+                      </object>
+                      <packing>
+                        <property name="top_attach">1</property>
+                        <property name="left_attach">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkComboBox" id="delete-binding-combobox">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="model">model6</property>
+                        <property name="focus_on_click">False</property>
+                        <child>
+                          <object class="GtkCellRendererText" id="renderer7"/>
+                          <attributes>
+                            <attribute name="text">0</attribute>
+                          </attributes>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="top_attach">1</property>
+                        <property name="left_attach">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="encoding-label">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">_Encoding:</property>
+                        <property name="use_underline">True</property>
+                        <property name="xalign">0</property>
+                      </object>
+                      <packing>
+                        <property name="top_attach">2</property>
+                        <property name="left_attach">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkComboBox" id="encoding-combobox">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="focus_on_click">False</property>
+                      </object>
+                      <packing>
+                        <property name="top_attach">2</property>
+                        <property name="left_attach">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="cjk-ambiguous-width-label">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">Ambiguous-_width characters:</property>
+                        <property name="use_underline">True</property>
+                        <property name="justify">center</property>
+                        <property name="mnemonic_widget">cjk-ambiguous-width-combobox</property>
+                        <property name="xalign">0</property>
+                      </object>
+                      <packing>
+                        <property name="top_attach">3</property>
+                        <property name="left_attach">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkComboBox" id="cjk-ambiguous-width-combobox">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="model">cjk-ambiguous-width-model</property>
+                        <property name="focus_on_click">False</property>
+                        <property name="id_column">1</property>
+                        <child>
+                          <object class="GtkCellRendererText" id="cjk-ambiguous-width-renderer"/>
+                          <attributes>
+                            <attribute name="text">0</attribute>
+                          </attributes>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="top_attach">3</property>
+                        <property name="left_attach">1</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkHButtonBox" id="hbuttonbox1">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="layout_style">start</property>
+                    <child>
+                      <object class="GtkButton" id="reset-compat-defaults-button">
+                        <property name="label" translatable="yes">_Reset Compatibility Options to Defaults</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="use_underline">True</property>
+                        <property name="focus_on_click">False</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">2</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="position">5</property>
+              </packing>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="label54">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Compatibility</property>
+                <property name="use_underline">True</property>
+                <property name="justify">center</property>
+              </object>
+              <packing>
+                <property name="position">4</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="name">profile-prefs</property>
+          </packing>
+        </child>
+<!-- profile prefs ends here -->
+
+
+              </object>
+            </child>
+          </object>
         </child>
+
         <child>
           <object class="GtkButtonBox" id="dialogue-buttonbox">
             <property name="visible">True</property>
diff --git a/src/profile-editor.c b/src/profile-editor.c
index 3bc7bd91..aeb91055 100644
--- a/src/profile-editor.c
+++ b/src/profile-editor.c
@@ -36,6 +36,114 @@
 #include "terminal-profiles-list.h"
 #include "terminal-libgsystem.h"
 
+GtkWidget *the_editor = NULL;  // global??
+GSettings *the_profile = NULL;  // the profile being edited -- global??
+
+GArray *the_signals;  // global??
+GArray *the_bindings; // global??
+
+typedef struct {
+  gpointer instance;
+  gulong handler_id;
+} ProfilePrefsSignal;
+
+typedef struct {
+  gpointer object;
+  char *property;
+} ProfilePrefsBinding;
+
+// FIXME explain these wrappers
+static void
+profile_prefs_register_signal_handler (gpointer instance,
+                                       gulong handler_id)
+{
+  ProfilePrefsSignal sig;
+  sig.instance = instance;
+  sig.handler_id = handler_id;
+  g_array_append_val (the_signals, sig);
+}
+
+static void
+profile_prefs_signal_handlers_disconnect_all (void)
+{
+  for (guint i = 0; i < the_signals->len; i++) {
+    ProfilePrefsSignal *sig = &g_array_index (the_signals, ProfilePrefsSignal, i);
+    g_signal_handler_disconnect (sig->instance, sig->handler_id);
+  }
+  g_array_set_size (the_signals, 0);
+}
+
+static gulong
+profile_prefs_signal_connect (gpointer instance,
+                              const gchar *detailed_signal,
+                              GCallback c_handler,
+                              gpointer data)
+{
+  gulong handler_id = g_signal_connect(instance, detailed_signal, c_handler, data);
+  profile_prefs_register_signal_handler (instance, handler_id);
+  return handler_id;
+}
+
+
+static void
+profile_prefs_register_settings_binding (gpointer object,
+                                         const char *property)
+{
+  ProfilePrefsBinding bind;
+  bind.object = object;
+  bind.property = g_strdup (property);
+  g_array_append_val (the_bindings, bind);
+}
+
+static void
+profile_prefs_settings_unbind_all (void)
+{
+  for (guint i = 0; i < the_bindings->len; i++) {
+    ProfilePrefsBinding *bind = &g_array_index (the_bindings, ProfilePrefsBinding, i);
+    g_settings_unbind (bind->object, bind->property);
+    g_free (bind->property);
+  }
+  g_array_set_size (the_bindings, 0);
+}
+
+static void
+profile_prefs_settings_bind (GSettings *settings,
+                             const gchar *key,
+                             gpointer object,
+                             const gchar *property,
+                             GSettingsBindFlags flags)
+{
+  profile_prefs_register_settings_binding (object, property);
+  g_settings_bind (settings, key, object, property, flags);
+}
+
+static void
+profile_prefs_settings_bind_with_mapping (GSettings *settings,
+                                          const gchar *key,
+                                          gpointer object,
+                                          const gchar *property,
+                                          GSettingsBindFlags flags,
+                                          GSettingsBindGetMapping get_mapping,
+                                          GSettingsBindSetMapping set_mapping,
+                                          gpointer user_data,
+                                          GDestroyNotify destroy)
+{
+  profile_prefs_register_settings_binding (object, property);
+  g_settings_bind_with_mapping (settings, key, object, property, flags, get_mapping, set_mapping, user_data, destroy);
+}
+
+static void
+profile_prefs_settings_bind_writable (GSettings *settings,
+                                      const gchar *key,
+                                      gpointer object,
+                                      const gchar *property,
+                                      gboolean inverted)
+{
+  profile_prefs_register_settings_binding (object, property);
+  g_settings_bind_writable (settings, key, object, property, inverted);
+}
+
+
 typedef struct _TerminalColorScheme TerminalColorScheme;
 
 struct _TerminalColorScheme
@@ -530,31 +638,15 @@ init_encodings_combo (GtkWidget *widget)
 }
 
 static void
-editor_help_button_clicked_cb (GtkWidget *button,
-                               GtkWidget *editor)
+profile_editor_destroyed (GtkWidget *editor)
 {
-  terminal_util_show_help ("profile");
-}
+  profile_prefs_signal_handlers_disconnect_all ();
+  profile_prefs_settings_unbind_all ();
 
-static void
-editor_close_button_clicked_cb (GtkWidget *button,
-                                GtkWidget *editor)
-{
-  gtk_widget_destroy (editor);
-}
+  g_array_free (the_signals, TRUE);
+  g_array_free (the_bindings, TRUE);
 
-static void
-profile_editor_destroyed (GtkWidget *editor,
-                          GSettings *profile)
-{
-  g_signal_handlers_disconnect_matched (profile, G_SIGNAL_MATCH_FUNC, 0, 0, NULL,
-                                        G_CALLBACK (profile_colors_notify_scheme_combo_cb), NULL);
-  g_signal_handlers_disconnect_matched (profile, G_SIGNAL_MATCH_FUNC, 0, 0, NULL,
-                                        G_CALLBACK (profile_palette_notify_scheme_combo_cb), NULL);
-  g_signal_handlers_disconnect_matched (profile, G_SIGNAL_MATCH_FUNC, 0, 0, NULL,
-                                        G_CALLBACK (profile_palette_notify_colorpickers_cb), NULL);
-
-  g_object_set_data (G_OBJECT (profile), "editor-window", NULL);
+//  g_object_set_data (G_OBJECT (profile), "editor-window", NULL);
   g_object_set_data (G_OBJECT (editor), "builder", NULL);
 }
 
@@ -625,19 +717,6 @@ scroll_event_cb (GtkWidget      *widget,
   return FALSE;
 }
 
-static gboolean
-string_to_window_title (GValue *value,
-                        GVariant *variant,
-                        gpointer user_data)
-{
-  const char *visible_name;
-
-  g_variant_get (variant, "&s", &visible_name);
-  g_value_take_string (value, g_strdup_printf (_("Editing Profile “%s”"), visible_name));
-
-  return TRUE;
-}
-
 
 static gboolean
 s_to_rgba (GValue *value,
@@ -803,86 +882,79 @@ monospace_filter (const PangoFontFamily *family,
   return pango_font_family_is_monospace ((PangoFontFamily *) family);
 }
 
-/**
- * terminal_profile_edit:
- * @profile: a #GSettings
- * @widget_name: a widget name in the profile editor's UI, or %NULL
- *
- * Shows the profile editor with @profile, anchored to @transient_parent.
- * If @widget_name is non-%NULL, focuses the corresponding widget and
- * switches the notebook to its containing page.
- */
+
 void
-terminal_profile_edit (GSettings  *profile,
-                       const char *widget_name)
+profile_prefs_init (GtkBuilder *builder)
 {
-  TerminalSettingsList *profiles_list;
-  GtkBuilder *builder;
-  GError *error = NULL;
   GtkWidget *editor, *w;
-  gs_free char *uuid = NULL;
-  guint i;
 
-  editor = g_object_get_data (G_OBJECT (profile), "editor-window");
-  if (editor)
-    {
-      terminal_util_dialog_focus_widget (editor, widget_name);
-
-      gtk_window_present (GTK_WINDOW (editor));
-      return;
-    }
+  the_signals = g_array_new (FALSE, FALSE, sizeof (ProfilePrefsSignal));
+  the_bindings = g_array_new (FALSE, FALSE, sizeof (ProfilePrefsBinding));
 
 #if !GTK_CHECK_VERSION (3, 19, 8)
   fixup_color_chooser_button ();
 #endif
 
-  profiles_list = terminal_app_get_profiles_list (terminal_app_get ());
-
-  builder = gtk_builder_new ();
-  gtk_builder_add_from_resource (builder, "/org/gnome/terminal/ui/profile-preferences.ui", &error);
-  g_assert_no_error (error);
+//  builder = gtk_builder_new ();
+//  gtk_builder_add_from_resource (builder, "/org/gnome/terminal/ui/profile-preferences.ui", &error);
+//  g_assert_no_error (error);
 
-  editor = (GtkWidget *) gtk_builder_get_object  (builder, "profile-editor-dialog");
+  editor = (GtkWidget *) gtk_builder_get_object  (builder, "profile-editor-notebook");
+  the_editor = editor;
   g_object_set_data_full (G_OBJECT (editor), "builder",
                           builder, (GDestroyNotify) g_object_unref);
 
-  gtk_window_set_application (GTK_WINDOW (editor), GTK_APPLICATION (terminal_app_get ()));
+//  gtk_window_set_application (GTK_WINDOW (editor), GTK_APPLICATION (terminal_app_get ()));
 
   /* Store the dialogue on the profile, so we can acccess it above to check if
    * there's already a profile editor for this profile.
    */
-  g_object_set_data (G_OBJECT (profile), "editor-window", editor);
+//  g_object_set_data (G_OBJECT (profile), "editor-window", editor);
 
   g_signal_connect (editor, "destroy",
                     G_CALLBACK (profile_editor_destroyed),
-                    profile);
-
-  w = (GtkWidget *) gtk_builder_get_object  (builder, "close-button");
-  g_signal_connect (w, "clicked", G_CALLBACK (editor_close_button_clicked_cb), editor);
-
-  w = (GtkWidget *) gtk_builder_get_object  (builder, "help-button");
-  g_signal_connect (w, "clicked", G_CALLBACK (editor_help_button_clicked_cb), editor);
+                    NULL);
 
   w = (GtkWidget *) gtk_builder_get_object  (builder, "profile-editor-notebook");
   gtk_widget_add_events (w, GDK_BUTTON_PRESS_MASK | GDK_SCROLL_MASK);
   g_signal_connect (w, "scroll-event", G_CALLBACK (scroll_event_cb), NULL);
 
-  uuid = terminal_settings_list_dup_uuid_from_child (profiles_list, profile);
+  w = (GtkWidget *) gtk_builder_get_object  (builder, "color-scheme-combobox");
+  init_color_scheme_menu (w);
+
+  w = (GtkWidget *) gtk_builder_get_object  (builder, "encoding-combobox");
+  init_encodings_combo (w);
+
+  terminal_util_bind_mnemonic_label_sensitivity (editor);
+}
+
+
+
+void
+profile_prefs_switch (const char *uuid, GSettings *profile)
+{
+  GtkWidget *editor, *w;
+  GtkBuilder *builder;
+  editor = the_editor;
+  guint i;
+
+  builder = g_object_get_data (G_OBJECT (editor), "builder");
+
+  profile_prefs_signal_handlers_disconnect_all ();
+  profile_prefs_settings_unbind_all ();
+
   gtk_label_set_text (GTK_LABEL (gtk_builder_get_object (builder, "profile-uuid")),
                       uuid);
 
-  g_signal_connect (gtk_builder_get_object  (builder, "default-size-reset-button"),
+  profile_prefs_signal_connect (gtk_builder_get_object  (builder, "default-size-reset-button"),
                     "clicked",
                     G_CALLBACK (default_size_reset_cb),
                     profile);
-  g_signal_connect (gtk_builder_get_object  (builder, "cell-scale-reset-button"),
+  profile_prefs_signal_connect (gtk_builder_get_object  (builder, "cell-scale-reset-button"),
                     "clicked",
                     G_CALLBACK (cell_scale_reset_cb),
                     profile);
 
-  w = (GtkWidget *) gtk_builder_get_object  (builder, "color-scheme-combobox");
-  init_color_scheme_menu (w);
-
   /* Hook up the palette colorpickers and combo box */
 
   for (i = 0; i < TERMINAL_PALETTE_SIZE; ++i)
@@ -907,64 +979,55 @@ terminal_profile_edit (GSettings  *profile,
       gtk_widget_set_tooltip_text (w, text);
       g_free (text);
 
-      g_signal_connect (w, "notify::rgba",
+      profile_prefs_signal_connect (w, "notify::rgba",
                         G_CALLBACK (palette_color_notify_cb),
                         profile);
     }
 
   profile_palette_notify_colorpickers_cb (profile, TERMINAL_PROFILE_PALETTE_KEY, editor);
-  g_signal_connect (profile, "changed::" TERMINAL_PROFILE_PALETTE_KEY,
+  profile_prefs_signal_connect (profile, "changed::" TERMINAL_PROFILE_PALETTE_KEY,
                     G_CALLBACK (profile_palette_notify_colorpickers_cb),
                     editor);
 
   w = (GtkWidget *) gtk_builder_get_object  (builder, "palette-combobox");
-  g_signal_connect (w, "notify::active",
+  profile_prefs_signal_connect (w, "notify::active",
                     G_CALLBACK (palette_scheme_combo_changed_cb),
                     profile);
 
   profile_palette_notify_scheme_combo_cb (profile, TERMINAL_PROFILE_PALETTE_KEY, GTK_COMBO_BOX (w));
-  g_signal_connect (profile, "changed::" TERMINAL_PROFILE_PALETTE_KEY,
+  profile_prefs_signal_connect (profile, "changed::" TERMINAL_PROFILE_PALETTE_KEY,
                     G_CALLBACK (profile_palette_notify_scheme_combo_cb),
                     w);
 
   /* Hook up the color scheme pickers and combo box */
   w = (GtkWidget *) gtk_builder_get_object  (builder, "color-scheme-combobox");
-  g_signal_connect (w, "notify::active",
+  profile_prefs_signal_connect (w, "notify::active",
                     G_CALLBACK (color_scheme_combo_changed_cb),
                     profile);
 
   profile_colors_notify_scheme_combo_cb (profile, NULL, GTK_COMBO_BOX (w));
-  g_signal_connect (profile, "changed::" TERMINAL_PROFILE_FOREGROUND_COLOR_KEY,
+  profile_prefs_signal_connect (profile, "changed::" TERMINAL_PROFILE_FOREGROUND_COLOR_KEY,
                     G_CALLBACK (profile_colors_notify_scheme_combo_cb),
                     w);
-  g_signal_connect (profile, "changed::" TERMINAL_PROFILE_BACKGROUND_COLOR_KEY,
+  profile_prefs_signal_connect (profile, "changed::" TERMINAL_PROFILE_BACKGROUND_COLOR_KEY,
                     G_CALLBACK (profile_colors_notify_scheme_combo_cb),
                     w);
 
   w = GTK_WIDGET (gtk_builder_get_object (builder, "custom-command-entry"));
   custom_command_entry_changed_cb (GTK_ENTRY (w));
-  g_signal_connect (w, "changed",
+  profile_prefs_signal_connect (w, "changed",
                     G_CALLBACK (custom_command_entry_changed_cb), NULL);
 
-  g_signal_connect (gtk_builder_get_object  (builder, "reset-compat-defaults-button"),
+  profile_prefs_signal_connect (gtk_builder_get_object  (builder, "reset-compat-defaults-button"),
                     "clicked",
                     G_CALLBACK (reset_compat_defaults_cb),
                     profile);
 
-  g_settings_bind_with_mapping (profile,
-                                TERMINAL_PROFILE_VISIBLE_NAME_KEY,
-                                editor,
-                                "title",
-                                G_SETTINGS_BIND_GET |
-                                G_SETTINGS_BIND_NO_SENSITIVITY,
-                                (GSettingsBindGetMapping)
-                                string_to_window_title, NULL, NULL, NULL);
-
   w = GTK_WIDGET (gtk_builder_get_object (builder, "background-colorpicker"));
 #if GTK_CHECK_VERSION (3, 19, 8)
   g_object_set (w, "show-editor", TRUE, NULL);
 #endif
-  g_settings_bind_with_mapping (profile,
+  profile_prefs_settings_bind_with_mapping (profile,
                                 TERMINAL_PROFILE_BACKGROUND_COLOR_KEY,
                                 w,
                                 "rgba",
@@ -973,7 +1036,7 @@ terminal_profile_edit (GSettings  *profile,
                                 (GSettingsBindSetMapping) rgba_to_s,
                                 NULL, NULL);
 
-  g_settings_bind_with_mapping (profile,
+  profile_prefs_settings_bind_with_mapping (profile,
                                 TERMINAL_PROFILE_BACKSPACE_BINDING_KEY,
                                 gtk_builder_get_object (builder,
                                                         "backspace-binding-combobox"),
@@ -982,11 +1045,11 @@ terminal_profile_edit (GSettings  *profile,
                                 (GSettingsBindGetMapping) string_to_enum,
                                 (GSettingsBindSetMapping) enum_to_string,
                                 vte_erase_binding_get_type, NULL);
-  g_settings_bind (profile,
+  profile_prefs_settings_bind (profile,
                    TERMINAL_PROFILE_BOLD_IS_BRIGHT_KEY,
                    gtk_builder_get_object (builder, "bold-is-bright-checkbutton"),
                    "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
-  g_settings_bind (profile, TERMINAL_PROFILE_BOLD_COLOR_SAME_AS_FG_KEY,
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_BOLD_COLOR_SAME_AS_FG_KEY,
                    gtk_builder_get_object (builder,
                                            "bold-color-checkbutton"),
                    "active",
@@ -998,13 +1061,13 @@ terminal_profile_edit (GSettings  *profile,
 #if GTK_CHECK_VERSION (3, 19, 8)
   g_object_set (w, "show-editor", TRUE, NULL);
 #endif
-  g_settings_bind (profile, TERMINAL_PROFILE_BOLD_COLOR_SAME_AS_FG_KEY,
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_BOLD_COLOR_SAME_AS_FG_KEY,
                    w,
                    "sensitive",
                    G_SETTINGS_BIND_GET |
                    G_SETTINGS_BIND_INVERT_BOOLEAN |
                    G_SETTINGS_BIND_NO_SENSITIVITY);
-  g_settings_bind_with_mapping (profile, TERMINAL_PROFILE_BOLD_COLOR_KEY,
+  profile_prefs_settings_bind_with_mapping (profile, TERMINAL_PROFILE_BOLD_COLOR_KEY,
                                 w,
                                 "rgba",
                                 G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET | G_SETTINGS_BIND_NO_SENSITIVITY,
@@ -1012,19 +1075,19 @@ terminal_profile_edit (GSettings  *profile,
                                 (GSettingsBindSetMapping) rgba_to_s,
                                 NULL, NULL);
 
-  g_settings_bind (profile, TERMINAL_PROFILE_CELL_HEIGHT_SCALE_KEY,
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_CELL_HEIGHT_SCALE_KEY,
                    gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON
                                                    (gtk_builder_get_object
                                                     (builder,
                                                      "cell-height-scale-spinbutton"))),
                    "value", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
-  g_settings_bind (profile, TERMINAL_PROFILE_CELL_WIDTH_SCALE_KEY,
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_CELL_WIDTH_SCALE_KEY,
                    gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON
                                                    (gtk_builder_get_object
                                                     (builder,
                                                      "cell-width-scale-spinbutton"))),
                    "value", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
-  g_settings_bind (profile, TERMINAL_PROFILE_CURSOR_COLORS_SET_KEY,
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_CURSOR_COLORS_SET_KEY,
                    gtk_builder_get_object (builder,
                                            "cursor-colors-checkbutton"),
                    "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
@@ -1033,12 +1096,12 @@ terminal_profile_edit (GSettings  *profile,
 #if GTK_CHECK_VERSION (3, 19, 8)
   g_object_set (w, "show-editor", TRUE, NULL);
 #endif
-  g_settings_bind (profile, TERMINAL_PROFILE_CURSOR_COLORS_SET_KEY,
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_CURSOR_COLORS_SET_KEY,
                    w,
                    "sensitive",
                    G_SETTINGS_BIND_GET |
                    G_SETTINGS_BIND_NO_SENSITIVITY);
-  g_settings_bind_with_mapping (profile, TERMINAL_PROFILE_CURSOR_FOREGROUND_COLOR_KEY,
+  profile_prefs_settings_bind_with_mapping (profile, TERMINAL_PROFILE_CURSOR_FOREGROUND_COLOR_KEY,
                                 w,
                                 "rgba",
                                 G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET | G_SETTINGS_BIND_NO_SENSITIVITY,
@@ -1050,12 +1113,12 @@ terminal_profile_edit (GSettings  *profile,
 #if GTK_CHECK_VERSION (3, 19, 8)
   g_object_set (w, "show-editor", TRUE, NULL);
 #endif
-  g_settings_bind (profile, TERMINAL_PROFILE_CURSOR_COLORS_SET_KEY,
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_CURSOR_COLORS_SET_KEY,
                    w,
                    "sensitive",
                    G_SETTINGS_BIND_GET |
                    G_SETTINGS_BIND_NO_SENSITIVITY);
-  g_settings_bind_with_mapping (profile, TERMINAL_PROFILE_CURSOR_BACKGROUND_COLOR_KEY,
+  profile_prefs_settings_bind_with_mapping (profile, TERMINAL_PROFILE_CURSOR_BACKGROUND_COLOR_KEY,
                                 w,
                                 "rgba",
                                 G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET | G_SETTINGS_BIND_NO_SENSITIVITY,
@@ -1063,7 +1126,7 @@ terminal_profile_edit (GSettings  *profile,
                                 (GSettingsBindSetMapping) rgba_to_s,
                                 NULL, NULL);
 
-  g_settings_bind (profile, TERMINAL_PROFILE_HIGHLIGHT_COLORS_SET_KEY,
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_HIGHLIGHT_COLORS_SET_KEY,
                    gtk_builder_get_object (builder,
                                            "highlight-colors-checkbutton"),
                    "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
@@ -1072,12 +1135,12 @@ terminal_profile_edit (GSettings  *profile,
 #if GTK_CHECK_VERSION (3, 19, 8)
   g_object_set (w, "show-editor", TRUE, NULL);
 #endif
-  g_settings_bind (profile, TERMINAL_PROFILE_HIGHLIGHT_COLORS_SET_KEY,
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_HIGHLIGHT_COLORS_SET_KEY,
                    w,
                    "sensitive",
                    G_SETTINGS_BIND_GET |
                    G_SETTINGS_BIND_NO_SENSITIVITY);
-  g_settings_bind_with_mapping (profile, TERMINAL_PROFILE_HIGHLIGHT_FOREGROUND_COLOR_KEY,
+  profile_prefs_settings_bind_with_mapping (profile, TERMINAL_PROFILE_HIGHLIGHT_FOREGROUND_COLOR_KEY,
                                 w,
                                 "rgba",
                                 G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET | G_SETTINGS_BIND_NO_SENSITIVITY,
@@ -1089,12 +1152,12 @@ terminal_profile_edit (GSettings  *profile,
 #if GTK_CHECK_VERSION (3, 19, 8)
   g_object_set (w, "show-editor", TRUE, NULL);
 #endif
-  g_settings_bind (profile, TERMINAL_PROFILE_HIGHLIGHT_COLORS_SET_KEY,
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_HIGHLIGHT_COLORS_SET_KEY,
                    w,
                    "sensitive",
                    G_SETTINGS_BIND_GET |
                    G_SETTINGS_BIND_NO_SENSITIVITY);
-  g_settings_bind_with_mapping (profile, TERMINAL_PROFILE_HIGHLIGHT_BACKGROUND_COLOR_KEY,
+  profile_prefs_settings_bind_with_mapping (profile, TERMINAL_PROFILE_HIGHLIGHT_BACKGROUND_COLOR_KEY,
                                 w,
                                 "rgba",
                                 G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET | G_SETTINGS_BIND_NO_SENSITIVITY,
@@ -1102,7 +1165,7 @@ terminal_profile_edit (GSettings  *profile,
                                 (GSettingsBindSetMapping) rgba_to_s,
                                 NULL, NULL);
 
-  g_settings_bind_with_mapping (profile, TERMINAL_PROFILE_CURSOR_SHAPE_KEY,
+  profile_prefs_settings_bind_with_mapping (profile, TERMINAL_PROFILE_CURSOR_SHAPE_KEY,
                                 gtk_builder_get_object (builder,
                                                         "cursor-shape-combobox"),
                                 "active",
@@ -1110,7 +1173,7 @@ terminal_profile_edit (GSettings  *profile,
                                 (GSettingsBindGetMapping) string_to_enum,
                                 (GSettingsBindSetMapping) enum_to_string,
                                 vte_cursor_shape_get_type, NULL);
-  g_settings_bind_with_mapping (profile, TERMINAL_PROFILE_CURSOR_BLINK_MODE_KEY,
+  profile_prefs_settings_bind_with_mapping (profile, TERMINAL_PROFILE_CURSOR_BLINK_MODE_KEY,
                                 gtk_builder_get_object (builder,
                                                         "cursor-blink-mode-combobox"),
                                 "active",
@@ -1118,7 +1181,7 @@ terminal_profile_edit (GSettings  *profile,
                                 (GSettingsBindGetMapping) string_to_enum,
                                 (GSettingsBindSetMapping) enum_to_string,
                                 vte_cursor_blink_mode_get_type, NULL);
-  g_settings_bind_with_mapping (profile, TERMINAL_PROFILE_TEXT_BLINK_MODE_KEY,
+  profile_prefs_settings_bind_with_mapping (profile, TERMINAL_PROFILE_TEXT_BLINK_MODE_KEY,
                                 gtk_builder_get_object (builder,
                                                         "text-blink-mode-combobox"),
                                 "active",
@@ -1126,22 +1189,22 @@ terminal_profile_edit (GSettings  *profile,
                                 (GSettingsBindGetMapping) string_to_enum,
                                 (GSettingsBindSetMapping) enum_to_string,
                                 vte_text_blink_mode_get_type, NULL);
-  g_settings_bind (profile, TERMINAL_PROFILE_CUSTOM_COMMAND_KEY,
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_CUSTOM_COMMAND_KEY,
                    gtk_builder_get_object (builder, "custom-command-entry"),
                    "text", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
-  g_settings_bind (profile, TERMINAL_PROFILE_DEFAULT_SIZE_COLUMNS_KEY,
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_DEFAULT_SIZE_COLUMNS_KEY,
                    gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON
                                                    (gtk_builder_get_object
                                                     (builder,
                                                      "default-size-columns-spinbutton"))),
                    "value", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
-  g_settings_bind (profile, TERMINAL_PROFILE_DEFAULT_SIZE_ROWS_KEY,
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_DEFAULT_SIZE_ROWS_KEY,
                    gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON
                                                    (gtk_builder_get_object
                                                     (builder,
                                                      "default-size-rows-spinbutton"))),
                    "value", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
-  g_settings_bind_with_mapping (profile, TERMINAL_PROFILE_DELETE_BINDING_KEY,
+  profile_prefs_settings_bind_with_mapping (profile, TERMINAL_PROFILE_DELETE_BINDING_KEY,
                                 gtk_builder_get_object (builder,
                                                         "delete-binding-combobox"),
                                 "active",
@@ -1149,7 +1212,7 @@ terminal_profile_edit (GSettings  *profile,
                                 (GSettingsBindGetMapping) string_to_enum,
                                 (GSettingsBindSetMapping) enum_to_string,
                                 vte_erase_binding_get_type, NULL);
-  g_settings_bind_with_mapping (profile, TERMINAL_PROFILE_EXIT_ACTION_KEY,
+  profile_prefs_settings_bind_with_mapping (profile, TERMINAL_PROFILE_EXIT_ACTION_KEY,
                                 gtk_builder_get_object (builder,
                                                         "exit-action-combobox"),
                                 "active",
@@ -1159,7 +1222,7 @@ terminal_profile_edit (GSettings  *profile,
                                 terminal_exit_action_get_type, NULL);
   w = (GtkWidget*) gtk_builder_get_object (builder, "font-selector");
   gtk_font_chooser_set_filter_func (GTK_FONT_CHOOSER (w), monospace_filter, NULL, NULL);
-  g_settings_bind (profile, TERMINAL_PROFILE_FONT_KEY,
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_FONT_KEY,
                    w,
                    "font-name", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
 
@@ -1167,7 +1230,7 @@ terminal_profile_edit (GSettings  *profile,
 #if GTK_CHECK_VERSION (3, 19, 8)
       g_object_set (w, "show-editor", TRUE, NULL);
 #endif
-  g_settings_bind_with_mapping (profile,
+  profile_prefs_settings_bind_with_mapping (profile,
                                 TERMINAL_PROFILE_FOREGROUND_COLOR_KEY,
                                 w,
                                 "rgba",
@@ -1176,33 +1239,33 @@ terminal_profile_edit (GSettings  *profile,
                                 (GSettingsBindSetMapping) rgba_to_s,
                                 NULL, NULL);
 
-  g_settings_bind (profile, TERMINAL_PROFILE_LOGIN_SHELL_KEY,
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_LOGIN_SHELL_KEY,
                    gtk_builder_get_object (builder,
                                            "login-shell-checkbutton"),
                    "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
-  g_settings_bind (profile, TERMINAL_PROFILE_VISIBLE_NAME_KEY,
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_VISIBLE_NAME_KEY,
                    gtk_builder_get_object (builder, "profile-name-entry"),
                    "text", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
-  g_settings_bind (profile, TERMINAL_PROFILE_SCROLLBACK_LINES_KEY,
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_SCROLLBACK_LINES_KEY,
                    gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON
                                                    (gtk_builder_get_object
                                                     (builder,
                                                      "scrollback-lines-spinbutton"))),
                    "value", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
-  g_settings_bind (profile, TERMINAL_PROFILE_SCROLLBACK_UNLIMITED_KEY,
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_SCROLLBACK_UNLIMITED_KEY,
                    gtk_builder_get_object (builder,
                                            "scrollback-limited-checkbutton"),
                    "active",
                    G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET |
                    G_SETTINGS_BIND_INVERT_BOOLEAN);
-  g_settings_bind (profile, TERMINAL_PROFILE_SCROLLBACK_UNLIMITED_KEY,
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_SCROLLBACK_UNLIMITED_KEY,
                    gtk_builder_get_object (builder,
                                            "scrollback-box"),
                    "sensitive", 
                    G_SETTINGS_BIND_GET |
                    G_SETTINGS_BIND_INVERT_BOOLEAN |
                    G_SETTINGS_BIND_NO_SENSITIVITY);
-  g_settings_bind_with_mapping (profile,
+  profile_prefs_settings_bind_with_mapping (profile,
                                 TERMINAL_PROFILE_SCROLLBAR_POLICY_KEY,
                                 gtk_builder_get_object (builder,
                                                         "scrollbar-checkbutton"),
@@ -1211,78 +1274,72 @@ terminal_profile_edit (GSettings  *profile,
                                 (GSettingsBindGetMapping) scrollbar_policy_to_bool,
                                 (GSettingsBindSetMapping) bool_to_scrollbar_policy,
                                 NULL, NULL);
-  g_settings_bind (profile, TERMINAL_PROFILE_SCROLL_ON_KEYSTROKE_KEY,
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_SCROLL_ON_KEYSTROKE_KEY,
                    gtk_builder_get_object (builder,
                                            "scroll-on-keystroke-checkbutton"),
                    "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
-  g_settings_bind (profile, TERMINAL_PROFILE_SCROLL_ON_OUTPUT_KEY,
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_SCROLL_ON_OUTPUT_KEY,
                    gtk_builder_get_object (builder,
                                            "scroll-on-output-checkbutton"),
                    "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
-  g_settings_bind (profile, TERMINAL_PROFILE_USE_SYSTEM_FONT_KEY,
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_USE_SYSTEM_FONT_KEY,
                    gtk_builder_get_object (builder,
                                            "custom-font-checkbutton"),
                    "active",
                    G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET |
                    G_SETTINGS_BIND_INVERT_BOOLEAN);
-  g_settings_bind (profile, TERMINAL_PROFILE_USE_CUSTOM_COMMAND_KEY,
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_USE_CUSTOM_COMMAND_KEY,
                    gtk_builder_get_object (builder,
                                            "use-custom-command-checkbutton"),
                    "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
-  g_settings_bind (profile, TERMINAL_PROFILE_USE_THEME_COLORS_KEY,
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_USE_THEME_COLORS_KEY,
                    gtk_builder_get_object (builder,
                                            "use-theme-colors-checkbutton"),
                    "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
-  g_settings_bind (profile, TERMINAL_PROFILE_AUDIBLE_BELL_KEY,
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_AUDIBLE_BELL_KEY,
                    gtk_builder_get_object (builder, "bell-checkbutton"),
                    "active",
                    G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
 
-  g_settings_bind (profile,
+  profile_prefs_settings_bind (profile,
                    TERMINAL_PROFILE_USE_CUSTOM_COMMAND_KEY,
                    gtk_builder_get_object (builder, "custom-command-box"),
                    "sensitive",
                    G_SETTINGS_BIND_GET | G_SETTINGS_BIND_NO_SENSITIVITY);
-  g_settings_bind (profile,
+  profile_prefs_settings_bind (profile,
                    TERMINAL_PROFILE_USE_SYSTEM_FONT_KEY,
                    gtk_builder_get_object (builder, "font-selector"),
                    "sensitive",
                    G_SETTINGS_BIND_GET | G_SETTINGS_BIND_INVERT_BOOLEAN |
                    G_SETTINGS_BIND_NO_SENSITIVITY);
-  g_settings_bind (profile,
+  profile_prefs_settings_bind (profile,
                    TERMINAL_PROFILE_USE_THEME_COLORS_KEY,
                    gtk_builder_get_object (builder, "colors-box"),
                    "sensitive",
                    G_SETTINGS_BIND_GET | G_SETTINGS_BIND_INVERT_BOOLEAN |
                    G_SETTINGS_BIND_NO_SENSITIVITY);
-  g_settings_bind_writable (profile,
+  profile_prefs_settings_bind_writable (profile,
                             TERMINAL_PROFILE_PALETTE_KEY,
                             gtk_builder_get_object (builder, "palette-box"),
                             "sensitive",
                             FALSE);
-  g_settings_bind (profile,
+  profile_prefs_settings_bind (profile,
                    TERMINAL_PROFILE_REWRAP_ON_RESIZE_KEY,
                    gtk_builder_get_object (builder, "rewrap-on-resize-checkbutton"),
                    "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
 
   /* Compatibility options */
   w = (GtkWidget *) gtk_builder_get_object  (builder, "encoding-combobox");
-  init_encodings_combo (w);
-  g_settings_bind (profile,
+  profile_prefs_settings_bind (profile,
                    TERMINAL_PROFILE_ENCODING_KEY,
                    w,
                    "active-id", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
 
   w = (GtkWidget *) gtk_builder_get_object  (builder, "cjk-ambiguous-width-combobox");
-  g_settings_bind (profile, TERMINAL_PROFILE_CJK_UTF8_AMBIGUOUS_WIDTH_KEY,
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_CJK_UTF8_AMBIGUOUS_WIDTH_KEY,
                    w,
                    "active-id",
                    G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
 
   /* Finished! */
-  terminal_util_bind_mnemonic_label_sensitivity (editor);
-
-  terminal_util_dialog_focus_widget (editor, widget_name);
-
-  gtk_window_present (GTK_WINDOW (editor));
 }
diff --git a/src/profile-editor.h b/src/profile-editor.h
index bddb95cd..6e29d8b4 100644
--- a/src/profile-editor.h
+++ b/src/profile-editor.h
@@ -23,8 +23,13 @@
 
 G_BEGIN_DECLS
 
-void terminal_profile_edit (GSettings  *profile,
-                            const char *widget_name);
+void profile_prefs_init (GtkBuilder *builder);
+
+void profile_prefs_switch (const char *uuid,
+                           GSettings *profile);
+
+//void terminal_profile_edit (GSettings  *profile,
+//                            const char *widget_name);
 
 G_END_DECLS
 
diff --git a/src/terminal-app.c b/src/terminal-app.c
index 5e782d9f..19a07734 100644
--- a/src/terminal-app.c
+++ b/src/terminal-app.c
@@ -333,7 +333,8 @@ terminal_app_new_profile (TerminalApp *app,
   if (profile == NULL)
     return;
 
-  terminal_profile_edit (profile, "profile-name-entry");
+// FIXME
+//  terminal_profile_edit (profile, "profile-name-entry");
 }
 
 void
@@ -1097,13 +1098,13 @@ terminal_app_edit_profile (TerminalApp     *app,
                            GSettings       *profile,
                            const char      *widget_name)
 {
-  terminal_profile_edit (profile, widget_name);
+  terminal_prefs_show_preferences (profile, widget_name);
 }
 
 void
 terminal_app_edit_preferences (TerminalApp *app)
 {
-  terminal_prefs_show_preferences ("general");
+  terminal_prefs_show_preferences (NULL, NULL);
 }
 
 /**
diff --git a/src/terminal-prefs.c b/src/terminal-prefs.c
index 8df280dc..f219f621 100644
--- a/src/terminal-prefs.c
+++ b/src/terminal-prefs.c
@@ -27,6 +27,7 @@
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 
+#include "profile-editor.h"
 #include "terminal-prefs.h"
 #include "terminal-accels.h"
 #include "terminal-app.h"
@@ -36,25 +37,13 @@
 #include "terminal-profiles-list.h"
 #include "terminal-libgsystem.h"
 
-typedef struct {
-  TerminalSettingsList *profiles_list;
-  GtkWidget *dialog;
-  GtkWindow *parent;
-
-  GtkTreeView *manage_profiles_list;
-  GtkWidget *manage_profiles_new_button;
-  GtkWidget *manage_profiles_edit_button;
-  GtkWidget *manage_profiles_clone_button;
-  GtkWidget *manage_profiles_delete_button;
-  GtkWidget *profiles_default_combo;
-} PrefData;
-
-static GtkWidget *prefs_dialog = NULL;
+static PrefData *the_pref_data = NULL;
 
 static void
 prefs_dialog_help_button_clicked_cb (GtkWidget *button,
                                      PrefData *data)
 {
+  // FIXME merge the "profile" and "pref" help pages
   terminal_util_show_help ("pref");
 }
 
@@ -65,6 +54,43 @@ prefs_dialog_close_button_clicked_cb (GtkWidget *button,
   gtk_widget_destroy (data->dialog);
 }
 
+/* Sidebar */
+
+static void
+listbox_row_selected_cb (GtkListBox *box,
+                         GtkListBoxRow *row,
+                         GtkStack *stack)
+{
+  int i, i2;
+  GtkListBoxRow *row2;
+  GSettings *profile;
+  char *uuid;
+
+  i = gtk_list_box_row_get_index (row);
+
+  i2 = 0;
+  while ((row2 = gtk_list_box_get_row_at_index (box, i2)) != NULL) {
+    profile = g_object_get_data (G_OBJECT (row2), "gsettings");
+
+    GtkStack *stack2 = g_object_get_data (G_OBJECT (row2), "popover-stack");
+    gtk_stack_set_visible_child_name (stack2, profile != NULL && i2 == i ? "button" : "placeholder");
+
+    stack2 = g_object_get_data (G_OBJECT (row2), "home-stack");
+    gtk_stack_set_visible_child_name (stack2, profile == the_pref_data->default_profile ? "home" : "placeholder");
+
+    i2++;
+  }
+
+  profile = g_object_get_data (G_OBJECT (row), "gsettings");
+  if (profile != NULL) {
+    uuid = g_object_get_data (G_OBJECT (row), "uuid");
+    profile_prefs_switch (uuid, profile);
+  }
+
+  char *stack_child_name = g_object_get_data (G_OBJECT (row), "stack_child_name");
+  gtk_stack_set_visible_child_name (stack, stack_child_name);
+}
+
 /* Profiles tab */
 
 enum
@@ -112,6 +138,187 @@ profile_sort_func (GtkTreeModel *model,
   return terminal_profiles_compare (profile_a, profile_b);
 }
 
+static GtkWidget *
+rowheader (const char *text)
+{
+  GtkLabel *label = (GtkLabel *) gtk_label_new (NULL);
+  gs_free char *markup = g_markup_printf_escaped ("<b>%s</b>", text);
+  gtk_label_set_markup (label, markup);
+  gtk_label_set_xalign (label, 0);
+  gtk_widget_set_margin_start ((GtkWidget *) label, 6);
+  gtk_widget_set_margin_end ((GtkWidget *) label, 6);
+  gtk_widget_set_margin_top ((GtkWidget *) label, 6);
+  gtk_widget_set_margin_bottom ((GtkWidget *) label, 6);
+  gtk_widget_show (GTK_WIDGET (label));
+  return GTK_WIDGET (label);
+}
+
+static void
+updateheaderfunc              (GtkListBoxRow *row,
+                               GtkListBoxRow *before,
+                               gpointer user_data)
+{
+  if (before == NULL) {
+    if (gtk_list_box_row_get_header (row) == NULL) {
+      gtk_list_box_row_set_header (row, rowheader (_("Global")));
+    }
+    return;
+  }
+
+  gpointer profile = g_object_get_data (G_OBJECT (row), "gsettings");
+  if (profile != NULL) {
+    gpointer profile_before = g_object_get_data (G_OBJECT (before), "gsettings");
+    if (profile_before != NULL) {
+      gtk_list_box_row_set_header (row, NULL);
+    } else {
+      if (gtk_list_box_row_get_header (row) == NULL) {
+        gtk_list_box_row_set_header (row, rowheader(_("Profiles")));
+      }
+    }
+  }
+}
+
+static GtkWidget *
+cccrrr (gpointer item,
+        gpointer user_data)
+{
+  GObject *model_item = item;
+  GSettings *gsettings = g_object_get_data (model_item, "gsettings");
+  char *uuid = g_object_get_data (model_item, "uuid");
+  char *name = g_object_get_data (model_item, "text");
+  char *stack_child_name = g_object_get_data (model_item, "stack_child_name");
+
+  GtkListBoxRow *listboxrow = (GtkListBoxRow *) gtk_list_box_row_new ();
+  g_object_set_data (G_OBJECT (listboxrow), "gsettings", gsettings);
+  g_object_set_data (G_OBJECT (listboxrow), "uuid", uuid);
+  g_object_set_data (G_OBJECT (listboxrow), "stack_child_name", stack_child_name);
+
+  GtkBox *hbox = (GtkBox *) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+  gtk_widget_set_margin_start ((GtkWidget *) hbox, 6);
+  gtk_widget_set_margin_end ((GtkWidget *) hbox, 6);
+  gtk_widget_set_margin_top ((GtkWidget *) hbox, 6);
+  gtk_widget_set_margin_bottom ((GtkWidget *) hbox, 6);
+
+  GtkLabel *label = (GtkLabel *) gtk_label_new (name);
+  gtk_label_set_xalign (label, 0);
+
+  gtk_box_pack_start (hbox, (GtkWidget *) label, TRUE, TRUE, 0);
+
+
+  GtkStack *popover_stack = (GtkStack *) gtk_stack_new ();
+  GtkMenuButton *popover_button = (GtkMenuButton *) gtk_menu_button_new ();
+  gtk_button_set_relief (GTK_BUTTON (popover_button), GTK_RELIEF_NONE);
+  gtk_stack_add_named (popover_stack, GTK_WIDGET (popover_button), "button");
+  GtkLabel *popover_label = (GtkLabel *) gtk_label_new ("");
+  gtk_stack_add_named (popover_stack, GTK_WIDGET (popover_label), "placeholder");
+  g_object_set_data (G_OBJECT (listboxrow), "popover-stack", popover_stack);
+
+  gtk_box_pack_end (hbox, (GtkWidget *) popover_stack, FALSE, FALSE, 0);
+
+
+  GtkStack *home_stack = (GtkStack *) gtk_stack_new ();
+  gtk_widget_set_margin_start ((GtkWidget *) home_stack, 12);
+  GtkImage *home_image = (GtkImage *) gtk_image_new_from_icon_name ("go-home", GTK_ICON_SIZE_BUTTON);
+  gtk_stack_add_named (home_stack, GTK_WIDGET (home_image), "home");
+  GtkLabel *home_label = (GtkLabel *) gtk_label_new ("");
+  gtk_stack_add_named (home_stack, GTK_WIDGET (home_label), "placeholder");
+  g_object_set_data (G_OBJECT (listboxrow), "home-stack", home_stack);
+
+  gtk_box_pack_end (hbox, (GtkWidget *) home_stack, FALSE, FALSE, 0);
+
+
+  GtkPopover *p = (GtkPopover *) gtk_popover_new (NULL);
+  GtkLabel *pl = (GtkLabel *) gtk_label_new ("PoPOvEr");
+  gtk_widget_show (GTK_WIDGET (pl));
+  gtk_container_add (GTK_CONTAINER (p), GTK_WIDGET (pl));
+  gtk_menu_button_set_popover (popover_button, GTK_WIDGET (p));
+
+
+  gtk_container_add ((GtkContainer *) listboxrow, (GtkWidget *) hbox);
+
+  gtk_widget_show_all ((GtkWidget *) listboxrow);
+
+  gtk_stack_set_visible_child_name (popover_stack, "placeholder");
+  gtk_stack_set_visible_child_name (home_stack, "home");
+
+  // is this really needed? what for?
+  if (gsettings != NULL)
+    g_object_set_data (G_OBJECT (gsettings), "listboxrow", listboxrow);
+
+  return GTK_WIDGET (listboxrow);
+}
+
+static void
+add_profile (const char *name,
+             const char *uuid,
+             GSettings *gsettings,
+             gboolean activate)
+{
+
+//  g_object_set_data (G_OBJECT (gsettings), "builder", builder);
+
+//  terminal_profile_edit (gsettings, "UnUsEd");
+
+  /* Add new row to sidebar */
+//  GtkListBox *listbox = (GtkListBox *) the_pref_data->listbox;
+
+
+
+//  if (activate)
+//    g_signal_emit_by_name (listboxrow, "activate");
+}
+
+static GListStore *
+profile_gliststore_new (PrefData *data,
+                        GSettings *selected_profile)
+{
+  GListStore *store;
+  GList *list, *l;
+  GObject *global;
+  GObject *shortcuts;
+  GObject *legacy;
+
+  store = g_list_store_new (G_TYPE_OBJECT);
+
+  list = terminal_settings_list_ref_children (data->profiles_list);
+
+  global = g_object_new (G_TYPE_OBJECT, NULL);
+  g_object_set_data (global, "stack_child_name", g_strdup ("general-prefs"));  // free?
+  g_object_set_data (global, "text", _("General"));
+  g_list_store_append (store, global);
+
+  shortcuts = g_object_new (G_TYPE_OBJECT, NULL);
+  g_object_set_data (shortcuts, "stack_child_name", g_strdup ("shortcut-prefs"));  // free?
+  g_object_set_data (shortcuts, "text", _("Shortcuts"));
+  g_list_store_append (store, shortcuts);
+
+  legacy = g_object_new (G_TYPE_OBJECT, NULL);
+  g_object_set_data (legacy, "stack_child_name", g_strdup ("old-profiles-list"));  // free?
+  g_object_set_data (legacy, "text", _("Legacy"));
+  g_list_store_append (store, legacy);
+
+  for (l = list; l != NULL; l = l->next) {
+    GObject *obj;
+    GSettings *profile = (GSettings *) l->data;
+    gchar *text = g_settings_get_string (profile, TERMINAL_PROFILE_VISIBLE_NAME_KEY);
+    gchar *uuid = terminal_settings_list_dup_uuid_from_child (data->profiles_list, profile);
+
+    obj = g_object_new (G_TYPE_OBJECT, NULL);
+    g_object_set_data (obj, "stack_child_name", g_strdup ("profile-prefs"));  // free?
+    g_object_set_data (obj, "text", g_strdup (text));
+    g_object_set_data (obj, "uuid", g_strdup (uuid));
+    g_object_set_data (obj, "gsettings", profile);
+    g_list_store_append (store, obj);
+
+//    add_profile (text, uuid, profile, FALSE);
+
+    g_free (uuid);
+    g_free (text);
+  }
+
+  return store;
+}
+
 static /* ref */ GtkTreeModel *
 profile_liststore_new (PrefData *data,
                        GSettings *selected_profile,
@@ -132,11 +339,18 @@ profile_liststore_new (PrefData *data,
   for (l = list; l != NULL; l = l->next)
     {
       GSettings *profile = (GSettings *) l->data;
+      gchar *text = g_settings_get_string (profile, TERMINAL_PROFILE_VISIBLE_NAME_KEY);
+      gchar *uuid = terminal_settings_list_dup_uuid_from_child (data->profiles_list, profile);
 
       gtk_list_store_insert_with_values (store, &iter, 0,
                                          (int) COL_PROFILE, profile,
                                          (int) -1);
 
+      add_profile (text, uuid, profile, FALSE);
+
+      g_free (uuid);
+      g_free (text);
+
       if (selected_profile_iter && profile == selected_profile)
         {
           *selected_profile_iter = iter;
@@ -215,6 +429,7 @@ profile_combo_box_new (PrefData *data)
                                       data, NULL);
 
   default_profile = terminal_settings_list_ref_default_child (data->profiles_list);
+  data->default_profile = default_profile; // ouch
   model = profile_liststore_new (data,
                                  default_profile,
                                  &iter,
@@ -239,6 +454,7 @@ profile_combo_box_changed_cb (GtkWidget *widget,
   if (!profile)
     return;
 
+  data->default_profile = profile;  // TODO update the icon in the sidebar
   uuid = terminal_settings_list_dup_uuid_from_child (data->profiles_list, profile);
   terminal_settings_list_set_default_child (data->profiles_list, uuid);
 }
@@ -268,6 +484,7 @@ profile_list_treeview_refill (PrefData *data)
   gboolean iter_set;
   gs_unref_object GSettings *selected_profile;
   gs_unref_object GtkTreeModel *model;
+  GListStore *gls;
 
   selected_profile = profile_list_ref_selected (data);
   model = profile_liststore_new (data,
@@ -281,6 +498,13 @@ profile_list_treeview_refill (PrefData *data)
 
   if (iter_set)
     gtk_tree_selection_select_iter (gtk_tree_view_get_selection (tree_view), &iter);
+
+  gls = profile_gliststore_new (data, selected_profile);
+  gtk_list_box_bind_model (GTK_LIST_BOX (data->listbox),
+                           G_LIST_MODEL (gls),
+                           cccrrr,
+                           NULL,
+                           NULL);
 }
 
 static void
@@ -289,6 +513,7 @@ profile_list_row_activated_cb (GtkTreeView *tree_view,
                                GtkTreeViewColumn *column,
                                PrefData *data)
 {
+#if 0
   gs_unref_object GSettings *selected_profile;
 
   selected_profile = profile_list_ref_selected (data);
@@ -296,6 +521,7 @@ profile_list_row_activated_cb (GtkTreeView *tree_view,
     return;
 
   terminal_app_edit_profile (terminal_app_get (), selected_profile, NULL);
+#endif
 }
 
 static GtkTreeView *
@@ -329,6 +555,7 @@ profile_list_treeview_new (PrefData *data)
   return GTK_TREE_VIEW (tree_view);
 }
 
+#if 0
 static void
 profile_list_delete_confirm_response_cb (GtkWidget *dialog,
                                          int response,
@@ -344,11 +571,13 @@ profile_list_delete_confirm_response_cb (GtkWidget *dialog,
 
   gtk_widget_destroy (dialog);
 }
+#endif
 
 static void
 profile_list_delete_button_clicked_cb (GtkWidget *button,
                                        PrefData *data)
 {
+#if 0
   GtkWidget *dialog;
   gs_unref_object GSettings *selected_profile;
   gs_free char *name = NULL;
@@ -388,19 +617,23 @@ profile_list_delete_button_clicked_cb (GtkWidget *button,
                     data);
 
   gtk_window_present (GTK_WINDOW (dialog));
+#endif
 }
 
 static void
 profile_list_new_button_clicked_cb (GtkWidget *button,
                                     PrefData *data)
 {
+#if 0
   terminal_app_new_profile (terminal_app_get (), NULL);
+#endif
 }
 
 static void
 profile_list_clone_button_clicked_cb (GtkWidget *button,
                                       PrefData *data)
 {
+#if 0
   gs_unref_object GSettings *selected_profile;
 
   selected_profile = profile_list_ref_selected (data);
@@ -408,12 +641,14 @@ profile_list_clone_button_clicked_cb (GtkWidget *button,
     return;
 
   terminal_app_new_profile (terminal_app_get (), selected_profile);
+#endif
 }
 
 static void
 profile_list_edit_button_clicked_cb (GtkWidget *button,
                                      PrefData *data)
 {
+#if 0
   gs_unref_object GSettings *selected_profile;
 
   selected_profile = profile_list_ref_selected (data);
@@ -421,6 +656,7 @@ profile_list_edit_button_clicked_cb (GtkWidget *button,
     return;
 
   terminal_app_edit_profile (terminal_app_get (), selected_profile, NULL);
+#endif
 }
 
 static void
@@ -460,8 +696,9 @@ prefs_dialog_destroy_cb (GtkWidget *widget,
   g_free (data);
 }
 
+// FIXME implement switching the tab to widget_name
 void
-terminal_prefs_show_preferences (const char *page)
+terminal_prefs_show_preferences (GSettings *profile, const char *widget_name)
 {
   TerminalApp *app = terminal_app_get ();
   PrefData *data;
@@ -474,15 +711,17 @@ terminal_prefs_show_preferences (const char *page)
   GtkWidget *default_hbox, *default_label;
   GtkWidget *close_button, *help_button;
   GtkTreeSelection *selection;
+  GtkBuilder *builder;
   GSettings *settings;
 
-  if (prefs_dialog != NULL)
+  if (the_pref_data != NULL)
     goto done;
 
   data = g_new0 (PrefData, 1);
+  the_pref_data = data;  // FIXME move it to below
   data->profiles_list = terminal_app_get_profiles_list (app);
 
-  terminal_util_load_widgets_resource ("/org/gnome/terminal/ui/preferences.ui",
+  builder = terminal_util_load_widgets_resource ("/org/gnome/terminal/ui/preferences.ui",
                                        "preferences-dialog",
                                        "preferences-dialog", &dialog,
                                        "close-button", &close_button,
@@ -503,6 +742,8 @@ terminal_prefs_show_preferences (const char *page)
                                        "delete-profile-button", &remove_button,
                                        "default-profile-hbox", &default_hbox,
                                        "default-profile-label", &default_label,
+                                       "the-stack", &data->stack,
+                                       "the-listbox", &data->listbox,
                                        NULL);
 
   data->dialog = dialog;
@@ -513,6 +754,14 @@ terminal_prefs_show_preferences (const char *page)
 
   settings = terminal_app_get_global_settings (app);
 
+  /* Sidebar */
+
+  gtk_list_box_set_header_func (GTK_LIST_BOX (data->listbox),
+                                updateheaderfunc,
+                                NULL,
+                                NULL /* destroy! */);
+  g_signal_connect (data->listbox, "row-selected", G_CALLBACK (listbox_row_selected_cb), data->stack);
+
   /* General tab */
 
   gboolean shell_shows_menubar;
@@ -624,11 +873,24 @@ terminal_prefs_show_preferences (const char *page)
   g_signal_connect (dialog, "destroy", G_CALLBACK (prefs_dialog_destroy_cb), data);
   gtk_window_set_default_size (GTK_WINDOW (dialog), -1, 350);
 
-  prefs_dialog = dialog;
-  g_object_add_weak_pointer (G_OBJECT (dialog), (gpointer *) &prefs_dialog);
+//  the_pref_data = data;
+  g_object_add_weak_pointer (G_OBJECT (dialog), (gpointer *) &the_pref_data);
+
+  /* profile prefs */
+  profile_prefs_init (builder);
 
 done:
-  terminal_util_dialog_focus_widget (prefs_dialog, page);
+  ;
+  GtkListBoxRow* lbr;
+  if (profile != NULL) {
+    lbr = g_object_get_data (G_OBJECT (profile), "listboxrow");
+  } else {
+    lbr = gtk_list_box_get_row_at_index (GTK_LIST_BOX (the_pref_data->listbox), 0);
+  }
+  g_signal_emit_by_name (lbr, "activate");  // wow does this really work before the window is presented?
+
+//  terminal_util_dialog_focus_widget (prefs_dialog, page);
+// TODO switch to the given notebook tab within the profile!
 
-  gtk_window_present (GTK_WINDOW (prefs_dialog));
+  gtk_window_present (GTK_WINDOW (the_pref_data->dialog));
 }
diff --git a/src/terminal-prefs.h b/src/terminal-prefs.h
index 1a4bc2df..97c07601 100644
--- a/src/terminal-prefs.h
+++ b/src/terminal-prefs.h
@@ -20,9 +20,34 @@
 
 #include <gtk/gtk.h>
 
+#include "terminal-profiles-list.h"
+
 G_BEGIN_DECLS
 
-void terminal_prefs_show_preferences (const char *page);
+// FIXME move back to the .c file if profile-editor.c is also merged there,
+// also remove the profiles-list.h incude above.
+// FIXME PrefData is a very bad name, rename to PrefsDialog maybe?
+/* Everything about a preferences dialog */
+typedef struct {
+  TerminalSettingsList *profiles_list;
+  GSettings *default_profile;
+
+  GtkWidget *dialog;
+  GtkWindow *parent;
+
+  GtkTreeView *manage_profiles_list;
+  GtkWidget *manage_profiles_new_button;
+  GtkWidget *manage_profiles_edit_button;
+  GtkWidget *manage_profiles_clone_button;
+  GtkWidget *manage_profiles_delete_button;
+  GtkWidget *profiles_default_combo;
+
+  GtkWidget *stack;
+  GtkWidget *listbox;
+
+} PrefData;
+
+void terminal_prefs_show_preferences (GSettings *profile, const char *widget_name);
 
 G_END_DECLS
 
diff --git a/src/terminal-screen.c b/src/terminal-screen.c
index 117315e1..6582851c 100644
--- a/src/terminal-screen.c
+++ b/src/terminal-screen.c
@@ -1273,6 +1273,7 @@ info_bar_response_cb (GtkWidget *info_bar,
       _terminal_screen_launch_child_on_idle (screen);
       break;
     case RESPONSE_EDIT_PROFILE:
+      // FIXME double check that swtiching to that tab works!!!
       terminal_app_edit_profile (terminal_app_get (),
                                  terminal_screen_get_profile (screen),
                                  "custom-command-entry");
diff --git a/src/terminal-util.c b/src/terminal-util.c
index 6813f9e7..38d76027 100644
--- a/src/terminal-util.c
+++ b/src/terminal-util.c
@@ -407,13 +407,13 @@ main_object_destroy_cb (GtkWidget *widget)
   g_object_set_data (G_OBJECT (widget), "builder", NULL);
 }
 
-void
+GtkBuilder *
 terminal_util_load_widgets_resource (const char *path,
                                      const char *main_object_name,
                                      const char *object_name,
                                      ...)
 {
-  gs_unref_object GtkBuilder *builder;
+  GtkBuilder *builder;
   GError *error = NULL;
   va_list args;
 
@@ -453,6 +453,7 @@ terminal_util_load_widgets_resource (const char *path,
       gtk_widget_set_margin_bottom (action_area, 5);
     }
   }
+  return builder;
 }
 
 void
diff --git a/src/terminal-util.h b/src/terminal-util.h
index c49460e9..702b0623 100644
--- a/src/terminal-util.h
+++ b/src/terminal-util.h
@@ -51,7 +51,7 @@ char *terminal_util_concat_uris (char **uris,
 
 char *terminal_util_get_licence_text (void);
 
-void terminal_util_load_widgets_resource (const char *path,
+GtkBuilder *terminal_util_load_widgets_resource (const char *path,
                                           const char *main_object_name,
                                           const char *object_name,
                                           ...);
