[gnome-terminal/gnome-3-34-ntfy-opn-ttl-ts: 12/16] Revert "Remove the static title setting from profile preferences"



commit 1c41cf96ccc6827b78631ffd8c25b34bd2ab1ce7
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Jun 30 17:39:48 2016 +0200

    Revert "Remove the static title setting from profile preferences"
    
    This reverts commit e9cb8fea14a849704074c5d69f173bcf4dc2fb27.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1296110

 src/org.gnome.Terminal.gschema.xml |  5 +++
 src/preferences.ui                 | 71 ++++++++++++++++++++++++++++++++++++++
 src/profile-editor.c               |  5 +++
 src/terminal-schemas.h             |  1 +
 src/terminal-screen.c              |  9 +++++
 5 files changed, 91 insertions(+)
---
diff --git a/src/org.gnome.Terminal.gschema.xml b/src/org.gnome.Terminal.gschema.xml
index 1b0fb22b..0c50f82f 100644
--- a/src/org.gnome.Terminal.gschema.xml
+++ b/src/org.gnome.Terminal.gschema.xml
@@ -183,6 +183,11 @@
       <summary>Highlight foreground colour</summary>
       <description>Custom color for the foreground of the text character at the terminal’s highlight 
position, as a color specification (can be HTML-style hex digits, or a color name such as “red”). This is 
ignored if highlight-colors-set is false.</description>
     </key>
+    <key name="title" type="s">
+      <default l10n="messages" context="title">'Terminal'</default>
+      <summary>Title for terminal</summary>
+      <description>Title to display for the terminal window or tab. This title may be replaced by or 
combined with the title set by the application inside the terminal, depending on the title_mode 
setting.</description>
+    </key>
     <key name="allow-bold" type="b">
       <default>true</default>
       <summary>Whether to allow bold text</summary>
diff --git a/src/preferences.ui b/src/preferences.ui
index a4b2027f..18f7e097 100644
--- a/src/preferences.ui
+++ b/src/preferences.ui
@@ -1864,6 +1864,77 @@
                             <property name="can_focus">False</property>
                             <property name="border_width">12</property>
                             <property name="row_spacing">18</property>
+                            <child>
+                              <object class="GtkGrid">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="row_spacing">6</property>
+                                <child>
+                                  <object class="GtkLabel">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="xalign">0</property>
+                                    <property name="label" translatable="yes">Title</property>
+                                    <attributes>
+                                      <attribute name="weight" value="bold"/>
+                                    </attributes>
+                                  </object>
+                                  <packing>
+                                    <property name="top_attach">0</property>
+                                    <property name="left_attach">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkAlignment">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="left_padding">12</property>
+                                    <child>
+                                      <object class="GtkGrid">
+                                        <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="title-entry-label">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="xalign">0</property>
+                                            <property name="label" translatable="yes">Title:</property>
+                                            <property name="use_underline">True</property>
+                                            <property name="mnemonic_widget">title-entry</property>
+                                          </object>
+                                          <packing>
+                                            <property name="top_attach">0</property>
+                                            <property name="left_attach">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkEntry" id="title-entry">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="hexpand">True</property>
+                                          </object>
+                                          <packing>
+                                            <property name="top_attach">0</property>
+                                            <property name="left_attach">1</property>
+                                          </packing>
+                                        </child>
+                                      </object>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="top_attach">1</property>
+                                    <property name="left_attach">0</property>
+                                    <property name="width">3</property>
+                                  </packing>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="top_attach">0</property>
+                                <property name="left_attach">0</property>
+                              </packing>
+                            </child>
                             <child>
                               <object class="GtkGrid">
                                 <property name="visible">True</property>
diff --git a/src/profile-editor.c b/src/profile-editor.c
index a0081e23..da8a7fdc 100644
--- a/src/profile-editor.c
+++ b/src/profile-editor.c
@@ -1201,6 +1201,11 @@ profile_prefs_load (const char *uuid, GSettings *profile)
                                "active",
                                G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET |
                                G_SETTINGS_BIND_INVERT_BOOLEAN);
+  profile_prefs_settings_bind (profile,
+                               TERMINAL_PROFILE_TITLE_KEY,
+                               gtk_builder_get_object (builder, "title-entry"),
+                               "text",
+                               G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
   profile_prefs_settings_bind (profile, TERMINAL_PROFILE_USE_CUSTOM_COMMAND_KEY,
                                gtk_builder_get_object (builder,
                                                        "use-custom-command-checkbutton"),
diff --git a/src/terminal-schemas.h b/src/terminal-schemas.h
index a386938b..f9222855 100644
--- a/src/terminal-schemas.h
+++ b/src/terminal-schemas.h
@@ -66,6 +66,7 @@ G_BEGIN_DECLS
 #define TERMINAL_PROFILE_SCROLL_ON_KEYSTROKE_KEY        "scroll-on-keystroke"
 #define TERMINAL_PROFILE_SCROLL_ON_OUTPUT_KEY           "scroll-on-output"
 #define TERMINAL_PROFILE_TEXT_BLINK_MODE_KEY            "text-blink-mode"
+#define TERMINAL_PROFILE_TITLE_KEY                      "title"
 #define TERMINAL_PROFILE_USE_CUSTOM_COMMAND_KEY         "use-custom-command"
 #define TERMINAL_PROFILE_USE_SKEY_KEY                   "use-skey"
 #define TERMINAL_PROFILE_USE_SYSTEM_FONT_KEY            "use-system-font"
diff --git a/src/terminal-screen.c b/src/terminal-screen.c
index ba761caf..7babf22b 100644
--- a/src/terminal-screen.c
+++ b/src/terminal-screen.c
@@ -800,11 +800,14 @@ char *
 terminal_screen_get_description (TerminalScreen *screen)
 {
   TerminalScreenPrivate *priv = screen->priv;
+  gs_free char *title_string = NULL;
   const char *title;
 
   /* use --title argument if one was supplied, otherwise ask the profile */
   if (priv->title)
     title = priv->title;
+  else
+    title = title_string = g_settings_get_string (priv->profile, TERMINAL_PROFILE_TITLE_KEY);
 
   return g_strdup_printf ("%s — %d",
                           title && title[0] ? title : _("Terminal"),
@@ -849,6 +852,12 @@ terminal_screen_profile_changed_cb (GSettings     *profile,
       vte_terminal_set_cjk_ambiguous_width (vte_terminal, (int) width);
     }
 
+  if (!prop_name ||
+      prop_name == I_(TERMINAL_PROFILE_TITLE_KEY))
+    {
+      g_object_notify (object, "description");
+    }
+
   if (gtk_widget_get_realized (GTK_WIDGET (screen)) &&
       (!prop_name ||
        prop_name == I_(TERMINAL_PROFILE_USE_SYSTEM_FONT_KEY) ||


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