[gnome-terminal] prefs: editor: Merge the Preferences and Profile Preferences windows



commit 42da010df60c14939f811dcb6b9ba03f1dbe6107
Author: Egmont Koblinger <egmont gmail com>
Date:   Sun Feb 4 00:32:16 2018 +0100

    prefs: editor: Merge the Preferences and Profile Preferences windows
    
    https://bugzilla.gnome.org/show_bug.cgi?id=722114

 configure.ac                       |    2 +-
 src/Makefile.am                    |    1 -
 src/migration.c                    |    3 +-
 src/org.gnome.Terminal.gschema.xml |    8 -
 src/preferences.ui                 | 2386 +++++++++++++++++++++++++++++++-----
 src/profile-editor.c               |  919 +++++++-------
 src/profile-editor.h               |   10 +-
 src/profile-preferences.ui         | 1851 ----------------------------
 src/terminal-accels.c              |    4 -
 src/terminal-app.c                 |   37 +-
 src/terminal-app.h                 |   13 +-
 src/terminal-menubar.ui            |    8 -
 src/terminal-prefs.c               |  956 ++++++++++-----
 src/terminal-prefs.h               |   28 +-
 src/terminal-screen.c              |   12 +-
 src/terminal-settings-list.c       |   48 +-
 src/terminal-settings-list.h       |    6 +-
 src/terminal-util.c                |    9 +-
 src/terminal-util.h                |   10 +-
 src/terminal-window.c              |   39 +-
 src/terminal.gresource.xml         |    1 -
 21 files changed, 3294 insertions(+), 3057 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 0dfb0c9..9a3b2be 100644
--- a/configure.ac
+++ b/configure.ac
@@ -62,7 +62,7 @@ case "$with_gtk" in
   3.0) GTK_API_VERSION=3.0
        GTK_REQUIRED=3.12.0
        GTK_MIN_REQUIRED=3.8
-       GTK_MAX_ALLOWED=3.20
+       GTK_MAX_ALLOWED=3.22
        VTE_API_VERSION=2.91
        VTE_REQUIRED=0.51.3
        ;;
diff --git a/src/Makefile.am b/src/Makefile.am
index 101367d..836a36f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -365,7 +365,6 @@ EXTRA_DIST = \
        nautilus.symbols \
        search-popover.ui \
        preferences.ui \
-       profile-preferences.ui \
        terminal.common.css \
        $(about_DATA) \
        $(builder_DATA) \
diff --git a/src/migration.c b/src/migration.c
index 68acd41..e3ae04b 100644
--- a/src/migration.c
+++ b/src/migration.c
@@ -386,7 +386,7 @@ migrate_profile (TerminalSettingsList *list,
     settings = terminal_settings_list_ref_default_child (list);
     is_default = TRUE;
   } else {
-    child_name = terminal_settings_list_add_child (list);
+    child_name = terminal_settings_list_add_child (list, NULL);
     settings = terminal_settings_list_ref_child (list, child_name);
     g_free (child_name);
     is_default = FALSE;
@@ -539,7 +539,6 @@ migrate_accels (GSettings *global_settings,
   static const const struct { const char *gconf_key; const char *settings_key; } const data[] = {
     { "new_tab",          "new-tab"            },
     { "new_window",       "new-window"         },
-    { "new_profile",      "new-profile"        },
     { "close_tab",        "close-tab"          },
     { "close_window",     "close-window"       },
     { "copy",             "copy"               },
diff --git a/src/org.gnome.Terminal.gschema.xml b/src/org.gnome.Terminal.gschema.xml
index 586d7a4..2edecea 100644
--- a/src/org.gnome.Terminal.gschema.xml
+++ b/src/org.gnome.Terminal.gschema.xml
@@ -413,10 +413,6 @@
       <default>'&lt;Ctrl&gt;&lt;Shift&gt;n'</default>
       <summary>Keyboard shortcut to open a new window</summary>
     </key>
-    <key name="new-profile" type="s">
-      <default>'disabled'</default>
-      <summary>Keyboard shortcut to create a new profile</summary>
-    </key>
     <key name="save-contents" type="s">
       <default>'disabled'</default>
       <summary>Keyboard shortcut to save the current tab contents to file</summary>
@@ -457,10 +453,6 @@
       <default>'disabled'</default>
       <summary>Keyboard shortcut to open the Preferences dialog</summary>
     </key>
-    <key name="profile-preferences" type="s">
-      <default>'disabled'</default>
-      <summary>Keyboard shortcut to open the current profile’s Preferences dialog</summary>
-    </key>
     <key name="full-screen" type="s">
       <default>'F11'</default>
       <summary>Keyboard shortcut to toggle full screen mode</summary>
diff --git a/src/preferences.ui b/src/preferences.ui
index c941438..1488382 100644
--- a/src/preferences.ui
+++ b/src/preferences.ui
@@ -42,394 +42,2042 @@
       </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">0</property>
+    <property name="upper">2147483647</property>
+    <property name="value">10000</property>
+    <property name="step_increment">1000</property>
+    <property name="page_increment">10000</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="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_top">12</property>
-        <property name="margin_bottom">12</property>
+        <property name="margin">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="GtkBox" id="general">
+              <object class="GtkFrame">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="border_width">12</property>
-                <property name="orientation">vertical</property>
-                <property name="spacing">6</property>
-                <child>
-                  <object class="GtkCheckButton" id="default-show-menubar-checkbutton">
-                    <property name="label" translatable="yes">_Show menubar by default in new 
terminals</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</property>
-                    <property name="draw_indicator">True</property>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
                 <child>
-                  <object class="GtkCheckButton" id="disable-mnemonics-checkbutton">
-                    <property name="label" translatable="yes">_Enable mnemonics (such as Alt+F to open the 
File menu)</property>
-                    <property name="use_action_appearance">False</property>
+                  <object class="GtkScrolledWindow">
                     <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</property>
-                    <property name="draw_indicator">True</property>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkCheckButton" id="disable-menu-accel-checkbutton">
-                    <property name="label" translatable="yes">Enable the _menu accelerator key (F10 by 
default)</property>
-                    <property name="use_action_appearance">False</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="use_underline">True</property>
-                    <property name="xalign">0</property>
-                    <property name="draw_indicator">True</property>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">2</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkGrid" id="grid1">
-                    <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" id="theme-variant-label">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="label" translatable="yes">Theme _variant:</property>
-                        <property name="use_underline">True</property>
-                        <property name="mnemonic_widget">theme-variant-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="theme-variant-combobox">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="model">theme-variant-liststore</property>
-                        <property name="id_column">1</property>
-                        <child>
-                          <object class="GtkCellRendererText" id="renderer1"/>
-                          <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>
-                        <property name="xalign">0</property>
-                      </object>
-                      <packing>
-                        <property name="top_attach">1</property>
-                        <property name="left_attach">0</property>
-                      </packing>
-                    </child>
+                    <property name="hscrollbar_policy">never</property>
                     <child>
-                      <object class="GtkComboBox" id="new-terminal-mode-combobox">
+                      <object class="GtkViewport">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="model">new-terminal-mode-liststore</property>
-                        <property name="id_column">1</property>
                         <child>
-                          <object class="GtkCellRendererText" id="renderer2"/>
-                          <attributes>
-                            <attribute name="text">0</attribute>
-                          </attributes>
+                          <object class="GtkListBox" id="the-listbox">
+                            <property name="visible">True</property>
+                          </object>
                         </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">True</property>
-                    <property name="position">3</property>
-                  </packing>
                 </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>
-              </packing>
-            </child>
             <child>
-              <object class="GtkGrid" id="keybindings">
+              <object class="GtkStack" id="the-stack">
                 <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="disable-shortcuts-checkbutton">
-                    <property name="label" translatable="yes">_Enable shortcuts</property>
-                    <property name="use_action_appearance">False</property>
+                  <object class="GtkEventBox" id="bug722114-comment25-1">
                     <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</property>
-                    <property name="draw_indicator">True</property>
+                    <property name="can_focus">False</property>
+                    <child>
+                      <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="spacing">6</property>
+                            <child>
+                              <object class="GtkCheckButton" id="default-show-menubar-checkbutton">
+                                <property name="label" translatable="yes">_Show menubar by default in new 
terminals</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</property>
+                                <property name="draw_indicator">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkCheckButton" id="disable-mnemonics-checkbutton">
+                                <property name="label" translatable="yes">_Enable mnemonics (such as Alt+F 
to open the File menu)</property>
+                                <property name="use_action_appearance">False</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="use_underline">True</property>
+                                <property name="xalign">0</property>
+                                <property name="draw_indicator">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkCheckButton" id="disable-menu-accel-checkbutton">
+                                <property name="label" translatable="yes">Enable the _menu accelerator key 
(F10 by default)</property>
+                                <property name="use_action_appearance">False</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="use_underline">True</property>
+                                <property name="xalign">0</property>
+                                <property name="draw_indicator">True</property>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">2</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkGrid" id="grid1">
+                                <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" id="theme-variant-label">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="label" translatable="yes">Theme _variant:</property>
+                                    <property name="use_underline">True</property>
+                                    <property name="mnemonic_widget">theme-variant-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="theme-variant-combobox">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="model">theme-variant-liststore</property>
+                                    <property name="id_column">1</property>
+                                    <child>
+                                      <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>
+                                    <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="new-terminal-mode-combobox">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="model">new-terminal-mode-liststore</property>
+                                    <property name="id_column">1</property>
+                                    <child>
+                                      <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>
+                                  </packing>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">3</property>
+                              </packing>
+                            </child>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
                   </object>
                   <packing>
-                    <property name="top_attach">0</property>
-                    <property name="left_attach">0</property>
+                    <property name="name">general-prefs</property>
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkScrolledWindow" id="scrolledwindow1">
+                  <object class="GtkEventBox" id="bug722114-comment25-2">
                     <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="hscrollbar_policy">never</property>
-                    <property name="shadow_type">in</property>
-                    <property name="hexpand">True</property>
-                    <property name="vexpand">True</property>
+                    <property name="can_focus">False</property>
                     <child>
-                      <object class="GtkTreeView" id="accelerators-treeview">
+                      <object class="GtkFrame" id="keybindings">
                         <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="rules_hint">True</property>
-                        <child internal-child="selection">
-                          <object class="GtkTreeSelection" id="treeview-selection"/>
+                        <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>
+                            <property name="column_spacing">12</property>
+                            <property name="row_spacing">6</property>
+                            <child>
+                              <object class="GtkCheckButton" id="disable-shortcuts-checkbutton">
+                                <property name="label" translatable="yes">_Enable shortcuts</property>
+                                <property name="use_action_appearance">False</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="use_underline">True</property>
+                                <property name="xalign">0</property>
+                                <property name="draw_indicator">True</property>
+                              </object>
+                              <packing>
+                                <property name="top_attach">0</property>
+                                <property name="left_attach">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkScrolledWindow" id="scrolledwindow1">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="hscrollbar_policy">never</property>
+                                <property name="shadow_type">in</property>
+                                <property name="hexpand">True</property>
+                                <property name="vexpand">True</property>
+                                <child>
+                                  <object class="GtkTreeView" id="accelerators-treeview">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="rules_hint">True</property>
+                                    <child internal-child="selection">
+                                      <object class="GtkTreeSelection" id="treeview-selection"/>
+                                    </child>
+                                  </object>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="top_attach">1</property>
+                                <property name="left_attach">0</property>
+                              </packing>
+                            </child>
+                          </object>
                         </child>
                       </object>
                     </child>
                   </object>
                   <packing>
-                    <property name="top_attach">1</property>
-                    <property name="left_attach">0</property>
+                    <property name="name">shortcut-prefs</property>
                   </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>
-              </packing>
-            </child>
-            <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="GtkHBox" id="hbox25">
+                  <object class="GtkEventBox" id="bug722114-comment25-3">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="spacing">6</property>
                     <child>
-                      <object class="GtkScrolledWindow" id="profiles-treeview-container">
+                      <object class="GtkNotebook" id="profile-editor-notebook">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
-                        <property name="hscrollbar_policy">never</property>
-                        <property name="shadow_type">in</property>
                         <child>
-                          <placeholder/>
+                          <object class="GtkVBox" id="vbox3">
+                            <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="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="GtkHBox">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="spacing">6</property>
+                                    <property name="valign">end</property>
+                                    <property name="vexpand">True</property>
+                                    <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="expand">False</property>
+                                        <property name="fill">True</property>
+                                        <property name="pack_type">end</property>
+                                        <property name="position">1</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="expand">False</property>
+                                        <property name="fill">True</property>
+                                        <property name="pack_type">end</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="top_attach">100</property>
+                                    <property name="left_attach">0</property>
+                                    <property name="width">4</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="numeric">True</property>
+                                        <property name="input_hints">GTK_INPUT_HINT_NO_EMOJI</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="numeric">True</property>
+                                        <property name="input_hints">GTK_INPUT_HINT_NO_EMOJI</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="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">7</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">7</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">8</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>
+                                        <property name="numeric">True</property>
+                                        <property name="input_hints">GTK_INPUT_HINT_NO_EMOJI</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="cell-width-scale-label">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</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">8</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>
+                                        <property name="numeric">True</property>
+                                        <property name="input_hints">GTK_INPUT_HINT_NO_EMOJI</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="cell-height-scale-label">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</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">8</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">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">8</property>
+                                    <property name="left_attach">3</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">9</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">9</property>
+                                    <property name="left_attach">1</property>
+                                    <property name="width">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>
-                      </object>
-                      <packing>
-                        <property name="expand">True</property>
-                        <property name="fill">True</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkVButtonBox" id="vbuttonbox1">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="spacing">6</property>
-                        <property name="layout_style">start</property>
-                        <child>
-                          <object class="GtkButton" id="new-profile-button">
-                            <property name="label">gtk-new</property>
+                        <child type="tab">
+                          <object class="GtkLabel" id="label32">
                             <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="can_default">True</property>
-                            <property name="receives_default">True</property>
-                            <property name="use_stock">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="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="position">0</property>
+                            <property name="tab_fill">False</property>
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkButton" id="clone-profile-button">
-                            <property name="label" translatable="yes">_Clone</property>
+                          <object class="GtkVBox" id="vbox90">
                             <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="can_default">True</property>
-                            <property name="receives_default">True</property>
-                            <property name="use_stock">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="expand">False</property>
-                            <property name="fill">True</property>
                             <property name="position">1</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">1</property>
+                            <property name="tab_fill">False</property>
+                          </packing>
+                        </child>
                         <child>
-                          <object class="GtkButton" id="edit-profile-button">
-                            <property name="label">gtk-edit</property>
+                          <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="numeric">True</property>
+                                    <property name="input_hints">GTK_INPUT_HINT_NO_EMOJI</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">2</property>
+                          </packing>
+                        </child>
+                        <child type="tab">
+                          <object class="GtkLabel" id="label60">
                             <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="can_default">True</property>
-                            <property name="receives_default">True</property>
-                            <property name="use_stock">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="expand">False</property>
-                            <property name="fill">True</property>
                             <property name="position">2</property>
+                            <property name="tab_fill">False</property>
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkButton" id="delete-profile-button">
-                            <property name="label">gtk-delete</property>
+                          <object class="GtkGrid">
                             <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="can_default">True</property>
-                            <property name="receives_default">True</property>
-                            <property name="use_stock">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="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="draw_indicator">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="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="draw_indicator">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="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="mnemonic_widget">custom-command-entry</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="GtkEntry" id="custom-command-entry">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="hexpand">True</property>
+                                <property name="input_hints">GTK_INPUT_HINT_NO_EMOJI</property>
+                              </object>
+                              <packing>
+                                <property name="top_attach">2</property>
+                                <property name="left_attach">1</property>
+                              </packing>
+                            </child>
+                            <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="mnemonic_widget">exit-action-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="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>
+                                <property name="halign">start</property>
+                                <child>
+                                  <object class="GtkCellRendererText" id="renderer3"/>
+                                  <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">3</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">3</property>
+                            <property name="tab_fill">False</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkGrid" id="table30">
+                            <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="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="mnemonic_widget">encoding-combobox</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>
+                            <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>
+                                <property name="halign">start</property>
+                              </object>
+                              <packing>
+                                <property name="top_attach">4</property>
+                                <property name="left_attach">0</property>
+                                <property name="width">2</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="position">4</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="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkHBox" id="default-profile-hbox">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="spacing">12</property>
-                    <child>
-                      <object class="GtkLabel" id="default-profile-label">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="label" translatable="yes">_Profile used when launching a new 
terminal:</property>
-                        <property name="use_underline">True</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>
-                      <placeholder/>
                     </child>
                   </object>
                   <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">1</property>
+                    <property name="name">profile-prefs</property>
                   </packing>
                 </child>
               </object>
-              <packing>
-                <property name="position">2</property>
-              </packing>
-            </child>
-            <child type="tab">
-              <object class="GtkLabel" id="label3">
-                <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>
         </child>
         <child>
           <object class="GtkButtonBox" id="dialogue-buttonbox">
@@ -480,4 +2128,146 @@
       </object>
     </child>
   </object>
+  <object class="GtkPopoverMenu" id="popover-menu">
+    <child>
+      <object class="GtkBox">
+        <property name="visible">True</property>
+        <property name="margin">6</property>
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkModelButton">
+            <property name="visible">True</property>
+            <property name="action-name">win.clone</property>
+            <property name="text" translatable="yes">Clone…</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkModelButton">
+            <property name="visible">True</property>
+            <property name="action-name">win.rename</property>
+            <property name="text" translatable="yes">Rename…</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkModelButton">
+            <property name="visible">True</property>
+            <property name="action-name">win.delete</property>
+            <property name="text" translatable="yes">Delete…</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkSeparator">
+            <property name="visible">True</property>
+            <property name="orientation">horizontal</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkModelButton">
+            <property name="visible">True</property>
+            <property name="action-name">win.set-as-default</property>
+            <property name="text" translatable="yes">Set as default</property>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
+  <object class="GtkPopover" id="popover-dialog">
+    <property name="can_focus">False</property>
+    <child>
+      <object class="GtkBox">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="border_width">12</property>
+        <property name="spacing">6</property>
+        <child>
+          <object class="GtkLabel" id="popover-dialog-label1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">label</property>
+            <property name="xalign">0</property>
+            <property name="margin_bottom">6</property>
+            <attributes>
+              <attribute name="weight" value="bold"/>
+            </attributes>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="popover-dialog-label2">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label" translatable="yes">label</property>
+            <property name="xalign">0</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkEntry" id="popover-dialog-entry">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="activates_default">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkButtonBox">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="layout_style">start</property>
+            <property name="margin_top">6</property>
+            <property name="spacing">6</property>
+            <child>
+              <object class="GtkButton" id="popover-dialog-cancel">
+                <property name="label" translatable="yes">Cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="pack_type">end</property>
+                <property name="position">0</property>
+                <property name="secondary">True</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="popover-dialog-ok">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="receives_default">True</property>
+                <property name="sensitive">False</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="pack_type">end</property>
+                <property name="position">1</property>
+                <property name="secondary">True</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">3</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
 </interface>
diff --git a/src/profile-editor.c b/src/profile-editor.c
index 7cc6462..de128e1 100644
--- a/src/profile-editor.c
+++ b/src/profile-editor.c
@@ -30,12 +30,119 @@
 #include "terminal-encoding.h"
 #include "terminal-enums.h"
 #include "profile-editor.h"
+#include "terminal-prefs.h"
 #include "terminal-schemas.h"
 #include "terminal-type-builtins.h"
 #include "terminal-util.h"
 #include "terminal-profiles-list.h"
 #include "terminal-libgsystem.h"
 
+
+/* Wrapper around g_signal_connect that maintains a list of the
+ * handlers installed, and can disconnect them all. */
+typedef struct {
+  gpointer instance;
+  gulong handler_id;
+} ProfilePrefsSignal;
+
+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_pref_data->profile_signals, sig);
+}
+
+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_signal_handlers_disconnect_all (void)
+{
+  for (guint i = 0; i < the_pref_data->profile_signals->len; i++) {
+    ProfilePrefsSignal *sig = &g_array_index (the_pref_data->profile_signals, ProfilePrefsSignal, i);
+    g_signal_handler_disconnect (sig->instance, sig->handler_id);
+  }
+  g_array_set_size (the_pref_data->profile_signals, 0);
+}
+
+
+/* Wrappers around g_settings_bind and friends that maintain a list of the
+ * bindings installed, and can unbind them all. */
+typedef struct {
+  gpointer object;
+  char *property;
+} ProfilePrefsBinding;
+
+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_pref_data->profile_bindings, bind);
+}
+
+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);
+}
+
+static void
+profile_prefs_settings_unbind_all (void)
+{
+  for (guint i = 0; i < the_pref_data->profile_bindings->len; i++) {
+    ProfilePrefsBinding *bind = &g_array_index (the_pref_data->profile_bindings, ProfilePrefsBinding, i);
+    g_settings_unbind (bind->object, bind->property);
+    g_free (bind->property);
+  }
+  g_array_set_size (the_pref_data->profile_bindings, 0);
+}
+
+
 typedef struct _TerminalColorScheme TerminalColorScheme;
 
 struct _TerminalColorScheme
