[nautilus-python] Added support for the NautilusMenuProvider.emit_items_updated_signal along with some documentation
- From: Adam Plumb <adamplumb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus-python] Added support for the NautilusMenuProvider.emit_items_updated_signal along with some documentation
- Date: Wed, 19 May 2010 19:43:38 +0000 (UTC)
commit 861214d87e5affe189cd6fd2195a629401d530b7
Author: Adam Plumb <adamplumb gmail com>
Date: Wed May 19 15:43:29 2010 -0400
Added support for the NautilusMenuProvider.emit_items_updated_signal along with some documentation
examples/documentation.py | 12 ++++++++++--
src/nautilus.override | 22 +++++++++++++++++++++-
2 files changed, 31 insertions(+), 3 deletions(-)
---
diff --git a/examples/documentation.py b/examples/documentation.py
index 4c28ed9..0ce6401 100644
--- a/examples/documentation.py
+++ b/examples/documentation.py
@@ -24,12 +24,12 @@ class MenuProvider:
will be called by Nautilus to provide a list of nautilus.MenuItems.
Signals:
- items_updated: Emitting this signal will cause Nautilus to refresh the
+ items-updated: Emitting this signal will cause Nautilus to refresh the
menu items returned by a ***_full call. The ***_full methods were
created with the extra provider parameter, which is required to
emit the items_updated signal. You can emit the signal like so:
- provider.emit("items_updated")
+ provider.emit("items-updated")
"""
def get_file_items(self, window, files):
@@ -98,6 +98,14 @@ class MenuProvider:
@rtype a sequence of nautilus.MenuItems
"""
+ def emit_items_updated_signal(provider):
+ """
+ @param provider a NautilusMenuProvider object
+ @type provider nautilus.MenuProvider
+
+ Emits the items-updated signal
+ """
+
class PropertyPageProvider:
def get_property_pages(self, files):
"""
diff --git a/src/nautilus.override b/src/nautilus.override
index 98abaef..2ff31fc 100644
--- a/src/nautilus.override
+++ b/src/nautilus.override
@@ -103,7 +103,8 @@ _wrap_nautilus_info_provider_update_complete_invoke(PyGObject *self, PyObject *a
&PyNautilusInfoProvider_Type, &py_provider,
&py_handle, &py_closure, &py_result))
{
- return NULL;
+ Py_INCREF(Py_None);
+ return Py_None;
}
closure = pyg_boxed_get(py_closure, GClosure);
@@ -117,3 +118,22 @@ _wrap_nautilus_info_provider_update_complete_invoke(PyGObject *self, PyObject *a
Py_INCREF(Py_None);
return Py_None;
}
+%%
+define NautilusMenuProvider.emit_items_updated_signal args
+static PyObject *
+_wrap_nautilus_menu_provider_emit_items_updated_signal(PyGObject *self, PyObject *args)
+{
+ PyGObject *py_provider;
+
+ if (!PyArg_ParseTuple(args, "O!:NautilusMenuProvider.emit_items_updated_signal",
+ &PyNautilusMenuProvider_Type, &py_provider))
+ {
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+
+ nautilus_menu_provider_emit_items_updated_signal(NAUTILUS_MENU_PROVIDER(py_provider->obj));
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]