[nautilus-python/wip/jtojnar/nautilus-4: 15/17] Port to libnautilus-extension-4




commit fac72de53ba7a102b22b64976bc49f68c97c23f7
Author: Jan Tojnar <jtojnar gmail com>
Date:   Wed Aug 10 21:31:32 2022 +0200

    Port to libnautilus-extension-4
    
    Mostly removed GTK-based API:
    https://gitlab.gnome.org/GNOME/nautilus/-/merge_requests/927

 README.md                                          |   2 +-
 docs/reference/nautilus-python-class-reference.xml |   1 -
 .../nautilus-python-location-widget-provider.xml   |  89 -------------
 docs/reference/nautilus-python-menu-provider.xml   |  24 ----
 docs/reference/nautilus-python-overview.xml        |   4 +-
 .../nautilus-python-property-page-provider.xml     |  84 -------------
 docs/reference/nautilus-python-property-page.xml   | 138 ---------------------
 .../nautilus-python-provider-reference.xml         |   2 -
 examples/TestExtension.py                          |   4 +-
 examples/background-image.py                       |   4 +-
 examples/location-widget-provider.py               |   9 --
 examples/md5sum-property-page.py                   |  47 -------
 examples/meson.build                               |   2 -
 examples/open-terminal.py                          |   4 +-
 examples/submenu.py                                |   4 +-
 meson.build                                        |   2 +-
 src/nautilus-python-object.c                       | 118 +-----------------
 src/nautilus-python.c                              |  17 +--
 src/nautilus-python.h                              |  12 --
 19 files changed, 14 insertions(+), 553 deletions(-)
---
diff --git a/README.md b/README.md
index 4be4c6f..a548538 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@ For examples and documentation check the `examples/` subdirectory.
 
 ## Requirements
 
-- Nautilus ≥ 3.27.90
+- Nautilus ≥ 43.beta
 - Python 3.x
 - PyGObject 3
 
diff --git a/docs/reference/nautilus-python-class-reference.xml 
b/docs/reference/nautilus-python-class-reference.xml
index 5117239..bc4a751 100644
--- a/docs/reference/nautilus-python-class-reference.xml
+++ b/docs/reference/nautilus-python-class-reference.xml
@@ -9,6 +9,5 @@
     <xi:include href="nautilus-python-file-info.xml"/>
     <xi:include href="nautilus-python-menu.xml"/>
     <xi:include href="nautilus-python-menu-item.xml"/>
-    <xi:include href="nautilus-python-property-page.xml"/>
 </chapter>
 
diff --git a/docs/reference/nautilus-python-menu-provider.xml 
b/docs/reference/nautilus-python-menu-provider.xml
index 97e8e08..5e0542e 100644
--- a/docs/reference/nautilus-python-menu-provider.xml
+++ b/docs/reference/nautilus-python-menu-provider.xml
@@ -23,27 +23,23 @@
 
       <methodsynopsis language="python">
         <methodname><link 
linkend="method-nautilus-python-menu-provider--get-file-items">get_file_items</link></methodname>
-        <methodparam><parameter role="keyword">window</parameter></methodparam>
         <methodparam><parameter role="keyword">files</parameter></methodparam>
       </methodsynopsis>
 
       <methodsynopsis language="python">
         <methodname><link 
linkend="method-nautilus-python-menu-provider--get-file-items-full">get_file_items_full</link></methodname>
         <methodparam><parameter role="keyword">provider</parameter></methodparam>
-        <methodparam><parameter role="keyword">window</parameter></methodparam>
         <methodparam><parameter role="keyword">files</parameter></methodparam>
       </methodsynopsis>
 
       <methodsynopsis language="python">
         <methodname><link 
linkend="method-nautilus-python-menu-provider--get-background-items">get_background_items</link></methodname>
-        <methodparam><parameter role="keyword">window</parameter></methodparam>
         <methodparam><parameter role="keyword">folder</parameter></methodparam>
       </methodsynopsis>
 
       <methodsynopsis language="python">
         <methodname><link 
linkend="method-nautilus-python-menu-provider--get-background-items-full">get_background_items_full</link></methodname>
         <methodparam><parameter role="keyword">provider</parameter></methodparam>
