summaryrefslogtreecommitdiff
path: root/libnautilus-extension/nautilus-menu-provider.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2006-06-16 15:40:18 +0000
committerAlexander Larsson <alexl@src.gnome.org>2006-06-16 15:40:18 +0000
commit1a7f1da177985095aa6c9b8000e24ab06e76aace (patch)
tree11c03c01e3b630281f06ae990c286db358de506f /libnautilus-extension/nautilus-menu-provider.c
parent2f6ea5757cd326d1e898332cf40c87c2906a2a0a (diff)
downloadnautilus-1a7f1da177985095aa6c9b8000e24ab06e76aace.tar.gz
Add items_updated signal
2006-06-16 Alexander Larsson <alexl@redhat.com> * libnautilus-extension/nautilus-menu-provider.[ch]: Add items_updated signal * libnautilus-private/Makefile.am: * libnautilus-private/nautilus-signaller.[ch]: * src/nautilus-signaller.[ch]: * src/Makefile.am: Move NautilusSignaller to libnautilus-private. Add popup_menu_changed signal. * src/nautilus-application.c: Signal popup_menu_changed when a menu provider emits items_updated. * src/file-manager/fm-directory-view.c: * src/nautilus-window.c: Handle popup_menu_changed. * src/nautilus-emblem-sidebar.c: * src/nautilus-history-sidebar.c: * src/nautilus-navigation-window-menus.c: * src/nautilus-navigation-window.c: * src/nautilus-property-browser.c: * src/nautilus-spatial-window.c: * src/nautilus-window-menus.c: Update includes. Patch from RUAUDEL Frédéric <ruaudel@embl.fr>
Diffstat (limited to 'libnautilus-extension/nautilus-menu-provider.c')
-rw-r--r--libnautilus-extension/nautilus-menu-provider.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/libnautilus-extension/nautilus-menu-provider.c b/libnautilus-extension/nautilus-menu-provider.c
index 956c5ec0e..b3929f04e 100644
--- a/libnautilus-extension/nautilus-menu-provider.c
+++ b/libnautilus-extension/nautilus-menu-provider.c
@@ -31,6 +31,20 @@
static void
nautilus_menu_provider_base_init (gpointer g_class)
{
+ static gboolean initialized = FALSE;
+
+ if (!initialized)
+ {
+ /* This signal should be emited each time the extension modify the list of menu items */
+ g_signal_new ("items_updated",
+ NAUTILUS_TYPE_MENU_PROVIDER,
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+ initialized = TRUE;
+ }
}
GType
@@ -107,4 +121,12 @@ nautilus_menu_provider_get_toolbar_items (NautilusMenuProvider *provider,
}
}
+/* This function emit a signal to inform nautilus that its item list has changed */
+void
+nautilus_menu_provider_emit_items_updated_signal (NautilusMenuProvider* provider)
+{
+ g_return_if_fail (NAUTILUS_IS_MENU_PROVIDER (provider));
+
+ g_signal_emit_by_name (provider, "items_updated");
+}