[network-manager-netbook] Move mobile providers handling to libnm-gtk



commit 6192cdb57584e91c3b09b934ef199abc76545e28
Author: Tambet Ingo <tambet gmail com>
Date:   Wed Dec 23 11:22:34 2009 +0200

    Move mobile providers handling to libnm-gtk

 configure.in                                       |    4 +-
 libnm-gtk/Makefile.am                              |    2 +
 .../nm-mobile-providers.c                          |   92 ++++++++++----------
 .../nm-mobile-providers.h                          |   52 ++++++------
 po/POTFILES.in                                     |    2 +-
 src/Makefile.am                                    |    2 -
 src/nmn-new-connection.c                           |   54 ++++++------
 7 files changed, 104 insertions(+), 104 deletions(-)
---
diff --git a/configure.in b/configure.in
index d603bfa..9545822 100644
--- a/configure.in
+++ b/configure.in
@@ -24,9 +24,9 @@ AM_GLIB_GNU_GETTEXT
 
 NM_REQUIRED=0.7.996
 
-PKG_CHECK_MODULES(LIBNM_GTK, gtk+-2.0 gconf-2.0 gnome-keyring-1 libnm-util >= $NM_REQUIRED libnm-glib >= $NM_REQUIRED)
+PKG_CHECK_MODULES(LIBNM_GTK, gtk+-2.0 gconf-2.0 gnome-keyring-1 libnm-util >= $NM_REQUIRED libnm-glib >= $NM_REQUIRED mobile-broadband-provider-info)
 
-PKG_CHECK_MODULES(NMN, dbus-glib-1 >= 0.75 gtk+-2.0 gconf-2.0 gnome-keyring-1 libnotify libnm-util >= $NM_REQUIRED libnm-glib >= $NM_REQUIRED mobile-broadband-provider-info moblin-panel nbtk-gtk-1.2)
+PKG_CHECK_MODULES(NMN, dbus-glib-1 >= 0.75 gtk+-2.0 gconf-2.0 gnome-keyring-1 libnotify libnm-util >= $NM_REQUIRED libnm-glib >= $NM_REQUIRED moblin-panel nbtk-gtk-1.2)
 
 dnl Check for gnome-bluetooth
 PKG_CHECK_MODULES(GNOME_BLUETOOTH,
diff --git a/libnm-gtk/Makefile.am b/libnm-gtk/Makefile.am
index 369a909..b4b1ff5 100644
--- a/libnm-gtk/Makefile.am
+++ b/libnm-gtk/Makefile.am
@@ -41,6 +41,7 @@ noinst_HEADERS = \
 	nm-item-provider.h \
 	nm-list-item.h \
 	nm-list-model.h \
+	nm-mobile-providers.h \
 	nm-status-icon.h \
 	nm-status-model.h \
 	nm-wifi-item.h \
@@ -74,6 +75,7 @@ libnm_gtk_la_SOURCES = \
 	nm-item-provider.c \
 	nm-list-item.c \
 	nm-list-model.c \
+	nm-mobile-providers.c \
 	nm-status-icon.c \
 	nm-status-model.c \
 	nm-wifi-item.c \
diff --git a/src/nmn-mobile-providers.c b/libnm-gtk/nm-mobile-providers.c
similarity index 90%
rename from src/nmn-mobile-providers.c
rename to libnm-gtk/nm-mobile-providers.c
index f446b44..54bead9 100644
--- a/src/nmn-mobile-providers.c
+++ b/libnm-gtk/nm-mobile-providers.c
@@ -23,7 +23,7 @@
 
 #include <glib/gi18n.h>
 
-#include "nmn-mobile-providers.h"
+#include "nm-mobile-providers.h"
 
 #define ISO_3166_COUNTRY_CODES "/usr/share/zoneinfo/iso3166.tab"
 
@@ -102,32 +102,32 @@ typedef struct {
 
     char *current_country;
     GSList *current_providers;
-    NmnMobileProvider *current_provider;
-    NmnMobileAccessMethod *current_method;
+    NMMobileProvider *current_provider;
+    NMMobileAccessMethod *current_method;
     GSList *mcc_mncs;
 
     char *text_buffer;
     MobileContextState state;
 } MobileParser;
 
-static NmnGsmMccMnc *
+static NMGsmMccMnc *
 mcc_mnc_new (const char *mcc, const char *mnc)
 {
-    NmnGsmMccMnc *m;
+    NMGsmMccMnc *m;
 
-    m = g_slice_new0 (NmnGsmMccMnc);
+    m = g_slice_new0 (NMGsmMccMnc);
     m->mcc = g_strdup (mcc);
     m->mnc = g_strdup (mnc);
     return m;
 }
 
 static void
-mcc_mnc_free (NmnGsmMccMnc *m)
+mcc_mnc_free (NMGsmMccMnc *m)
 {
     g_return_if_fail (m != NULL);
     g_free (m->mcc);
     g_free (m->mnc);
-    g_slice_free (NmnGsmMccMnc, m);
+    g_slice_free (NMGsmMccMnc, m);
 }
 
 static GSList *
@@ -136,7 +136,7 @@ mcc_mnc_list_copy (GSList *list)
     GSList *iter, *ret = NULL;
 
     for (iter = list; iter; iter = g_slist_next (iter)) {
-        NmnGsmMccMnc *m = iter->data;
+        NMGsmMccMnc *m = iter->data;
 
         ret = g_slist_prepend (ret, mcc_mnc_new (m->mcc, m->mnc));
     }
@@ -144,12 +144,12 @@ mcc_mnc_list_copy (GSList *list)
     return g_slist_reverse (ret);
 }
 
