From a3e0e474e770cb79f0e5e65b8a79bb161a5c635b Mon Sep 17 00:00:00 2001 From: Michael James Gratton Date: Sun, 25 Sep 2016 01:05:29 +1000 Subject: [PATCH] Use GtkApplication built-in for loading app menu. * src/client/application/geary-application.vala (GearyApplication): Set the resource_base_path to comply with the expected modern app id, so the app menu will be automatically loaded. * ui/CMakeLists.txt: Replace app_menu.interface with gtk/menus.ui. Don't try ot copy interface files now that there aren't any. * gtk/menus.ui: Replaces app_menu.interface. --- src/client/application/geary-application.vala | 6 ++- ui/CMakeLists.txt | 4 +- ui/app_menu.interface | 30 --------------- ui/gtk/menus.ui | 38 +++++++++++++++++++ 4 files changed, 44 insertions(+), 34 deletions(-) delete mode 100644 ui/app_menu.interface create mode 100644 ui/gtk/menus.ui diff --git a/src/client/application/geary-application.vala b/src/client/application/geary-application.vala index da5ff3ea..0bc14082 100644 --- a/src/client/application/geary-application.vala +++ b/src/client/application/geary-application.vala @@ -88,8 +88,10 @@ public class GearyApplication : Gtk.Application { private bool is_destroyed = false; public GearyApplication() { - Object(application_id: APP_ID); - + Object( + application_id: APP_ID, + resource_base_path: "/org/gnome/Geary" // XXX remove this when Bug 766196 is fixed + ); _instance = this; } diff --git a/ui/CMakeLists.txt b/ui/CMakeLists.txt index e16c2850..8171ed17 100644 --- a/ui/CMakeLists.txt +++ b/ui/CMakeLists.txt @@ -4,7 +4,6 @@ set(RESOURCE_LIST STRIPBLANKS "account_cannot_remove.glade" STRIPBLANKS "account_list.glade" STRIPBLANKS "account_spinner.glade" - STRIPBLANKS "app_menu.interface" STRIPBLANKS "certificate_warning_dialog.glade" STRIPBLANKS "composer-headerbar.ui" STRIPBLANKS "composer-menus.ui" @@ -12,6 +11,7 @@ set(RESOURCE_LIST STRIPBLANKS "edit_alternate_emails.glade" STRIPBLANKS "find_bar.glade" STRIPBLANKS "folder-popover.ui" + STRIPBLANKS "gtk/menus.ui" STRIPBLANKS "login.glade" STRIPBLANKS "password-dialog.glade" STRIPBLANKS "preferences.glade" @@ -50,7 +50,7 @@ add_custom_target(resource_copy ALL COMMAND cp ${RESOURCES_XML} ${CMAKE_BINARY_DIR}/ui COMMAND - cp ${CMAKE_SOURCE_DIR}/ui/*.glade ${CMAKE_SOURCE_DIR}/ui/*.interface ${CMAKE_SOURCE_DIR}/ui/*.ui ${CMAKE_BINARY_DIR}/ui + cp ${CMAKE_SOURCE_DIR}/ui/*.glade ${CMAKE_SOURCE_DIR}/ui/*.ui ${CMAKE_BINARY_DIR}/ui COMMAND cp ${CMAKE_SOURCE_DIR}/ui/*.css ${CMAKE_BINARY_DIR}/ui ) diff --git a/ui/app_menu.interface b/ui/app_menu.interface deleted file mode 100644 index 9c40ec03..00000000 --- a/ui/app_menu.interface +++ /dev/null @@ -1,30 +0,0 @@ - - -
- - A_ccounts - app.GearyAccounts - - - _Preferences - app.GearyPreferences - -
-
- - _Help - app.GearyHelp - F1 - - - _About - app.GearyAbout - - - _Quit - app.GearyQuit - <Primary>Q - -
-
-
diff --git a/ui/gtk/menus.ui b/ui/gtk/menus.ui new file mode 100644 index 00000000..b1770de1 --- /dev/null +++ b/ui/gtk/menus.ui @@ -0,0 +1,38 @@ + + + + +
+ + Compose Message + app.compose + +
+
+ + A_ccounts + app.accounts + + + _Preferences + app.preferences + +
+
+ + _Help + app.help + F1 + + + _About + app.about + + + _Quit + app.quit + <Primary>Q + +
+
+