[balsa/gtk3] Use installed main-window.ui



commit 7f4be38eef25fb3946bfaf056d1b6eb9e2395c83
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Mon Jul 22 22:18:13 2013 -0400

    Use installed main-window.ui
    
        * src/main-window.c (bw_set_menus): use installed ui file.
        * ui/Makefile.am: install it.
        * ui/main-window.ui: new file.

 ChangeLog         |    6 ++++++
 src/main-window.c |    5 ++++-
 ui/Makefile.am    |    2 +-
 3 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 8e61c0f..707cc69 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2013-07-22  Peter Bloomfield
 
+       * src/main-window.c (bw_set_menus): use installed ui file.
+       * ui/Makefile.am: install it.
+       * ui/main-window.ui: new file.
+
+2013-07-22  Peter Bloomfield
+
        Move GAction-toggled callback to application-helpers
 
        * libbalsa/application-helpers.c (libbalsa_window_get_menu_bar),
diff --git a/src/main-window.c b/src/main-window.c
index 7393640..309302d 100644
--- a/src/main-window.c
+++ b/src/main-window.c
@@ -2021,7 +2021,7 @@ bw_set_menus(BalsaWindow * window)
         {"store-address",         store_address_activated}
     };
     GtkBuilder *builder;
-    static const gchar ui_file[] = "main-window.ui";
+    gchar *ui_file;
     GError *err = NULL;
 
     g_action_map_add_action_entries(G_ACTION_MAP(balsa_app.application),
@@ -2033,6 +2033,8 @@ bw_set_menus(BalsaWindow * window)
                                     window);
 
     builder = gtk_builder_new();
+    ui_file = g_build_filename(BALSA_DATA_PREFIX, "ui", "main-window.ui",
+                               NULL);
     if (gtk_builder_add_from_file(builder, ui_file, &err)) {
         gtk_application_set_app_menu(balsa_app.application,
                                      G_MENU_MODEL(gtk_builder_get_object
@@ -2047,6 +2049,7 @@ bw_set_menus(BalsaWindow * window)
                           err->message);
         g_error_free(err);
     }
+    g_free(ui_file);
     g_object_unref(builder);
 }
 
diff --git a/ui/Makefile.am b/ui/Makefile.am
index a8aaf87..82c2823 100644
--- a/ui/Makefile.am
+++ b/ui/Makefile.am
@@ -1,4 +1,4 @@
-balsa_ui_FILES = source-viewer.ui
+balsa_ui_FILES = source-viewer.ui main-window.ui
 
 EXTRA_DIST = $(balsa_ui_FILES)
 


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