-static NmnMobileAccessMethod *
+static NMMobileAccessMethod *
 access_method_new (void)
 {
-    NmnMobileAccessMethod *method;
+    NMMobileAccessMethod *method;
 
-    method = g_slice_new0 (NmnMobileAccessMethod);
+    method = g_slice_new0 (NMMobileAccessMethod);
     method->refs = 1;
     method->lcl_names = g_hash_table_new_full (g_str_hash, g_str_equal,
                                                (GDestroyNotify) g_free,
@@ -158,8 +158,8 @@ access_method_new (void)
     return method;
 }
 
-NmnMobileAccessMethod *
-nmn_mobile_access_method_ref (NmnMobileAccessMethod *method)
+NMMobileAccessMethod *
+nm_mobile_access_method_ref (NMMobileAccessMethod *method)
 {
     g_return_val_if_fail (method != NULL, NULL);
     g_return_val_if_fail (method->refs > 0, NULL);
@@ -170,7 +170,7 @@ nmn_mobile_access_method_ref (NmnMobileAccessMethod *method)
 }
 
 void
-nmn_mobile_access_method_unref (NmnMobileAccessMethod *method)
+nm_mobile_access_method_unref (NMMobileAccessMethod *method)
 {
     g_return_if_fail (method != NULL);
     g_return_if_fail (method->refs > 0);
@@ -190,30 +190,30 @@ nmn_mobile_access_method_unref (NmnMobileAccessMethod *method)
 
         g_slist_free (method->cdma_sid);
 
-        g_slice_free (NmnMobileAccessMethod, method);
+        g_slice_free (NMMobileAccessMethod, method);
     }
 }
 
 GType
-nmn_mobile_access_method_get_type (void)
+nm_mobile_access_method_get_type (void)
 {
     static GType type = 0;
 
     if (G_UNLIKELY (type == 0)) {
-        type = g_boxed_type_register_static ("NmnMobileAccessMethod",
-                                             (GBoxedCopyFunc) nmn_mobile_access_method_ref,
-                                             (GBoxedFreeFunc) nmn_mobile_access_method_unref);
+        type = g_boxed_type_register_static ("NMMobileAccessMethod",
+                                             (GBoxedCopyFunc) nm_mobile_access_method_ref,
+                                             (GBoxedFreeFunc) nm_mobile_access_method_unref);
     }
     return type;
 }
 
 