@@ -217,7 +324,7 @@ static void profile_palette_notify_scheme_combo_cb (GSettings *profile,
 
 static void profile_palette_notify_colorpickers_cb (GSettings *profile,
                                                     const char *key,
-                                                    GtkWidget *editor);
+                                                    gpointer user_data);
 
 
 /* gdk_rgba_equal is too strict! */
@@ -381,34 +488,29 @@ palette_color_notify_cb (GtkColorButton *button,
                          GParamSpec *pspec,
                          GSettings *profile)
 {
-  GtkWidget *editor;
   GdkRGBA color;
   guint i;
 
   gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (button), &color);
   i = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (button), "palette-entry-index"));
 
-  editor = gtk_widget_get_toplevel (GTK_WIDGET (button));
-  g_signal_handlers_block_by_func (profile, G_CALLBACK (profile_palette_notify_colorpickers_cb), editor);
+  g_signal_handlers_block_by_func (profile, G_CALLBACK (profile_palette_notify_colorpickers_cb), NULL);
   modify_palette_entry (profile, i, &color);
-  g_signal_handlers_unblock_by_func (profile, G_CALLBACK (profile_palette_notify_colorpickers_cb), editor);
+  g_signal_handlers_unblock_by_func (profile, G_CALLBACK (profile_palette_notify_colorpickers_cb), NULL);
 }
 
 static void
 profile_palette_notify_colorpickers_cb (GSettings *profile,
                                         const char *key,
-                                        GtkWidget *editor)
+                                        gpointer user_data)
 {
   GtkWidget *w;
-  GtkBuilder *builder;
+  GtkBuilder *builder = the_pref_data->builder;
   gs_free GdkRGBA *colors;
   gsize n_colors, i;
 
   g_assert (strcmp (key, TERMINAL_PROFILE_PALETTE_KEY) == 0);
 
-  builder = g_object_get_data (G_OBJECT (editor), "builder");
-  g_assert (builder != NULL);
-
   colors = terminal_g_settings_get_rgba_palette (profile, TERMINAL_PROFILE_PALETTE_KEY, &n_colors);
 
   n_colors = MIN (n_colors, TERMINAL_PALETTE_SIZE);
@@ -417,7 +519,7 @@ profile_palette_notify_colorpickers_cb (GSettings *profile,
       char name[32];
 
       g_snprintf (name, sizeof (name), "palette-colorpicker-%" G_GSIZE_FORMAT, i);
-      w = (GtkWidget *) gtk_builder_get_object  (builder, name);
+      w = (GtkWidget *) gtk_builder_get_object (builder, name);
 
       g_signal_handlers_block_by_func (w, G_CALLBACK (palette_color_notify_cb), profile);
       gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (w), &colors[i]);
@@ -529,36 +631,6 @@ init_encodings_combo (GtkWidget *widget)
                                   "text", ENCODINGS_COLUMN_TEXT, NULL);
 }
 
-static void
-editor_help_button_clicked_cb (GtkWidget *button,
-                               GtkWidget *editor)
-{
-  terminal_util_show_help ("profile");
-}
-
-static void
-editor_close_button_clicked_cb (GtkWidget *button,
-                                GtkWidget *editor)
-{
-  gtk_widget_destroy (editor);
-}
-
-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 (editor), "builder", NULL);
-}
-
-
 /* Tab scrolling was removed from GtkNotebook in gtk 3, so reimplement it here */
 static gboolean
 scroll_event_cb (GtkWidget      *widget,
@@ -625,19 +697,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,83 +862,30 @@ 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.
- */
+/* Called once per Preferences window, to initialize stuff that doesn't depend on the profile being edited */
 void
-terminal_profile_edit (GSettings  *profile,
-                       const char *widget_name)
+profile_prefs_init (void)
 {
-  TerminalSettingsList *profiles_list;
-  GtkBuilder *builder;
-  GError *error = NULL;
-  GtkWidget *editor, *w;
-  gs_free char *uuid = NULL;
+  GtkWidget *w;
+  GtkBuilder *builder = the_pref_data->builder;
   char *text;
-  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_pref_data->profile_signals = g_array_new (FALSE, FALSE, sizeof (ProfilePrefsSignal));
+  the_pref_data->profile_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);
-
-  editor = (GtkWidget *) gtk_builder_get_object  (builder, "profile-editor-dialog");
-  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 ()));
-
-  /* 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_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);
-
-  w = (GtkWidget *) gtk_builder_get_object  (builder, "profile-editor-notebook");
+  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);
-  gtk_label_set_text (GTK_LABEL (gtk_builder_get_object (builder, "profile-uuid")),
-                      uuid);
+  w = (GtkWidget *) gtk_builder_get_object (builder, "color-scheme-combobox");
+  init_color_scheme_menu (w);
 
-  g_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"),
-                    "clicked",
-                    G_CALLBACK (cell_scale_reset_cb),
-                    profile);
+  w = (GtkWidget *) gtk_builder_get_object (builder, "encoding-combobox");
+  init_encodings_combo (w);
 
   /* Translators: Appears as: [numeric entry] × width */
   text = g_strdup_printf ("× %s", _("width"));
@@ -891,18 +897,47 @@ terminal_profile_edit (GSettings  *profile,
   gtk_label_set_text ((GtkLabel *) gtk_builder_get_object (builder, "cell-height-scale-label"),
                       text);
   g_free (text);
+}
 
-  w = (GtkWidget *) gtk_builder_get_object  (builder, "color-scheme-combobox");
-  init_color_scheme_menu (w);
+/* Called each time the user switches away from a profile, so it's no longer being edited */
+void
+profile_prefs_unload (void)
+{
+  profile_prefs_signal_handlers_disconnect_all ();
+  profile_prefs_settings_unbind_all ();
+}
+
+/* Called each time the user selects a new profile to edit */
+void
+profile_prefs_load (const char *uuid, GSettings *profile)
+{
+  GtkWidget *w;
+  GtkBuilder *builder = the_pref_data->builder;
+  guint i;
+
+  profile_prefs_unload ();
+
+  gtk_label_set_text (GTK_LABEL (gtk_builder_get_object (builder, "profile-uuid")),
+                      uuid);
+
+  profile_prefs_signal_connect (gtk_builder_get_object (builder, "default-size-reset-button"),
+                                "clicked",
+                                G_CALLBACK (default_size_reset_cb),
+                                profile);
+  profile_prefs_signal_connect (gtk_builder_get_object (builder, "cell-scale-reset-button"),
+                                "clicked",
+                                G_CALLBACK (cell_scale_reset_cb),
+                                profile);
 
   /* Hook up the palette colorpickers and combo box */
 
   for (i = 0; i < TERMINAL_PALETTE_SIZE; ++i)
     {
       char name[32];
+      char *text;
 
       g_snprintf (name, sizeof (name), "palette-colorpicker-%u", i);
-      w = (GtkWidget *) gtk_builder_get_object  (builder, name);
+      w = (GtkWidget *) gtk_builder_get_object (builder, name);
 
 #if GTK_CHECK_VERSION (3, 19, 8)
       g_object_set (w, "show-editor", TRUE, NULL);
@@ -918,383 +953,373 @@ terminal_profile_edit (GSettings  *profile,
       gtk_widget_set_tooltip_text (w, text);
       g_free (text);
 
-      g_signal_connect (w, "notify::rgba",
-                        G_CALLBACK (palette_color_notify_cb),
-                        profile);
+      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,
-                    G_CALLBACK (profile_palette_notify_colorpickers_cb),
-                    editor);
+  profile_palette_notify_colorpickers_cb (profile, TERMINAL_PROFILE_PALETTE_KEY, NULL);
+  profile_prefs_signal_connect (profile, "changed::" TERMINAL_PROFILE_PALETTE_KEY,
+                                G_CALLBACK (profile_palette_notify_colorpickers_cb),
+                                NULL);
 
-  w = (GtkWidget *) gtk_builder_get_object  (builder, "palette-combobox");
-  g_signal_connect (w, "notify::active",
-                    G_CALLBACK (palette_scheme_combo_changed_cb),
-                    profile);
+  w = (GtkWidget *) gtk_builder_get_object (builder, "palette-combobox");
+  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,
-                    G_CALLBACK (profile_palette_notify_scheme_combo_cb),
-                    w);
+  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",
-                    G_CALLBACK (color_scheme_combo_changed_cb),
-                    profile);
+  w = (GtkWidget *) gtk_builder_get_object (builder, "color-scheme-combobox");
+  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,
-                    G_CALLBACK (profile_colors_notify_scheme_combo_cb),
-                    w);
-  g_signal_connect (profile, "changed::" TERMINAL_PROFILE_BACKGROUND_COLOR_KEY,
-                    G_CALLBACK (profile_colors_notify_scheme_combo_cb),
-                    w);
+  profile_prefs_signal_connect (profile, "changed::" TERMINAL_PROFILE_FOREGROUND_COLOR_KEY,
+                                G_CALLBACK (profile_colors_notify_scheme_combo_cb),
+                                w);
+  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",
-                    G_CALLBACK (custom_command_entry_changed_cb), NULL);
-
-  g_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);
+  profile_prefs_signal_connect (w, "changed",
+                                G_CALLBACK (custom_command_entry_changed_cb), NULL);
+
+  profile_prefs_signal_connect (gtk_builder_get_object (builder, "reset-compat-defaults-button"),
+                                "clicked",
+                                G_CALLBACK (reset_compat_defaults_cb),
+                                profile);
 
   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,
