[bijiben/wip/sadiq/modernize] app-menu: Simplify setting Application menu



commit ffd20163ff60508b2a399e2fc9b75201a5dbeb50
Author: Mohammed Sadiq <sadiq sadiqpk org>
Date:   Wed Oct 25 18:00:51 2017 +0530

    app-menu: Simplify setting Application menu
    
    gtk_application() looks for "gtk/menus.ui" and set it as app-menu
    if has a menu with id "app-menu". So no need to manually take
    care of those

 src/bjb-app-menu.c    |    9 ---------
 src/bjb.gresource.xml |    2 +-
 2 files changed, 1 insertions(+), 10 deletions(-)
---
diff --git a/src/bjb-app-menu.c b/src/bjb-app-menu.c
index f1877a9..dff6324 100644
--- a/src/bjb-app-menu.c
+++ b/src/bjb-app-menu.c
@@ -163,17 +163,8 @@ static GActionEntry app_entries[] = {
 
 void bjb_app_menu_set(GApplication *application)
 {
-  GtkBuilder *builder;
-
   g_action_map_add_action_entries (G_ACTION_MAP (application),
                                    app_entries,
                                    G_N_ELEMENTS (app_entries),
                                    application);
-
-  builder = gtk_builder_new ();
-  gtk_builder_add_from_resource (builder, "/org/gnome/bijiben/app-menu.ui", NULL);
-
-  gtk_application_set_app_menu (GTK_APPLICATION (application),
-                                G_MENU_MODEL (gtk_builder_get_object (builder, "app-menu")));
-  g_object_unref (builder);
 }
diff --git a/src/bjb.gresource.xml b/src/bjb.gresource.xml
index a3f5149..96bed3e 100644
--- a/src/bjb.gresource.xml
+++ b/src/bjb.gresource.xml
@@ -2,7 +2,7 @@
 <gresources>
   <gresource prefix="/org/gnome/bijiben">
     <file alias="Adwaita.css">resources/Adwaita.css</file>
-    <file alias="app-menu.ui">resources/app-menu.ui</file>
+    <file alias="gtk/menus.ui">resources/app-menu.ui</file>
     <file alias="editor-toolbar.ui" compressed="true" 
preprocess="xml-stripblanks">resources/editor-toolbar.ui</file>
     <file alias="thumbnail-frame.png">resources/thumbnail-frame.png</file>
     <file alias="note-symbolic.svg">resources/note-symbolic.svg</file>


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