[network-manager-applet] libnm-gtk: split wireless and mobile dialogs in a separate library (bgo #657092)



commit 1ef13dd77b3c1bc92409bfd148f955c893f8469c
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Mon Aug 22 13:57:53 2011 +0200

    libnm-gtk: split wireless and mobile dialogs in a separate library (bgo #657092)
    
    Introduce a new libnm-gtk library, that will be used by
    gnome-control-center to replace the nm-applet dbus methods.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=657092

 configure.ac                                       |    2 +
 po/POTFILES.in                                     |    6 +-
 src/Makefile.am                                    |   12 +-
 src/applet-device-cdma.c                           |   20 ++--
 src/applet-device-gsm.c                            |   20 ++--
 src/applet-device-wifi.c                           |   10 +-
 src/applet.c                                       |    2 +-
 src/connection-editor/Makefile.am                  |    2 +
 src/connection-editor/page-mobile.c                |   42 ++++----
 src/gnome-bluetooth/Makefile.am                    |    2 +
 src/gnome-bluetooth/bt-widget.c                    |   30 +++---
 src/libnm-gtk/Makefile.am                          |   46 +++++++++
 src/libnm-gtk/libnm-gtk.pc.in                      |   13 +++
 .../nm-mobile-wizard.c}                            |  104 ++++++++++----------
 .../nm-mobile-wizard.h}                            |   28 +++---
 .../nm-wireless-dialog.c}                          |   40 +++++---
 .../nm-wireless-dialog.h}                          |   16 ++-
 src/{ => libnm-gtk}/wifi.ui                        |    0
 src/utils/Makefile.am                              |    5 +-
 19 files changed, 236 insertions(+), 164 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index f023547..2861c50 100644