-                                TERMINAL_PROFILE_BACKGROUND_COLOR_KEY,
-                                w,
-                                "rgba",
-                                G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
-                                (GSettingsBindGetMapping) s_to_rgba,
-                                (GSettingsBindSetMapping) rgba_to_s,
-                                NULL, NULL);
-
-  g_settings_bind_with_mapping (profile,
-                                TERMINAL_PROFILE_BACKSPACE_BINDING_KEY,
-                                gtk_builder_get_object (builder,
-                                                        "backspace-binding-combobox"),
-                                "active",
-                                G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
-                                (GSettingsBindGetMapping) string_to_enum,
-                                (GSettingsBindSetMapping) enum_to_string,
-                                vte_erase_binding_get_type, NULL);
-  g_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,
-                   gtk_builder_get_object (builder,
-                                           "bold-color-checkbutton"),
-                   "active",
-                   G_SETTINGS_BIND_GET |
-                   G_SETTINGS_BIND_INVERT_BOOLEAN |
-                   G_SETTINGS_BIND_SET);
+  profile_prefs_settings_bind_with_mapping (profile,
+                                            TERMINAL_PROFILE_BACKGROUND_COLOR_KEY,
+                                            w,
+                                            "rgba",
+                                            G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
+                                            (GSettingsBindGetMapping) s_to_rgba,
+                                            (GSettingsBindSetMapping) rgba_to_s,
+                                            NULL, NULL);
+
+  profile_prefs_settings_bind_with_mapping (profile,
+                                            TERMINAL_PROFILE_BACKSPACE_BINDING_KEY,
+                                            gtk_builder_get_object (builder,
+                                                                    "backspace-binding-combobox"),
+                                            "active",
+                                            G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
+                                            (GSettingsBindGetMapping) string_to_enum,
+                                            (GSettingsBindSetMapping) enum_to_string,
+                                            vte_erase_binding_get_type, NULL);
+  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);
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_BOLD_COLOR_SAME_AS_FG_KEY,
+                               gtk_builder_get_object (builder,
+                                                       "bold-color-checkbutton"),
+                               "active",
+                               G_SETTINGS_BIND_GET |
+                               G_SETTINGS_BIND_INVERT_BOOLEAN |
+                               G_SETTINGS_BIND_SET);
 
   w = GTK_WIDGET (gtk_builder_get_object (builder, "bold-colorpicker"));
 #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,
-                   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,
-                                w,
-                                "rgba",
-                                G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET | G_SETTINGS_BIND_NO_SENSITIVITY,
-                                (GSettingsBindGetMapping) s_to_rgba,
-                                (GSettingsBindSetMapping) rgba_to_s,
-                                NULL, NULL);
-
-  g_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,
-                   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,
-                   gtk_builder_get_object (builder,
-                                           "cursor-colors-checkbutton"),
-                   "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+  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);
+  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,
+                                            (GSettingsBindGetMapping) s_to_rgba,
+                                            (GSettingsBindSetMapping) rgba_to_s,
+                                            NULL, NULL);
+
+  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);
+  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);
+  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);
 
   w = GTK_WIDGET (gtk_builder_get_object (builder, "cursor-foreground-colorpicker"));
 #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,
-                   w,
-                   "sensitive",
-                   G_SETTINGS_BIND_GET |
-                   G_SETTINGS_BIND_NO_SENSITIVITY);
-  g_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,
-                                (GSettingsBindGetMapping) s_to_rgba,
-                                (GSettingsBindSetMapping) rgba_to_s,
-                                NULL, NULL);
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_CURSOR_COLORS_SET_KEY,
+                               w,
+                               "sensitive",
+                               G_SETTINGS_BIND_GET |
+                               G_SETTINGS_BIND_NO_SENSITIVITY);
+  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,
+                                            (GSettingsBindGetMapping) s_to_rgba,
+                                            (GSettingsBindSetMapping) rgba_to_s,
+                                            NULL, NULL);
 
   w = GTK_WIDGET (gtk_builder_get_object (builder, "cursor-background-colorpicker"));
 #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,
-                   w,
-                   "sensitive",
-                   G_SETTINGS_BIND_GET |
-                   G_SETTINGS_BIND_NO_SENSITIVITY);
-  g_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,
-                                (GSettingsBindGetMapping) s_to_rgba,
-                                (GSettingsBindSetMapping) rgba_to_s,
-                                NULL, NULL);
-
-  g_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);
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_CURSOR_COLORS_SET_KEY,
+                               w,
+                               "sensitive",
+                               G_SETTINGS_BIND_GET |
+                               G_SETTINGS_BIND_NO_SENSITIVITY);
+  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,
+                                            (GSettingsBindGetMapping) s_to_rgba,
+                                            (GSettingsBindSetMapping) rgba_to_s,
+                                            NULL, NULL);
+
+  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);
 
   w = GTK_WIDGET (gtk_builder_get_object (builder, "highlight-foreground-colorpicker"));
 #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,
-                   w,
-                   "sensitive",
-                   G_SETTINGS_BIND_GET |
-                   G_SETTINGS_BIND_NO_SENSITIVITY);
-  g_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,
-                                (GSettingsBindGetMapping) s_to_rgba,
-                                (GSettingsBindSetMapping) rgba_to_s,
-                                NULL, NULL);
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_HIGHLIGHT_COLORS_SET_KEY,
+                               w,
+                               "sensitive",
+                               G_SETTINGS_BIND_GET |
+                               G_SETTINGS_BIND_NO_SENSITIVITY);
+  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,
+                                            (GSettingsBindGetMapping) s_to_rgba,
+                                            (GSettingsBindSetMapping) rgba_to_s,
+                                            NULL, NULL);
 
   w = GTK_WIDGET (gtk_builder_get_object (builder, "highlight-background-colorpicker"));
 #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,
-                   w,
-                   "sensitive",
-                   G_SETTINGS_BIND_GET |
-                   G_SETTINGS_BIND_NO_SENSITIVITY);
-  g_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,
-                                (GSettingsBindGetMapping) s_to_rgba,
-                                (GSettingsBindSetMapping) rgba_to_s,
-                                NULL, NULL);
-
-  g_settings_bind_with_mapping (profile, TERMINAL_PROFILE_CURSOR_SHAPE_KEY,
-                                gtk_builder_get_object (builder,
-                                                        "cursor-shape-combobox"),
-                                "active",
-                                G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
-                                (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,
-                                gtk_builder_get_object (builder,
-                                                        "cursor-blink-mode-combobox"),
-                                "active",
-                                G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
-                                (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,
-                                gtk_builder_get_object (builder,
-                                                        "text-blink-mode-combobox"),
-                                "active",
-                                G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
-                                (GSettingsBindGetMapping) string_to_enum,
-                                (GSettingsBindSetMapping) enum_to_string,
-                                vte_text_blink_mode_get_type, NULL);
-  g_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,
-                   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,
-                   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,
-                                gtk_builder_get_object (builder,
-                                                        "delete-binding-combobox"),
-                                "active",
-                                G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
-                                (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,
-                                gtk_builder_get_object (builder,
-                                                        "exit-action-combobox"),
-                                "active",
-                                G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
-                                (GSettingsBindGetMapping) string_to_enum,
-                                (GSettingsBindSetMapping) enum_to_string,
-                                terminal_exit_action_get_type, NULL);
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_HIGHLIGHT_COLORS_SET_KEY,
+                               w,
+                               "sensitive",
+                               G_SETTINGS_BIND_GET |
+                               G_SETTINGS_BIND_NO_SENSITIVITY);
+  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,
+                                            (GSettingsBindGetMapping) s_to_rgba,
+                                            (GSettingsBindSetMapping) rgba_to_s,
+                                            NULL, NULL);
+
+  profile_prefs_settings_bind_with_mapping (profile, TERMINAL_PROFILE_CURSOR_SHAPE_KEY,
+                                            gtk_builder_get_object (builder,
+                                                                    "cursor-shape-combobox"),
+                                            "active",
+                                            G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
+                                            (GSettingsBindGetMapping) string_to_enum,
+                                            (GSettingsBindSetMapping) enum_to_string,
+                                            vte_cursor_shape_get_type, NULL);
+  profile_prefs_settings_bind_with_mapping (profile, TERMINAL_PROFILE_CURSOR_BLINK_MODE_KEY,
+                                            gtk_builder_get_object (builder,
+                                                                    "cursor-blink-mode-combobox"),
+                                            "active",
+                                            G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
+                                            (GSettingsBindGetMapping) string_to_enum,
+                                            (GSettingsBindSetMapping) enum_to_string,
+                                            vte_cursor_blink_mode_get_type, NULL);
+  profile_prefs_settings_bind_with_mapping (profile, TERMINAL_PROFILE_TEXT_BLINK_MODE_KEY,
+                                            gtk_builder_get_object (builder,
+                                                                    "text-blink-mode-combobox"),
+                                            "active",
+                                            G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
+                                            (GSettingsBindGetMapping) string_to_enum,
+                                            (GSettingsBindSetMapping) enum_to_string,
+                                            vte_text_blink_mode_get_type, NULL);
+  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);
+  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);
+  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);
+  profile_prefs_settings_bind_with_mapping (profile, TERMINAL_PROFILE_DELETE_BINDING_KEY,
+                                            gtk_builder_get_object (builder,
+                                                                    "delete-binding-combobox"),
+                                            "active",
+                                            G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
+                                            (GSettingsBindGetMapping) string_to_enum,
+                                            (GSettingsBindSetMapping) enum_to_string,
+                                            vte_erase_binding_get_type, NULL);
+  profile_prefs_settings_bind_with_mapping (profile, TERMINAL_PROFILE_EXIT_ACTION_KEY,
+                                            gtk_builder_get_object (builder,
+                                                                    "exit-action-combobox"),
+                                            "active",
+                                            G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
+                                            (GSettingsBindGetMapping) string_to_enum,
+                                            (GSettingsBindSetMapping) enum_to_string,
+                                            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,
-                   w,
-                   "font-name", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_FONT_KEY,
+                               w,
+                               "font-name", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
 
   w = GTK_WIDGET (gtk_builder_get_object (builder, "foreground-colorpicker"));
 #if GTK_CHECK_VERSION (3, 19, 8)
       g_object_set (w, "show-editor", TRUE, NULL);
 #endif
-  g_settings_bind_with_mapping (profile,
-                                TERMINAL_PROFILE_FOREGROUND_COLOR_KEY,
-                                w,
-                                "rgba",
-                                G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
-                                (GSettingsBindGetMapping) s_to_rgba,
-                                (GSettingsBindSetMapping) rgba_to_s,
-                                NULL, NULL);
-
-  g_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,
-                   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,
-                   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,
-                   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,
-                   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,
-                                TERMINAL_PROFILE_SCROLLBAR_POLICY_KEY,
-                                gtk_builder_get_object (builder,
-                                                        "scrollbar-checkbutton"),
-                                "active",
-                                G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
-                                (GSettingsBindGetMapping) scrollbar_policy_to_bool,
-                                (GSettingsBindSetMapping) bool_to_scrollbar_policy,
-                                NULL, NULL);
-  g_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,
-                   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,
-                   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,
-                   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,
-                   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,
-                   gtk_builder_get_object (builder, "bell-checkbutton"),
-                   "active",
-                   G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
-
-  g_settings_bind (profile,
-                   TERMINAL_PROFILE_USE_CUSTOM_COMMAND_KEY,
-                   gtk_builder_get_object (builder, "custom-command-entry-label"),
-                   "sensitive",
-                   G_SETTINGS_BIND_GET | G_SETTINGS_BIND_NO_SENSITIVITY);
-  g_settings_bind (profile,
-                   TERMINAL_PROFILE_USE_CUSTOM_COMMAND_KEY,
-                   gtk_builder_get_object (builder, "custom-command-entry"),
-                   "sensitive",
-                   G_SETTINGS_BIND_GET | G_SETTINGS_BIND_NO_SENSITIVITY);
-  g_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,
-                   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,
-                            TERMINAL_PROFILE_PALETTE_KEY,
-                            gtk_builder_get_object (builder, "palette-box"),
-                            "sensitive",
-                            FALSE);
+  profile_prefs_settings_bind_with_mapping (profile,
+                                            TERMINAL_PROFILE_FOREGROUND_COLOR_KEY,
+                                            w,
+                                            "rgba",
+                                            G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
+                                            (GSettingsBindGetMapping) s_to_rgba,
+                                            (GSettingsBindSetMapping) rgba_to_s,
+                                            NULL, NULL);
+
+  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);
+  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);
+  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);
+  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);
+  profile_prefs_settings_bind_with_mapping (profile,
+                                            TERMINAL_PROFILE_SCROLLBAR_POLICY_KEY,
+                                            gtk_builder_get_object (builder,
+                                                                    "scrollbar-checkbutton"),
+                                            "active",
+                                            G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
+                                            (GSettingsBindGetMapping) scrollbar_policy_to_bool,
+                                            (GSettingsBindSetMapping) bool_to_scrollbar_policy,
+                                            NULL, NULL);
+  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);
+  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);
+  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);
+  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);
+  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);
+  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);
+
+  profile_prefs_settings_bind (profile,
+                               TERMINAL_PROFILE_USE_CUSTOM_COMMAND_KEY,
+                               gtk_builder_get_object (builder, "custom-command-entry-label"),
+                               "sensitive",
+                               G_SETTINGS_BIND_GET | G_SETTINGS_BIND_NO_SENSITIVITY);
+  profile_prefs_settings_bind (profile,
+                               TERMINAL_PROFILE_USE_CUSTOM_COMMAND_KEY,
+                               gtk_builder_get_object (builder, "custom-command-entry"),
+                               "sensitive",
+                               G_SETTINGS_BIND_GET | G_SETTINGS_BIND_NO_SENSITIVITY);
+  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);
+  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);
+  profile_prefs_settings_bind_writable (profile,
+                                        TERMINAL_PROFILE_PALETTE_KEY,
+                                        gtk_builder_get_object (builder, "palette-box"),
+                                        "sensitive",
+                                        FALSE);
 
   /* Compatibility options */
