[easytag/wip/application-window: 5/6] Add toolbar for new GAction-using toolbar buttons



commit db1cf34bec32e215f09e4e60c666f22c19e5182f
Author: David King <amigadave amigadave com>
Date:   Sun Jul 13 09:40:47 2014 +0100

    Add toolbar for new GAction-using toolbar buttons

 data/org.gnome.EasyTAG.gresource.xml |    1 +
 data/toolbar.ui                      |   23 +++++++++++++++++++++++
 po/POTFILES.in                       |    1 +
 src/application_window.c             |   19 +++++++++++++++++++
 4 files changed, 44 insertions(+), 0 deletions(-)
---
diff --git a/data/org.gnome.EasyTAG.gresource.xml b/data/org.gnome.EasyTAG.gresource.xml
index b475283..f9a0494 100644
--- a/data/org.gnome.EasyTAG.gresource.xml
+++ b/data/org.gnome.EasyTAG.gresource.xml
@@ -2,5 +2,6 @@
 <gresources>
     <gresource prefix='/org/gnome/EasyTAG'>
         <file preprocess='xml-stripblanks'>menus.ui</file>
+        <file preprocess='xml-stripblanks'>toolbar.ui</file>
     </gresource>
 </gresources>
diff --git a/data/toolbar.ui b/data/toolbar.ui
new file mode 100644
index 0000000..1940d96
--- /dev/null
+++ b/data/toolbar.ui
@@ -0,0 +1,23 @@
+<interface domain="easytag">
+    <object class="GtkToolbar" id="main_toolbar">
+        <property name="visible">True</property>
+        <child>
+            <object class="GtkToolButton" id="cddb_button">
+                <property name="action-name">win.show-cddb</property>
+                <property name="icon-name">media-optical</property>
+                <property name="label" translatable="yes">CDDB Search…</property>
+                <property name="tooltip-text" translatable="yes">CDDB Search</property>
+                <property name="visible">True</property>
+            </object>
+        </child>
+        <child>
+            <object class="GtkToolButton" id="playlist_button">
+                <property name="action-name">win.show-playlist</property>
+                <property name="icon-name">document-save-as</property>
+                <property name="label" translatable="yes">Generate Playlist…</property>
+                <property name="tooltip-text" translatable="yes">Generate a playlist</property>
+                <property name="visible">True</property>
+            </object>
+        </child>
+    </object>
+</interface>
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 4c642a1..b2e644b 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,6 +1,7 @@
 data/easytag.appdata.xml.in
 data/easytag.desktop.in
 [type: gettext/glade]data/menus.ui
+[type: gettext/glade]data/toolbar.ui
 data/org.gnome.EasyTAG.gschema.xml
 nautilus-extension/nautilus-easytag.c
 src/about.c
diff --git a/src/application_window.c b/src/application_window.c
index edb665f..e66186e 100644
--- a/src/application_window.c
+++ b/src/application_window.c
@@ -1940,10 +1940,29 @@ et_application_window_init (EtApplicationWindow *self)
     {
         GtkWidget *menu_area;
         GtkWidget *tool_area;
+        GtkBuilder *builder;
+        GError *error = NULL;
+        GtkWidget *toolbar;
 
         Create_UI (window, &menu_area, &tool_area);
         gtk_box_pack_start (GTK_BOX (main_vbox), menu_area, FALSE, FALSE, 0);
         gtk_box_pack_start (GTK_BOX (main_vbox), tool_area, FALSE, FALSE, 0);
+
+        builder = gtk_builder_new ();
+        gtk_builder_add_from_resource (builder,
+                                       "/org/gnome/EasyTAG/toolbar.ui",
+                                       &error);
+
+        if (error != NULL)
+        {
+            g_error ("Unable to get toolbar from resource: %s",
+                     error->message);
+        }
+
+        toolbar = GTK_WIDGET (gtk_builder_get_object (builder, "main_toolbar"));
+        gtk_box_pack_start (GTK_BOX (main_vbox), toolbar, FALSE, FALSE, 0);
+
+        g_object_unref (builder);
     }
 
     /* The two panes: BrowserArea on the left, FileArea+TagArea on the right */


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