From 0c094d660769a00564ef33a775a387f62cf2ff41 Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Mon, 19 Dec 2011 10:47:28 -0500 Subject: [PATCH] Drop the GApplication menu test --- gio/tests/Makefile.am | 4 -- gio/tests/gapplication-example-menu.c | 87 ----------------------------------- 2 files changed, 91 deletions(-) delete mode 100644 gio/tests/gapplication-example-menu.c diff --git a/gio/tests/Makefile.am b/gio/tests/Makefile.am index 3d87981..7c7bded 100644 --- a/gio/tests/Makefile.am +++ b/gio/tests/Makefile.am @@ -111,7 +111,6 @@ SAMPLE_PROGS = \ gapplication-example-cmdline2 \ gapplication-example-cmdline3 \ gapplication-example-actions \ - gapplication-example-menu \ $(NULL) @@ -428,9 +427,6 @@ gapplication_example_cmdline3_LDADD = $(progs_ldadd) gapplication_example_actions_SOURCES = gapplication-example-actions.c gapplication_example_actions_LDADD = $(progs_ldadd) -gapplication_example_menu_SOURCES = gapplication-example-menu.c -gapplication_example_menu_LDADD = $(progs_ldadd) - gmenumodel_LDADD = $(progs_ldadd) schema_tests = \ diff --git a/gio/tests/gapplication-example-menu.c b/gio/tests/gapplication-example-menu.c deleted file mode 100644 index 29cab05..0000000 --- a/gio/tests/gapplication-example-menu.c +++ /dev/null @@ -1,87 +0,0 @@ -#include -#include -#include - -static void -activate (GApplication *application) -{ - g_application_hold (application); - g_print ("activated\n"); - g_application_release (application); -} - -static void -show_help (GSimpleAction *action, - GVariant *parameter, - gpointer data) -{ - g_print ("Want help, eh ?!\n"); -} - -static void -show_about (GSimpleAction *action, - GVariant *parameter, - gpointer user_data) -{ - g_print ("Not much to say, really.\nJust a stupid example\n"); -} - -static void -quit_app (GSimpleAction *action, - GVariant *parameter, - gpointer user_data) -{ - g_print ("Quitting...\n"); - g_application_release (g_application_get_default ()); -} - -static GActionEntry entries[] = { - { "help", show_help, NULL, NULL, NULL }, - { "about", show_about, NULL, NULL, NULL }, - { "quit", quit_app, NULL, NULL, NULL } -}; - -static void -add_actions (GApplication *app) -{ - g_action_map_add_action_entries (G_ACTION_MAP (app), - entries, G_N_ELEMENTS (entries), - NULL); -} - -static void -add_menu (GApplication *app) -{ - GMenu *menu; - - menu = g_menu_new (); - - g_menu_append (menu, "Help", "help"); - g_menu_append (menu, "About Example", "about"); - g_menu_append (menu, "Quit", "quit"); - - g_application_set_app_menu (app, G_MENU_MODEL (menu)); - - g_object_unref (menu); -} - -int -main (int argc, char **argv) -{ - GApplication *app; - int status; - - app = g_application_new ("org.gtk.TestApplication", 0); - g_signal_connect (app, "activate", G_CALLBACK (activate), NULL); - - add_actions (app); - add_menu (app); - - g_application_hold (app); - - status = g_application_run (app, argc, argv); - - g_object_unref (app); - - return status; -} -- 2.7.4