-  w = (GtkWidget *) gtk_builder_get_object  (builder, "encoding-combobox");
-  init_encodings_combo (w);
-  g_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,
-                   w,
-                   "active-id",
-                   G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
-
-  /* Finished! */
-  terminal_util_bind_mnemonic_label_sensitivity (editor);
+  w = (GtkWidget *) gtk_builder_get_object (builder, "encoding-combobox");
+  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");
+  profile_prefs_settings_bind (profile, TERMINAL_PROFILE_CJK_UTF8_AMBIGUOUS_WIDTH_KEY,
+                               w,
+                               "active-id",
+                               G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+}
 
-  terminal_util_dialog_focus_widget (editor, widget_name);
+/* Called once per Preferences window, to destroy stuff that doesn't depend on the profile being edited */
+void
+profile_prefs_destroy (void)
+{
+  profile_prefs_unload ();
 
-  gtk_window_present (GTK_WINDOW (editor));
+  g_array_free (the_pref_data->profile_signals, TRUE);
+  g_array_free (the_pref_data->profile_bindings, TRUE);
 }
diff --git a/src/profile-editor.h b/src/profile-editor.h
index bddb95c..e83d393 100644
--- a/src/profile-editor.h
+++ b/src/profile-editor.h
@@ -23,8 +23,14 @@
 
 G_BEGIN_DECLS
 
-void terminal_profile_edit (GSettings  *profile,
-                            const char *widget_name);
+void profile_prefs_init (void);
+
+void profile_prefs_destroy (void);
+
+void profile_prefs_unload (void);
+
+void profile_prefs_load (const char *uuid,
+                         GSettings *profile);
 
 G_END_DECLS
 
diff --git a/src/terminal-accels.c b/src/terminal-accels.c
index 23db404..bbe3268 100644
--- a/src/terminal-accels.c
+++ b/src/terminal-accels.c
@@ -63,7 +63,6 @@
 #define KEY_HELP                "help"
 #define KEY_MOVE_TAB_LEFT       "move-tab-left"
 #define KEY_MOVE_TAB_RIGHT      "move-tab-right"
-#define KEY_NEW_PROFILE         "new-profile"
 #define KEY_NEW_TAB             "new-tab"
 #define KEY_NEW_WINDOW          "new-window"
 #define KEY_NEXT_TAB            "next-tab"
@@ -71,7 +70,6 @@
 #define KEY_PREFERENCES         "preferences"
 #define KEY_PREV_TAB            "prev-tab"
 #define KEY_PRINT               "print"
-#define KEY_PROFILE_PREFERENCES "profile-preferences"
 #define KEY_READ_ONLY           "read-only"
 #define KEY_RESET_AND_CLEAR     "reset-and-clear"
 #define KEY_RESET               "reset"
@@ -125,7 +123,6 @@ typedef struct
 static KeyEntry file_entries[] = {
   ENTRY (N_("New Tab"),       KEY_NEW_TAB,       "new-terminal",  "(ss)",  "('tab','current')"   ),
   ENTRY (N_("New Window"),    KEY_NEW_WINDOW,    "new-terminal",  "(ss)",  "('window','current')"),
-  ENTRY (N_("New Profile"),   KEY_NEW_PROFILE,   "new-profile",   NULL,    NULL                  ),
 #ifdef ENABLE_SAVE
   ENTRY (N_("Save Contents"), KEY_SAVE_CONTENTS, "save-contents", NULL,    NULL                  ),
 #endif
@@ -145,7 +142,6 @@ static KeyEntry edit_entries[] = {
   ENTRY (N_("Paste"),               KEY_PASTE,               "paste-text",   NULL, NULL      ),
   ENTRY (N_("Select All"),          KEY_SELECT_ALL,          "select-all",   NULL, NULL      ),
   ENTRY (N_("Preferences"),         KEY_PREFERENCES,         "edit-preferences",  NULL, NULL      ),
-  ENTRY (N_("Profile Preferences"), KEY_PROFILE_PREFERENCES, "edit-profile", NULL, NULL      ),
 };
 
 static KeyEntry search_entries[] = {
diff --git a/src/terminal-app.c b/src/terminal-app.c
index 5e782d9..8f44b6b 100644
--- a/src/terminal-app.c
+++ b/src/terminal-app.c
@@ -310,30 +310,23 @@ app_load_css (GApplication *application)
   add_css_provider (application, TRUE);
 }
 
-void
+char *
 terminal_app_new_profile (TerminalApp *app,
-                          GSettings   *base_profile)
+                          GSettings   *base_profile,
+                          const char  *name)
 {
-  gs_unref_object GSettings *profile = NULL;
-  gs_free char *uuid;
+  char *uuid;
 
   if (base_profile) {
     gs_free char *base_uuid;
 
     base_uuid = terminal_settings_list_dup_uuid_from_child (app->profiles_list, base_profile);
-    uuid = terminal_settings_list_clone_child (app->profiles_list, base_uuid);
+    uuid = terminal_settings_list_clone_child (app->profiles_list, base_uuid, name);
   } else {
-    uuid = terminal_settings_list_add_child (app->profiles_list);
+    uuid = terminal_settings_list_add_child (app->profiles_list, name);
   }
 
-  if (uuid == NULL)
-    return;
-
-  profile = terminal_settings_list_ref_child (app->profiles_list, uuid);
-  if (profile == NULL)
-    return;
-
-  terminal_profile_edit (profile, "profile-name-entry");
+  return uuid;
 }
 
 void
@@ -625,7 +618,7 @@ app_menu_preferences_cb (GSimpleAction *action,
 {
   TerminalApp *app = user_data;
 
-  terminal_app_edit_preferences (app);
+  terminal_app_edit_preferences (app, NULL, NULL);
 }
 
 static void
@@ -1093,17 +1086,11 @@ terminal_app_get_clipboard_targets (TerminalApp *app,
 }
 
 void
-terminal_app_edit_profile (TerminalApp     *app,
-                           GSettings       *profile,
-                           const char      *widget_name)
-{
-  terminal_profile_edit (profile, widget_name);
-}
-
-void
-terminal_app_edit_preferences (TerminalApp *app)
+terminal_app_edit_preferences (TerminalApp     *app,
+                               GSettings       *profile,
+                               const char      *widget_name)
 {
-  terminal_prefs_show_preferences ("general");
+  terminal_prefs_show_preferences (profile, widget_name);
 }
 
 /**
diff --git a/src/terminal-app.h b/src/terminal-app.h
index c88fe93..f29d766 100644
--- a/src/terminal-app.h
+++ b/src/terminal-app.h
@@ -56,12 +56,13 @@ GdkAtom *terminal_app_get_clipboard_targets (TerminalApp *app,
                                              GtkClipboard *clipboard,
                                              int *n_targets);
 
-void terminal_app_edit_profile (TerminalApp *app,
-                                GSettings   *profile,
-                                const char  *widget_name);
+void terminal_app_edit_preferences (TerminalApp *app,
+                                    GSettings   *profile,
+                                    const char  *widget_name);
 
-void terminal_app_new_profile (TerminalApp *app,
-                               GSettings   *default_base_profile);
+char *terminal_app_new_profile (TerminalApp *app,
+                                GSettings   *default_base_profile,
+                                const char  *name);
 
 void terminal_app_remove_profile (TerminalApp *app,
                                   GSettings *profile);
@@ -94,8 +95,6 @@ void terminal_app_register_screen (TerminalApp *app,
 void terminal_app_unregister_screen (TerminalApp *app,
                                      TerminalScreen *screen);
 
-void terminal_app_edit_preferences (TerminalApp *app);
-
 TerminalSettingsList *terminal_app_get_profiles_list (TerminalApp *app);
 
 /* Menus */
diff --git a/src/terminal-menubar.ui b/src/terminal-menubar.ui
index 57d1f3d..b374a94 100644
--- a/src/terminal-menubar.ui
+++ b/src/terminal-menubar.ui
@@ -22,10 +22,6 @@
       <section id="new-terminal-section" />
       <section>
         <item>
-          <attribute name="label" translatable="yes">New _Profile</attribute>
-          <attribute name="action">win.new-profile</attribute>
-        </item>
-        <item>
           <attribute name="label" translatable="yes">_Save Contents…</attribute>
           <attribute name="action">win.save-contents</attribute>
           <attribute name="hidden-when">action-missing</attribute>
@@ -88,10 +84,6 @@
           <attribute name="label" translatable="yes">P_references</attribute>
           <attribute name="action">win.edit-preferences</attribute>
         </item>
-        <item>
-          <attribute name="label" translatable="yes">Pr_ofile Preferences</attribute>
-          <attribute name="action">win.edit-profile</attribute>
-        </item>
       </section>
     </submenu>
     <submenu>
diff --git a/src/terminal-prefs.c b/src/terminal-prefs.c
index 8df280d..07d8b36 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,20 +37,9 @@
 #include "terminal-profiles-list.h"
 #include "terminal-libgsystem.h"
 
-typedef struct {
-  TerminalSettingsList *profiles_list;
-  GtkWidget *dialog;
-  GtkWindow *parent;
+PrefData *the_pref_data = NULL;  /* global */
 
-  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;
+/* Bottom */
 
 static void
 prefs_dialog_help_button_clicked_cb (GtkWidget *button,
@@ -65,373 +55,658 @@ prefs_dialog_close_button_clicked_cb (GtkWidget *button,
   gtk_widget_destroy (data->dialog);
 }
 
-/* Profiles tab */
+/* Sidebar */
 
-enum
+static inline GSimpleAction *
+lookup_action (GtkWindow *window,
+               const char *name)
 {
-  COL_PROFILE,
-  NUM_PROFILE_COLUMNS
-};
+  GAction *action;
+
+  action = g_action_map_lookup_action (G_ACTION_MAP (window), name);
+  g_return_val_if_fail (action != NULL, NULL);
 
+  return G_SIMPLE_ACTION (action);
+}
+
+/* Update the sidebar (visibility of icons, sensitivity of menu entries) to reflect the default and the 
selected profiles. */
 static void
-profile_cell_data_func (GtkTreeViewColumn *tree_column,
-                        GtkCellRenderer *cell,
-                        GtkTreeModel *tree_model,
-                        GtkTreeIter *iter,
-                        PrefData *data)
+listbox_update (GtkListBox *box)
 {
-  gs_unref_object GSettings *profile;
-  gs_free char *text;
-  GValue value = { 0, };
+  int i;
+  GtkListBoxRow *row;
+  GSettings *profile;
+  gs_unref_object GSettings *default_profile;
+  GtkStack *stack;
+  GtkMenuButton *button;
+
+  default_profile = terminal_settings_list_ref_default_child (the_pref_data->profiles_list);
+
+  /* GTK+ doesn't seem to like if a popover is assigned to multiple buttons at once
+   * (not even temporarily), so make sure to remove it from the previous button first. */
+  for (i = 0; (row = gtk_list_box_get_row_at_index (box, i)) != NULL; i++) {
+    button = g_object_get_data (G_OBJECT (row), "popover-button");
+    gtk_menu_button_set_popover (button, NULL);
+  }
+
+  for (i = 0; (row = gtk_list_box_get_row_at_index (box, i)) != NULL; i++) {
+    profile = g_object_get_data (G_OBJECT (row), "gsettings");
 
-  gtk_tree_model_get (tree_model, iter, (int) COL_PROFILE, &profile, (int) -1);
-  text = g_settings_get_string (profile, TERMINAL_PROFILE_VISIBLE_NAME_KEY);
+    gboolean is_selected_profile = (profile != NULL && profile == the_pref_data->selected_profile);
+    gboolean is_default_profile = (profile != NULL && profile == default_profile);
 
-  g_value_init (&value, G_TYPE_STRING);
-  if (text[0])
-    g_value_set_string (&value, text);
-  else
-    g_value_set_static_string (&value, _("Unnamed"));
+    stack = g_object_get_data (G_OBJECT (row), "home-stack");
+    gtk_stack_set_visible_child_name (stack, is_default_profile ? "home" : "placeholder");
 
-  g_object_set_property (G_OBJECT (cell), "text", &value);
-  g_value_unset (&value);
+    stack = g_object_get_data (G_OBJECT (row), "popover-stack");
+    gtk_stack_set_visible_child_name (stack, is_selected_profile ? "button" : "placeholder");
+    if (is_selected_profile) {
+      g_simple_action_set_enabled (lookup_action (GTK_WINDOW (the_pref_data->dialog), "delete"), 
!is_default_profile);
+      g_simple_action_set_enabled (lookup_action (GTK_WINDOW (the_pref_data->dialog), "set-as-default"), 
!is_default_profile);
+
+      GtkPopover *popover_menu = GTK_POPOVER (gtk_builder_get_object (the_pref_data->builder, 
"popover-menu"));
+      button = g_object_get_data (G_OBJECT (row), "popover-button");
+      gtk_menu_button_set_popover (button, GTK_WIDGET (popover_menu));
+      gtk_popover_set_relative_to (popover_menu, GTK_WIDGET (button));
+    }
+  }
 }
 
-static int
-profile_sort_func (GtkTreeModel *model,
-                   GtkTreeIter *a,
-                   GtkTreeIter *b,
-                   gpointer user_data)
+static void
+update_window_title (void)
 {
-  gs_unref_object GSettings *profile_a;
-  gs_unref_object GSettings *profile_b;
+  GtkListBoxRow *row = the_pref_data->selected_list_box_row;
+  if (row == NULL)
+    return;
 
-  gtk_tree_model_get (model, a, (int) COL_PROFILE, &profile_a, (int) -1);
-  gtk_tree_model_get (model, b, (int) COL_PROFILE, &profile_b, (int) -1);
+  GSettings *profile = g_object_get_data (G_OBJECT (row), "gsettings");
+  GtkLabel *label = g_object_get_data (G_OBJECT (row), "label");
+  const char *text = gtk_label_get_text (label);
+  gs_free char *subtitle;
+  gs_free char *title;
 
-  return terminal_profiles_compare (profile_a, profile_b);
+  if (profile == NULL) {
+    subtitle = g_strdup (text);
+  } else {
+    subtitle = g_strdup_printf (_("Profile “%s”"), text);
+  }
+
+  title = g_strdup_printf (_("Preferences – %s"), subtitle);
+  gtk_window_set_title (GTK_WINDOW (the_pref_data->dialog), title);
 }
 
-static /* ref */ GtkTreeModel *
-profile_liststore_new (PrefData *data,
-                       GSettings *selected_profile,
-                       GtkTreeIter *selected_profile_iter,
-                       gboolean *selected_profile_iter_set)
+/* A new entry is selected in the sidebar */
+static void
+listbox_row_selected_cb (GtkListBox *box,
+                         GtkListBoxRow *row,
+                         GtkStack *stack)
 {
-  GtkListStore *store;
-  GtkTreeIter iter;
-  GList *list, *l;
+  profile_prefs_unload ();
 
-  G_STATIC_ASSERT (NUM_PROFILE_COLUMNS == 1);
-  store = gtk_list_store_new (NUM_PROFILE_COLUMNS, G_TYPE_SETTINGS);
+  /* row can be NULL intermittently during a profile meta operations */
+  g_free (the_pref_data->selected_profile_uuid);
+  if (row != NULL) {
+    the_pref_data->selected_profile = g_object_get_data (G_OBJECT (row), "gsettings");
+    the_pref_data->selected_profile_uuid = g_strdup (g_object_get_data (G_OBJECT (row), "uuid"));
+  } else {
+    the_pref_data->selected_profile = NULL;
+    the_pref_data->selected_profile_uuid = NULL;
+  }
+  the_pref_data->selected_list_box_row = row;
 
-  if (selected_profile_iter)
-    *selected_profile_iter_set = FALSE;
+  listbox_update (box);
 
-  list = terminal_settings_list_ref_children (data->profiles_list);
-  for (l = list; l != NULL; l = l->next)
-    {
-      GSettings *profile = (GSettings *) l->data;
-
-      gtk_list_store_insert_with_values (store, &iter, 0,
-                                         (int) COL_PROFILE, profile,
-                                         (int) -1);
-
-      if (selected_profile_iter && profile == selected_profile)
-        {
-          *selected_profile_iter = iter;
-          *selected_profile_iter_set = TRUE;
-        }
+  if (row != NULL) {
+    if (the_pref_data->selected_profile != NULL) {
+      profile_prefs_load (the_pref_data->selected_profile_uuid, the_pref_data->selected_profile);
     }
 
-  g_list_free_full (list, (GDestroyNotify) g_object_unref);
-
-  /* Now turn on sorting */
-  gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (store),
-                                   COL_PROFILE,
-                                   profile_sort_func,
-                                   NULL, NULL);
-  gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store),
-                                        COL_PROFILE, GTK_SORT_ASCENDING);
+    char *stack_child_name = g_object_get_data (G_OBJECT (row), "stack_child_name");
+    gtk_stack_set_visible_child_name (stack, stack_child_name);
+  }
 
-  return GTK_TREE_MODEL (store);
+  update_window_title ();
 }
 