-        <methodparam><parameter role="keyword">window</parameter></methodparam>
         <methodparam><parameter role="keyword">folder</parameter></methodparam>
       </methodsynopsis>
 
@@ -109,15 +105,10 @@
 
           <programlisting><methodsynopsis language="python">
             <methodname>get_file_items</methodname>
-            <methodparam><parameter role="keyword">window</parameter></methodparam>
             <methodparam><parameter role="keyword">files</parameter></methodparam>
           </methodsynopsis></programlisting>
 
           <variablelist>
-            <varlistentry>
-                <term><parameter role="keyword">window</parameter>&nbsp;:</term>
-                <listitem><simpara>the current <link 
linkend="class-gtkwindow"><classname>gtk.Window</classname></link> instance</simpara></listitem>
-            </varlistentry>
             <varlistentry>
                 <term><parameter role="keyword">menu</parameter>&nbsp;:</term>
                 <listitem><simpara>a list of <link 
linkend="class-nautilus-python-file-info"><classname>Nautilus.FileInfo</classname></link> 
objects.</simpara></listitem>
@@ -140,7 +131,6 @@
           <programlisting><methodsynopsis language="python">
             <methodname>get_file_items_full</methodname>
             <methodparam><parameter role="keyword">provider</parameter></methodparam>
-            <methodparam><parameter role="keyword">window</parameter></methodparam>
             <methodparam><parameter role="keyword">files</parameter></methodparam>
           </methodsynopsis></programlisting>
 
@@ -149,10 +139,6 @@
                 <term><parameter role="keyword">provider</parameter>&nbsp;:</term>
                 <listitem><simpara>the current <link 
linkend="class-nautilus-python-menu-provider"><classname>Nautilus.MenuProvider</classname></link> 
instance</simpara></listitem>
             </varlistentry>
-            <varlistentry>
-                <term><parameter role="keyword">window</parameter>&nbsp;:</term>
-                <listitem><simpara>the current <link 
linkend="class-gtkwindow"><classname>gtk.Window</classname></link> instance</simpara></listitem>
-            </varlistentry>
             <varlistentry>
                 <term><parameter role="keyword">files</parameter>&nbsp;:</term>
                 <listitem><simpara>a list of <link 
linkend="class-nautilus-python-file-info"><classname>Nautilus.FileInfo</classname></link> 
objects.</simpara></listitem>
@@ -183,15 +169,10 @@
 
           <programlisting><methodsynopsis language="python">
             <methodname>get_background_items</methodname>
-            <methodparam><parameter role="keyword">window</parameter></methodparam>
             <methodparam><parameter role="keyword">folder</parameter></methodparam>
           </methodsynopsis></programlisting>
 
           <variablelist>
-            <varlistentry>
-                <term><parameter role="keyword">window</parameter>&nbsp;:</term>
-                <listitem><simpara>the current <link 
linkend="class-gtkwindow"><classname>gtk.Window</classname></link> instance</simpara></listitem>
-            </varlistentry>
             <varlistentry>
                 <term><parameter role="keyword">folder</parameter>&nbsp;:</term>
                 <listitem><simpara>the current folder, as a <link 
linkend="class-nautilus-python-file-info"><classname>Nautilus.FileInfo</classname></link> 
object.</simpara></listitem>
@@ -214,7 +195,6 @@
           <programlisting><methodsynopsis language="python">
             <methodname>get_background_items_full</methodname>
             <methodparam><parameter role="keyword">provider</parameter></methodparam>
-            <methodparam><parameter role="keyword">window</parameter></methodparam>
             <methodparam><parameter role="keyword">folder</parameter></methodparam>
           </methodsynopsis></programlisting>
 
@@ -223,10 +203,6 @@
                 <term><parameter role="keyword">provider</parameter>&nbsp;:</term>
                 <listitem><simpara>the current <link 
linkend="class-nautilus-python-menu-provider"><classname>Nautilus.MenuProvider</classname></link> 
instance</simpara></listitem>
             </varlistentry>
-            <varlistentry>
-                <term><parameter role="keyword">window</parameter>&nbsp;:</term>
-                <listitem><simpara>the current <link 
linkend="class-gtkwindow"><classname>gtk.Window</classname></link> instance</simpara></listitem>
-            </varlistentry>
             <varlistentry>
                 <term><parameter role="keyword">folder</parameter>&nbsp;:</term>
                 <listitem><simpara>the current folder, as a <link 