--- a/configure.ac
+++ b/configure.ac
@@ -162,6 +162,8 @@ GNOME_MAINTAINER_MODE_DEFINES
 AC_CONFIG_FILES([
 Makefile
 src/Makefile
+src/libnm-gtk/Makefile
+src/libnm-gtk/libnm-gtk.pc
 src/marshallers/Makefile
 src/utils/Makefile
 src/utils/tests/Makefile
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 0dc16d0..4afbe21 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -15,7 +15,6 @@ src/applet.c
 src/applet.h
 [type: gettext/glade]src/gsm-unlock.ui
 [type: gettext/glade]src/info.ui
-[type: gettext/glade]src/wifi.ui
 [type: gettext/glade]src/wired-8021x.ui
 src/connection-editor/ce-page.c
 [type: gettext/glade]src/connection-editor/ce-ip4-routes.ui
@@ -47,12 +46,13 @@ src/connection-editor/nm-connection-editor.c
 src/connection-editor/nm-connection-list.c
 src/connection-editor/vpn-helpers.c
 src/gnome-bluetooth/bt-widget.c
+src/libnm-gtk/nm-mobile-wizard.c
+src/libnm-gtk/nm-wireless-dialog.c
+[type: gettext/glade]src/libnm-gtk/wifi.ui
 src/main.c
 src/mb-menu-item.c
-src/utils/mobile-wizard.c
 src/utils/nmn-mobile-providers.c
 src/wired-dialog.c
-src/wireless-dialog.c
 src/wireless-security/eap-method.c
 [type: gettext/glade]src/wireless-security/eap-method-leap.ui
 src/wireless-security/eap-method-peap.c
diff --git a/src/Makefile.am b/src/Makefile.am
index fde4fbe..c4808e6 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = marshallers utils gconf-helpers wireless-security connection-editor gnome-bluetooth
+SUBDIRS = marshallers utils gconf-helpers wireless-security libnm-gtk connection-editor gnome-bluetooth
 
 bin_PROGRAMS = nm-applet
 
@@ -21,7 +21,8 @@ nm_applet_CPPFLAGS = \
 	-I${top_builddir}/src/marshallers \
 	-I${top_srcdir}/src/utils \
 	-I${top_srcdir}/src/gconf-helpers  \
-	-I${top_srcdir}/src/wireless-security
+	-I${top_srcdir}/src/wireless-security \
+	-I${top_srcdir}/src/libnm-gtk
 
 BUILT_SOURCES = applet-dbus-bindings.h
 
@@ -38,8 +39,6 @@ nm_applet_SOURCES = \
 	applet-vpn-request.h \
 	wired-dialog.h \
 	wired-dialog.c \
-	wireless-dialog.h \
-	wireless-dialog.c \
 	applet-dialogs.h \
 	applet-dialogs.c \
 	applet-device-wired.h \
@@ -72,10 +71,11 @@ nm_applet_LDADD = \
 	${top_builddir}/src/marshallers/libmarshallers.la \
 	${top_builddir}/src/utils/libutils.la \
 	${top_builddir}/src/gconf-helpers/libgconf-helpers.la \
-	${top_builddir}/src/wireless-security/libwireless-security.la
+	${top_builddir}/src/wireless-security/libwireless-security.la \
+	${top_builddir}/src/libnm-gtk/libnm-gtk.la
 
 uidir = $(datadir)/nm-applet
-ui_DATA = gsm-unlock.ui info.ui wired-8021x.ui wifi.ui keyring.png
+ui_DATA = gsm-unlock.ui info.ui wired-8021x.ui keyring.png
 
 CLEANFILES = *.bak $(BUILT_SOURCES)
 
diff --git a/src/applet-device-cdma.c b/src/applet-device-cdma.c
index fe2e435..7894df2 100644
--- a/src/applet-device-cdma.c
+++ b/src/applet-device-cdma.c
@@ -39,7 +39,7 @@
 #include "applet.h"
 #include "applet-device-cdma.h"
 #include "utils.h"
-#include "mobile-wizard.h"
+#include "nm-mobile-wizard.h"
 #include "applet-dialogs.h"
 #include "nma-marshal.h"
 #include "nmn-mobile-providers.h"
@@ -94,9 +94,9 @@ typedef struct {
 } AutoCdmaWizardInfo;
 
 static void
-mobile_wizard_done (MobileWizard *wizard,
+mobile_wizard_done (NMAMobileWizard *wizard,
                     gboolean canceled,
-                    MobileWizardAccessMethod *method,
+                    NMAMobileWizardAccessMethod *method,
                     gpointer user_data)
 {
 	AutoCdmaWizardInfo *info = user_data;
@@ -155,7 +155,7 @@ done:
 	(*(info->callback)) (connection, TRUE, canceled, info->callback_data);
 
 	if (wizard)
-		mobile_wizard_destroy (wizard);
+		nma_mobile_wizard_destroy (wizard);
 	g_free (info);
 }
 
@@ -163,23 +163,23 @@ static gboolean
 do_mobile_wizard (AppletNewAutoConnectionCallback callback,
                   gpointer callback_data)
 {
-	MobileWizard *wizard;
+	NMAMobileWizard *wizard;
 	AutoCdmaWizardInfo *info;
-	MobileWizardAccessMethod *method;
+	NMAMobileWizardAccessMethod *method;
 
 	info = g_malloc0 (sizeof (AutoCdmaWizardInfo));
 	info->callback = callback;
 	info->callback_data = callback_data;
 
-	wizard = mobile_wizard_new (NULL, NULL, NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO, FALSE,
-	                            mobile_wizard_done, info);
+	wizard = nma_mobile_wizard_new (NULL, NULL, NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO, FALSE,
+									mobile_wizard_done, info);
 	if (wizard) {
-		mobile_wizard_present (wizard);
+		nma_mobile_wizard_present (wizard);
 		return TRUE;
 	}
 
 	/* Fall back to something */
-	method = g_malloc0 (sizeof (MobileWizardAccessMethod));
+	method = g_malloc0 (sizeof (NMAMobileWizardAccessMethod));
 	method->devtype = NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO;
 	method->provider_name = _("CDMA");
 	mobile_wizard_done (NULL, FALSE, method, info);
diff --git a/src/applet-device-gsm.c b/src/applet-device-gsm.c
index c08d02e..d2740ef 100644
--- a/src/applet-device-gsm.c
+++ b/src/applet-device-gsm.c
@@ -41,7 +41,7 @@
 #include "applet.h"
 #include "applet-device-gsm.h"
 #include "utils.h"
-#include "mobile-wizard.h"
+#include "nm-mobile-wizard.h"
 #include "applet-dialogs.h"
 #include "mb-menu-item.h"
 #include "nma-marshal.h"
@@ -119,9 +119,9 @@ typedef struct {
 } AutoGsmWizardInfo;
 
 static void
-mobile_wizard_done (MobileWizard *wizard,
+mobile_wizard_done (NMAMobileWizard *wizard,
                     gboolean canceled,
-                    MobileWizardAccessMethod *method,
+                    NMAMobileWizardAccessMethod *method,
                     gpointer user_data)
 {
 	AutoGsmWizardInfo *info = user_data;
@@ -181,7 +181,7 @@ done:
 	(*(info->callback)) (connection, TRUE, canceled, info->callback_data);
 
 	if (wizard)
-		mobile_wizard_destroy (wizard);
+		nma_mobile_wizard_destroy (wizard);
 	g_free (info);
 }
 
@@ -189,23 +189,23 @@ static gboolean
 do_mobile_wizard (AppletNewAutoConnectionCallback callback,
                   gpointer callback_data)
 {
-	MobileWizard *wizard;
+	NMAMobileWizard *wizard;
 	AutoGsmWizardInfo *info;
-	MobileWizardAccessMethod *method;
+	NMAMobileWizardAccessMethod *method;
 
 	info = g_malloc0 (sizeof (AutoGsmWizardInfo));
 	info->callback = callback;
 	info->callback_data = callback_data;
 
-	wizard = mobile_wizard_new (NULL, NULL, NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS, FALSE,
-	                            mobile_wizard_done, info);
+	wizard = nma_mobile_wizard_new (NULL, NULL, NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS, FALSE,
+									mobile_wizard_done, info);
 	if (wizard) {
-		mobile_wizard_present (wizard);
+		nma_mobile_wizard_present (wizard);
 		return TRUE;
 	}
 
 	/* Fall back to something */
-	method = g_malloc0 (sizeof (MobileWizardAccessMethod));
+	method = g_malloc0 (sizeof (NMAMobileWizardAccessMethod));
 	method->devtype = NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS;
 	method->provider_name = _("GSM");
 	mobile_wizard_done (NULL, FALSE, method, info);
diff --git a/src/applet-device-wifi.c b/src/applet-device-wifi.c
index 2045d59..3781b86 100644
--- a/src/applet-device-wifi.c
+++ b/src/applet-device-wifi.c
@@ -45,7 +45,7 @@
 #include "applet-device-wifi.h"
 #include "ap-menu-item.h"
 #include "utils.h"
-#include "wireless-dialog.h"
+#include "nm-wireless-dialog.h"
 
 #define ACTIVE_AP_TAG "active-ap"
 
@@ -77,7 +77,7 @@ applet_wifi_connect_to_hidden_network (NMApplet *applet)
 {
 	GtkWidget *dialog;
 
-	dialog = nma_wireless_dialog_new_for_other (applet);
+	dialog = nma_wireless_dialog_new_for_other (applet->nm_client, applet->settings);
 	if (dialog) {
 		g_signal_connect (dialog, "response",
 		                  G_CALLBACK (wireless_dialog_response_cb),
@@ -130,7 +130,7 @@ applet_wifi_create_wifi_network (NMApplet *applet)
 {
 	GtkWidget *dialog;
 
-	dialog = nma_wireless_dialog_new_for_create (applet);
+	dialog = nma_wireless_dialog_new_for_create (applet->nm_client, applet->settings);
 	if (dialog) {
 		g_signal_connect (dialog, "response",
 		                  G_CALLBACK (wireless_dialog_response_cb),
@@ -471,7 +471,7 @@ _do_new_auto_connection (NMApplet *applet,
 		more_info->callback = callback;
 		more_info->callback_data = callback_data;
 
-		dialog = nma_wireless_dialog_new (applet, connection, device, ap, FALSE);
+		dialog = nma_wireless_dialog_new (applet->nm_client, applet->settings, connection, device, ap, FALSE);
 		if (dialog) {
 			g_signal_connect (dialog, "response",
 				              G_CALLBACK (more_info_wifi_dialog_response_cb),
@@ -1673,7 +1673,7 @@ wireless_get_secrets (SecretsRequest *req, GError **error)
 
 	applet_secrets_request_set_free_func (req, free_wifi_info);
 
-	info->dialog = nma_wireless_dialog_new (req->applet, req->connection, NULL, NULL, TRUE);
+	info->dialog = nma_wireless_dialog_new (req->applet->nm_client, req->applet->settings, req->connection, NULL, NULL, TRUE);
 	if (info->dialog) {
 		g_signal_connect (info->dialog, "response",
 		                  G_CALLBACK (get_secrets_dialog_response_cb),
diff --git a/src/applet.c b/src/applet.c
index 84bd3b9..47ce4bf 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -73,7 +73,7 @@
 #include "applet-device-bt.h"
 #include "applet-device-wimax.h"
 #include "applet-dialogs.h"
-#include "wireless-dialog.h"
+#include "nm-wireless-dialog.h"
 #include "applet-vpn-request.h"
 #include "utils.h"
 #include "gconf-helpers.h"
diff --git a/src/connection-editor/Makefile.am b/src/connection-editor/Makefile.am
index 98000a5..59d2b50 100644
--- a/src/connection-editor/Makefile.am
+++ b/src/connection-editor/Makefile.am
@@ -14,6 +14,7 @@ nm_connection_editor_CPPFLAGS = \
 	$(DISABLE_DEPRECATED) \
 	-I${top_srcdir}/src/utils \
 	-I${top_srcdir}/src/wireless-security \
+	-I${top_srcdir}/src/libnm-gtk \
 	-I${top_builddir}/src/marshallers
 
 nm_connection_editor_SOURCES = \
@@ -62,6 +63,7 @@ nm_connection_editor_LDADD = \
 	${top_builddir}/src/wireless-security/libwireless-security.la \
 	${top_builddir}/src/utils/libutils.la \
 	${top_builddir}/src/marshallers/libmarshallers.la \
+	${top_builddir}/src/libnm-gtk/libnm-gtk.la \
 	$(GTK_LIBS) \
 	$(NMA_LIBS) \
 	-lm
diff --git a/src/connection-editor/page-mobile.c b/src/connection-editor/page-mobile.c
index 042264d..9ae7c65 100644
--- a/src/connection-editor/page-mobile.c
+++ b/src/connection-editor/page-mobile.c
@@ -36,7 +36,7 @@
 
 #include "page-mobile.h"
 #include "nm-connection-editor.h"
-#include "mobile-wizard.h"
+#include "nm-mobile-wizard.h"
 
 G_DEFINE_TYPE (CEPageMobile, ce_page_mobile, CE_TYPE_PAGE)
 
@@ -192,16 +192,16 @@ show_passwords (GtkToggleButton *button, gpointer user_data)
 }
 
 static void
-apn_button_mobile_wizard_done (MobileWizard *wizard,
+apn_button_mobile_wizard_done (NMAMobileWizard *wizard,
                                gboolean canceled,
-                               MobileWizardAccessMethod *method,
+                               NMAMobileWizardAccessMethod *method,
                                gpointer user_data)
 {
 	CEPageMobile *self = CE_PAGE_MOBILE (user_data);
 	CEPageMobilePrivate *priv = CE_PAGE_MOBILE_GET_PRIVATE (self);
 
 	if (canceled || !method) {
-		mobile_wizard_destroy (wizard);
+		nma_mobile_wizard_destroy (wizard);
 		return;
 	}
 
@@ -227,7 +227,7 @@ apn_button_mobile_wizard_done (MobileWizard *wizard,
 		}
 	}
 
-	mobile_wizard_destroy (wizard);
+	nma_mobile_wizard_destroy (wizard);
 }
 
 static void
@@ -235,7 +235,7 @@ apn_button_clicked (GtkButton *button, gpointer user_data)
 {
 	CEPageMobile *self = CE_PAGE_MOBILE (user_data);
 	CEPageMobilePrivate *priv = CE_PAGE_MOBILE_GET_PRIVATE (self);
-	MobileWizard *wizard;
+	NMAMobileWizard *wizard;
 	GtkWidget *toplevel;
 
 	toplevel = gtk_widget_get_toplevel (CE_PAGE (self)->page);
@@ -246,14 +246,14 @@ apn_button_clicked (GtkButton *button, gpointer user_data)
 		priv->window_added = TRUE;
 	}
 
-	wizard = mobile_wizard_new (GTK_WINDOW (toplevel),
-	                            priv->window_group,
-	                            NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS,
-	                            FALSE,
-	                            apn_button_mobile_wizard_done,
-	                            self);
+	wizard = nma_mobile_wizard_new (GTK_WINDOW (toplevel),
+									priv->window_group,
+									NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS,
+									FALSE,
+									apn_button_mobile_wizard_done,
+									self);
 	if (wizard)
-		mobile_wizard_present (wizard);
+		nma_mobile_wizard_present (wizard);
 }
 
 static void
@@ -545,9 +545,9 @@ typedef struct {
 } WizardInfo;
 
 static void
-new_connection_mobile_wizard_done (MobileWizard *wizard,
+new_connection_mobile_wizard_done (NMAMobileWizard *wizard,
                                    gboolean canceled,
-                                   MobileWizardAccessMethod *method,
+                                   NMAMobileWizardAccessMethod *method,
                                    gpointer user_data)
 {
 	WizardInfo *info = user_data;
@@ -600,7 +600,7 @@ new_connection_mobile_wizard_done (MobileWizard *wizard,
 	(*info->result_func) (connection, canceled, NULL, info->user_data);
 
 	if (wizard)
-		mobile_wizard_destroy (wizard);
+		nma_mobile_wizard_destroy (wizard);
 	g_free (info);
 }
 
@@ -616,22 +616,22 @@ mobile_connection_new (GtkWindow *parent,
                        PageGetConnectionsFunc get_connections_func,
                        gpointer user_data)
 {
-	MobileWizard *wizard;
+	NMAMobileWizard *wizard;
 	WizardInfo *info;
 	GtkWidget *dialog, *vbox, *gsm_radio, *cdma_radio, *label, *content, *alignment;
 	GtkWidget *hbox, *image;
 	gint response;
-	MobileWizardAccessMethod method;
+	NMAMobileWizardAccessMethod method;
 
 	info = g_malloc0 (sizeof (WizardInfo));
 	info->result_func = result_func;
 	info->get_connections_func = get_connections_func;
 	info->user_data = user_data;
 
-	wizard = mobile_wizard_new (parent, NULL, NM_DEVICE_MODEM_CAPABILITY_NONE, FALSE,
-	                            new_connection_mobile_wizard_done, info);
+	wizard = nma_mobile_wizard_new (parent, NULL, NM_DEVICE_MODEM_CAPABILITY_NONE, FALSE,
+									new_connection_mobile_wizard_done, info);
 	if (wizard) {
-		mobile_wizard_present (wizard);
+		nma_mobile_wizard_present (wizard);
 		return;
 	}
 
diff --git a/src/gnome-bluetooth/Makefile.am b/src/gnome-bluetooth/Makefile.am
index 1ed8fc7..b5f93f0 100644
--- a/src/gnome-bluetooth/Makefile.am
+++ b/src/gnome-bluetooth/Makefile.am
@@ -5,6 +5,7 @@ INCLUDES = \
 	-I$(top_builddir) \
 	-I${top_builddir}/src/marshallers \
 	-I${top_srcdir}/src/utils \
+	-I${top_srcdir}/src/libnm-gtk \
 	$(GNOME_BLUETOOTH_CFLAGS) \
 	$(DISABLE_DEPRECATED) \
 	$(WARN_CFLAGS)
@@ -23,6 +24,7 @@ libnma_la_LDFLAGS = -module -avoid-version
 libnma_la_LIBADD = \
 	$(top_builddir)/src/marshallers/libmarshallers.la \
 	$(top_builddir)/src/utils/libutils.la \
+	$(top_builddir)/src/libnm-gtk/libnm-gtk.la \
 	$(GNOME_BLUETOOTH_LIBS)
 endif
 
diff --git a/src/gnome-bluetooth/bt-widget.c b/src/gnome-bluetooth/bt-widget.c
index df850d9..972916d 100644
--- a/src/gnome-bluetooth/bt-widget.c
+++ b/src/gnome-bluetooth/bt-widget.c
@@ -49,7 +49,7 @@
 #include <dbus/dbus-glib.h>
 
 #include "nma-marshal.h"
-#include "mobile-wizard.h"
+#include "nm-mobile-wizard.h"
 
 #define DBUS_TYPE_G_MAP_OF_VARIANT (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE))
 
@@ -96,7 +96,7 @@ typedef struct {
 	char *rfcomm_iface;
 	guint dun_timeout_id;
 
-	MobileWizard *wizard;
+	NMAMobileWizard *wizard;
 	GtkWindowGroup *window_group;
 } PluginInfo;
 
@@ -349,7 +349,7 @@ dun_cleanup (PluginInfo *info, const char *message, gboolean uncheck)
 	}
 
 	if (info->wizard) {
-		mobile_wizard_destroy (info->wizard);
+		nma_mobile_wizard_destroy (info->wizard);
 		info->wizard = NULL;
 	}
 
@@ -379,7 +379,7 @@ dun_error (PluginInfo *info, const char *func, GError *error, const char *fallba
 }
 
 static NMConnection *
-dun_new_cdma (MobileWizardAccessMethod *method)
+dun_new_cdma (NMAMobileWizardAccessMethod *method)
 {
 	NMConnection *connection;
 	NMSetting *setting;
@@ -427,7 +427,7 @@ dun_new_cdma (MobileWizardAccessMethod *method)
 }
 
 static NMConnection *
-dun_new_gsm (MobileWizardAccessMethod *method)
+dun_new_gsm (NMAMobileWizardAccessMethod *method)
 {
 	NMConnection *connection;
 	NMSetting *setting;
@@ -495,9 +495,9 @@ dun_add_cb (NMRemoteSettings *settings,
 }
 
 static void
-wizard_done_cb (MobileWizard *self,
+wizard_done_cb (NMAMobileWizard *self,
                 gboolean canceled,
-                MobileWizardAccessMethod *method,
+                NMAMobileWizardAccessMethod *method,
                 gpointer user_data)
 {
 	PluginInfo *info = user_data;
@@ -521,7 +521,7 @@ wizard_done_cb (MobileWizard *self,
 		return;
 	}
 
-	mobile_wizard_destroy (info->wizard);
+	nma_mobile_wizard_destroy (info->wizard);
 	info->wizard = NULL;
 
 	g_assert (connection);
@@ -630,13 +630,13 @@ modem_get_all_cb (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data)
 		}
 
 		/* Start the mobile wizard */
-		info->wizard = mobile_wizard_new (parent ? GTK_WINDOW (parent) : NULL,
-		                                  info->window_group,
-		                                  devtype,
-		                                  FALSE,
-		                                  wizard_done_cb,
-		                                  info);
-		mobile_wizard_present (info->wizard);
+		info->wizard = nma_mobile_wizard_new (parent ? GTK_WINDOW (parent) : NULL,
+											  info->window_group,
+											  devtype,
+											  FALSE,
+											  wizard_done_cb,
+											  info);
+		nma_mobile_wizard_present (info->wizard);
 	}
 
 out:
diff --git a/src/libnm-gtk/Makefile.am b/src/libnm-gtk/Makefile.am
new file mode 100644
index 0000000..7ac24fe
--- /dev/null
+++ b/src/libnm-gtk/Makefile.am
@@ -0,0 +1,46 @@
+uidir = $(datadir)/libnm-gtk
+ui_DATA = wifi.ui
+
+libnmgtkdir = $(includedir)/libnm-gtk
+
+libnmgtk_HEADERS = \
+	nm-wireless-dialog.h \
+	nm-mobile-wizard.h
+
+lib_LTLIBRARIES = libnm-gtk.la
+
+libnm_gtk_la_SOURCES = \
+	nm-wireless-dialog.c \
+	nm-mobile-wizard.c
+
+libnm_gtk_la_CFLAGS = \
+	$(GTK_CFLAGS) \
+	$(NMA_CFLAGS) \
+	$(DBUS_CFLAGS) \
+	$(GNOME_KEYRING_CFLAGS) \
+	-DICONDIR=\""$(datadir)/icons"\" \
+	-DUIDIR=\""$(uidir)"\" \
+	-DBINDIR=\""$(bindir)"\" \
+	-DSYSCONFDIR=\""$(sysconfdir)"\" \
+	-DLIBEXECDIR=\""$(libexecdir)"\" \
+	-DAUTOSTARTDIR=\""$(sysconfdir)/xdg/autostart"\" \
+	-DVPN_NAME_FILES_DIR=\""$(sysconfdir)/NetworkManager/VPN"\" \
+	-DNMALOCALEDIR=\"$(datadir)/locale\" \
+	$(DISABLE_DEPRECATED) \
+	-I${top_builddir}/src/marshallers \
+	-I${top_srcdir}/src/utils \
+	-I${top_srcdir}/src/wireless-security
+
+libnm_gtk_la_LIBADD = \
+	$(GTK_LIBS) \
+	$(NMA_LIBS) \
+	$(GNOME_KEYRING_LIBS) \
+	$(top_builddir)/src/marshallers/libmarshallers.la \
+	$(top_builddir)/src/wireless-security/libwireless-security.la
+
+libnm_gtk_la_LDFLAGS = -Wl,-no-undefined
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = libnm-gtk.pc
+
+EXTRA_DIST = libnm-gtk.pc.in $(ui_DATA)
\ No newline at end of file
diff --git a/src/libnm-gtk/libnm-gtk.pc.in b/src/libnm-gtk/libnm-gtk.pc.in
new file mode 100644
index 0000000..88a222f
--- /dev/null
+++ b/src/libnm-gtk/libnm-gtk.pc.in
@@ -0,0 +1,13 @@
+prefix= prefix@
+exec_prefix= exec_prefix@
+includedir= includedir@
+libdir= libdir@
+nmversion=0.8.998
+
+Name: libnm-gtk
+Description: NetworkManager Gtk+ dialogs
+Version: @PACKAGE_VERSION@
+Requires: NetworkManager >= ${nmversion} libnm-util >= ${nmversion} libnm-glib >= ${nmversion} gtk+-3.0 >= 2.91.4
+Requires.private: dbus-glib-1
+Cflags: -I${includedir}/libnm-gtk
+Libs: -L${libdir} -lnm-gtk
\ No newline at end of file
diff --git a/src/utils/mobile-wizard.c b/src/libnm-gtk/nm-mobile-wizard.c
similarity index 95%
rename from src/utils/mobile-wizard.c
rename to src/libnm-gtk/nm-mobile-wizard.c
index 471e488..9154ffb 100644
--- a/src/utils/mobile-wizard.c
+++ b/src/libnm-gtk/nm-mobile-wizard.c
@@ -36,21 +36,21 @@
 #include <nm-client.h>
 #include <nm-device-modem.h>
 
-#include "mobile-wizard.h"
+#include "nm-mobile-wizard.h"
 #include "nmn-mobile-providers.h"
 #include "utils.h"
 
 #define DEVICE_TAG "device"
 #define TYPE_TAG "setting-type"
 
-static char *get_selected_country (MobileWizard *self, gboolean *unlisted);
-static NmnMobileProvider *get_selected_provider (MobileWizard *self);
-static NmnMobileAccessMethodType get_provider_unlisted_type (MobileWizard *self);
-static NmnMobileAccessMethod *get_selected_method (MobileWizard *self, gboolean *manual);
+static char *get_selected_country (NMAMobileWizard *self, gboolean *unlisted);
+static NmnMobileProvider *get_selected_provider (NMAMobileWizard *self);
+static NmnMobileAccessMethodType get_provider_unlisted_type (NMAMobileWizard *self);
+static NmnMobileAccessMethod *get_selected_method (NMAMobileWizard *self, gboolean *manual);
 
-struct MobileWizard {
+struct NMAMobileWizard {
 	GtkWidget *assistant;
-	MobileWizardCallback callback;
+	NMAMobileWizardCallback callback;
 	gpointer user_data;
 	GHashTable *providers;
 	GHashTable *country_codes;
@@ -111,13 +111,13 @@ struct MobileWizard {
 static void
 assistant_closed (GtkButton *button, gpointer user_data)
 {
-	MobileWizard *self = user_data;
+	NMAMobileWizard *self = user_data;
 	NmnMobileProvider *provider;
 	NmnMobileAccessMethod *method;
-	MobileWizardAccessMethod *wiz_method;
+	NMAMobileWizardAccessMethod *wiz_method;
 	NmnMobileAccessMethodType method_type = self->method_type;
 
-	wiz_method = g_malloc0 (sizeof (MobileWizardAccessMethod));
+	wiz_method = g_malloc0 (sizeof (NMAMobileWizardAccessMethod));
 
 	provider = get_selected_provider (self);
 	if (!provider) {
@@ -175,7 +175,7 @@ assistant_closed (GtkButton *button, gpointer user_data)
 static void
 assistant_cancel (GtkButton *button, gpointer user_data)
 {
-	MobileWizard *self = user_data;
+	NMAMobileWizard *self = user_data;
 
 	(*(self->callback)) (self, TRUE, NULL, self->user_data);
 }
@@ -185,7 +185,7 @@ assistant_cancel (GtkButton *button, gpointer user_data)
 /**********************************************************/
 
 static void
-confirm_setup (MobileWizard *self)
+confirm_setup (NMAMobileWizard *self)
 {
 	GtkWidget *vbox, *label, *alignment, *pbox;
 
@@ -270,7 +270,7 @@ confirm_setup (MobileWizard *self)
 }
 
 static void
-confirm_prepare (MobileWizard *self)
+confirm_prepare (NMAMobileWizard *self)
 {
 	NmnMobileProvider *provider = NULL;
 	NmnMobileAccessMethod *method = NULL;
@@ -342,7 +342,7 @@ confirm_prepare (MobileWizard *self)
 #define PLAN_COL_MANUAL 2
 
 static NmnMobileAccessMethod *
-get_selected_method (MobileWizard *self, gboolean *manual)
+get_selected_method (NMAMobileWizard *self, gboolean *manual)
 {
 	GtkTreeModel *model;
 	NmnMobileAccessMethod *method = NULL;
@@ -372,7 +372,7 @@ get_selected_method (MobileWizard *self, gboolean *manual)
 }
 
 static void
-plan_update_complete (MobileWizard *self)
+plan_update_complete (NMAMobileWizard *self)
 {
 	GtkAssistant *assistant = GTK_ASSISTANT (self->assistant);
 	gboolean is_manual = FALSE;
@@ -392,7 +392,7 @@ plan_update_complete (MobileWizard *self)
 }
 
 static void
-plan_combo_changed (MobileWizard *self)
+plan_combo_changed (NMAMobileWizard *self)
 {
 	NmnMobileAccessMethod *method = NULL;
 	gboolean is_manual = FALSE;
@@ -465,7 +465,7 @@ apn_filter_cb (GtkEntry *   entry,
 }
 
 static void
-plan_setup (MobileWizard *self)
+plan_setup (NMAMobileWizard *self)
 {
 	GtkWidget *vbox, *label, *alignment, *hbox, *image;
 	GtkCellRenderer *renderer;
@@ -540,7 +540,7 @@ plan_setup (MobileWizard *self)
 }
 
 static void
-plan_prepare (MobileWizard *self)
+plan_prepare (NMAMobileWizard *self)
 {
 	NmnMobileProvider *provider;
 	GtkTreeIter method_iter;
@@ -622,7 +622,7 @@ providers_search_func (GtkTreeModel *model,
 }
 
 static NmnMobileProvider *
-get_selected_provider (MobileWizard *self)
+get_selected_provider (NMAMobileWizard *self)
 {
 	GtkTreeSelection *selection;
 	GtkTreeModel *model = NULL;
@@ -643,7 +643,7 @@ get_selected_provider (MobileWizard *self)
 }
 
 static void
-providers_update_complete (MobileWizard *self)
+providers_update_complete (NMAMobileWizard *self)
 {
 	GtkAssistant *assistant = GTK_ASSISTANT (self->assistant);
 	gboolean use_view;
@@ -668,7 +668,7 @@ providers_update_complete (MobileWizard *self)
 static gboolean
 focus_providers_view (gpointer user_data)
 {
-	MobileWizard *self = user_data;
+	NMAMobileWizard *self = user_data;
 
 	self->providers_focus_id = 0;
 	gtk_widget_grab_focus (self->providers_view);
@@ -678,7 +678,7 @@ focus_providers_view (gpointer user_data)
 static gboolean
 focus_provider_unlisted_entry (gpointer user_data)
 {
-	MobileWizard *self = user_data;
+	NMAMobileWizard *self = user_data;
 
 	self->providers_focus_id = 0;
 	gtk_widget_grab_focus (self->provider_unlisted_entry);
@@ -688,7 +688,7 @@ focus_provider_unlisted_entry (gpointer user_data)
 static void
 providers_radio_toggled (GtkToggleButton *button, gpointer user_data)
 {
-	MobileWizard *self = user_data;
+	NMAMobileWizard *self = user_data;
 	gboolean use_view;
 
 	use_view = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (self->providers_view_radio));
@@ -710,7 +710,7 @@ providers_radio_toggled (GtkToggleButton *button, gpointer user_data)
 }
 
 static NmnMobileAccessMethodType
-get_provider_unlisted_type (MobileWizard *self)
+get_provider_unlisted_type (NMAMobileWizard *self)
 {
 	switch (gtk_combo_box_get_active (GTK_COMBO_BOX (self->provider_unlisted_type_combo))) {
 	case 0:
@@ -723,7 +723,7 @@ get_provider_unlisted_type (MobileWizard *self)
 }
 
 static void
-providers_setup (MobileWizard *self)
+providers_setup (NMAMobileWizard *self)
 {
 	GtkWidget *vbox, *scroll, *alignment, *unlisted_table, *label;
 	GtkCellRenderer *renderer;
@@ -835,7 +835,7 @@ providers_setup (MobileWizard *self)
 }
 
 static void
-providers_prepare (MobileWizard *self)
+providers_prepare (NMAMobileWizard *self)
 {
 	GtkTreeSelection *selection;
 	GSList *providers, *piter;
@@ -950,7 +950,7 @@ country_search_func (GtkTreeModel *model,
 static void
 add_one_country (gpointer key, gpointer value, gpointer user_data)
 {
-	MobileWizard *self = user_data;
+	NMAMobileWizard *self = user_data;
 	GtkTreeIter country_iter;
 	GtkTreePath *country_path, *country_view_path;
 
@@ -986,7 +986,7 @@ add_one_country (gpointer key, gpointer value, gpointer user_data)
 }
 
 static char *
-get_selected_country (MobileWizard *self, gboolean *out_unlisted)
+get_selected_country (NMAMobileWizard *self, gboolean *out_unlisted)
 {
 	GtkTreeSelection *selection;
 	GtkTreeModel *model = NULL;
@@ -1014,7 +1014,7 @@ get_selected_country (MobileWizard *self, gboolean *out_unlisted)
 }
 
 static void
-country_update_complete (MobileWizard *self)
+country_update_complete (NMAMobileWizard *self)
 {
 	char *country = NULL;
 	gboolean unlisted = FALSE;
@@ -1063,7 +1063,7 @@ out:
 }
 
 static void
-country_setup (MobileWizard *self)
+country_setup (NMAMobileWizard *self)
 {
 	GtkWidget *vbox, *label, *scroll, *alignment;
 	GtkCellRenderer *renderer;
@@ -1156,7 +1156,7 @@ country_setup (MobileWizard *self)
 static gboolean
 focus_country_view (gpointer user_data)
 {
-	MobileWizard *self = user_data;
+	NMAMobileWizard *self = user_data;
 
 	self->country_focus_id = 0;
 	gtk_widget_grab_focus (self->country_view);
@@ -1164,7 +1164,7 @@ focus_country_view (gpointer user_data)
 }
 
 static void
-country_prepare (MobileWizard *self)
+country_prepare (NMAMobileWizard *self)
 {
 	gtk_tree_view_set_search_column (GTK_TREE_VIEW (self->country_view), 0);
 	gtk_tree_view_set_search_equal_func (GTK_TREE_VIEW (self->country_view), country_search_func, self, NULL);
@@ -1184,7 +1184,7 @@ country_prepare (MobileWizard *self)
 #define INTRO_COL_SEPARATOR 2
 
 static gboolean
-__intro_device_added (MobileWizard *self, NMDevice *device, gboolean select_it)
+__intro_device_added (NMAMobileWizard *self, NMDevice *device, gboolean select_it)
 {
 	GtkTreeIter iter;
 	const char *desc = utils_get_device_description (device);
@@ -1219,13 +1219,13 @@ __intro_device_added (MobileWizard *self, NMDevice *device, gboolean select_it)
 }
 
 static void
-intro_device_added_cb (NMClient *client, NMDevice *device, MobileWizard *self)
+intro_device_added_cb (NMClient *client, NMDevice *device, NMAMobileWizard *self)
 {
 	__intro_device_added (self, device, TRUE);
 }
 
 static void
-intro_device_removed_cb (NMClient *client, NMDevice *device, MobileWizard *self)
+intro_device_removed_cb (NMClient *client, NMDevice *device, NMAMobileWizard *self)
 {
 	GtkTreeIter iter;
 	gboolean have_device = FALSE, removed = FALSE;
@@ -1279,7 +1279,7 @@ intro_device_removed_cb (NMClient *client, NMDevice *device, MobileWizard *self)
 }
 
 static void
-intro_add_initial_devices (MobileWizard *self)
+intro_add_initial_devices (NMAMobileWizard *self)
 {
 	const GPtrArray *devices;
 	gboolean selected_first = FALSE;
@@ -1302,7 +1302,7 @@ intro_add_initial_devices (MobileWizard *self)
 }
 
 static void
-intro_remove_all_devices (MobileWizard *self)
+intro_remove_all_devices (NMAMobileWizard *self)
 {
 	gtk_tree_store_clear (self->dev_store);
 
@@ -1312,7 +1312,7 @@ intro_remove_all_devices (MobileWizard *self)
 }
 
 static void
-intro_manager_running_cb (NMClient *client, GParamSpec *pspec, MobileWizard *self)
+intro_manager_running_cb (NMClient *client, GParamSpec *pspec, NMAMobileWizard *self)
 {
 	if (nm_client_get_manager_running (client))
 		intro_add_initial_devices (self);
@@ -1329,7 +1329,7 @@ intro_row_separator_func (GtkTreeModel *model, GtkTreeIter *iter, gpointer data)
 }
 
 static void
-intro_combo_changed (MobileWizard *self)
+intro_combo_changed (NMAMobileWizard *self)
 {
 	GtkTreeIter iter;
 	NMDevice *selected = NULL;
@@ -1358,7 +1358,7 @@ intro_combo_changed (MobileWizard *self)
 }
 
 static void
-intro_setup (MobileWizard *self)
+intro_setup (NMAMobileWizard *self)
 {
 	GtkWidget *vbox, *label, *alignment, *info_vbox;
 	GtkCellRenderer *renderer;
@@ -1469,7 +1469,7 @@ intro_setup (MobileWizard *self)
 /**********************************************************/
 
 static void
-remove_provider_focus_idle (MobileWizard *self)
+remove_provider_focus_idle (NMAMobileWizard *self)
 {
 	if (self->providers_focus_id) {
 		g_source_remove (self->providers_focus_id);
@@ -1478,7 +1478,7 @@ remove_provider_focus_idle (MobileWizard *self)
 }
 
 static void
-remove_country_focus_idle (MobileWizard *self)
+remove_country_focus_idle (NMAMobileWizard *self)
 {
 	if (self->country_focus_id) {
 		g_source_remove (self->country_focus_id);
@@ -1489,7 +1489,7 @@ remove_country_focus_idle (MobileWizard *self)
 static void
 assistant_prepare (GtkAssistant *assistant, GtkWidget *page, gpointer user_data)
 {
-	MobileWizard *self = user_data;
+	NMAMobileWizard *self = user_data;
 
 	if (page != self->providers_page)
 		remove_provider_focus_idle (self);
@@ -1509,7 +1509,7 @@ assistant_prepare (GtkAssistant *assistant, GtkWidget *page, gpointer user_data)
 static gint
 forward_func (gint current_page, gpointer user_data)
 {
-	MobileWizard *self = user_data;
+	NMAMobileWizard *self = user_data;
 
 	if (current_page == self->providers_idx) {
 		NmnMobileAccessMethodType method_type = self->method_type;
@@ -1584,23 +1584,23 @@ get_country_from_locale (void)
 	return cc;
 }
 
-MobileWizard *
-mobile_wizard_new (GtkWindow *parent,
+NMAMobileWizard *
+nma_mobile_wizard_new (GtkWindow *parent,
                    GtkWindowGroup *window_group,
                    NMDeviceModemCapabilities modem_caps,
                    gboolean will_connect_after,
-                   MobileWizardCallback cb,
+                   NMAMobileWizardCallback cb,
                    gpointer user_data)
 {
-	MobileWizard *self;
+	NMAMobileWizard *self;
 	char *cc;
 
-	self = g_malloc0 (sizeof (MobileWizard));
+	self = g_malloc0 (sizeof (NMAMobileWizard));
 	g_return_val_if_fail (self != NULL, NULL);
 
 	self->providers = nmn_mobile_providers_parse (&(self->country_codes));
 	if (!self->providers || !self->country_codes) {
-		mobile_wizard_destroy (self);
+		nma_mobile_wizard_destroy (self);
 		return NULL;
 	}
 
@@ -1649,7 +1649,7 @@ mobile_wizard_new (GtkWindow *parent,
 }
 
 void
-mobile_wizard_present (MobileWizard *self)
+nma_mobile_wizard_present (NMAMobileWizard *self)
 {
 	g_return_if_fail (self != NULL);
 
@@ -1658,7 +1658,7 @@ mobile_wizard_present (MobileWizard *self)
 }
 
 void
-mobile_wizard_destroy (MobileWizard *self)
+nma_mobile_wizard_destroy (NMAMobileWizard *self)
 {
 	g_return_if_fail (self != NULL);
 
diff --git a/src/utils/mobile-wizard.h b/src/libnm-gtk/nm-mobile-wizard.h
similarity index 61%
rename from src/utils/mobile-wizard.h
rename to src/libnm-gtk/nm-mobile-wizard.h
index 0fc3e6c..21c7e48 100644
--- a/src/utils/mobile-wizard.h
+++ b/src/libnm-gtk/nm-mobile-wizard.h
@@ -27,7 +27,7 @@
 #include <NetworkManager.h>
 #include <nm-device.h>
 
-typedef struct MobileWizard MobileWizard;
+typedef struct NMAMobileWizard NMAMobileWizard;
 
 typedef struct {
 	char *provider_name;
@@ -36,23 +36,23 @@ typedef struct {
 	char *username;
 	char *password;
 	char *gsm_apn;
-} MobileWizardAccessMethod;
+} NMAMobileWizardAccessMethod;
 
-typedef void (*MobileWizardCallback) (MobileWizard *self,
-                                      gboolean canceled,
-                                      MobileWizardAccessMethod *method,
-                                      gpointer user_data);
+typedef void (*NMAMobileWizardCallback) (NMAMobileWizard *self,
+										 gboolean canceled,
+										 NMAMobileWizardAccessMethod *method,
+										 gpointer user_data);
 
-MobileWizard *mobile_wizard_new (GtkWindow *parent,
-                                 GtkWindowGroup *window_group,
-                                 NMDeviceModemCapabilities modem_caps,
-                                 gboolean will_connect_after,
-                                 MobileWizardCallback cb,
-                                 gpointer user_data);
+NMAMobileWizard *nma_mobile_wizard_new (GtkWindow *parent,
+										GtkWindowGroup *window_group,
+										NMDeviceModemCapabilities modem_caps,
+										gboolean will_connect_after,
+										NMAMobileWizardCallback cb,
+										gpointer user_data);
 
-void mobile_wizard_present (MobileWizard *wizard);
+void nma_mobile_wizard_present (NMAMobileWizard *wizard);
 
-void mobile_wizard_destroy (MobileWizard *self);
+void nma_mobile_wizard_destroy (NMAMobileWizard *self);
 
 #endif /* MOBILE_WIZARD_H */
 
diff --git a/src/wireless-dialog.c b/src/libnm-gtk/nm-wireless-dialog.c
similarity index 97%
rename from src/wireless-dialog.c
rename to src/libnm-gtk/nm-wireless-dialog.c
index 99b8aaf..0d79f75 100644
--- a/src/wireless-dialog.c
+++ b/src/libnm-gtk/nm-wireless-dialog.c
@@ -37,9 +37,7 @@
 #include <nm-setting-wireless.h>
 #include <nm-setting-ip4-config.h>
 
-#include "applet.h"
-#include "applet-dialogs.h"
-#include "wireless-dialog.h"
+#include "nm-wireless-dialog.h"
 #include "wireless-security.h"
 #include "utils.h"
 
@@ -56,7 +54,8 @@ typedef struct {
 } GetSecretsInfo;
 
 typedef struct {
-	NMApplet *applet;
+	NMClient *client;
+	NMRemoteSettings *settings;
 
 	GtkBuilder *builder;
 
@@ -461,7 +460,7 @@ connection_combo_init (NMAWirelessDialog *self, NMConnection *connection)
 		gtk_list_store_append (store, &tree_iter);
 		gtk_list_store_set (store, &tree_iter, C_SEP_COLUMN, TRUE, -1);
 
-		connections = applet_get_all_connections (priv->applet);
+		connections = nm_remote_settings_list_connections (priv->settings);
 		for (iter = connections; iter; iter = g_slist_next (iter)) {
 			NMConnection *candidate = NM_CONNECTION (iter->data);
 			NMSettingWireless *s_wireless;
@@ -643,7 +642,7 @@ device_combo_init (NMAWirelessDialog *self, NMDevice *device)
 		add_device_to_model (store, device);
 		num_added++;
 	} else {
-		devices = nm_client_get_devices (priv->applet->nm_client);
+		devices = nm_client_get_devices (priv->client);
 		if (devices->len == 0)
 			return FALSE;
 
@@ -1270,7 +1269,8 @@ nma_wireless_dialog_get_connection (NMAWirelessDialog *self,
 }
 
 GtkWidget *
-nma_wireless_dialog_new (NMApplet *applet,
+nma_wireless_dialog_new (NMClient *client,
+						 NMRemoteSettings *settings,
                          NMConnection *connection,
                          NMDevice *device,
                          NMAccessPoint *ap,
@@ -1280,8 +1280,9 @@ nma_wireless_dialog_new (NMApplet *applet,
 	NMAWirelessDialogPrivate *priv;
 	guint32 dev_caps;
 
-	g_return_val_if_fail (applet != NULL, NULL);
-	g_return_val_if_fail (connection != NULL, NULL);
+	g_return_val_if_fail (NM_IS_CLIENT (client), NULL);
+	g_return_val_if_fail (NM_IS_REMOTE_SETTINGS (settings), NULL);
+	g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
 
 	/* Ensure device validity */
 	if (device) {
@@ -1294,7 +1295,8 @@ nma_wireless_dialog_new (NMApplet *applet,
 	if (obj) {
 		priv = NMA_WIRELESS_DIALOG_GET_PRIVATE (obj);
 
-		priv->applet = applet;
+		priv->client = g_object_ref (client);
+		priv->settings = g_object_ref (settings);
 		if (ap)
 			priv->ap = g_object_ref (ap);
 
@@ -1312,12 +1314,13 @@ nma_wireless_dialog_new (NMApplet *applet,
 }
 
 static GtkWidget *
-internal_new_other (NMApplet *applet, gboolean create)
+internal_new_other (NMClient *client, NMRemoteSettings *settings, gboolean create)
 {
 	NMAWirelessDialog *self;
 	NMAWirelessDialogPrivate *priv;
 
-	g_return_val_if_fail (applet != NULL, NULL);
+	g_return_val_if_fail (NM_IS_CLIENT (client), NULL);
+	g_return_val_if_fail (NM_IS_REMOTE_SETTINGS (settings), NULL);
 
 	self = NMA_WIRELESS_DIALOG (g_object_new (NMA_TYPE_WIRELESS_DIALOG, NULL));
 	if (!self)
@@ -1325,7 +1328,8 @@ internal_new_other (NMApplet *applet, gboolean create)
 
 	priv = NMA_WIRELESS_DIALOG_GET_PRIVATE (self);
 
-	priv->applet = applet;
+	priv->client = g_object_ref (client);
+	priv->settings = g_object_ref (settings);
 	priv->sec_combo = GTK_WIDGET (gtk_builder_get_object (priv->builder, "security_combo"));
 	priv->group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
 	priv->adhoc_create = create;
@@ -1340,15 +1344,15 @@ internal_new_other (NMApplet *applet, gboolean create)
 }
 
 GtkWidget *
-nma_wireless_dialog_new_for_other (NMApplet *applet)
+nma_wireless_dialog_new_for_other (NMClient *client, NMRemoteSettings *settings)
 {
-	return internal_new_other (applet, FALSE);
+	return internal_new_other (client, settings, FALSE);
 }
 
 GtkWidget *
-nma_wireless_dialog_new_for_create (NMApplet *applet)
+nma_wireless_dialog_new_for_create (NMClient *client, NMRemoteSettings *settings)
 {
-	return internal_new_other (applet, TRUE);
+	return internal_new_other (client, settings, TRUE);
 }
 
 GtkWidget *
@@ -1410,6 +1414,8 @@ dispose (GObject *object)
 	if (priv->secrets_info)
 		priv->secrets_info->canceled = TRUE;
 
+	g_object_unref (priv->client);
+	g_object_unref (priv->settings);
 	g_object_unref (priv->builder);
 
 	model_free (priv->device_model, D_NAME_COLUMN);
diff --git a/src/wireless-dialog.h b/src/libnm-gtk/nm-wireless-dialog.h
similarity index 85%
rename from src/wireless-dialog.h
rename to src/libnm-gtk/nm-wireless-dialog.h
index 95848ff..a6a25ba 100644
--- a/src/wireless-dialog.h
+++ b/src/libnm-gtk/nm-wireless-dialog.h
@@ -19,8 +19,8 @@
  * (C) Copyright 2007 Red Hat, Inc.
  */
 
-#ifndef WIRELESS_DIALOG_H
-#define WIRELESS_DIALOG_H
+#ifndef NMA_WIRELESS_DIALOG_H
+#define NMA_WIRELESS_DIALOG_H
 
 #include <gtk/gtk.h>
 #include <glib.h>
@@ -29,6 +29,7 @@
 #include <nm-connection.h>
 #include <nm-device.h>
 #include <nm-access-point.h>
+#include <nm-remote-settings.h>
 
 #define NMA_TYPE_WIRELESS_DIALOG            (nma_wireless_dialog_get_type ())
 #define NMA_WIRELESS_DIALOG(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMA_TYPE_WIRELESS_DIALOG, NMAWirelessDialog))
@@ -47,15 +48,18 @@ typedef struct {
 
 GType nma_wireless_dialog_get_type (void);
 
-GtkWidget *nma_wireless_dialog_new (NMApplet *applet,
+GtkWidget *nma_wireless_dialog_new (NMClient *client,
+				    NMRemoteSettings *settings,
                                     NMConnection *connection,
                                     NMDevice *device,
                                     NMAccessPoint *ap,
                                     gboolean secrets_only);
 
-GtkWidget *nma_wireless_dialog_new_for_other (NMApplet *applet);
+GtkWidget *nma_wireless_dialog_new_for_other (NMClient *client,
+					      NMRemoteSettings *settings);
 
-GtkWidget *nma_wireless_dialog_new_for_create (NMApplet *applet);
+GtkWidget *nma_wireless_dialog_new_for_create (NMClient *client,
+					       NMRemoteSettings *settings);
 
 NMConnection * nma_wireless_dialog_get_connection (NMAWirelessDialog *dialog,
                                                    NMDevice **device,
@@ -67,5 +71,5 @@ void nma_wireless_dialog_set_nag_ignored (NMAWirelessDialog *dialog, gboolean ig
 
 gboolean nma_wireless_dialog_get_nag_ignored (NMAWirelessDialog *dialog);
 
-#endif	/* WIRELESS_DIALOG_H */
+#endif	/* NMA_WIRELESS_DIALOG_H */
 
diff --git a/src/wifi.ui b/src/libnm-gtk/wifi.ui
similarity index 100%
rename from src/wifi.ui
rename to src/libnm-gtk/wifi.ui
diff --git a/src/utils/Makefile.am b/src/utils/Makefile.am
index d161a8d..060a2d8 100644
--- a/src/utils/Makefile.am
+++ b/src/utils/Makefile.am
@@ -6,15 +6,12 @@ libutils_la_SOURCES = \
 	utils.c \
 	utils.h \
 	nmn-mobile-providers.h \
-	nmn-mobile-providers.c \
-	mobile-wizard.h \
-	mobile-wizard.c
+	nmn-mobile-providers.c
 
 libutils_la_CPPFLAGS = \
 	$(GTK_CFLAGS) \
 	$(NMA_CFLAGS) \
 	$(GNOME_KEYRING_CFLAGS) \
-	-DUIDIR=\""$(uidir)"\" \
 	-DDATADIR=\""$(datadir)"\" \
 	$(DISABLE_DEPRECATED) \
 	-I${top_srcdir}/src



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