-static /* ref */ GSettings*
-profile_combo_box_ref_selected (GtkComboBox *combo)
+/* A profile's name changed, perhaps externally */
+static void
+profile_name_changed_cb (GtkLabel      *label,
+                         GParamSpec    *pspec,
+                         GtkListBoxRow *row)
 {
-  GSettings *profile;
-  GtkTreeIter iter;
+  gtk_list_box_row_changed (row);  /* trigger re-sorting */
 
-  if (gtk_combo_box_get_active_iter (combo, &iter))
-    gtk_tree_model_get (gtk_combo_box_get_model (combo), &iter,
-                        (int) COL_PROFILE, &profile, (int) -1);
-  else
-    profile = NULL;
+  if (row == the_pref_data->selected_list_box_row)
+    update_window_title ();
+}
 
-  return profile;
+/* Select a profile in the sidebar by UUID */
+static gboolean
+listbox_select_profile (const char *uuid)
+{
+  GtkListBoxRow *row;
+  for (int i = 0; (row = gtk_list_box_get_row_at_index (the_pref_data->listbox, i)) != NULL; i++) {
+    const char *rowuuid = g_object_get_data (G_OBJECT (row), "uuid");
+    if (g_strcmp0 (rowuuid, uuid) == 0) {
+      g_signal_emit_by_name (row, "activate");
+      return TRUE;
+    }
+  }
+  return FALSE;
 }
 
+/* Create a new profile now, select it, update the UI. */
 static void
-profile_combo_box_refill (PrefData *data)
+profile_new_now (const char *name)
 {
-  GtkComboBox *combo = GTK_COMBO_BOX (data->profiles_default_combo);
-  GtkTreeIter iter;
-  gboolean iter_set;
-  gs_unref_object GSettings *selected_profile;
-  gs_unref_object GtkTreeModel *model;
+  gs_free char *uuid = terminal_app_new_profile (terminal_app_get (), NULL, name);
 
-  selected_profile = profile_combo_box_ref_selected (combo);
+  listbox_select_profile (uuid);
+}
 
-  model = profile_liststore_new (data,
-                                 selected_profile,
-                                 &iter,
-                                 &iter_set);
-  gtk_combo_box_set_model (combo, model);
+/* Clone the selected profile now, select it, update the UI. */
+static void
+profile_clone_now (const char *name)
+{
+  if (the_pref_data->selected_profile == NULL)
+    return;
 
-  if (iter_set)
-    gtk_combo_box_set_active_iter (combo, &iter);
+  gs_free char *uuid = terminal_app_new_profile (terminal_app_get (), the_pref_data->selected_profile, name);
+
+  listbox_select_profile (uuid);
 }
 
-static GtkWidget*
-profile_combo_box_new (PrefData *data)
+/* Rename the selected profile now, update the UI. */
+static void
+profile_rename_now (const char *name)
 {
-  GtkWidget *combo_widget;
-  GtkComboBox *combo;
-  GtkCellRenderer *renderer;
-  GtkTreeIter iter;
-  gboolean iter_set;
-  gs_unref_object GSettings *default_profile;
-  gs_unref_object GtkTreeModel *model;
+  if (the_pref_data->selected_profile == NULL)
+    return;
 
-  combo_widget = gtk_combo_box_new ();
-  combo = GTK_COMBO_BOX (combo_widget);
-  terminal_util_set_atk_name_description (combo_widget, NULL, _("Click button to choose profile"));
+  /* This will automatically trigger a call to profile_name_changed_cb(). */
+  g_settings_set_string (the_pref_data->selected_profile, TERMINAL_PROFILE_VISIBLE_NAME_KEY, name);
+}
 
-  renderer = gtk_cell_renderer_text_new ();
-  gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), renderer, TRUE);
-  gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (combo), renderer,
-                                      (GtkCellLayoutDataFunc) profile_cell_data_func,
-                                      data, NULL);
+/* Delete the selected profile now, update the UI. */
+static void
+profile_delete_now (const char *dummy)
+{
+  if (the_pref_data->selected_profile == NULL)
+    return;
 
-  default_profile = terminal_settings_list_ref_default_child (data->profiles_list);
-  model = profile_liststore_new (data,
-                                 default_profile,
-                                 &iter,
-                                 &iter_set);
-  gtk_combo_box_set_model (combo, model);
+  /* Prepare to select the next one, or if there's no such then the previous one. */
+  int index = gtk_list_box_row_get_index (the_pref_data->selected_list_box_row);
+  GtkListBoxRow *new_selected_row = gtk_list_box_get_row_at_index (the_pref_data->listbox, index + 1);
+  if (new_selected_row == NULL)
+    new_selected_row = gtk_list_box_get_row_at_index (the_pref_data->listbox, index - 1);
+  GSettings *new_selected_profile = g_object_get_data (G_OBJECT (new_selected_row), "gsettings");
+  gs_free char *uuid = NULL;
+  if (new_selected_profile != NULL)
+    uuid = terminal_settings_list_dup_uuid_from_child (the_pref_data->profiles_list, new_selected_profile);
 
-  if (iter_set)
-    gtk_combo_box_set_active_iter (combo, &iter);
+  terminal_app_remove_profile (terminal_app_get (), the_pref_data->selected_profile);
 
-  gtk_widget_show (combo_widget);
-  return combo_widget;
+  listbox_select_profile (uuid);
 }
 
+/* "Set as default" selected. Do it now without asking for confirmation. */
 static void
-profile_combo_box_changed_cb (GtkWidget *widget,
-                              PrefData *data)
+profile_set_as_default_cb (GSimpleAction *simple,
+                           GVariant      *parameter,
+                           gpointer       user_data)
 {
-  gs_unref_object GSettings *profile;
-  gs_free char *uuid = NULL;
-
-  profile = profile_combo_box_ref_selected (GTK_COMBO_BOX (data->profiles_default_combo));
-  if (!profile)
+  if (the_pref_data->selected_profile_uuid == NULL)
     return;
 
-  uuid = terminal_settings_list_dup_uuid_from_child (data->profiles_list, profile);
-  terminal_settings_list_set_default_child (data->profiles_list, uuid);
+  /* This will automatically trigger a call to listbox_update() via "default-changed". */
+  terminal_settings_list_set_default_child (the_pref_data->profiles_list, 
the_pref_data->selected_profile_uuid);
 }
 
-static GSettings *
-profile_list_ref_selected (PrefData *data)
-{
-  GtkTreeSelection *selection;
-  GtkTreeIter iter;
-  GtkTreeModel *model;
-  GSettings *selected_profile;
 
-  selection = gtk_tree_view_get_selection (data->manage_profiles_list);
-  if (!gtk_tree_selection_get_selected (selection, NULL, &iter))
-    return NULL;
+static void
+popover_dialog_cancel_clicked_cb (GtkButton *button,
+                                  gpointer user_data)
+{
+  GtkPopover *popover_dialog = GTK_POPOVER (gtk_builder_get_object (the_pref_data->builder, 
"popover-dialog"));
 
-  model = gtk_tree_view_get_model (data->manage_profiles_list);
-  gtk_tree_model_get (model, &iter, (int) COL_PROFILE, &selected_profile, (int) -1);
-  return selected_profile;
+#if GTK_CHECK_VERSION (3, 22, 0)
+  gtk_popover_popdown (popover_dialog);
+#else
+  gtk_widget_hide (GTK_WIDGET (popover_dialog));
+#endif
 }
 
 static void
-profile_list_treeview_refill (PrefData *data)
+popover_dialog_ok_clicked_cb (GtkButton *button,
+                              void (*fn) (const char *))
 {
-  GtkTreeView *tree_view = data->manage_profiles_list;
-  GtkTreeIter iter;
-  gboolean iter_set;
-  gs_unref_object GSettings *selected_profile;
-  gs_unref_object GtkTreeModel *model;
-
-  selected_profile = profile_list_ref_selected (data);
-  model = profile_liststore_new (data,
-                                 selected_profile,
-                                 &iter,
-                                 &iter_set);
-  gtk_tree_view_set_model (tree_view, model);
+  GtkEntry *entry = GTK_ENTRY (gtk_builder_get_object (the_pref_data->builder, "popover-dialog-entry"));
+  const char *name = gtk_entry_get_text (entry);
 
-  if (!iter_set)
-    iter_set = gtk_tree_model_get_iter_first (model, &iter);
+  /* Perform what we came for */
+  (*fn) (name);
 
-  if (iter_set)
-    gtk_tree_selection_select_iter (gtk_tree_view_get_selection (tree_view), &iter);
+  /* Hide/popdown the popover */
+  popover_dialog_cancel_clicked_cb (button, NULL);
 }
 
 static void
-profile_list_row_activated_cb (GtkTreeView *tree_view,
-                               GtkTreePath *path,
-                               GtkTreeViewColumn *column,
-                               PrefData *data)
+popover_dialog_closed_cb (GtkPopover *popover,
+                          gpointer   user_data)
 {
-  gs_unref_object GSettings *selected_profile;
 
-  selected_profile = profile_list_ref_selected (data);
-  if (selected_profile == NULL)
-    return;
+  GtkEntry *entry = GTK_ENTRY (gtk_builder_get_object (the_pref_data->builder, "popover-dialog-entry"));
+  gtk_entry_set_text (entry, "");
+
+  GtkButton *ok = GTK_BUTTON (gtk_builder_get_object (the_pref_data->builder, "popover-dialog-ok"));
+  GtkButton *cancel = GTK_BUTTON (gtk_builder_get_object (the_pref_data->builder, "popover-dialog-cancel"));
 
-  terminal_app_edit_profile (terminal_app_get (), selected_profile, NULL);
+  g_signal_handlers_disconnect_matched (ok, G_SIGNAL_MATCH_FUNC, 0, 0, NULL,
+                                        G_CALLBACK (popover_dialog_ok_clicked_cb), NULL);
+  g_signal_handlers_disconnect_matched (cancel, G_SIGNAL_MATCH_FUNC, 0, 0, NULL,
+                                        G_CALLBACK (popover_dialog_cancel_clicked_cb), NULL);
+  g_signal_handlers_disconnect_matched (popover, G_SIGNAL_MATCH_FUNC, 0, 0, NULL,
+                                        G_CALLBACK (popover_dialog_closed_cb), NULL);
+}
+
+
+/* Updates the OK button's sensitivity (insensitive if entry field is empty or whitespace only).
+ * The entry's initial value and OK's initial sensitivity have to match in the .ui file. */
+static void
+popover_dialog_notify_text_cb (GtkEntry   *entry,
+                               GParamSpec *pspec,
+                               GtkWidget  *ok)
+{
+  gs_free char *text = g_strchomp (g_strdup (gtk_entry_get_text (entry)));
+  gtk_widget_set_sensitive (ok, text[0] != '\0');
 }
 
-static GtkTreeView *
-profile_list_treeview_new (PrefData *data)
+
+/* Common dialog for entering new profile name, or confirming deletion */
+static void
+profile_popup_dialog (GtkWidget *relative_to,
+                      const char *header,
+                      const char *body,
+                      const char *entry_text,
+                      const char *ok_text,
+                      void (*fn) (const char *))
 {
-  GtkWidget *tree_view;
-  GtkTreeSelection *selection;
-  GtkCellRenderer *renderer;
-  GtkTreeViewColumn *column;
+  GtkLabel *label1 = GTK_LABEL (gtk_builder_get_object (the_pref_data->builder, "popover-dialog-label1"));
+  gtk_label_set_text (label1, header);
+
+  GtkLabel *label2 = GTK_LABEL (gtk_builder_get_object (the_pref_data->builder, "popover-dialog-label2"));
+  gtk_label_set_text (label2, body);
+
+  GtkEntry *entry = GTK_ENTRY (gtk_builder_get_object (the_pref_data->builder, "popover-dialog-entry"));
+  if (entry_text != NULL) {
+    gtk_entry_set_text (entry, entry_text);
+    gtk_widget_show (GTK_WIDGET (entry));
+  } else {
+    gtk_entry_set_text (entry, ".");  /* to make the OK button sensitive */
+    gtk_widget_hide (GTK_WIDGET (entry));
+  }
 
-  tree_view = gtk_tree_view_new ();
-  terminal_util_set_atk_name_description (tree_view, _("Profile list"), NULL);
-  gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tree_view), FALSE);
+  GtkButton *ok = GTK_BUTTON (gtk_builder_get_object (the_pref_data->builder, "popover-dialog-ok"));
+  gtk_button_set_label (ok, ok_text);
+  GtkButton *cancel = GTK_BUTTON (gtk_builder_get_object (the_pref_data->builder, "popover-dialog-cancel"));
+  GtkPopover *popover_dialog = GTK_POPOVER (gtk_builder_get_object (the_pref_data->builder, 
"popover-dialog"));
 