linkend="class-nautilus-python-file-info"><classname>Nautilus.FileInfo</classname></link> 
object.</simpara></listitem>
diff --git a/docs/reference/nautilus-python-overview.xml b/docs/reference/nautilus-python-overview.xml
index 9827d78..ccdc291 100644
--- a/docs/reference/nautilus-python-overview.xml
+++ b/docs/reference/nautilus-python-overview.xml
@@ -10,8 +10,8 @@
     One simply imports the Nautilus module from the gobject introspection repository and creates a class 
which is derived from a gobject.GObject and 
     one of the Nautilus module's classes. When an extension derives a class, it becomes a "provider", 
     telling Nautilus to ask it for information. There are several types of providers 
-    available for extensions to use: there is MenuProvider, LocationWidgetProvider, 
-    ColumnProvider, PropertyPageProvider, and InfoProvider, all of which will be explained 
+    available for extensions to use: there is MenuProvider, 
+    ColumnProvider, and InfoProvider, all of which will be explained 
     in more detail below. Your class can be derived from multiple providers.</para>
     
     <para>Here are the basic steps:</para>
diff --git a/docs/reference/nautilus-python-provider-reference.xml 
b/docs/reference/nautilus-python-provider-reference.xml
index 3abb323..3c0d335 100644
--- a/docs/reference/nautilus-python-provider-reference.xml
+++ b/docs/reference/nautilus-python-provider-reference.xml
@@ -7,8 +7,6 @@
     <title>Provider Interfaces</title>
     <xi:include href="nautilus-python-column-provider.xml"/>
     <xi:include href="nautilus-python-info-provider.xml"/>
-    <xi:include href="nautilus-python-location-widget-provider.xml"/>
     <xi:include href="nautilus-python-menu-provider.xml"/>
-    <xi:include href="nautilus-python-property-page-provider.xml"/>
 </chapter>
 
diff --git a/examples/TestExtension.py b/examples/TestExtension.py
index b2fde59..9df9b4e 100644
--- a/examples/TestExtension.py
+++ b/examples/TestExtension.py
@@ -1,4 +1,4 @@
-from gi.repository import Nautilus, GObject, Gtk
+from gi.repository import Nautilus, GObject
 from typing import List
 
 
@@ -16,7 +16,6 @@ class TestExtension(GObject.GObject, Nautilus.MenuProvider):
 
     def get_file_items(
         self,
-        window: Gtk.Widget,
         files: List[Nautilus.FileInfo],
     ) -> List[Nautilus.MenuItem]:
         if len(files) != 1:
@@ -39,7 +38,6 @@ class TestExtension(GObject.GObject, Nautilus.MenuProvider):
     # a warning if the method isn't present
     def get_background_items(
         self,
-        window: Gtk.Widget,
         current_folder: Nautilus.FileInfo,
     ) -> List[Nautilus.MenuItem]:
         return []
diff --git a/examples/background-image.py b/examples/background-image.py
index 7be2e29..b417f54 100644
--- a/examples/background-image.py
+++ b/examples/background-image.py
@@ -1,4 +1,4 @@
-from gi.repository import Nautilus, GObject, Gio, Gtk
+from gi.repository import Nautilus, GObject, Gio
 from typing import List
 
 SUPPORTED_FORMATS = "image/jpeg", "image/png"
@@ -23,7 +23,6 @@ class BackgroundImageExtension(GObject.GObject, Nautilus.MenuProvider):
 
     def get_file_items(
         self,
-        window: Gtk.Widget,
         files: List[Nautilus.FileInfo],
     ) -> List[Nautilus.MenuItem]:
         if len(files) != 1:
@@ -55,7 +54,6 @@ class BackgroundImageExtension(GObject.GObject, Nautilus.MenuProvider):
     # isn't present
     def get_background_items(
         self,
-        window: Gtk.Widget,
         current_folder: Nautilus.FileInfo,
     ) -> List[Nautilus.MenuItem]:
         return []
