[network-manager-pptp/lr/libnm: 9/15] properties: build also the libnm-glib version of the properties plugin



commit 19f79ea2d748f006428718a0ab5df8d3fc8e8145
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Fri Jul 17 15:04:42 2015 +0200

    properties: build also the libnm-glib version of the properties plugin

 configure.ac                 |    6 +++---
 nm-pptp-service.name.in      |    5 ++++-
 properties/Makefile.am       |   30 +++++++++++++++++++++++++-----
 properties/advanced-dialog.c |    7 +++++++
 properties/nm-pptp.c         |   23 ++++++++++++++++++-----
 5 files changed, 57 insertions(+), 14 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index b94e478..b0f24b4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -67,9 +67,9 @@ GLIB_CFLAGS="$GLIB_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32"
 PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1 >= 0.74)
 
 PKG_CHECK_MODULES(LIBNM_GLIB,
-                  NetworkManager >= 1.0
-                  libnm-glib >= 1.0
-                  libnm-glib-vpn >= 1.0)
+                  NetworkManager >= 1.1.0
+                  libnm-glib >= 1.1.0
+                  libnm-glib-vpn >= 1.1.0)
 
 if test x"$with_gnome" != xno; then
        PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.4)
diff --git a/nm-pptp-service.name.in b/nm-pptp-service.name.in
index af69a5f..7aab477 100644
--- a/nm-pptp-service.name.in
+++ b/nm-pptp-service.name.in
@@ -3,7 +3,10 @@ name=pptp
 service=org.freedesktop.NetworkManager.pptp
 program= LIBEXECDIR@/nm-pptp-service
 
+[libnm]
+plugin= PLUGINDIR@/libnm-pptp-properties
+
 [GNOME]
 auth-dialog= LIBEXECDIR@/nm-pptp-auth-dialog
-properties= PLUGINDIR@/libnm-pptp-properties
+properties= PLUGINDIR@/libnm-pptp-properties-old
 supports-external-ui-mode=true
diff --git a/properties/Makefile.am b/properties/Makefile.am
index c759ffa..33a6ded 100644
--- a/properties/Makefile.am
+++ b/properties/Makefile.am
@@ -1,5 +1,5 @@
 plugindir = $(libdir)/NetworkManager
-plugin_LTLIBRARIES = libnm-pptp-properties.la
+plugin_LTLIBRARIES = libnm-pptp-properties.la libnm-pptp-properties-old.la
 
 AM_CPPFLAGS = -I${top_srcdir}
 
@@ -11,29 +11,49 @@ libnm_pptp_properties_la_SOURCES = \
        import-export.c \
        import-export.h
 
+libnm_pptp_properties_old_la_SOURCES = \
+       $(libnm_pptp_properties_la_SOURCES)
+
 uidir = $(datadir)/gnome-vpn-properties/pptp
 ui_DATA = nm-pptp-dialog.ui
 
-libnm_pptp_properties_la_CFLAGS =                       \
+common_CFLAGS =                                         \
         $(GLIB_CFLAGS)                                  \
         $(GTK_CFLAGS)                                   \
-        $(LIBNMA_CFLAGS)                                \
-        $(LIBNM_CFLAGS)                                 \
-       -I$(top_srcdir)/src                             \
+        -I$(top_srcdir)/src                             \
         -DICONDIR=\""$(datadir)/pixmaps"\"              \
         -DUIDIR=\""$(uidir)"\"                          \
         -DLOCALEDIR=\""$(datadir)/locale"\"             \
         -DG_DISABLE_DEPRECATED                          \
         -DVERSION=\"$(VERSION)\"
 
+libnm_pptp_properties_la_CFLAGS =                       \
+        $(common_CFLAGS)                                \
+        $(LIBNM_CFLAGS)                                 \
+        $(LIBNMA_CFLAGS)
+
+libnm_pptp_properties_old_la_CFLAGS =                   \
+        -DNM_PPTP_OLD                                   \
+        $(common_CFLAGS)                                \
+        $(LIBNM_GLIB_CFLAGS)                            \
+        $(LIBNM_GTK_CFLAGS)
+
 libnm_pptp_properties_la_LIBADD = \
         $(GTK_LIBS) \
         $(LIBNM_LIBS) \
         $(LIBNMA_LIBS)
 
+libnm_pptp_properties_old_la_LIBADD = \
+        $(GTK_LIBS) \
+        $(LIBNM_GLIB_LIBS) \
+        $(LIBNM_GTK_LIBS)
+
 libnm_pptp_properties_la_LDFLAGS =   \
         -avoid-version
 
+libnm_pptp_properties_old_la_LDFLAGS =   \
+        $(libnm_pptp_properties_la_LDFLAGS)
+
 CLEANFILES = *.bak *~
 
 EXTRA_DIST =                            \
diff --git a/properties/advanced-dialog.c b/properties/advanced-dialog.c
index 10bb848..f0a4ddb 100644
--- a/properties/advanced-dialog.c
+++ b/properties/advanced-dialog.c
@@ -35,7 +35,14 @@
 #include <glib.h>
 #include <glib/gi18n-lib.h>
 
+#ifdef NM_PPTP_OLD
+#define NM_VPN_LIBNM_COMPAT
+#include <nm-connection.h>
+#include <nm-setting-vpn.h>
+
+#else /* !NM_PPTP_OLD */
 #include <NetworkManager.h>
+#endif
 
 #include "advanced-dialog.h"
 #include "nm-pptp.h"
diff --git a/properties/nm-pptp.c b/properties/nm-pptp.c
index 8f3070f..c687c4f 100644
--- a/properties/nm-pptp.c
+++ b/properties/nm-pptp.c
@@ -34,18 +34,31 @@
 #include <string.h>
 #include <gtk/gtk.h>
 
+#ifdef NM_PPTP_OLD
+#define NM_VPN_LIBNM_COMPAT
+#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-ui-utils.h>
+
+#define PPTP_PLUGIN_NAME    _("Point-to-Point Tunneling Protocol (PPTP)")
+#define PPTP_PLUGIN_DESC    _("Compatible with Microsoft and other PPTP VPN servers.")
+
+#else /* !NM_PPTP_OLD */
+
 #include <NetworkManager.h>
 #include <nma-ui-utils.h>
 
+#define PPTP_PLUGIN_NAME    _("pptp")
+#define PPTP_PLUGIN_DESC    _("Point-to-Point Tunneling Protocol (PPTP)")
+#endif
+
 #include "nm-pptp-service-defines.h"
 #include "nm-pptp.h"
 #include "import-export.h"
 #include "advanced-dialog.h"
 
-#define PPTP_PLUGIN_NAME    _("Point-to-Point Tunneling Protocol (PPTP)")
-#define PPTP_PLUGIN_DESC    _("Compatible with Microsoft and other PPTP VPN servers.")
-#define PPTP_PLUGIN_SERVICE NM_DBUS_SERVICE_PPTP
-
 typedef void (*ChangedCallback) (GtkWidget *widget, gpointer user_data);
 
 /************** plugin class **************/
@@ -686,7 +699,7 @@ get_property (GObject *object, guint prop_id,
                g_value_set_string (value, PPTP_PLUGIN_DESC);
                break;
        case PROP_SERVICE:
-               g_value_set_string (value, PPTP_PLUGIN_SERVICE);
+               g_value_set_string (value, NM_DBUS_SERVICE_PPTP);
                break;
        default:
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);


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