-  selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
-  gtk_tree_selection_set_mode (GTK_TREE_SELECTION (selection),
-                               GTK_SELECTION_BROWSE);
+  g_signal_connect (ok, "clicked", G_CALLBACK (popover_dialog_ok_clicked_cb), fn);
+  g_signal_connect (cancel, "clicked", G_CALLBACK (popover_dialog_cancel_clicked_cb), NULL);
+  g_signal_connect (popover_dialog, "closed", G_CALLBACK (popover_dialog_closed_cb), NULL);
 
-  column = gtk_tree_view_column_new ();
-  renderer = gtk_cell_renderer_text_new ();
-  gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (column), renderer, TRUE);
-  gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (column), renderer,
-                                      (GtkCellLayoutDataFunc) profile_cell_data_func,
-                                      data, NULL);
-  gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view),
-                               GTK_TREE_VIEW_COLUMN (column));
+  gtk_popover_set_relative_to (popover_dialog, relative_to);
+  gtk_popover_set_position (popover_dialog, GTK_POS_BOTTOM);
+  gtk_popover_set_default_widget (popover_dialog, GTK_WIDGET (ok));
 
-  g_signal_connect (tree_view, "row-activated",
-                    G_CALLBACK (profile_list_row_activated_cb), data);
+#if GTK_CHECK_VERSION (3, 22, 0)
+  gtk_popover_popup (popover_dialog);
+#else
+  gtk_widget_show (GTK_WIDGET (popover_dialog));
+#endif
 
-  return GTK_TREE_VIEW (tree_view);
+  gtk_widget_grab_focus (entry_text != NULL ? GTK_WIDGET (entry) : GTK_WIDGET (cancel));
 }
 
+/* "New" selected, ask for profile name */
 static void
-profile_list_delete_confirm_response_cb (GtkWidget *dialog,
-                                         int response,
-                                         PrefData *data)
+profile_new_cb (GtkButton *button,
+                gpointer   user_data)
 {
-  GSettings *profile;
+  profile_popup_dialog (GTK_WIDGET (the_pref_data->new_profile_button),
+                        _("New Profile"),
+                        _("Enter name for new profile with default settings:"),
+                        "",
+                        _("Create"),
+                        profile_new_now);
+}
 
-  profile = (GSettings *) g_object_get_data (G_OBJECT (dialog), "profile");
-  g_assert (profile != NULL);
+/* "Clone" selected, ask for profile name */
+static void
+profile_clone_cb (GSimpleAction *simple,
+                  GVariant      *parameter,
+                  gpointer       user_data)
+{
+  gs_free char *name = g_settings_get_string (the_pref_data->selected_profile, 
TERMINAL_PROFILE_VISIBLE_NAME_KEY);
 
-  if (response == GTK_RESPONSE_ACCEPT)
-    terminal_app_remove_profile (terminal_app_get (), profile);
+  gs_free char *label = g_strdup_printf (_("Enter name for new profile based on “%s”:"), name);
+  gs_free char *clone_name = g_strdup_printf (_("%s (Copy)"), name);
 
-  gtk_widget_destroy (dialog);
+  profile_popup_dialog (GTK_WIDGET (the_pref_data->selected_list_box_row),
+                        _("Clone Profile"),
+                        label,
+                        clone_name,
+                        _("Clone"),
+                        profile_clone_now);
 }
 
+/* "Rename" selected, ask for new name */
 static void
-profile_list_delete_button_clicked_cb (GtkWidget *button,
-                                       PrefData *data)
+profile_rename_cb (GSimpleAction *simple,
+                        GVariant      *parameter,
+                        gpointer       user_data)
 {
-  GtkWidget *dialog;
-  gs_unref_object GSettings *selected_profile;
-  gs_free char *name = NULL;
+  if (the_pref_data->selected_profile == NULL)
+    return;
+
+  gs_free char *name = g_settings_get_string (the_pref_data->selected_profile, 
TERMINAL_PROFILE_VISIBLE_NAME_KEY);
 
-  selected_profile = profile_list_ref_selected (data);
-  if (selected_profile == NULL)
+  gs_free char *label = g_strdup_printf (_("Enter new name for profile “%s”:"), name);
+
+  profile_popup_dialog (GTK_WIDGET (the_pref_data->selected_list_box_row),
+                        _("Rename Profile"),
+                        label,
+                        name,
+                        _("Rename"),
+                        profile_rename_now);
+}
+
+/* "Delete" selected, ask for confirmation */
+static void
+profile_delete_cb (GSimpleAction *simple,
+                   GVariant      *parameter,
+                   gpointer       user_data)
+{
+  if (the_pref_data->selected_profile == NULL)
     return;
 
-  name = g_settings_get_string (selected_profile, TERMINAL_PROFILE_VISIBLE_NAME_KEY);
-  dialog = gtk_message_dialog_new (GTK_WINDOW (data->dialog),
-                                   GTK_DIALOG_DESTROY_WITH_PARENT,
-                                   GTK_MESSAGE_QUESTION,
-                                   GTK_BUTTONS_NONE,
-                                   _("Delete profile “%s”?"),
-                                   name);
+  gs_free char *name = g_settings_get_string (the_pref_data->selected_profile, 
TERMINAL_PROFILE_VISIBLE_NAME_KEY);
 
-  gtk_dialog_add_buttons (GTK_DIALOG (dialog),
-                          _("_Cancel"),
-                          GTK_RESPONSE_REJECT,
-                          _("_Delete"),
-                          GTK_RESPONSE_ACCEPT,
-                          NULL);
-  gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
-                                           GTK_RESPONSE_ACCEPT,
-                                           GTK_RESPONSE_REJECT,
-                                           -1);
-  gtk_dialog_set_default_response (GTK_DIALOG (dialog),
-                                   GTK_RESPONSE_ACCEPT);
+  gs_free char *label = g_strdup_printf (_("Really delete profile “%s”?"), name);
 
-  gtk_window_set_title (GTK_WINDOW (dialog), _("Delete Profile"));
-  gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
+  profile_popup_dialog (GTK_WIDGET (the_pref_data->selected_list_box_row),
+                        _("Delete Profile"),
+                        label,
+                        NULL,
+                        _("Delete"),
+                        profile_delete_now);
+}
 
-  g_object_set_data_full (G_OBJECT (dialog), "profile", g_object_ref (selected_profile), g_object_unref);
+#if !GTK_CHECK_VERSION (3, 22, 27)
+/* Avoid crash on PageUp and PageDown: bugs 791549 & 770703 */
+static gboolean
+listbox_key_press_event_cb (GtkListBox  *box,
+                            GdkEventKey *event,
+                            gpointer     user_data)
+{
+  switch (event->keyval) {
+  case GDK_KEY_Page_Up:
+  case GDK_KEY_Page_Down:
+  case GDK_KEY_KP_Page_Up:
+  case GDK_KEY_KP_Page_Down:
+    return TRUE;
+  default:
+    return FALSE;
+  }
+}
+#endif
 
-  g_signal_connect (dialog, "response",
-                    G_CALLBACK (profile_list_delete_confirm_response_cb),
-                    data);
+/* Create a (non-header) row of the sidebar, either a global or a profile entry. */
+static GtkListBoxRow *
+listbox_create_row (const char *name,
+                    const char *stack_child_name,
+                    const char *uuid,
+                    GSettings  *gsettings,
+                    gpointer    sort_order)
+{
+  GtkListBoxRow *row = GTK_LIST_BOX_ROW (gtk_list_box_row_new ());
+
+  g_object_set_data_full (G_OBJECT (row), "stack_child_name", g_strdup (stack_child_name), g_free);
+  g_object_set_data_full (G_OBJECT (row), "uuid", g_strdup (uuid), g_free);
+  g_object_set_data (G_OBJECT (row), "gsettings", gsettings);
+  g_object_set_data (G_OBJECT (row), "sort_order", sort_order);
+
+  GtkBox *hbox = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0));
+  gtk_widget_set_margin_start (GTK_WIDGET (hbox), 6);
+  gtk_widget_set_margin_end (GTK_WIDGET (hbox), 6);
+  gtk_widget_set_margin_top (GTK_WIDGET (hbox), 6);
+  gtk_widget_set_margin_bottom (GTK_WIDGET (hbox), 6);
+
+  GtkLabel *label = GTK_LABEL (gtk_label_new (name));
+  if (gsettings != NULL) {
+    g_signal_connect (label, "notify::label", G_CALLBACK (profile_name_changed_cb), row);
+    g_settings_bind (gsettings,
+                     TERMINAL_PROFILE_VISIBLE_NAME_KEY,
+                     label,
+                     "label",
+                     G_SETTINGS_BIND_GET);
+  }
+  gtk_label_set_xalign (label, 0);
+  gtk_box_pack_start (hbox, GTK_WIDGET (label), TRUE, TRUE, 0);
+  g_object_set_data (G_OBJECT (row), "label", label);
+
+  /* Always add the "default" symbol and the "menu" button, even on rows of global prefs.
+   * Use GtkStack to possible achieve visibility:hidden on it.
+   * This is so that all listbox rows have the same dimensions, and the width doesn't change
+   * as you switch the default profile. */
+
+  GtkStack *popover_stack = GTK_STACK (gtk_stack_new ());
+  gtk_widget_set_margin_start (GTK_WIDGET (popover_stack), 6);
+  GtkMenuButton *popover_button = GTK_MENU_BUTTON (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 = GTK_LABEL (gtk_label_new (""));
+  gtk_stack_add_named (popover_stack, GTK_WIDGET (popover_label), "placeholder");
+  g_object_set_data (G_OBJECT (row), "popover-stack", popover_stack);
+  g_object_set_data (G_OBJECT (row), "popover-button", popover_button);
+
+  gtk_box_pack_end (hbox, GTK_WIDGET (popover_stack), FALSE, FALSE, 0);
+
+  GtkStack *home_stack = GTK_STACK (gtk_stack_new ());
+  gtk_widget_set_margin_start (GTK_WIDGET (home_stack), 12);
+  GtkImage *home_image = GTK_IMAGE (gtk_image_new_from_icon_name ("emblem-default-symbolic", 
GTK_ICON_SIZE_BUTTON));
+  gtk_widget_set_tooltip_text (GTK_WIDGET (home_image), _("This is the default profile"));
+  gtk_stack_add_named (home_stack, GTK_WIDGET (home_image), "home");
+  GtkLabel *home_label = GTK_LABEL (gtk_label_new (""));
+  gtk_stack_add_named (home_stack, GTK_WIDGET (home_label), "placeholder");
+  g_object_set_data (G_OBJECT (row), "home-stack", home_stack);
+
+  gtk_box_pack_end (hbox, GTK_WIDGET (home_stack), FALSE, FALSE, 0);
+
+  gtk_container_add (GTK_CONTAINER (row), GTK_WIDGET (hbox));
+
+  gtk_widget_show_all (GTK_WIDGET (row));
+
+  gtk_stack_set_visible_child_name (popover_stack, "placeholder");
+  gtk_stack_set_visible_child_name (home_stack, "placeholder");
+
+  return row;
+}
 
-  gtk_window_present (GTK_WINDOW (dialog));
+/* Add all the non-profile rows to the sidebar */
+static void
+listbox_add_all_globals (PrefData *data)
+{
+  GtkListBoxRow *row;
+
+  row = listbox_create_row (_("General"),
+                            "general-prefs",
+                            NULL, NULL, (gpointer) 0);
+  gtk_list_box_insert (data->listbox, GTK_WIDGET (row), -1);
+
+  row = listbox_create_row (_("Shortcuts"),
+                            "shortcut-prefs",
+                            NULL, NULL, (gpointer) 1);
+  gtk_list_box_insert (data->listbox, GTK_WIDGET (row), -1);
 }
 
+/* Remove all the profile rows from the sidebar */
 static void
-profile_list_new_button_clicked_cb (GtkWidget *button,
-                                    PrefData *data)
+listbox_remove_all_profiles (PrefData *data)
 {
-  terminal_app_new_profile (terminal_app_get (), NULL);
+  int i = 0;
+
+  data->selected_profile = NULL;
+  g_free (data->selected_profile_uuid);
+  data->selected_profile_uuid = NULL;
+  profile_prefs_unload ();
+
+  GtkListBoxRow *row = gtk_list_box_get_row_at_index (GTK_LIST_BOX (the_pref_data->listbox), 0);
+  g_signal_emit_by_name (row, "activate");
+
+  while ((row = gtk_list_box_get_row_at_index (data->listbox, i)) != NULL) {
+    if (g_object_get_data (G_OBJECT (row), "gsettings") != NULL) {
+      gtk_widget_destroy (GTK_WIDGET (row));
+    } else {
+      i++;
+    }
+  }
 }
 
+/* Add all the profiles to the sidebar */
 static void
-profile_list_clone_button_clicked_cb (GtkWidget *button,
-                                      PrefData *data)
+listbox_add_all_profiles (PrefData *data)
 {
-  gs_unref_object GSettings *selected_profile;
+  GList *list, *l;
+  GtkListBoxRow *row;
 
-  selected_profile = profile_list_ref_selected (data);
-  if (selected_profile == NULL)
-    return;
+  list = terminal_settings_list_ref_children (data->profiles_list);
+
+  for (l = list; l != NULL; l = l->next) {
+    GSettings *profile = (GSettings *) l->data;
+    gs_free gchar *text = g_settings_get_string (profile, TERMINAL_PROFILE_VISIBLE_NAME_KEY);
+    gs_free gchar *uuid = terminal_settings_list_dup_uuid_from_child (data->profiles_list, profile);
+
+    row = listbox_create_row (NULL,
+                              "profile-prefs",
+                              uuid,
+                              profile,
+                              (gpointer) 42);
+    gtk_list_box_insert (data->listbox, GTK_WIDGET (row), -1);
+  }
 
-  terminal_app_new_profile (terminal_app_get (), selected_profile);
+  listbox_update (data->listbox);  /* FIXME: This is not needed but I don't know why :-) */
 }
 
