From b31a310d7d9785d48d9d7711d8bf197e04a80f9d Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 9 Jul 2014 10:13:38 -0400 Subject: [PATCH] widget-factory: Use the new application resource support --- demos/widget-factory/Makefile.am | 1 + demos/widget-factory/menus.ui | 19 +++++++++++++++++++ demos/widget-factory/widget-factory.c | 17 ----------------- .../widget-factory.gresource.xml | 3 +++ demos/widget-factory/widget-factory.ui | 15 --------------- 5 files changed, 23 insertions(+), 32 deletions(-) create mode 100644 demos/widget-factory/menus.ui diff --git a/demos/widget-factory/Makefile.am b/demos/widget-factory/Makefile.am index 67f170dcf4..ff72599c6d 100644 --- a/demos/widget-factory/Makefile.am +++ b/demos/widget-factory/Makefile.am @@ -60,6 +60,7 @@ uninstall-update-icon-cache: EXTRA_DIST += \ widget-factory.ui \ + menus.ui \ widget-factory.gresource.xml -include $(top_srcdir)/git.mk diff --git a/demos/widget-factory/menus.ui b/demos/widget-factory/menus.ui new file mode 100644 index 0000000000..d3eb8551d1 --- /dev/null +++ b/demos/widget-factory/menus.ui @@ -0,0 +1,19 @@ + + + + +
+ + About + app.about + +
+
+ + _Quit + app.quit + <Primary>q + +
+
+
diff --git a/demos/widget-factory/widget-factory.c b/demos/widget-factory/widget-factory.c index 820c49ee75..07e1ce9d18 100644 --- a/demos/widget-factory/widget-factory.c +++ b/demos/widget-factory/widget-factory.c @@ -230,22 +230,6 @@ on_entry_icon_release (GtkEntry *entry, } -static void -startup (GApplication *app) -{ - GtkBuilder *builder; - GMenuModel *appmenu; - - builder = gtk_builder_new (); - gtk_builder_add_from_resource (builder, "/ui/widget-factory.ui", NULL); - - appmenu = (GMenuModel *)gtk_builder_get_object (builder, "appmenu"); - - gtk_application_set_app_menu (GTK_APPLICATION (app), appmenu); - - g_object_unref (builder); -} - static void update_header (GtkListBoxRow *row, GtkListBoxRow *before, @@ -437,7 +421,6 @@ main (int argc, char *argv[]) app_entries, G_N_ELEMENTS (app_entries), app); - g_signal_connect (app, "startup", G_CALLBACK (startup), NULL); g_signal_connect (app, "activate", G_CALLBACK (activate), NULL); status = g_application_run (G_APPLICATION (app), argc, argv); diff --git a/demos/widget-factory/widget-factory.gresource.xml b/demos/widget-factory/widget-factory.gresource.xml index ec660fff81..7569da3440 100644 --- a/demos/widget-factory/widget-factory.gresource.xml +++ b/demos/widget-factory/widget-factory.gresource.xml @@ -3,4 +3,7 @@ widget-factory.ui + + menus.ui + diff --git a/demos/widget-factory/widget-factory.ui b/demos/widget-factory/widget-factory.ui index fe29337b5d..3cca886ede 100644 --- a/demos/widget-factory/widget-factory.ui +++ b/demos/widget-factory/widget-factory.ui @@ -1,21 +1,6 @@ - -
- - About - app.about - -
-
- - _Quit - app.quit - <Primary>q - -
-