-static NmnMobileProvider *
+static NMMobileProvider *
 provider_new (void)
 {
-    NmnMobileProvider *provider;
+    NMMobileProvider *provider;
 
-    provider = g_slice_new0 (NmnMobileProvider);
+    provider = g_slice_new0 (NMMobileProvider);
     provider->refs = 1;
     provider->lcl_names = g_hash_table_new_full (g_str_hash, g_str_equal,
                                                  (GDestroyNotify) g_free,
@@ -222,8 +222,8 @@ provider_new (void)
     return provider;
 }
 
-NmnMobileProvider *
-nmn_mobile_provider_ref (NmnMobileProvider *provider)
+NMMobileProvider *
+nm_mobile_provider_ref (NMMobileProvider *provider)
 {
     provider->refs++;
 
@@ -231,28 +231,28 @@ nmn_mobile_provider_ref (NmnMobileProvider *provider)
 }
 
 void
-nmn_mobile_provider_unref (NmnMobileProvider *provider)
+nm_mobile_provider_unref (NMMobileProvider *provider)
 {
     if (--provider->refs == 0) {
         g_free (provider->name);
         g_hash_table_destroy (provider->lcl_names);
 
-        g_slist_foreach (provider->methods, (GFunc) nmn_mobile_access_method_unref, NULL);
+        g_slist_foreach (provider->methods, (GFunc) nm_mobile_access_method_unref, NULL);
         g_slist_free (provider->methods);
 
-        g_slice_free (NmnMobileProvider, provider);
+        g_slice_free (NMMobileProvider, provider);
     }
 }
 
 GType
-nmn_mobile_provider_get_type (void)
+nm_mobile_provider_get_type (void)
 {
     static GType type = 0;
 
     if (G_UNLIKELY (type == 0)) {
-        type = g_boxed_type_register_static ("NmnMobileProvider",
-                                             (GBoxedCopyFunc) nmn_mobile_provider_ref,
-                                             (GBoxedFreeFunc) nmn_mobile_provider_unref);
+        type = g_boxed_type_register_static ("NMMobileProvider",
+                                             (GBoxedCopyFunc) nm_mobile_provider_ref,
+                                             (GBoxedFreeFunc) nm_mobile_provider_unref);
     }
     return type;
 }
@@ -263,7 +263,7 @@ provider_list_free (gpointer data)
     GSList *list = (GSList *) data;
 
     while (list) {
-        nmn_mobile_provider_unref ((NmnMobileProvider *) list->data);
+        nm_mobile_provider_unref ((NMMobileProvider *) list->data);
         list = g_slist_delete_link (list, list);
     }
 }
