[simple-scan] Set HeaderBar title in .vala file since Glade drops the translatable flags



commit f26b7487ee5a7a2d91c18ad3c54ede3b59f9c035
Author: Robert Ancell <robert ancell canonical com>
Date:   Sat May 20 14:30:18 2017 +1200

    Set HeaderBar title in .vala file since Glade drops the translatable flags

 src/app-window.ui   |    5 ++---
 src/app-window.vala |    8 ++++++++
 2 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/src/app-window.ui b/src/app-window.ui
index 4154251..02f0b10 100644
--- a/src/app-window.ui
+++ b/src/app-window.ui
@@ -265,8 +265,8 @@
                         <property name="use_underline">True</property>
                         <property name="use_stock">True</property>
                         <signal name="activate" handler="quit_menuitem_activate_cb" swapped="no"/>
-                        <accelerator key="q" signal="activate" modifiers="GDK_CONTROL_MASK"/>
                         <accelerator key="w" signal="activate" modifiers="GDK_CONTROL_MASK"/>
+                        <accelerator key="q" signal="activate" modifiers="GDK_CONTROL_MASK"/>
                       </object>
                     </child>
                   </object>
@@ -590,11 +590,10 @@
       </object>
     </child>
     <child type="titlebar">
-      <object class="GtkHeaderBar" id="headerbar">
+      <object class="GtkHeaderBar" id="header_bar">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="vexpand">True</property>
-        <property name="title" translatable="yes" comments="Title of scan window">Simple Scan</property>
         <property name="show_close_button">True</property>
         <child>
           <object class="GtkBox" id="open_box">
diff --git a/src/app-window.vala b/src/app-window.vala
index 2b16b67..9d9d43a 100644
--- a/src/app-window.vala
+++ b/src/app-window.vala
@@ -34,6 +34,8 @@ public class AppWindow : Gtk.ApplicationWindow
     private PreferencesDialog preferences_dialog;
 
     [GtkChild]
+    private Gtk.HeaderBar header_bar;
+    [GtkChild]
     private Gtk.MenuBar menubar;
     [GtkChild]
     private Gtk.Toolbar toolbar;
@@ -1633,6 +1635,11 @@ public class AppWindow : Gtk.ApplicationWindow
         }
         else
         {
+            /* Set HeaderBar title here because Glade doesn't keep it translated */
+            /* https://bugzilla.gnome.org/show_bug.cgi?id=782753 */
+            /* Title of scan window */
+            header_bar.title = _("Simple Scan");
+
             app.add_action_entries (action_entries, this);
 
             var appmenu = new Menu ();
@@ -1693,6 +1700,7 @@ public class AppWindow : Gtk.ApplicationWindow
                                                        _("_Install Drivers"), 2) as Gtk.Button;
 
         /* Populate ActionBar (not supported in Glade) */
+        /* https://bugzilla.gnome.org/show_bug.cgi?id=769966 */
         var button = new Gtk.Button.with_label (/* Label on new document button */
                                                _("Start Again…"));
         button.visible = true;


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