[network-manager-openvpn/lr/libnm: 2/4] properties: port the new plugin to libnm



commit 0f4e37d74586acadbef35e2a26142caff2c0f83f
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Thu Jul 16 12:28:10 2015 +0200

    properties: port the new plugin to libnm

 configure.ac                 |    3 +
 properties/Makefile.am       |    5 +-
 properties/auth-helpers.c    |   34 +++++++++----
 properties/auth-helpers.h    |   12 +++-
 properties/import-export.c   |   22 ++++++--
 properties/import-export.h   |    7 +++
 properties/nm-openvpn.c      |  114 +++++++++++++++++++++++++++--------------
 properties/tests/Makefile.am |    2 +-
 8 files changed, 137 insertions(+), 62 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index b7c9ab5..ca487c0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -78,6 +78,9 @@ if test x"$with_gnome" != xno; then
        PKG_CHECK_MODULES(LIBSECRET, libsecret-unstable)
 fi
 
+PKG_CHECK_MODULES(LIBNM, libnm >= 0.9.11)
+PKG_CHECK_MODULES(LIBNMA, libnma >= 1.1.0)
+
 NM_COMPILER_WARNINGS
 
 dnl
diff --git a/properties/Makefile.am b/properties/Makefile.am
index 58e808f..3f56cb9 100644
--- a/properties/Makefile.am
+++ b/properties/Makefile.am
@@ -26,9 +26,8 @@ libnm_openvpn_properties_new_la_CFLAGS =                \
         -DNM_OPENVPN_NEW                                \
         $(GLIB_CFLAGS)                                  \
         $(GTK_CFLAGS)                                   \
-        $(NM_CFLAGS)                                    \
-        $(NMGTK_CFLAGS)                                 \
-        -I$(top_srcdir)/src                             \
+        $(LIBNM_CFLAGS)                                 \
+        $(LIBNMA_CFLAGS)                                \
         -DICONDIR=\""$(datadir)/pixmaps"\"              \
         -DUIDIR=\""$(uidir)"\"                          \
         -DLOCALEDIR=\"$(datadir)/locale\"               \
diff --git a/properties/auth-helpers.c b/properties/auth-helpers.c
index 514275f..83ef339 100644
--- a/properties/auth-helpers.c
+++ b/properties/auth-helpers.c
@@ -34,14 +34,28 @@
 #include <errno.h>
 
 #include <glib/gi18n-lib.h>
+
+#ifdef NM_OPENVPN_OLD
 #include <nm-setting-connection.h>
 #include <nm-setting-8021x.h>
 #include <nm-utils.h>
 #include <nm-ui-utils.h>
 
+#define NMSettingVpn NMSettingVPN
+#endif
+
+#ifdef NM_OPENVPN_NEW
+#include <NetworkManager.h>
+#include <nma-ui-utils.h>
+#endif
+
 #include "auth-helpers.h"
 #include "nm-openvpn.h"
+#ifdef NM_OPENVPN_NEW
+#include "src/nm-openvpn-service-defines.h"
+#else
 #include "src/nm-openvpn-service.h"
+#endif
 #include "common/utils.h"
 
 #define BLOCK_HANDLER_ID "block-handler-id"