@@ -496,7 +496,7 @@ parser_gsm_apn_end (MobileParser *parser,
         parser->current_method->gateway = parser->text_buffer;
         parser->text_buffer = NULL;
     } else if (!strcmp (name, "apn")) {
-        parser->current_method->type = NMN_MOBILE_ACCESS_METHOD_TYPE_GSM;
+        parser->current_method->type = NM_MOBILE_ACCESS_METHOD_TYPE_GSM;
         parser->current_method->dns = g_slist_reverse (parser->current_method->dns);
         parser->current_method->gsm_mcc_mnc = mcc_mnc_list_copy (parser->mcc_mncs);
 
@@ -527,7 +527,7 @@ parser_cdma_end (MobileParser *parser,
         parser->current_method->gateway = parser->text_buffer;
         parser->text_buffer = NULL;
     } else if (!strcmp (name, "cdma")) {
-        parser->current_method->type = NMN_MOBILE_ACCESS_METHOD_TYPE_CDMA;
+        parser->current_method->type = NM_MOBILE_ACCESS_METHOD_TYPE_CDMA;
         parser->current_method->dns = g_slist_reverse (parser->current_method->dns);
         parser->current_method->cdma_sid = g_slist_reverse (parser->current_method->cdma_sid);
 
@@ -592,7 +592,7 @@ static const GMarkupParser mobile_parser = {
 };
 
 GHashTable *
-nmn_mobile_providers_parse (GHashTable **out_ccs)
+nm_mobile_providers_parse (GHashTable **out_ccs)
 {
     GMarkupParseContext *ctx;
     GIOChannel *channel;
@@ -653,7 +653,7 @@ nmn_mobile_providers_parse (GHashTable **out_ccs)
 
     if (parser.current_provider) {
         g_warning ("pending current provider");
-        nmn_mobile_provider_unref (parser.current_provider);
+        nm_mobile_provider_unref (parser.current_provider);
     }
 
     if (parser.current_providers) {
@@ -676,7 +676,7 @@ nmn_mobile_providers_parse (GHashTable **out_ccs)
 }
 
 static void
-dump_generic (NmnMobileAccessMethod *method)
+dump_generic (NMMobileAccessMethod *method)
 {
     GSList *iter;
     GString *dns;
@@ -694,7 +694,7 @@ dump_generic (NmnMobileAccessMethod *method)
 }
 
 static void
-dump_cdma (NmnMobileAccessMethod *method)
+dump_cdma (NMMobileAccessMethod *method)
 {
     GSList *iter;
 
@@ -707,7 +707,7 @@ dump_cdma (NmnMobileAccessMethod *method)
 }
 
 static void
-dump_gsm (NmnMobileAccessMethod *method)
+dump_gsm (NMMobileAccessMethod *method)
 {
     GSList *iter;
 
@@ -716,7 +716,7 @@ dump_gsm (NmnMobileAccessMethod *method)
     dump_generic (method);
 
     for (iter = method->gsm_mcc_mnc; iter; iter = g_slist_next (iter)) {
-        NmnGsmMccMnc *m = iter->data;
+        NMGsmMccMnc *m = iter->data;
         g_print ("        MCC/MNC: %s-%s\n", m->mcc, m->mnc);
     }
 }
@@ -727,17 +727,17 @@ dump_country (gpointer key, gpointer value, gpointer user_data)
     GSList *citer, *miter;
 
     for (citer = value; citer; citer = g_slist_next (citer)) {
-        NmnMobileProvider *provider = citer->data;
+        NMMobileProvider *provider = citer->data;
 
         g_print ("Provider: %s (%s)\n", provider->name, (const char *) key);
         for (miter = provider->methods; miter; miter = g_slist_next (miter)) {
-            NmnMobileAccessMethod *method = miter->data;
+            NMMobileAccessMethod *method = miter->data;
 
             switch (method->type) {
-            case NMN_MOBILE_ACCESS_METHOD_TYPE_CDMA:
+            case NM_MOBILE_ACCESS_METHOD_TYPE_CDMA:
                 dump_cdma (method);
                 break;
-            case NMN_MOBILE_ACCESS_METHOD_TYPE_GSM:
+            case NM_MOBILE_ACCESS_METHOD_TYPE_GSM:
                 dump_gsm (method);
                 break;
             default:
@@ -749,7 +749,7 @@ dump_country (gpointer key, gpointer value, gpointer user_data)
 }
 
 void
-nmn_mobile_providers_dump (GHashTable *providers)
+nm_mobile_providers_dump (GHashTable *providers)
 {
     g_return_if_fail (providers != NULL);
     g_hash_table_foreach (providers, dump_country, NULL);
diff --git a/src/nmn-mobile-providers.h b/libnm-gtk/nm-mobile-providers.h
similarity index 53%
rename from src/nmn-mobile-providers.h
rename to libnm-gtk/nm-mobile-providers.h
index 82ad75e..405aa6c 100644
--- a/src/nmn-mobile-providers.h
+++ b/libnm-gtk/nm-mobile-providers.h
@@ -17,25 +17,25 @@
  * (C) Copyright 2009 Novell, Inc.
  */
 
-#ifndef NMN_MOBILE_PROVIDERS_H
-#define NMN_MOBILE_PROVIDERS_H
+#ifndef NM_MOBILE_PROVIDERS_H
+#define NM_MOBILE_PROVIDERS_H
 
 #include <glib.h>
 #include <glib-object.h>
 
-#define NMN_TYPE_MOBILE_PROVIDER (nmn_mobile_provider_get_type ())
-#define NMN_TYPE_MOBILE_ACCESS_METHOD (nmn_mobile_access_method_get_type ())
+#define NM_TYPE_MOBILE_PROVIDER (nm_mobile_provider_get_type ())
+#define NM_TYPE_MOBILE_ACCESS_METHOD (nm_mobile_access_method_get_type ())
 
 typedef enum {
-    NMN_MOBILE_ACCESS_METHOD_TYPE_UNKNOWN = 0,
-    NMN_MOBILE_ACCESS_METHOD_TYPE_GSM,
-    NMN_MOBILE_ACCESS_METHOD_TYPE_CDMA
-} NmnMobileProviderType;
+    NM_MOBILE_ACCESS_METHOD_TYPE_UNKNOWN = 0,
+    NM_MOBILE_ACCESS_METHOD_TYPE_GSM,
+    NM_MOBILE_ACCESS_METHOD_TYPE_CDMA
+} NMMobileProviderType;
 
 typedef struct {
     char *mcc;
     char *mnc;
-} NmnGsmMccMnc;
+} NMGsmMccMnc;
 
 typedef struct {
     char *name;
@@ -47,44 +47,44 @@ typedef struct {
     char *gateway;
     GSList *dns; /* GSList of 'char *' */
 
-    /* Only used with NMN_PROVIDER_TYPE_GSM */
+    /* Only used with NM_PROVIDER_TYPE_GSM */
     char *gsm_apn;
-    GSList *gsm_mcc_mnc; /* GSList of NmnGsmMccMnc */
+    GSList *gsm_mcc_mnc; /* GSList of NMGsmMccMnc */
 
-    /* Only used with NMN_PROVIDER_TYPE_CDMA */
+    /* Only used with NM_PROVIDER_TYPE_CDMA */
     GSList *cdma_sid; /* GSList of guint32 */
 
-    NmnMobileProviderType type;
+    NMMobileProviderType type;
 
     gint refs;
-} NmnMobileAccessMethod;
+} NMMobileAccessMethod;
 
 typedef struct {
     char *name;
     /* maps lang (char *) -> name (char *) */
     GHashTable *lcl_names;
 
-    GSList *methods; /* GSList of NmnMobileAccessMethod */
+    GSList *methods; /* GSList of NMMobileAccessMethod */
 
     gint refs;
-} NmnMobileProvider;
+} NMMobileProvider;
 
 
-GType nmn_mobile_provider_get_type (void);
-GType nmn_mobile_access_method_get_type (void);
+GType nm_mobile_provider_get_type (void);
+GType nm_mobile_access_method_get_type (void);
 
-NmnMobileProvider *nmn_mobile_provider_ref   (NmnMobileProvider *provider);
-void               nmn_mobile_provider_unref (NmnMobileProvider *provider);
+NMMobileProvider *nm_mobile_provider_ref   (NMMobileProvider *provider);
+void              nm_mobile_provider_unref (NMMobileProvider *provider);
 
-NmnMobileAccessMethod *nmn_mobile_access_method_ref   (NmnMobileAccessMethod *method);
-void                   nmn_mobile_access_method_unref (NmnMobileAccessMethod *method);
+NMMobileAccessMethod *nm_mobile_access_method_ref   (NMMobileAccessMethod *method);
+void                  nm_mobile_access_method_unref (NMMobileAccessMethod *method);
 
 /* Returns a hash table where keys are country names 'char *',
-   values are a 'GSList *' of 'NmnMobileProvider *'.
+   values are a 'GSList *' of 'NMMobileProvider *'.
    Everything is destroyed with g_hash_table_destroy (). */
 
-GHashTable *nmn_mobile_providers_parse (GHashTable **out_ccs);
+GHashTable *nm_mobile_providers_parse (GHashTable **out_ccs);
 
-void nmn_mobile_providers_dump (GHashTable *providers);
+void nm_mobile_providers_dump (GHashTable *providers);
 
-#endif /* NMN_MOBILE_PROVIDERS_H */
+#endif /* NM_MOBILE_PROVIDERS_H */
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 9e770e6..f89bd85 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,5 +1,6 @@
 network-manager-netbook.desktop.in
 gnome-bluetooth/network-manager-applet.c
+libnm-gtk/nm-mobile-providers.c
 libnm-gtk/nm-bt-item.c
 libnm-gtk/nm-ethernet-item.c
 libnm-gtk/nm-wifi-item.c
@@ -30,4 +31,3 @@ src/nmn-panel-client.c
 src/nmn-item-renderer.c
 src/nmn-connection-details.c
 src/nmn-new-connection.c
-src/nmn-mobile-providers.c
diff --git a/src/Makefile.am b/src/Makefile.am
index 87b2edf..d89f636 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -29,8 +29,6 @@ network_manager_netbook_SOURCES = \
 	nmn-item-renderer.h \
 	nmn-list.c \
 	nmn-list.h \
-	nmn-mobile-providers.c \
-	nmn-mobile-providers.h \
 	nmn-model.c \
 	nmn-model.h \
 	nmn-new-connection.c \
diff --git a/src/nmn-new-connection.c b/src/nmn-new-connection.c
index 3d625e4..95d75e5 100644
--- a/src/nmn-new-connection.c
+++ b/src/nmn-new-connection.c
@@ -31,12 +31,12 @@
 #include <nm-setting-cdma.h>
 #include <nm-setting-ip4-config.h>
 #include <nm-utils.h>
+#include <nm-mobile-providers.h>
 #include "nmn-new-connection.h"
 #include "nm-list-model.h"
 #include "nm-wifi-item.h"
 #include "nm-gconf-settings.h"
 #include "nmn-list.h"
-#include "nmn-mobile-providers.h"
 #include "wireless-dialog.h"
 
 G_DEFINE_TYPE (NmnNewConnection, nmn_new_connection, GTK_TYPE_VBOX)
@@ -216,7 +216,7 @@ wifi_page_init (NmnNewConnection *connection)
 #define MOBILE_COL_METHOD   2
 
 static gboolean
-mobile_have_device (NmnNewConnection *connection, NmnMobileProviderType *type)
+mobile_have_device (NmnNewConnection *connection, NMMobileProviderType *type)
 {
     NmnNewConnectionPrivate *priv = GET_PRIVATE (connection);
     NMClient *client;
@@ -231,12 +231,12 @@ mobile_have_device (NmnNewConnection *connection, NmnMobileProviderType *type)
 
         if (NM_IS_GSM_DEVICE (device)) {
             found = TRUE;
-            *type = NMN_MOBILE_ACCESS_METHOD_TYPE_GSM;
+            *type = NM_MOBILE_ACCESS_METHOD_TYPE_GSM;
         }
 
         if (NM_IS_CDMA_DEVICE (device)) {
             found = TRUE;
-            *type = NMN_MOBILE_ACCESS_METHOD_TYPE_CDMA;
+            *type = NM_MOBILE_ACCESS_METHOD_TYPE_CDMA;
         }
     }
 
@@ -247,7 +247,7 @@ static void
 mobile_status_update (NmnNewConnection *connection)
 {
     NmnNewConnectionPrivate *priv = GET_PRIVATE (connection);
-    NmnMobileProviderType type;
+    NMMobileProviderType type;
     gboolean found;
 
     if (!nmn_model_modems_get_active (priv->model)) {
@@ -267,12 +267,12 @@ mobile_status_update (NmnNewConnection *connection)
 }
 
 static gboolean
-method_list_has_type (GSList *list, NmnMobileProviderType type)
+method_list_has_type (GSList *list, NMMobileProviderType type)
 {
     GSList *iter;
 
     for (iter = list; iter; iter = iter->next) {
-        NmnMobileAccessMethod *method = iter->data;
+        NMMobileAccessMethod *method = iter->data;
 
         if (method->type == type)
             return TRUE;
@@ -282,12 +282,12 @@ method_list_has_type (GSList *list, NmnMobileProviderType type)
 }
 
 static gboolean
-provider_list_has_type (GSList *list, NmnMobileProviderType type)
+provider_list_has_type (GSList *list, NMMobileProviderType type)
 {
     GSList *iter;
 
     for (iter = list; iter; iter = iter->next) {
-        NmnMobileProvider *provider = (NmnMobileProvider *) iter->data;
+        NMMobileProvider *provider = (NMMobileProvider *) iter->data;
 
         if (method_list_has_type (provider->methods, type))
             return TRUE;
@@ -298,7 +298,7 @@ provider_list_has_type (GSList *list, NmnMobileProviderType type)
 
 typedef struct {
     GtkTreeStore *store;
-    NmnMobileProviderType provider_type;
+    NMMobileProviderType provider_type;
 
     GtkTreeIter *parent_iter;
 } MobilePopulateInfo;
@@ -306,7 +306,7 @@ typedef struct {
 static void
 add_one_method (gpointer data, gpointer user_data)
 {
-    NmnMobileAccessMethod *method = (NmnMobileAccessMethod *) data;
+    NMMobileAccessMethod *method = (NMMobileAccessMethod *) data;
     MobilePopulateInfo *info = (MobilePopulateInfo *) user_data;
     GtkTreeIter iter;
 
@@ -315,7 +315,7 @@ add_one_method (gpointer data, gpointer user_data)
 
     gtk_tree_store_append (info->store, &iter, info->parent_iter);
 
-    if (method->type == NMN_MOBILE_ACCESS_METHOD_TYPE_GSM) {
+    if (method->type == NM_MOBILE_ACCESS_METHOD_TYPE_GSM) {
         char *txt;
 
         txt = g_strdup_printf ("%s (APN %s)", method->name, method->gsm_apn);
@@ -336,7 +336,7 @@ add_one_method (gpointer data, gpointer user_data)
 static void
 add_one_provider (gpointer data, gpointer user_data)
 {
-    NmnMobileProvider *provider = (NmnMobileProvider *) data;
+    NMMobileProvider *provider = (NMMobileProvider *) data;
     MobilePopulateInfo *info = (MobilePopulateInfo *) user_data;
     GtkTreeIter *country_iter;
     GtkTreeIter iter;
@@ -384,17 +384,17 @@ mobile_list_populate (NmnNewConnection *connection)
     GtkTreeModel *sort_model;
     GtkCellRenderer *renderer;
     GtkTreeViewColumn *column;
-    NmnMobileProviderType provider_type;
+    NMMobileProviderType provider_type;
     MobilePopulateInfo info;
 
     if (priv->mobile_list_populated || !mobile_have_device (connection, &provider_type))
         return;
 
-    mobile_providers = nmn_mobile_providers_parse (NULL);
+    mobile_providers = nm_mobile_providers_parse (NULL);
     if (!mobile_providers)
         return;
 
-    store = gtk_tree_store_new (3, G_TYPE_STRING, NMN_TYPE_MOBILE_PROVIDER, NMN_TYPE_MOBILE_ACCESS_METHOD);
+    store = gtk_tree_store_new (3, G_TYPE_STRING, NM_TYPE_MOBILE_PROVIDER, NM_TYPE_MOBILE_ACCESS_METHOD);
 
     info.store = store;
     info.provider_type = provider_type;
@@ -425,7 +425,7 @@ mobile_tree_selection_changed (GtkTreeSelection *selection,
     NmnNewConnection *connection = (NmnNewConnection *) user_data;
     NmnNewConnectionPrivate *priv = GET_PRIVATE (connection);
     GtkTreeModel *model;
-    NmnMobileAccessMethod *method = NULL;
+    NMMobileAccessMethod *method = NULL;
     GtkTreeIter iter;
 
     if (gtk_tree_selection_get_selected (selection, &model, &iter))
@@ -433,12 +433,12 @@ mobile_tree_selection_changed (GtkTreeSelection *selection,
 
     gtk_widget_set_sensitive (priv->mobile_save, method != NULL);
     if (method)
-        nmn_mobile_access_method_unref (method);
+        nm_mobile_access_method_unref (method);
 }
 
 static NMConnection *
-mobile_new_connection (NmnMobileProvider *provider,
-                       NmnMobileAccessMethod *method)
+mobile_new_connection (NMMobileProvider *provider,
+                       NMMobileAccessMethod *method)
 {
     NMConnection *connection;
     NMSetting *type_setting;
@@ -448,7 +448,7 @@ mobile_new_connection (NmnMobileProvider *provider,
 
     connection = nm_connection_new ();
 
-    if (method->type == NMN_MOBILE_ACCESS_METHOD_TYPE_GSM) {
+    if (method->type == NM_MOBILE_ACCESS_METHOD_TYPE_GSM) {
         type_setting = nm_setting_gsm_new ();
         g_object_set (type_setting,
                       NM_SETTING_GSM_NUMBER,   "*99#",
@@ -459,7 +459,7 @@ mobile_new_connection (NmnMobileProvider *provider,
 
         /* FIXME: Choose the network_id more intelligently */
         if (g_slist_length (method->gsm_mcc_mnc) == 1) {
-            NmnGsmMccMnc *mcc_mnc = (NmnGsmMccMnc *) method->gsm_mcc_mnc->data;
+            NMGsmMccMnc *mcc_mnc = (NMGsmMccMnc *) method->gsm_mcc_mnc->data;
             char *network_id;
 
             network_id = g_strconcat (mcc_mnc->mcc, mcc_mnc->mnc, NULL);
@@ -469,7 +469,7 @@ mobile_new_connection (NmnMobileProvider *provider,
 
             g_free (network_id);
         }
-    } else if (method->type == NMN_MOBILE_ACCESS_METHOD_TYPE_CDMA) {
+    } else if (method->type == NM_MOBILE_ACCESS_METHOD_TYPE_CDMA) {
         type_setting = nm_setting_cdma_new ();
         g_object_set (type_setting, NM_SETTING_CDMA_NUMBER, "#777", NULL);
     } else
@@ -534,8 +534,8 @@ mobile_save_clicked (GtkButton *button, gpointer user_data)
     NmnNewConnectionPrivate *priv = GET_PRIVATE (self);
     GtkTreeSelection *selection;
     GtkTreeModel *model;
-    NmnMobileProvider *provider = NULL;
-    NmnMobileAccessMethod *method = NULL;
+    NMMobileProvider *provider = NULL;
+    NMMobileAccessMethod *method = NULL;
     GtkTreeIter method_iter;
     GtkTreeIter provider_iter;
 
@@ -565,10 +565,10 @@ mobile_save_clicked (GtkButton *button, gpointer user_data)
     }
 
     if (provider)
-        nmn_mobile_provider_unref (provider);
+        nm_mobile_provider_unref (provider);
 
     if (method)
-        nmn_mobile_access_method_unref (method);
+        nm_mobile_access_method_unref (method);
 }
 
 static void



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