+/* Re-add all the profiles to the sidebar.
+ * This is called when a profile is added or removed, and also when the list of profiles is
+ * modified externally.
+ * Try to keep the selected profile, whenever possible.
+ * When the list is modified externally, the terminal_settings_list_*() methods seem to preserve
+ * the GSettings object for every profile that remains in the list. There's no guarantee however
+ * that a newly created GSettings can't receive the same address that a ceased one used to have.
+ * So don't rely on GSettings* to keep track of the selected profile, use the UUID instead. */
 static void
-profile_list_edit_button_clicked_cb (GtkWidget *button,
-                                     PrefData *data)
+listbox_readd_profiles (PrefData *data)
 {
-  gs_unref_object GSettings *selected_profile;
+  gs_free char *uuid = g_strdup (data->selected_profile_uuid);
 
-  selected_profile = profile_list_ref_selected (data);
-  if (selected_profile == NULL)
-    return;
+  listbox_remove_all_profiles (data);
+  listbox_add_all_profiles (data);
 
-  terminal_app_edit_profile (terminal_app_get (), selected_profile, NULL);
+  if (uuid != NULL)
+    listbox_select_profile (uuid);
 }
 
+/* Create a header row ("Global" or "Profiles +") */
+static GtkWidget *
+listboxrow_create_header (const char *text,
+                          gboolean visible_button)
+{
+  GtkBox *hbox = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0));
+  gtk_widget_set_margin_start (GTK_WIDGET (hbox), 6);
+  gtk_widget_set_margin_end (GTK_WIDGET (hbox), 6);
+  gtk_widget_set_margin_top (GTK_WIDGET (hbox), 6);
+  gtk_widget_set_margin_bottom (GTK_WIDGET (hbox), 6);
+
+  GtkLabel *label = GTK_LABEL (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_box_pack_start (hbox, GTK_WIDGET (label), TRUE, TRUE, 0);
+
+  /* Always add a "new profile" button. Use GtkStack to possible achieve visibility:hidden on it.
+   * This is so that both header rows have the same dimensions. */
+
+  GtkStack *stack = GTK_STACK (gtk_stack_new ());
+  GtkButton *button = GTK_BUTTON (gtk_button_new_from_icon_name ("list-add-symbolic", GTK_ICON_SIZE_BUTTON));
+  gtk_button_set_relief (button, GTK_RELIEF_NONE);
+  gtk_stack_add_named (stack, GTK_WIDGET (button), "button");
+  GtkLabel *labelx = GTK_LABEL (gtk_label_new (""));
+  gtk_stack_add_named (stack, GTK_WIDGET (labelx), "placeholder");
+
+  gtk_box_pack_end (hbox, GTK_WIDGET (stack), FALSE, FALSE, 0);
+
+  gtk_widget_show_all (GTK_WIDGET (hbox));
+
+  if (visible_button) {
+    gtk_stack_set_visible_child_name (stack, "button");
+    g_signal_connect (button, "clicked", G_CALLBACK (profile_new_cb), NULL);
+    the_pref_data->new_profile_button = GTK_WIDGET (button);
+  } else {
+    gtk_stack_set_visible_child_name (stack, "placeholder");
+  }
+
+  return GTK_WIDGET (hbox);
+}
+
+/* Manage the creation or removal of the header row ("Global" or "Profiles +") */
 static void
-profile_list_selection_changed_cb (GtkTreeSelection *selection,
-                                   PrefData *data)
+listboxrow_update_header (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, listboxrow_create_header (_("Global"), FALSE));
+    }
+    return;
+  }
+
+  GSettings *profile = g_object_get_data (G_OBJECT (row), "gsettings");
+  if (profile != NULL) {
+    GSettings *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, listboxrow_create_header (_("Profiles"), TRUE));
+      }
+    }
+  }
+}
+
+/* Sort callback for rows of the sidebar (global and profile ones).
+ * Global ones are kept at the top in fixed order. This is implemented via sort_order
+ * which is an integer disguised as a pointer for ease of implementation.
+ * Profile ones are sorted lexicographically. */
+static gint
+listboxrow_compare_cb (GtkListBoxRow *row1,
+                       GtkListBoxRow *row2,
+                       gpointer       user_data)
 {
-  gboolean selected = gtk_tree_selection_get_selected (selection, NULL, NULL);
+  gpointer sort_order_1 = g_object_get_data (G_OBJECT (row1), "sort_order");
+  gpointer sort_order_2 = g_object_get_data (G_OBJECT (row2), "sort_order");
+
+  if (sort_order_1 != sort_order_2)
+    return sort_order_1 < sort_order_2 ? -1 : 1;
+
+  GtkLabel *label1 = g_object_get_data (G_OBJECT (row1), "label");
+  const char *text1 = gtk_label_get_text (label1);
+  GtkLabel *label2 = g_object_get_data (G_OBJECT (row2), "label");
+  const char *text2 = gtk_label_get_text (label2);
 
-  gtk_widget_set_sensitive (data->manage_profiles_edit_button, selected);
-  gtk_widget_set_sensitive (data->manage_profiles_clone_button, selected);
-  gtk_widget_set_sensitive (data->manage_profiles_delete_button, selected);
+  return g_utf8_collate (text1, text2);
 }
 
 /* Keybindings tab */
@@ -444,45 +719,56 @@ shortcuts_button_toggled_cb (GtkWidget *widget,
   gtk_widget_queue_draw (GTK_WIDGET (tree_view));
 }
 
-/* Encodings tab */
-
 /* misc */
 
 static void
 prefs_dialog_destroy_cb (GtkWidget *widget,
                          PrefData *data)
 {
-  g_signal_handlers_disconnect_by_func (data->profiles_list, G_CALLBACK (profile_combo_box_refill), data);
-  g_signal_handlers_disconnect_by_func (data->profiles_list, G_CALLBACK (profile_list_treeview_refill), 
data);
-
   /* Don't run this handler again */
   g_signal_handlers_disconnect_by_func (widget, G_CALLBACK (prefs_dialog_destroy_cb), data);
+
+  g_signal_handlers_disconnect_by_func (data->profiles_list,
+                                        G_CALLBACK (listbox_readd_profiles), data);
+  g_signal_handlers_disconnect_by_func (data->profiles_list,
+                                        G_CALLBACK (listbox_update), data->listbox);
+
+  profile_prefs_destroy ();
+
+  g_object_unref (data->builder);
+  g_free (data->selected_profile_uuid);
   g_free (data);
 }
 
 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;
   GtkWidget *dialog, *tree_view;
   GtkWidget *show_menubar_button, *disable_mnemonics_button, *disable_menu_accel_button;
   GtkWidget *disable_shortcuts_button;
-  GtkWidget *tree_view_container, *new_button, *edit_button, *clone_button, *remove_button;
   GtkWidget *theme_variant_label, *theme_variant_combo;
   GtkWidget *new_terminal_mode_label, *new_terminal_mode_combo;
-  GtkWidget *default_hbox, *default_label;
   GtkWidget *close_button, *help_button;
-  GtkTreeSelection *selection;
   GSettings *settings;
 
-  if (prefs_dialog != NULL)
+  const GActionEntry action_entries[] = {
+    { "clone",          profile_clone_cb,          NULL, NULL, NULL },
+    { "rename",         profile_rename_cb,         NULL, NULL, NULL },
+    { "delete",         profile_delete_cb,         NULL, NULL, NULL },
+    { "set-as-default", profile_set_as_default_cb, NULL, NULL, NULL },
+  };
+
+  if (the_pref_data != NULL)
     goto done;
 
-  data = g_new0 (PrefData, 1);
+  the_pref_data = g_new0 (PrefData, 1);
+  data = the_pref_data;
   data->profiles_list = terminal_app_get_profiles_list (app);
 
