GNOME Bugzilla – Bug 757946
Let GtkApplication load the appmenu
Last modified: 2015-11-23 11:03:29 UTC
.
Created attachment 315264 [details] [review] application: let GtkApplication load the appmenu Since bgo#757826 introduced g_application_set_resource_base_path, we don't need to use a GtkBuilder to load the appmenu. GtkApplication automatically loads menus from the GtkBuilder resource located at "gtk/menus.ui", relative to the application's resource base path (see g_application_set_resource_base_path ()). The menu with the ID "app-menu" is taken as the application's app menu.
Thanks for the patch Felipe! However, we didn't do it in the past because of consistency. As you can see all of the ui files are in src. Then we have the /gtk directory for copy pasted files from gtk (which is not the case of the menus.ui). So basically what I wanted for some time is a hierarchy like gedit. That means, a resources directory where you will have a /gtk subdirectory for the menus, shortcuts window, etc. And then in src you will still have the /gtk subdirectory for copy pasted files from gtk+. As it is now, I prefer to keep the consistency rather than making the hierarchy more confusing. So I would like to accept the patch when the transition to /resources is done.
Created attachment 315272 [details] [review] application: let GtkApplication load the appmenu Since bgo#757826 introduced g_application_set_resource_base_path, we don't need to use a GtkBuilder to load the appmenu. GtkApplication automatically loads menus from the GtkBuilder resource located at "gtk/menus.ui", relative to the application's resource base path (see g_application_set_resource_base_path ()). The menu with the ID "app-menu" is taken as the application's app menu.
Created attachment 315273 [details] [review] application: let GtkApplication load the appmenu Since bgo#757826 introduced g_application_set_resource_base_path, we don't need to use a GtkBuilder to load the appmenu. GtkApplication automatically loads menus from the GtkBuilder resource located at "gtk/menus.ui", relative to the application's resource base path (see g_application_set_resource_base_path ()). The menu with the ID "app-menu" is taken as the application's app menu.
Created attachment 316083 [details] [review] application: let GtkApplication load the appmenu Since bgo#757826 introduced g_application_set_resource_base_path, we don't need to use a GtkBuilder to load the appmenu. GtkApplication automatically loads menus from the GtkBuilder resource located at "gtk/menus.ui", relative to the application's resource base path (see g_application_set_resource_base_path ()). The menu with the ID "app-menu" is taken as the application's app menu.
Review of attachment 316083 [details] [review]: LGTM thanks!