[evolution] Remove App menu
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Remove App menu
- Date: Mon, 10 Feb 2020 15:23:15 +0000 (UTC)
commit aaf9798e60f5e8db7ce23cff6d60edbc3421d374
Author: Milan Crha <mcrha redhat com>
Date: Mon Feb 10 16:23:57 2020 +0100
Remove App menu
Related to https://gitlab.gnome.org/GNOME/Initiatives/issues/4
src/shell/e-shell.c | 68 -----------------------------------------------------
1 file changed, 68 deletions(-)
---
diff --git a/src/shell/e-shell.c b/src/shell/e-shell.c
index b384ed5067..d1c4f93560 100644
--- a/src/shell/e-shell.c
+++ b/src/shell/e-shell.c
@@ -1418,71 +1418,6 @@ shell_get_dialog_parent_cb (ECredentialsPrompter *prompter,
return NULL;
}
-static void
-shell_app_menu_activate_cb (GSimpleAction *action,
- GVariant *parameter,
- gpointer user_data)
-{
- EShell *shell = user_data;
- const gchar *name;
-
- g_return_if_fail (G_IS_ACTION (action));
- g_return_if_fail (E_IS_SHELL (shell));
-
- name = g_action_get_name (G_ACTION (action));
- g_return_if_fail (name != NULL);
-
- if (g_str_equal (name, "new-window")) {
- shell_action_new_window_cb (action, parameter, shell);
- } else if (g_str_equal (name, "preferences")) {
- e_shell_utils_run_preferences (shell);
- } else if (g_str_equal (name, "help")) {
- e_shell_utils_run_help_contents (shell);
- } else if (g_str_equal (name, "about")) {
- e_shell_utils_run_help_about (shell);
- } else {
- g_warning ("%s: Unknown app-menu action '%s'", G_STRFUNC, name);
- }
-}
-
-static void
-shell_create_app_menu (GtkApplication *application)
-{
- const GActionEntry actions[] = {
- { "new-window", shell_app_menu_activate_cb, NULL, NULL, NULL },
- { "preferences", shell_app_menu_activate_cb, NULL, NULL, NULL },
- { "help", shell_app_menu_activate_cb, NULL, NULL, NULL },
- { "about", shell_app_menu_activate_cb, NULL, NULL, NULL }
- };
- GMenu *app_menu, *section;
-
- g_return_if_fail (GTK_IS_APPLICATION (application));
-
- app_menu = g_menu_new ();
-
- section = g_menu_new ();
- g_menu_append (section, _("New _Window"), "app.new-window");
- g_menu_append_section (app_menu, NULL, G_MENU_MODEL (section));
- g_object_unref (section);
-
- section = g_menu_new ();
- g_menu_append (section, _("_Preferences"), "app.preferences");
- g_menu_append_section (app_menu, NULL, G_MENU_MODEL (section));
- g_object_unref (section);
-
- section = g_menu_new ();
- g_menu_append (section, _("_Help"), "app.help");
- g_menu_append (section, _("_About"), "app.about");
- g_menu_append (section, _("_Quit"), "app.quit");
- g_menu_append_section (app_menu, NULL, G_MENU_MODEL (section));
- g_object_unref (section);
-
- gtk_application_set_app_menu (application, G_MENU_MODEL (app_menu));
- g_action_map_add_action_entries (G_ACTION_MAP (application), actions, G_N_ELEMENTS (actions),
application);
-
- g_object_unref (app_menu);
-}
-
static void
shell_sm_quit_cb (EShell *shell,
gpointer user_data)
@@ -1762,9 +1697,6 @@ shell_startup (GApplication *application)
/* Chain up to parent's startup() method. */
G_APPLICATION_CLASS (e_shell_parent_class)->startup (application);
-
- if (e_util_is_running_gnome ())
- shell_create_app_menu (GTK_APPLICATION (application));
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]