-  terminal_util_load_widgets_resource ("/org/gnome/terminal/ui/preferences.ui",
+  /* FIXME this method is only used from here. Inline it here instead. */
+  data->builder = terminal_util_load_widgets_resource ("/org/gnome/terminal/ui/preferences.ui",
                                        "preferences-dialog",
                                        "preferences-dialog", &dialog,
                                        "close-button", &close_button,
@@ -496,13 +782,8 @@ terminal_prefs_show_preferences (const char *page)
                                        "disable-shortcuts-checkbutton", &disable_shortcuts_button,
                                        "disable-menu-accel-checkbutton", &disable_menu_accel_button,
                                        "accelerators-treeview", &tree_view,
-                                       "profiles-treeview-container", &tree_view_container,
-                                       "new-profile-button", &new_button,
-                                       "edit-profile-button", &edit_button,
-                                       "clone-profile-button", &clone_button,
-                                       "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,7 +794,34 @@ terminal_prefs_show_preferences (const char *page)
 
   settings = terminal_app_get_global_settings (app);
 
-  /* General tab */
+  g_action_map_add_action_entries (G_ACTION_MAP (dialog),
+                                   action_entries, G_N_ELEMENTS (action_entries),
+                                   data);
+
+  /* Sidebar */
+
+  gtk_list_box_set_header_func (GTK_LIST_BOX (data->listbox),
+                                listboxrow_update_header,
+                                NULL,
+                                NULL);
+  g_signal_connect (data->listbox, "row-selected", G_CALLBACK (listbox_row_selected_cb), data->stack);
+  gtk_list_box_set_sort_func (data->listbox, listboxrow_compare_cb, NULL, NULL);
+#if !GTK_CHECK_VERSION (3, 22, 27)
+  g_signal_connect (data->listbox, "key-press-event", G_CALLBACK (listbox_key_press_event_cb), NULL);
+#endif
+
+  listbox_add_all_globals (data);
+  listbox_add_all_profiles (data);
+  g_signal_connect_swapped (data->profiles_list, "children-changed",
+                            G_CALLBACK (listbox_readd_profiles), data);
+  g_signal_connect_swapped (data->profiles_list, "default-changed",
+                            G_CALLBACK (listbox_update), data->listbox);
+
+  GtkEntry *entry = GTK_ENTRY (gtk_builder_get_object (the_pref_data->builder, "popover-dialog-entry"));
+  GtkButton *ok = GTK_BUTTON (gtk_builder_get_object (the_pref_data->builder, "popover-dialog-ok"));
+  g_signal_connect (entry, "notify::text", G_CALLBACK (popover_dialog_notify_text_cb), ok);
+
+  /* General page */
 
   gboolean shell_shows_menubar;
   g_object_get (gtk_settings_get_default (),
@@ -551,21 +859,22 @@ terminal_prefs_show_preferences (const char *page)
   gtk_widget_set_visible (new_terminal_mode_combo, FALSE);
 #endif
 
-  /* Keybindings tab */
-
   g_settings_bind (settings,
                    TERMINAL_SETTING_ENABLE_MNEMONICS_KEY,
                    disable_mnemonics_button,
                    "active",
                    G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
   g_settings_bind (settings,
-                   TERMINAL_SETTING_ENABLE_SHORTCUTS_KEY,
-                   disable_shortcuts_button,
+                   TERMINAL_SETTING_ENABLE_MENU_BAR_ACCEL_KEY,
+                   disable_menu_accel_button,
                    "active",
                    G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+
+  /* Shortcuts page */
+
   g_settings_bind (settings,
-                   TERMINAL_SETTING_ENABLE_MENU_BAR_ACCEL_KEY,
-                   disable_menu_accel_button,
+                   TERMINAL_SETTING_ENABLE_SHORTCUTS_KEY,
+                   disable_shortcuts_button,
                    "active",
                    G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
 
@@ -574,61 +883,28 @@ terminal_prefs_show_preferences (const char *page)
 
   terminal_accels_fill_treeview (tree_view, disable_shortcuts_button);
 
-  /* Profiles tab */
+  /* Profile page */
 
-  data->manage_profiles_new_button = GTK_WIDGET (new_button);
-  data->manage_profiles_edit_button = GTK_WIDGET (edit_button);
-  data->manage_profiles_clone_button = GTK_WIDGET (clone_button);
-  data->manage_profiles_delete_button  = GTK_WIDGET (remove_button);
-
-  data->manage_profiles_list = profile_list_treeview_new (data);
-  selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (data->manage_profiles_list));
-  g_signal_connect (selection, "changed", G_CALLBACK (profile_list_selection_changed_cb), data);
-
-  profile_list_treeview_refill (data);
-  g_signal_connect_swapped (data->profiles_list, "children-changed",
-                            G_CALLBACK (profile_list_treeview_refill), data);
-
-  gtk_container_add (GTK_CONTAINER (tree_view_container), GTK_WIDGET (data->manage_profiles_list));
-  gtk_widget_show (GTK_WIDGET (data->manage_profiles_list));
-
-  g_signal_connect (new_button, "clicked",
-                    G_CALLBACK (profile_list_new_button_clicked_cb),
-                    data);
-  g_signal_connect (edit_button, "clicked",
-                    G_CALLBACK (profile_list_edit_button_clicked_cb),
-                    data);
-  g_signal_connect (clone_button, "clicked",
-                    G_CALLBACK (profile_list_clone_button_clicked_cb),
-                    data);
-  g_signal_connect (remove_button, "clicked",
-                    G_CALLBACK (profile_list_delete_button_clicked_cb),
-                    data);
-
-  data->profiles_default_combo = profile_combo_box_new (data);
-  g_signal_connect_swapped (data->profiles_list, "children-changed",
-                            G_CALLBACK (profile_combo_box_refill), data);
-  g_signal_connect (data->profiles_default_combo, "changed",
-                    G_CALLBACK (profile_combo_box_changed_cb), data);
-
-  gtk_box_pack_start (GTK_BOX (default_hbox), data->profiles_default_combo, FALSE, FALSE, 0);
-  gtk_widget_show (data->profiles_default_combo);
-
-  // FIXMEchpe
-  gtk_label_set_mnemonic_widget (GTK_LABEL (default_label), data->profiles_default_combo);
+  profile_prefs_init ();
 
   /* misc */
 
   g_signal_connect (close_button, "clicked", G_CALLBACK (prefs_dialog_close_button_clicked_cb), data);
   g_signal_connect (help_button, "clicked", G_CALLBACK (prefs_dialog_help_button_clicked_cb), data);
   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);
+  g_object_add_weak_pointer (G_OBJECT (dialog), (gpointer *) &the_pref_data);
 
 done:
-  terminal_util_dialog_focus_widget (prefs_dialog, page);
+  if (profile != NULL) {
+    gs_free char *uuid = terminal_settings_list_dup_uuid_from_child (the_pref_data->profiles_list, profile);
+    listbox_select_profile (uuid);
+  } else {
+    GtkListBoxRow *row = gtk_list_box_get_row_at_index (GTK_LIST_BOX (the_pref_data->listbox), 0);
+    g_signal_emit_by_name (row, "activate");
+  }
+
+  terminal_util_dialog_focus_widget (the_pref_data->builder, widget_name);
 
-  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 1a4bc2d..ecb4129 100644
--- a/src/terminal-prefs.h
+++ b/src/terminal-prefs.h
@@ -20,9 +20,35 @@
 
 #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 terminal-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 *selected_profile;
+  GtkListBoxRow *selected_list_box_row;
+  char *selected_profile_uuid;  /* a copy thereof, to survive changes to profiles_list */
+
+  GtkBuilder *builder;
+  GtkWidget *dialog;
+  GtkListBox *listbox;
+  GtkWidget *new_profile_button;
+  GtkWidget *stack;
+
+  GArray *profile_signals;
+  GArray *profile_bindings;
+} PrefData;
+
+extern PrefData *the_pref_data;  /* global */
+
+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 117315e..5f78de9 100644
--- a/src/terminal-screen.c
+++ b/src/terminal-screen.c
@@ -1253,7 +1253,7 @@ get_child_environment (TerminalScreen *screen,
 
 enum {
   RESPONSE_RELAUNCH,
-  RESPONSE_EDIT_PROFILE
+  RESPONSE_EDIT_PREFERENCES
 };
 
 static void
@@ -1272,10 +1272,10 @@ info_bar_response_cb (GtkWidget *info_bar,
       gtk_widget_destroy (info_bar);
       _terminal_screen_launch_child_on_idle (screen);
       break;
-    case RESPONSE_EDIT_PROFILE:
-      terminal_app_edit_profile (terminal_app_get (),
-                                 terminal_screen_get_profile (screen),
-                                 "custom-command-entry");
+    case RESPONSE_EDIT_PREFERENCES:
+      terminal_app_edit_preferences (terminal_app_get (),
+                                     terminal_screen_get_profile (screen),
+                                     "custom-command-entry");
       break;
     default:
       gtk_widget_destroy (info_bar);
@@ -1389,7 +1389,7 @@ spawn_result_cb (VteTerminal *terminal,
 
     vte_terminal_set_pty (terminal, NULL);
     info_bar = terminal_info_bar_new (GTK_MESSAGE_ERROR,
-                                      _("_Profile Preferences"), RESPONSE_EDIT_PROFILE,
+                                      _("_Preferences"), RESPONSE_EDIT_PREFERENCES,
                                       _("_Relaunch"), RESPONSE_RELAUNCH,
                                       NULL);
     terminal_info_bar_format_text (TERMINAL_INFO_BAR (info_bar),
diff --git a/src/terminal-settings-list.c b/src/terminal-settings-list.c
index cdc80b6..e5949b2 100644
--- a/src/terminal-settings-list.c
+++ b/src/terminal-settings-list.c
@@ -271,8 +271,24 @@ terminal_settings_list_ref_child_internal (TerminalSettingsList *list,
 }
 
 static char *
+new_child (TerminalSettingsList *list,
+           const char *name)
+{
+  char *new_uuid = new_list_entry ();
+
+  if (name != NULL) {
+    gs_free char *new_path = path_new (list, new_uuid);
+    gs_unref_object GSettings *child = g_settings_new_with_path (list->child_schema_id, new_path);
+    g_settings_set_string (child, TERMINAL_PROFILE_VISIBLE_NAME_KEY, name);
+  }
+
+  return new_uuid;
+}
+
+static char *
 clone_child (TerminalSettingsList *list,
-             const char *uuid)
+             const char *uuid,
+             const char *name)
 {
   char *new_uuid;
   gs_free char *path;
@@ -305,7 +321,6 @@ clone_child (TerminalSettingsList *list,
 
     rkey = g_strconcat (path, keys[i], NULL);
     value = dconf_client_read (client, rkey);
-
     if (value) {
       gs_free char *wkey;
       wkey = g_strconcat (new_path, keys[i], NULL);
@@ -313,6 +328,16 @@ clone_child (TerminalSettingsList *list,
     }
   }
 
+  if (name != NULL) {
+    GVariant *value;
+    value = g_variant_new_string (name);
+    if (value) {
+      gs_free char *wkey;
+      wkey = g_strconcat (new_path, TERMINAL_PROFILE_VISIBLE_NAME_KEY, NULL);
+      dconf_changeset_set (changeset, wkey, value);
+    }
+  }
+
   dconf_client_change_sync (client, changeset, NULL, NULL, NULL);
   dconf_changeset_unref (changeset);
 
@@ -321,15 +346,16 @@ clone_child (TerminalSettingsList *list,
 
 static char *
 terminal_settings_list_add_child_internal (TerminalSettingsList *list,
-                                           const char *uuid)
+                                           const char *uuid,
+                                           const char *name)
 {
   char *new_uuid;
   gs_strfreev char **new_uuids;
 
   if (uuid && settings_backend_is_dconf ())
-    new_uuid = clone_child (list, uuid);
+    new_uuid = clone_child (list, uuid, name);
   else
-    new_uuid = new_list_entry ();
+    new_uuid = new_child (list, name);
 
   _terminal_debug_print (TERMINAL_DEBUG_SETTINGS_LIST,
                          "%s NEW UUID %s\n", G_STRFUNC, new_uuid);
@@ -762,23 +788,26 @@ terminal_settings_list_ref_default_child (TerminalSettingsList *list)
 /**
  * terminal_settings_list_add_child:
  * @list: a #TerminalSettingsList
+ * @name: the name of the new profile
  *
  * Adds a new child to the list, and returns a reference to its #GSettings.
  *
  * Returns: (transfer full): the UUID of new child
  */
 char *
-terminal_settings_list_add_child (TerminalSettingsList *list)
+terminal_settings_list_add_child (TerminalSettingsList *list,
+                                  const char *name)
 {
   g_return_val_if_fail (TERMINAL_IS_SETTINGS_LIST (list), NULL);
 
-  return terminal_settings_list_add_child_internal (list, NULL);
+  return terminal_settings_list_add_child_internal (list, NULL, name);
 }
 
 /**
  * terminal_settings_list_clone_child:
  * @list: a #TerminalSettingsList
  * @uuid: the UUID of the child to clone
+ * @name: the name of the new child
  *
  * Adds a new child to the list, and returns a reference to its #GSettings.
  * All keys of the new child will have the same value as @uuid's.
@@ -787,12 +816,13 @@ terminal_settings_list_add_child (TerminalSettingsList *list)
  */
 char *
 terminal_settings_list_clone_child (TerminalSettingsList *list,
-                                    const char *uuid)
+                                    const char *uuid,
+                                    const char *name)
 {
   g_return_val_if_fail (TERMINAL_IS_SETTINGS_LIST (list), NULL);
   g_return_val_if_fail (terminal_settings_list_valid_uuid (uuid), NULL);
 
-  return terminal_settings_list_add_child_internal (list, uuid);
+  return terminal_settings_list_add_child_internal (list, uuid, name);
 }
 
 /**
diff --git a/src/terminal-settings-list.h b/src/terminal-settings-list.h
index c68c499..ecf8950 100644
--- a/src/terminal-settings-list.h
+++ b/src/terminal-settings-list.h
@@ -51,10 +51,12 @@ gboolean terminal_settings_list_has_child (TerminalSettingsList *list,
 GSettings *terminal_settings_list_ref_child (TerminalSettingsList *list,
                                              const char *uuid);
 
-char *terminal_settings_list_add_child (TerminalSettingsList *list);
+char *terminal_settings_list_add_child (TerminalSettingsList *list,
+                                        const char *name);
 
 char *terminal_settings_list_clone_child (TerminalSettingsList *list,
-                                          const char *uuid);
+                                          const char *uuid,
+                                          const char *name);
 
 void terminal_settings_list_remove_child (TerminalSettingsList *list,
                                           const char *uuid);
diff --git a/src/terminal-util.c b/src/terminal-util.c
index 6813f9e..b40e100 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
@@ -494,16 +495,14 @@ terminal_util_dialog_response_on_delete (GtkWindow *widget)
 }
 
 void
-terminal_util_dialog_focus_widget (GtkWidget *dialog,
+terminal_util_dialog_focus_widget (GtkBuilder *builder,
                                    const char *widget_name)
 {
-  GtkBuilder *builder;
   GtkWidget *widget, *page, *page_parent;
 
   if (widget_name == NULL)
     return;
 
-  builder = g_object_get_data (G_OBJECT (dialog), "builder");
   widget = GTK_WIDGET (gtk_builder_get_object (builder, widget_name));
   if (widget == NULL)
     return;
diff --git a/src/terminal-util.h b/src/terminal-util.h
index c49460e..abd34fd 100644
--- a/src/terminal-util.h
+++ b/src/terminal-util.h
@@ -51,16 +51,16 @@ char *terminal_util_concat_uris (char **uris,
 
 char *terminal_util_get_licence_text (void);
 
-void terminal_util_load_widgets_resource (const char *path,
-                                          const char *main_object_name,
-                                          const char *object_name,
-                                          ...);
+GtkBuilder *terminal_util_load_widgets_resource (const char *path,
+                                                 const char *main_object_name,
+                                                 const char *object_name,
+                                                 ...);
 
 void terminal_util_load_objects_resource (const char *path,
                                           const char *object_name,
                                           ...);
 
-void terminal_util_dialog_focus_widget (GtkWidget *dialog,
+void terminal_util_dialog_focus_widget (GtkBuilder *builder,
                                         const char *widget_name);
 
 gboolean terminal_util_dialog_response_on_delete (GtkWindow *widget);
diff --git a/src/terminal-window.c b/src/terminal-window.c
index 8a1bf17..a9c0a20 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.c
@@ -413,18 +413,6 @@ action_new_terminal_cb (GSimpleAction *action,
     gtk_window_present (GTK_WINDOW (window));
 }
 
-static void
-action_new_profile_cb (GSimpleAction *action,
-                       GVariant *parameter,
-                       gpointer user_data)
-{
-  TerminalWindow *window = user_data;
-  TerminalWindowPrivate *priv = window->priv;
-
-  terminal_app_new_profile (terminal_app_get (),
-                            terminal_screen_get_profile (priv->active_screen));
-}
-
 #ifdef ENABLE_SAVE
 
 static void
@@ -970,20 +958,12 @@ action_edit_preferences_cb (GSimpleAction *action,
                             GVariant *parameter,
                             gpointer user_data)
 {
-  terminal_app_edit_preferences (terminal_app_get ());
-}
-
-static void
-action_edit_profile_cb (GSimpleAction *action,
-                        GVariant *parameter,
-                        gpointer user_data)
-{
   TerminalWindow *window = user_data;
   TerminalWindowPrivate *priv = window->priv;
 
-  terminal_app_edit_profile (terminal_app_get (),
-                             terminal_screen_get_profile (priv->active_screen),
-                             NULL);
+  terminal_app_edit_preferences (terminal_app_get (),
+                                 terminal_screen_get_profile (priv->active_screen),
+                                 NULL);
 }
 
 static void
@@ -1828,20 +1808,13 @@ screen_show_popup_menu_cb (TerminalScreen *screen,
     gs_unref_object GMenu *submenu5 = g_menu_new ();
     g_menu_append_section (submenu5, NULL, profiles_menu);
 
-    gs_unref_object GMenu *section51 = g_menu_new ();
-    g_menu_append (section51, _("_Profile Preferences"), "win.edit-profile");
-    g_menu_append_section (submenu5, NULL, G_MENU_MODEL (section51));
-
     gs_unref_object GMenuItem *item5 = g_menu_item_new (_("P_rofiles"), NULL);
     g_menu_item_set_submenu (item5, G_MENU_MODEL (submenu5));
     g_menu_append_item (section5, item5);
-  } else {
-    /* If there's only a single profile, put the Profile Preferences item in the
-     * context menu itself.
-     */
-    g_menu_append (section5, _("_Profile Preferences"), "win.edit-profile");
   }
 
+  g_menu_append (section5, _("_Preferences"), "win.edit-preferences");
+
   g_menu_append_section (menu, NULL, G_MENU_MODEL (section5));
 
   /* New Terminal section */
@@ -2124,7 +2097,6 @@ terminal_window_init (TerminalWindow *window)
     { "copy",                action_copy_cb,             "s",    NULL, NULL },
     { "copy-hyperlink",      action_copy_hyperlink_cb,   NULL,   NULL, NULL },
     { "copy-match",          action_copy_match_cb,       NULL,   NULL, NULL },
-    { "edit-profile",        action_edit_profile_cb,     NULL,   NULL, NULL },
     { "edit-preferences",    action_edit_preferences_cb, NULL,   NULL, NULL },
     { "find",                action_find_cb,             NULL,   NULL, NULL },
     { "find-backward",       action_find_backward_cb,    NULL,   NULL, NULL },
@@ -2133,7 +2105,6 @@ terminal_window_init (TerminalWindow *window)
     { "help",                action_help_cb,             NULL,   NULL, NULL },
     { "inspector",           action_inspector_cb,        NULL,   NULL, NULL },
     { "leave-fullscreen",    action_leave_fullscreen_cb, NULL,   NULL, NULL },
-    { "new-profile",         action_new_profile_cb,      NULL,   NULL, NULL },
     { "new-terminal",        action_new_terminal_cb,     "(ss)", NULL, NULL },
     { "open-match",          action_open_match_cb,       NULL,   NULL, NULL },
     { "open-hyperlink",      action_open_hyperlink_cb,   NULL,   NULL, NULL },
diff --git a/src/terminal.gresource.xml b/src/terminal.gresource.xml
index 411c570..503e1a5 100644
--- a/src/terminal.gresource.xml
+++ b/src/terminal.gresource.xml
@@ -22,7 +22,6 @@
     <file alias="ui/menubar.ui" compressed="true" preprocess="xml-stripblanks">terminal-menubar.ui</file>
     <file alias="ui/notebook-menu.ui" compressed="true" 
preprocess="xml-stripblanks">terminal-notebook-menu.ui</file>
     <file alias="ui/preferences.ui" compressed="true" preprocess="xml-stripblanks">preferences.ui</file>
-    <file alias="ui/profile-preferences.ui" compressed="true" 
preprocess="xml-stripblanks">profile-preferences.ui</file>
     <file alias="ui/search-popover.ui" compressed="true" 
preprocess="xml-stripblanks">search-popover.ui</file>
     <file alias="ui/terminal.about" compressed="true">terminal.about</file>
     <file alias="ui/window.ui" compressed="true" preprocess="xml-stripblanks">terminal-window.ui</file>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]