diff --git a/examples/meson.build b/examples/meson.build
index 5595735..b79d303 100644
--- a/examples/meson.build
+++ b/examples/meson.build
@@ -6,9 +6,7 @@ install_data(
 install_data(
   'background-image.py',
   'block-size-column.py',
-  'location-widget-provider.py',
   'open-terminal.py',
-  'md5sum-property-page.py',
   'submenu.py',
   'TestExtension.py',
   'update-file-info-async.py',
diff --git a/examples/open-terminal.py b/examples/open-terminal.py
index 074f1fd..c34fcce 100644
--- a/examples/open-terminal.py
+++ b/examples/open-terminal.py
@@ -1,7 +1,7 @@
 # This example is contributed by Martin Enlund
 import os
 from urllib.parse import unquote
-from gi.repository import Nautilus, GObject, Gtk
+from gi.repository import Nautilus, GObject
 from typing import List
 
 
@@ -28,7 +28,6 @@ class OpenTerminalExtension(GObject.GObject, Nautilus.MenuProvider):
 
     def get_file_items(
         self,
-        window: Gtk.Widget,
         files: List[Nautilus.FileInfo],
     ) -> List[Nautilus.MenuItem]:
         if len(files) != 1:
@@ -51,7 +50,6 @@ class OpenTerminalExtension(GObject.GObject, Nautilus.MenuProvider):
 
     def get_background_items(
         self,
-        window: Gtk.Widget,
         current_folder: Nautilus.FileInfo,
     ) -> List[Nautilus.MenuItem]:
         item = Nautilus.MenuItem(
diff --git a/examples/submenu.py b/examples/submenu.py
index e8924b8..e3f53ca 100644
--- a/examples/submenu.py
+++ b/examples/submenu.py
@@ -1,11 +1,10 @@
-from gi.repository import Nautilus, GObject, Gtk
+from gi.repository import Nautilus, GObject
 from typing import List
 
 
 class ExampleMenuProvider(GObject.GObject, Nautilus.MenuProvider):
     def get_file_items(
         self,
-        window: Gtk.Widget,
         files: List[Nautilus.FileInfo],
     ) -> List[Nautilus.MenuItem]:
         top_menuitem = Nautilus.MenuItem(
@@ -32,7 +31,6 @@ class ExampleMenuProvider(GObject.GObject, Nautilus.MenuProvider):
 
     def get_background_items(
         self,
-        window: Gtk.Widget,
         current_folder: Nautilus.FileInfo,
     ) -> List[Nautilus.MenuItem]:
         submenu = Nautilus.Menu()
diff --git a/meson.build b/meson.build
index 22547fc..7463639 100644
--- a/meson.build
+++ b/meson.build
@@ -20,7 +20,7 @@ pygobject_major_version = 3
 pygobject_minor_version = 0
 pygobject_micro_version = 0
 pygobject = dependency('pygobject-3.0', version: f'>= 
@pygobject_major_version@.@pygobject_minor_version@.@pygobject_micro_version@')
-libnautilus_extension = dependency('libnautilus-extension', version: '>= 3.27.90')
+libnautilus_extension = dependency('libnautilus-extension-4', version: '>= 43.beta')
 python_dep = python3.dependency(embed: true)
 
 nautilus_extension_dir = libnautilus_extension.get_variable('extensiondir', pkgconfig_define: ['libdir', 
libdir])
diff --git a/src/nautilus-python-object.c b/src/nautilus-python-object.c
index 001df00..74a4ac0 100644
--- a/src/nautilus-python-object.c
+++ b/src/nautilus-python-object.c
@@ -126,90 +126,9 @@ nautilus_python_boxed_new (PyTypeObject *type, gpointer boxed, gboolean free_on_
     return (PyObject *) self;
 }
 
-#define METHOD_NAME "get_property_pages"
-static GList *
-nautilus_python_object_get_property_pages (NautilusPropertyPageProvider *provider,
-                                           GList                         *files) {
-    NautilusPythonObject *object = (NautilusPythonObject*)provider;
-    PyObject *py_files, *py_ret = NULL;
-    GList *ret = NULL;
-    PyGILState_STATE state = pyg_gil_state_ensure();
-    
-    debug_enter();
-
-    CHECK_OBJECT(object);
-    CHECK_METHOD_NAME(object->instance);
-
-    CONVERT_LIST(py_files, files);
-    
-    py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME,
-                                 "(N)", py_files);
-    HANDLE_RETVAL(py_ret);
-
-    HANDLE_LIST(py_ret, NautilusPropertyPage, "Nautilus.PropertyPage");
-    
-beach:
-    free_pygobject_data_list (files);
-    Py_XDECREF(py_ret);
-    pyg_gil_state_release(state);
-    return ret;
-}
-#undef METHOD_NAME
-
-static void
-nautilus_python_object_property_page_provider_interface_init (NautilusPropertyPageProviderInterface 
*interface) {
-    interface->get_pages = nautilus_python_object_get_property_pages;
-}
-
-#define METHOD_NAME "get_widget"
-static GtkWidget *
-nautilus_python_object_get_widget (NautilusLocationWidgetProvider *provider,
-                                   const char                        *uri,
-                                   GtkWidget                       *window) {
-    NautilusPythonObject *object = (NautilusPythonObject*)provider;
-    GtkWidget *ret = NULL;
-    PyObject *py_ret = NULL;
-    PyGObject *py_ret_gobj;
-    PyObject *py_uri = NULL;
-    PyGILState_STATE state = pyg_gil_state_ensure();
-
-    debug_enter();
-
-    CHECK_OBJECT(object);
-    CHECK_METHOD_NAME(object->instance);
-
-    py_uri = PyUnicode_FromString(uri);
-
-    py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME,
-                                 "(NN)", py_uri,
-                                 pygobject_new((GObject *)window));
-    HANDLE_RETVAL(py_ret);
-
-    py_ret_gobj = (PyGObject *)py_ret;
-    if (!pygobject_check(py_ret_gobj, &PyGtkWidget_Type)) {
-        PyErr_SetString(PyExc_TypeError,
-                        METHOD_NAME "should return a gtk.Widget");
-        goto beach;
-    }
-
-    ret = (GtkWidget *)g_object_ref(py_ret_gobj->obj);
-
-beach:
-    Py_XDECREF(py_ret);
-    pyg_gil_state_release(state);
-    return ret;
-}
-#undef METHOD_NAME
-
-static void
-nautilus_python_object_location_widget_provider_interface_init (NautilusLocationWidgetProviderInterface 
*interface) {
-    interface->get_widget = nautilus_python_object_get_widget;
-}
-
 #define METHOD_NAME "get_file_items"
 static GList *
 nautilus_python_object_get_file_items (NautilusMenuProvider *provider,
-                                       GtkWidget             *window,
                                        GList                 *files) {
     NautilusPythonObject *object = (NautilusPythonObject*)provider;
     GList *ret = NULL;
@@ -223,16 +142,14 @@ nautilus_python_object_get_file_items (NautilusMenuProvider *provider,
     if (PyObject_HasAttrString(object->instance, "get_file_items_full")) {
         CONVERT_LIST(py_files, files);
         py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX "get_file_items_full",
-                                     "(NNN)",
+                                     "(NN)",
                                      pygobject_new((GObject *)provider), 
-                                     pygobject_new((GObject *)window), 
                                      py_files);
     }
     else if (PyObject_HasAttrString(object->instance, "get_file_items")) {
         CONVERT_LIST(py_files, files);
         py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME,
-                                     "(NN)", 
-                                     pygobject_new((GObject *)window), 
+                                     "(N)",
                                      py_files);
     }
     else {
@@ -254,7 +171,6 @@ beach:
 #define METHOD_NAME "get_background_items"
 static GList *
 nautilus_python_object_get_background_items (NautilusMenuProvider *provider,
-                                             GtkWidget               *window,
                                              NautilusFileInfo       *file) {
     NautilusPythonObject *object = (NautilusPythonObject*)provider;
     GList *ret = NULL;
@@ -267,15 +183,13 @@ nautilus_python_object_get_background_items (NautilusMenuProvider *provider,
 
     if (PyObject_HasAttrString(object->instance, "get_background_items_full")) {
         py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX "get_background_items_full",
-                                     "(NNN)",
+                                     "(NN)",
                                      pygobject_new((GObject *)provider),
-                                     pygobject_new((GObject *)window),
                                      pygobject_new((GObject *)file));
     }
     else if (PyObject_HasAttrString(object->instance, "get_background_items")) {
         py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME,
-                                     "(NN)",
-                                     pygobject_new((GObject *)window),
+                                     "(N)",
                                      pygobject_new((GObject *)file));
     }
     else {
@@ -453,18 +367,6 @@ nautilus_python_object_get_type (GTypeModule *module,
     g_autofree GTypeInfo *info = NULL;
     g_autofree gchar *type_name = NULL;
     GType gtype;
-      
-    static const GInterfaceInfo property_page_provider_interface_info = {
-        (GInterfaceInitFunc) nautilus_python_object_property_page_provider_interface_init,
-        NULL,
-        NULL
-    };
-
-    static const GInterfaceInfo location_widget_provider_interface_info = {
-        (GInterfaceInitFunc) nautilus_python_object_location_widget_provider_interface_init,
-        NULL,
-        NULL
-    };
 
     static const GInterfaceInfo menu_provider_interface_info = {
         (GInterfaceInitFunc) nautilus_python_object_menu_provider_interface_init,
@@ -505,18 +407,6 @@ nautilus_python_object_get_type (GTypeModule *module,
                                          type_name,
                                          info, 0);
 
-    if (PyObject_IsSubclass(type, (PyObject*)&PyNautilusPropertyPageProvider_Type)) {
-        g_type_module_add_interface (module, gtype, 
-                                     NAUTILUS_TYPE_PROPERTY_PAGE_PROVIDER,
-                                     &property_page_provider_interface_info);
-    }
-
-    if (PyObject_IsSubclass(type, (PyObject*)&PyNautilusLocationWidgetProvider_Type)) {
-        g_type_module_add_interface (module, gtype,
-                                     NAUTILUS_TYPE_LOCATION_WIDGET_PROVIDER,
-                                     &location_widget_provider_interface_info);
-    }
-    
     if (PyObject_IsSubclass(type, (PyObject*)&PyNautilusMenuProvider_Type)) {
         g_type_module_add_interface (module, gtype, 
                                      NAUTILUS_TYPE_MENU_PROVIDER,
diff --git a/src/nautilus-python.c b/src/nautilus-python.c
index 5f61797..bc71bcd 100644
--- a/src/nautilus-python.c
+++ b/src/nautilus-python.c
@@ -23,7 +23,6 @@
 #define NO_IMPORT_PYGOBJECT //To avoid a multiple definition, nautilus-python-object.c also includes and 
does the import.
 #include <pygobject.h>
 #include <gmodule.h>
-#include <gtk/gtk.h>
 
 #include "nautilus-python.h"
 #include "nautilus-python-object.h"
@@ -41,16 +40,12 @@ static gboolean nautilus_python_init_python(void);
 static GArray *all_types = NULL;
 
 
-PyTypeObject *_PyGtkWidget_Type;
 PyTypeObject *_PyNautilusColumn_Type;
 PyTypeObject *_PyNautilusColumnProvider_Type;
 PyTypeObject *_PyNautilusInfoProvider_Type;
-PyTypeObject *_PyNautilusLocationWidgetProvider_Type;
 PyTypeObject *_PyNautilusMenu_Type;
 PyTypeObject *_PyNautilusMenuItem_Type;
 PyTypeObject *_PyNautilusMenuProvider_Type;
-PyTypeObject *_PyNautilusPropertyPage_Type;
-PyTypeObject *_PyNautilusPropertyPageProvider_Type;
 PyTypeObject *_PyNautilusOperationHandle_Type;
 
 static inline gboolean 
@@ -96,9 +91,7 @@ nautilus_python_load_file(GTypeModule *type_module,
 
         if (PyObject_IsSubclass(value, (PyObject*)&PyNautilusColumnProvider_Type) ||
                                PyObject_IsSubclass(value, (PyObject*)&PyNautilusInfoProvider_Type) ||
-                               PyObject_IsSubclass(value, (PyObject*)&PyNautilusLocationWidgetProvider_Type) 
||
-                               PyObject_IsSubclass(value, (PyObject*)&PyNautilusMenuProvider_Type) ||
-                               PyObject_IsSubclass(value, (PyObject*)&PyNautilusPropertyPageProvider_Type)) {
+                               PyObject_IsSubclass(value, (PyObject*)&PyNautilusMenuProvider_Type)) {
             gtype = nautilus_python_object_get_type(type_module, value);
             g_array_append_val(all_types, gtype);
         }
@@ -194,16 +187,13 @@ nautilus_python_init_python (void) {
     /* import nautilus */
     g_setenv("INSIDE_NAUTILUS_PYTHON", "", FALSE);
     debug("import nautilus");
-    PyRun_SimpleString("import gi; gi.require_version('Nautilus', '3.0')");
+    PyRun_SimpleString("import gi; gi.require_version('Nautilus', '4.0')");
     nautilus = PyImport_ImportModule("gi.repository.Nautilus");
     if (!nautilus) {
         PyErr_Print();
         return FALSE;
     }
 
-    _PyGtkWidget_Type = pygobject_lookup_class(GTK_TYPE_WIDGET);
-    g_assert(_PyGtkWidget_Type != NULL);
-
 #define IMPORT(x, y) \
     _PyNautilus##x##_Type = (PyTypeObject *)PyObject_GetAttrString(nautilus, y); \
     if (_PyNautilus##x##_Type == NULL) { \
@@ -214,12 +204,9 @@ nautilus_python_init_python (void) {
     IMPORT(Column, "Column");
     IMPORT(ColumnProvider, "ColumnProvider");
     IMPORT(InfoProvider, "InfoProvider");
-    IMPORT(LocationWidgetProvider, "LocationWidgetProvider");
     IMPORT(Menu, "Menu");
     IMPORT(MenuItem, "MenuItem");
     IMPORT(MenuProvider, "MenuProvider");
-    IMPORT(PropertyPage, "PropertyPage");
-    IMPORT(PropertyPageProvider, "PropertyPageProvider");
     IMPORT(OperationHandle, "OperationHandle");
 
 #undef IMPORT
diff --git a/src/nautilus-python.h b/src/nautilus-python.h
index f0883f4..90f8e17 100644
--- a/src/nautilus-python.h
+++ b/src/nautilus-python.h
@@ -37,9 +37,6 @@ extern NautilusPythonDebug nautilus_python_debug;
 #define debug_enter_args(x, y) { if (nautilus_python_debug & NAUTILUS_PYTHON_DEBUG_MISC) \
                                      g_printf("%s: entered " x "\n", __FUNCTION__, y); }
 
-extern PyTypeObject *_PyGtkWidget_Type;
-#define PyGtkWidget_Type (*_PyGtkWidget_Type)
-
 extern PyTypeObject *_PyNautilusColumn_Type;
 #define PyNautilusColumn_Type (*_PyNautilusColumn_Type)
 
@@ -49,9 +46,6 @@ extern PyTypeObject *_PyNautilusColumnProvider_Type;
 extern PyTypeObject *_PyNautilusInfoProvider_Type;
 #define PyNautilusInfoProvider_Type (*_PyNautilusInfoProvider_Type)
 
-extern PyTypeObject *_PyNautilusLocationWidgetProvider_Type;
-#define PyNautilusLocationWidgetProvider_Type (*_PyNautilusLocationWidgetProvider_Type)
-
 extern PyTypeObject *_PyNautilusMenu_Type;
 #define PyNautilusMenu_Type (*_PyNautilusMenu_Type)
 
@@ -61,12 +55,6 @@ extern PyTypeObject *_PyNautilusMenuItem_Type;
 extern PyTypeObject *_PyNautilusMenuProvider_Type;
 #define PyNautilusMenuProvider_Type (*_PyNautilusMenuProvider_Type)
 
-extern PyTypeObject *_PyNautilusPropertyPage_Type;
-#define PyNautilusPropertyPage_Type (*_PyNautilusPropertyPage_Type)
-
-extern PyTypeObject *_PyNautilusPropertyPageProvider_Type;
-#define PyNautilusPropertyPageProvider_Type (*_PyNautilusPropertyPageProvider_Type)
-
 extern PyTypeObject *_PyNautilusOperationHandle_Type;
 #define PyNautilusOperationHandle_Type (*_PyNautilusOperationHandle_Type)
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]