@@ -55,7 +69,7 @@ show_password (GtkToggleButton *togglebutton, GtkEntry *password_entry)
 static GtkWidget *
 setup_secret_widget (GtkBuilder *builder,
                      const char *widget_name,
-                     NMSettingVPN *s_vpn,
+                     NMSettingVpn *s_vpn,
                      const char *secret_key)
 {
        GtkWidget *widget;
@@ -148,7 +162,7 @@ tls_cert_changed_cb (GtkWidget *widget, gpointer data)
 static void
 tls_setup (GtkBuilder *builder,
            GtkSizeGroup *group,
-           NMSettingVPN *s_vpn,
+           NMSettingVpn *s_vpn,
            const char *prefix,
            GtkWidget *ca_chooser,
            ChangedCallback changed_cb,
@@ -234,7 +248,7 @@ tls_setup (GtkBuilder *builder,
 static void
 pw_setup (GtkBuilder *builder,
           GtkSizeGroup *group,
-          NMSettingVPN *s_vpn,
+          NMSettingVpn *s_vpn,
           const char *prefix,
           ChangedCallback changed_cb,
           gpointer user_data)
@@ -269,7 +283,7 @@ pw_setup (GtkBuilder *builder,
 void
 tls_pw_init_auth_widget (GtkBuilder *builder,
                          GtkSizeGroup *group,
-                         NMSettingVPN *s_vpn,
+                         NMSettingVpn *s_vpn,
                          const char *contype,
                          const char *prefix,
                          ChangedCallback changed_cb,
@@ -326,7 +340,7 @@ tls_pw_init_auth_widget (GtkBuilder *builder,
 void
 sk_init_auth_widget (GtkBuilder *builder,
                      GtkSizeGroup *group,
-                     NMSettingVPN *s_vpn,
+                     NMSettingVpn *s_vpn,
                      ChangedCallback changed_cb,
                      gpointer user_data)
 {
@@ -566,7 +580,7 @@ update_from_filechooser (GtkBuilder *builder,
                          const char *key,
                          const char *prefix,
                          const char *widget_name,
-                         NMSettingVPN *s_vpn)
+                         NMSettingVpn *s_vpn)
 {
        GtkWidget *widget;
        char *tmp, *filename;
@@ -588,7 +602,7 @@ update_from_filechooser (GtkBuilder *builder,
 }
 
 static void
-update_tls (GtkBuilder *builder, const char *prefix, NMSettingVPN *s_vpn)
+update_tls (GtkBuilder *builder, const char *prefix, NMSettingVpn *s_vpn)
 {
        GtkWidget *widget;
        NMSettingSecretFlags pw_flags;
@@ -614,7 +628,7 @@ update_tls (GtkBuilder *builder, const char *prefix, NMSettingVPN *s_vpn)
 }
 
 static void
-update_pw (GtkBuilder *builder, const char *prefix, NMSettingVPN *s_vpn)
+update_pw (GtkBuilder *builder, const char *prefix, NMSettingVpn *s_vpn)
 {
        GtkWidget *widget;
        NMSettingSecretFlags pw_flags;
@@ -651,7 +665,7 @@ update_pw (GtkBuilder *builder, const char *prefix, NMSettingVPN *s_vpn)
 gboolean
 auth_widget_update_connection (GtkBuilder *builder,
                                const char *contype,
-                               NMSettingVPN *s_vpn)
+                               NMSettingVpn *s_vpn)
 {
        GtkTreeModel *model;
        GtkTreeIter iter;
@@ -920,7 +934,7 @@ advanced_dialog_new_hash_from_connection (NMConnection *connection,
                                           GError **error)
 {
        GHashTable *hash;
-       NMSettingVPN *s_vpn;
+       NMSettingVpn *s_vpn;
        const char *secret, *flags;
 
        hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
diff --git a/properties/auth-helpers.h b/properties/auth-helpers.h
index 1c298e0..c606d79 100644
--- a/properties/auth-helpers.h
+++ b/properties/auth-helpers.h
@@ -25,14 +25,20 @@
 #include <glib.h>
 #include <gtk/gtk.h>
 
+#ifdef NM_OPENVPN_OLD
 #include <nm-connection.h>
 #include <nm-setting-vpn.h>
+#endif
+
+#ifdef NM_OPENVPN_NEW
+#include <NetworkManager.h>
+#endif
 
 typedef void (*ChangedCallback) (GtkWidget *widget, gpointer user_data);
 
 void tls_pw_init_auth_widget (GtkBuilder *builder,
                               GtkSizeGroup *group,
-                              NMSettingVPN *s_vpn,
+                              NMSettingVpn *s_vpn,
                               const char *contype,
                               const char *prefix,
                               ChangedCallback changed_cb,
@@ -40,7 +46,7 @@ void tls_pw_init_auth_widget (GtkBuilder *builder,
 
 void sk_init_auth_widget (GtkBuilder *builder,
                           GtkSizeGroup *group,
-                          NMSettingVPN *s_vpn,
+                          NMSettingVpn *s_vpn,
                           ChangedCallback changed_cb,
                           gpointer user_data);
 
@@ -48,7 +54,7 @@ gboolean auth_widget_check_validity (GtkBuilder *builder, const char *contype, G
 
 gboolean auth_widget_update_connection (GtkBuilder *builder,
                                         const char *contype,
-                                        NMSettingVPN *s_vpn);
+                                        NMSettingVpn *s_vpn);
 
 GtkFileFilter *tls_file_chooser_filter_new (gboolean pkcs_allowed);
 
diff --git a/properties/import-export.c b/properties/import-export.c
index 9d1225a..5e12a17 100644
--- a/properties/import-export.c
+++ b/properties/import-export.c
@@ -35,13 +35,23 @@
 
 #include <glib/gi18n-lib.h>
 
+#ifdef NM_OPENVPN_OLD
 #include <nm-setting-vpn.h>
 #include <nm-setting-connection.h>
 #include <nm-setting-ip4-config.h>
 
+#define nm_simple_connection_new nm_connection_new
+#define NMSettingVpn NMSettingVPN
+#endif
+
+#ifdef NM_OPENVPN_NEW
+#include <NetworkManager.h>
+#endif
+
 #include "import-export.h"
 #include "nm-openvpn.h"
-#include "../src/nm-openvpn-service.h"
+//#include "../src/nm-openvpn-service.h"
+#include "../src/nm-openvpn-service-defines.h"
 #include "../common/utils.h"
 
 #define AUTH_TAG "auth "
@@ -129,7 +139,7 @@ static gboolean
 handle_path_item (const char *line,
                   const char *tag,
                   const char *key,
-                  NMSettingVPN *s_vpn,
+                  NMSettingVpn *s_vpn,
                   const char *path,
                   char **leftover)
 {
@@ -178,7 +188,7 @@ get_args (const char *line, int *nitems)
 }
 
 static void
-handle_direction (const char *tag, const char *key, char *leftover, NMSettingVPN *s_vpn)
+handle_direction (const char *tag, const char *key, char *leftover, NMSettingVpn *s_vpn)
 {
        glong direction;
 
@@ -288,7 +298,7 @@ do_import (const char *path, char **lines, GError **error)
 {
        NMConnection *connection = NULL;
        NMSettingConnection *s_con;
-       NMSettingVPN *s_vpn;
+       NMSettingVpn *s_vpn;
        char *last_dot;
        char **line;
        gboolean have_client = FALSE, have_remote = FALSE;
@@ -299,7 +309,7 @@ do_import (const char *path, char **lines, GError **error)
        gboolean http_proxy = FALSE, socks_proxy = FALSE, proxy_set = FALSE;
        int nitems;
 
-       connection = nm_connection_new ();
+       connection = nm_simple_connection_new ();
        s_con = NM_SETTING_CONNECTION (nm_setting_connection_new ());
        nm_connection_add_setting (connection, NM_SETTING (s_con));
 
@@ -797,7 +807,7 @@ gboolean
 do_export (const char *path, NMConnection *connection, GError **error)
 {
        NMSettingConnection *s_con;
-       NMSettingVPN *s_vpn;
+       NMSettingVpn *s_vpn;
        FILE *f;
        const char *value;
        const char *gateways = NULL;
diff --git a/properties/import-export.h b/properties/import-export.h
index 1c5fbc9..5266333 100644
--- a/properties/import-export.h
+++ b/properties/import-export.h
@@ -23,7 +23,14 @@
 #define _IMPORT_EXPORT_H_
 
 #include <glib.h>
+
+#ifdef NM_OPENVPN_OLD
 #include <nm-connection.h>
+#endif
+
+#ifdef NM_OPENVPN_NEW
+#include <NetworkManager.h>
+#endif
 
 NMConnection *do_import (const char *path, char **lines, GError **error);
 
diff --git a/properties/nm-openvpn.c b/properties/nm-openvpn.c
index 33dcc63..9cca952 100644
--- a/properties/nm-openvpn.c
+++ b/properties/nm-openvpn.c
@@ -37,12 +37,39 @@
 #include <string.h>
 #include <gtk/gtk.h>
 
+#ifdef NM_OPENVPN_OLD
 #include <nm-vpn-plugin-ui-interface.h>
 #include <nm-setting-vpn.h>
 #include <nm-setting-connection.h>
 #include <nm-setting-ip4-config.h>
 
-#include "nm-openvpn-service-defines.h"
+// FIXME: Check what danw's NM_VPN_LIBNM_COMPAT does
+#define NMVpnEditorPluginInterface NMVpnPluginUiInterface
+#define NM_TYPE_VPN_EDITOR_PLUGIN NM_TYPE_VPN_PLUGIN_UI_INTERFACE
+#define NMVpnEditorInterface NMVpnPluginUiWidgetInterface
+#define NM_TYPE_VPN_EDITOR NM_TYPE_VPN_PLUGIN_UI_WIDGET_INTERFACE
+#define NMSettingVpn NMSettingVPN
+#define NMVpnEditor NMVpnPluginUiWidgetInterface
+#define NMVpnEditorPlugin NMVpnPluginUiInterface
+#define NM_VPN_EDITOR_PLUGIN_CAPABILITY_IMPORT NM_VPN_PLUGIN_UI_CAPABILITY_IMPORT
+#define NM_VPN_EDITOR_PLUGIN_CAPABILITY_EXPORT NM_VPN_PLUGIN_UI_CAPABILITY_EXPORT
+#define NM_VPN_EDITOR_PLUGIN_CAPABILITY_IPV6 NM_VPN_PLUGIN_UI_CAPABILITY_IPV6
+#define PROP_DESC NM_VPN_PLUGIN_UI_INTERFACE_PROP_DESC
+#define PROP_NAME NM_VPN_PLUGIN_UI_INTERFACE_PROP_NAME
+#define PROP_SERVICE NM_VPN_PLUGIN_UI_INTERFACE_PROP_SERVICE
+#define NM_VPN_EDITOR_PLUGIN_NAME NM_VPN_PLUGIN_UI_INTERFACE_NAME
+#define NM_VPN_EDITOR_PLUGIN_DESCRIPTION NM_VPN_PLUGIN_UI_INTERFACE_DESC
+#define NM_VPN_EDITOR_PLUGIN_SERVICE NM_VPN_PLUGIN_UI_INTERFACE_SERVICE
+#define get_editor ui_factory
+#define get_suggested_filename get_suggested_name
+#define nm_vpn_editor_plugin_factory nm_vpn_plugin_ui_factory
+#endif
+
+#ifdef NM_OPENVPN_NEW
+#include <NetworkManager.h>
+#endif
+
+#include "src/nm-openvpn-service-defines.h"
 #include "nm-openvpn.h"
 #include "auth-helpers.h"
 #include "import-export.h"
@@ -54,18 +81,27 @@
 
 /************** plugin class **************/
 
-static void openvpn_plugin_ui_interface_init (NMVpnPluginUiInterface *iface_class);
+#ifdef NM_OPENVPN_NEW
+enum {
+       PROP_0,
+       PROP_NAME,
+       PROP_DESC,
+       PROP_SERVICE
+};
+#endif
+
+static void openvpn_plugin_ui_interface_init (NMVpnEditorPluginInterface *iface_class);
 
 G_DEFINE_TYPE_EXTENDED (OpenvpnPluginUi, openvpn_plugin_ui, G_TYPE_OBJECT, 0,
-                        G_IMPLEMENT_INTERFACE (NM_TYPE_VPN_PLUGIN_UI_INTERFACE,
+                        G_IMPLEMENT_INTERFACE (NM_TYPE_VPN_EDITOR_PLUGIN,
                                                openvpn_plugin_ui_interface_init))
 
 /************** UI widget class **************/
 
-static void openvpn_plugin_ui_widget_interface_init (NMVpnPluginUiWidgetInterface *iface_class);
+static void openvpn_plugin_ui_widget_interface_init (NMVpnEditorInterface *iface_class);
 
 G_DEFINE_TYPE_EXTENDED (OpenvpnPluginUiWidget, openvpn_plugin_ui_widget, G_TYPE_OBJECT, 0,
-                        G_IMPLEMENT_INTERFACE (NM_TYPE_VPN_PLUGIN_UI_WIDGET_INTERFACE,
+                        G_IMPLEMENT_INTERFACE (NM_TYPE_VPN_EDITOR,
                                                openvpn_plugin_ui_widget_interface_init))
 
 #define OPENVPN_PLUGIN_UI_WIDGET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), 
OPENVPN_TYPE_PLUGIN_UI_WIDGET, OpenvpnPluginUiWidgetPrivate))
@@ -318,7 +354,7 @@ static gboolean
 init_plugin_ui (OpenvpnPluginUiWidget *self, NMConnection *connection, GError **error)
 {
        OpenvpnPluginUiWidgetPrivate *priv = OPENVPN_PLUGIN_UI_WIDGET_GET_PRIVATE (self);
-       NMSettingVPN *s_vpn;
+       NMSettingVpn *s_vpn;
        GtkWidget *widget;
        GtkListStore *store;
        GtkTreeIter iter;
@@ -419,7 +455,7 @@ init_plugin_ui (OpenvpnPluginUiWidget *self, NMConnection *connection, GError **
 }
 
 static GObject *
-get_widget (NMVpnPluginUiWidgetInterface *iface)
+get_widget (NMVpnEditor *iface)
 {
        OpenvpnPluginUiWidget *self = OPENVPN_PLUGIN_UI_WIDGET (iface);
        OpenvpnPluginUiWidgetPrivate *priv = OPENVPN_PLUGIN_UI_WIDGET_GET_PRIVATE (self);
@@ -430,7 +466,7 @@ get_widget (NMVpnPluginUiWidgetInterface *iface)
 static void
 hash_copy_advanced (gpointer key, gpointer data, gpointer user_data)
 {
-       NMSettingVPN *s_vpn = NM_SETTING_VPN (user_data);
+       NMSettingVpn *s_vpn = NM_SETTING_VPN (user_data);
        const char *value = (const char *) data;
 
        g_return_if_fail (value && strlen (value));
@@ -462,13 +498,13 @@ get_auth_type (GtkBuilder *builder)
 }
 
 static gboolean
-update_connection (NMVpnPluginUiWidgetInterface *iface,
+update_connection (NMVpnEditor *iface,
                    NMConnection *connection,
                    GError **error)
 {
        OpenvpnPluginUiWidget *self = OPENVPN_PLUGIN_UI_WIDGET (iface);
        OpenvpnPluginUiWidgetPrivate *priv = OPENVPN_PLUGIN_UI_WIDGET_GET_PRIVATE (self);
-       NMSettingVPN *s_vpn;
+       NMSettingVpn *s_vpn;
        GtkWidget *widget;
        char *str, *auth_type;
        gboolean valid = FALSE;
@@ -534,19 +570,19 @@ is_new_func (const char *key, const char *value, gpointer user_data)
        *is_new = FALSE;
 }
 
-static NMVpnPluginUiWidgetInterface *
+static NMVpnEditor *
 nm_vpn_plugin_ui_widget_interface_new (NMConnection *connection, GError **error)
 {
-       NMVpnPluginUiWidgetInterface *object;
+       NMVpnEditor *object;
        OpenvpnPluginUiWidgetPrivate *priv;
        char *ui_file;
        gboolean new = TRUE;
-       NMSettingVPN *s_vpn;
+       NMSettingVpn *s_vpn;
 
        if (error)
                g_return_val_if_fail (*error == NULL, NULL);
 
-       object = NM_VPN_PLUGIN_UI_WIDGET_INTERFACE (g_object_new (OPENVPN_TYPE_PLUGIN_UI_WIDGET, NULL));
+       object = g_object_new (OPENVPN_TYPE_PLUGIN_UI_WIDGET, NULL);
        if (!object) {
                g_set_error_literal (error, OPENVPN_PLUGIN_UI_ERROR, 0, _("could not create openvpn object"));
                return NULL;
@@ -641,7 +677,7 @@ openvpn_plugin_ui_widget_init (OpenvpnPluginUiWidget *plugin)
 }
 
 static void
-openvpn_plugin_ui_widget_interface_init (NMVpnPluginUiWidgetInterface *iface_class)
+openvpn_plugin_ui_widget_interface_init (NMVpnEditorInterface *iface_class)
 {
        /* interface implementation */
        iface_class->get_widget = get_widget;
@@ -649,7 +685,7 @@ openvpn_plugin_ui_widget_interface_init (NMVpnPluginUiWidgetInterface *iface_cla
 }
 
 static NMConnection *
-import (NMVpnPluginUiInterface *iface, const char *path, GError **error)
+import (NMVpnEditorPlugin *iface, const char *path, GError **error)
 {
        NMConnection *connection = NULL;
        char *contents = NULL;
@@ -707,7 +743,7 @@ out:
 }
 
 static gboolean
-export (NMVpnPluginUiInterface *iface,
+export (NMVpnEditorPlugin *iface,
         const char *path,
         NMConnection *connection,
         GError **error)
@@ -716,7 +752,7 @@ export (NMVpnPluginUiInterface *iface,
 }
 
 static char *
-get_suggested_name (NMVpnPluginUiInterface *iface, NMConnection *connection)
+get_suggested_filename (NMVpnEditorPlugin *iface, NMConnection *connection)
 {
        NMSettingConnection *s_con;
        const char *id;
@@ -733,15 +769,15 @@ get_suggested_name (NMVpnPluginUiInterface *iface, NMConnection *connection)
 }
 
 static guint32
-get_capabilities (NMVpnPluginUiInterface *iface)
+get_capabilities (NMVpnEditorPlugin *iface)
 {
-       return (NM_VPN_PLUGIN_UI_CAPABILITY_IMPORT |
-               NM_VPN_PLUGIN_UI_CAPABILITY_EXPORT |
-               NM_VPN_PLUGIN_UI_CAPABILITY_IPV6);
+       return (NM_VPN_EDITOR_PLUGIN_CAPABILITY_IMPORT |
+               NM_VPN_EDITOR_PLUGIN_CAPABILITY_EXPORT |
+               NM_VPN_EDITOR_PLUGIN_CAPABILITY_IPV6);
 }
 
-static NMVpnPluginUiWidgetInterface *
-ui_factory (NMVpnPluginUiInterface *iface, NMConnection *connection, GError **error)
+static NMVpnEditor *
+get_editor (NMVpnEditorPlugin *iface, NMConnection *connection, GError **error)
 {
        return nm_vpn_plugin_ui_widget_interface_new (connection, error);
 }
@@ -751,13 +787,13 @@ get_property (GObject *object, guint prop_id,
                          GValue *value, GParamSpec *pspec)
 {
        switch (prop_id) {
-       case NM_VPN_PLUGIN_UI_INTERFACE_PROP_NAME:
+       case PROP_NAME:
                g_value_set_string (value, OPENVPN_PLUGIN_NAME);
                break;
-       case NM_VPN_PLUGIN_UI_INTERFACE_PROP_DESC:
+       case PROP_DESC:
                g_value_set_string (value, OPENVPN_PLUGIN_DESC);
                break;
-       case NM_VPN_PLUGIN_UI_INTERFACE_PROP_SERVICE:
+       case PROP_SERVICE:
                g_value_set_string (value, OPENVPN_PLUGIN_SERVICE);
                break;
        default:
@@ -774,16 +810,16 @@ openvpn_plugin_ui_class_init (OpenvpnPluginUiClass *req_class)
        object_class->get_property = get_property;
 
        g_object_class_override_property (object_class,
-                                         NM_VPN_PLUGIN_UI_INTERFACE_PROP_NAME,
-                                         NM_VPN_PLUGIN_UI_INTERFACE_NAME);
+                                         PROP_NAME,
+                                         NM_VPN_EDITOR_PLUGIN_NAME);
 
        g_object_class_override_property (object_class,
-                                         NM_VPN_PLUGIN_UI_INTERFACE_PROP_DESC,
-                                         NM_VPN_PLUGIN_UI_INTERFACE_DESC);
+                                         PROP_DESC,
+                                         NM_VPN_EDITOR_PLUGIN_DESCRIPTION);
 
        g_object_class_override_property (object_class,
-                                         NM_VPN_PLUGIN_UI_INTERFACE_PROP_SERVICE,
-                                         NM_VPN_PLUGIN_UI_INTERFACE_SERVICE);
+                                         PROP_SERVICE,
+                                         NM_VPN_EDITOR_PLUGIN_SERVICE);
 }
 
 static void
@@ -792,19 +828,19 @@ openvpn_plugin_ui_init (OpenvpnPluginUi *plugin)
 }
 
 static void
-openvpn_plugin_ui_interface_init (NMVpnPluginUiInterface *iface_class)
+openvpn_plugin_ui_interface_init (NMVpnEditorPluginInterface *iface_class)
 {
        /* interface implementation */
-       iface_class->ui_factory = ui_factory;
+       iface_class->get_editor = get_editor;
        iface_class->get_capabilities = get_capabilities;
        iface_class->import_from_file = import;
        iface_class->export_to_file = export;
-       iface_class->get_suggested_name = get_suggested_name;
+       iface_class->get_suggested_filename = get_suggested_filename;
 }
 
 
-G_MODULE_EXPORT NMVpnPluginUiInterface *
-nm_vpn_plugin_ui_factory (GError **error)
+G_MODULE_EXPORT NMVpnEditorPlugin *
+nm_vpn_editor_plugin_factory (GError **error)
 {
        if (error)
                g_return_val_if_fail (*error == NULL, NULL);
@@ -812,6 +848,6 @@ nm_vpn_plugin_ui_factory (GError **error)
        bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
        bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
 
-       return NM_VPN_PLUGIN_UI_INTERFACE (g_object_new (OPENVPN_TYPE_PLUGIN_UI, NULL));
+       return g_object_new (OPENVPN_TYPE_PLUGIN_UI, NULL);
 }
 
diff --git a/properties/tests/Makefile.am b/properties/tests/Makefile.am
index 3ebab55..bfacb8c 100644
--- a/properties/tests/Makefile.am
+++ b/properties/tests/Makefile.am
@@ -18,7 +18,7 @@ test_import_export_LDADD = \
        $(GTK_LIBS) \
        $(NM_LIBS) \
        $(NMGTK_LIBS) \
-       $(top_builddir)/properties/libnm-openvpn-properties.la
+       $(top_builddir)/properties/libnm-openvpn-properties-old.la
 
 if WITH_TESTS
 


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