[network-manager-applet/aleksander/mobile-providers: 8/21] libnm-gtk: don't use 'gsm' in the interface, use '3gpp' instead



commit 1581a951fa7c5d995accb586dd3b18dc01b3b470
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Mon Nov 26 18:48:38 2012 +0100

    libnm-gtk: don't use 'gsm' in the interface, use '3gpp' instead
    
     * The 'NMAGsmMccMnc' type is renamed to 'NMAMccMnc'.
    
     * The 'NMAMobileAccessMethodType' enum is renamed to 'NMAMobileFamily'; and
       the '_GSM' suffixed  enum value is renamed to '_3GPP'.
    
     * The 'nma_mobile_access_method_get_method_type()' method in the interface is
       now renamed to 'nma_mobile_access_method_get_family()'.
    
     * The 'nma_mobile_access_method_get_gsm_apn()' method in the interface is now
       renamed to 'nma_mobile_access_method_get_3gpp_apn()'.
    
     * The 'nma_mobile_provider_get_gsm_mcc_mnc()' method in the interface is now
       renamed to 'nma_mobile_provider_get_3gpp_mcc_mnc()'.
    
     * And for consistency, 'nma_mobile_providers_find_for_mcc_mnc()' was
       renamed to 'nma_mobile_providers_find_for_3gpp_mcc_mnc()' and
       'nma_mobile_providers_find_for_sid() was renamed to
       'nma_mobile_providers_find_for_cdma_sid()'.

 src/applet-device-cdma.c            |    2 +-
 src/applet-device-gsm.c             |    2 +-
 src/libnm-gtk/nm-mobile-providers.c |  114 +++++++++++++++++-----------------
 src/libnm-gtk/nm-mobile-providers.h |   64 ++++++++++----------
 src/libnm-gtk/nm-mobile-wizard.c    |   82 +++++++++++++-------------
 5 files changed, 132 insertions(+), 132 deletions(-)
---
diff --git a/src/applet-device-cdma.c b/src/applet-device-cdma.c
index cfec847..fb304fe 100644
--- a/src/applet-device-cdma.c
+++ b/src/applet-device-cdma.c
@@ -735,7 +735,7 @@ serving_system_reply (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_dat
 
 			g_free (info->provider_name);
 
-			provider = nma_mobile_providers_find_for_sid (info->country_infos, new_sid);
+			provider = nma_mobile_providers_find_for_cdma_sid (info->country_infos, new_sid);
 			info->provider_name = (provider ?
 			                       g_strdup (nma_mobile_provider_get_name (provider)) :
 			                       NULL);
diff --git a/src/applet-device-gsm.c b/src/applet-device-gsm.c
index b46b422..ff841e2 100644
--- a/src/applet-device-gsm.c
+++ b/src/applet-device-gsm.c
@@ -1133,7 +1133,7 @@ parse_op_name (GsmDeviceInfo *info, const char *orig, const char *op_code)
 	if (!info->country_infos)
 		return strdup (orig);
 
-	provider = nma_mobile_providers_find_for_mcc_mnc (info->country_infos, orig);
+	provider = nma_mobile_providers_find_for_3gpp_mcc_mnc (info->country_infos, orig);
 	return (provider ? g_strdup (nma_mobile_provider_get_name (provider)) : NULL);
 }
 
diff --git a/src/libnm-gtk/nm-mobile-providers.c b/src/libnm-gtk/nm-mobile-providers.c
index c4b25b8..1408ee1 100644
--- a/src/libnm-gtk/nm-mobile-providers.c
+++ b/src/libnm-gtk/nm-mobile-providers.c
@@ -40,42 +40,42 @@
 #define ISO_CODES_LOCALESDIR ISO_CODES_PREFIX"/share/locale"
 
 /******************************************************************************/
-/* GSM MCCMNC type */
+/* MCCMNC type */
 
-static NMAGsmMccMnc *mcc_mnc_copy (const NMAGsmMccMnc *other);
-static void          mcc_mnc_free (NMAGsmMccMnc *m);
+static NMAMccMnc *mcc_mnc_copy (const NMAMccMnc *other);
+static void       mcc_mnc_free (NMAMccMnc *m);
 
-G_DEFINE_BOXED_TYPE (NMAGsmMccMnc, nma_gsm_mcc_mnc, mcc_mnc_copy, mcc_mnc_free)
+G_DEFINE_BOXED_TYPE (NMAMccMnc, nma_mcc_mnc, mcc_mnc_copy, mcc_mnc_free)
 
-static NMAGsmMccMnc *
+static NMAMccMnc *
 mcc_mnc_new (const char *mcc, const char *mnc)
 {
-    NMAGsmMccMnc *m;
+    NMAMccMnc *m;
 
-    m = g_slice_new0 (NMAGsmMccMnc);
+    m = g_slice_new0 (NMAMccMnc);
     m->mcc = g_strstrip (g_strdup (mcc));
     m->mnc = g_strstrip (g_strdup (mnc));
     return m;
 }
 
-static NMAGsmMccMnc *
-mcc_mnc_copy (const NMAGsmMccMnc *other)
+static NMAMccMnc *
+mcc_mnc_copy (const NMAMccMnc *other)
 {
-    NMAGsmMccMnc *ret;
+    NMAMccMnc *ret;
 
-    ret = g_slice_new (NMAGsmMccMnc);
+    ret = g_slice_new (NMAMccMnc);
     ret->mcc = g_strdup (other->mcc);
     ret->mnc = g_strdup (other->mnc);
     return ret;
 }
 
 static void
-mcc_mnc_free (NMAGsmMccMnc *m)
+mcc_mnc_free (NMAMccMnc *m)
 {
     g_return_if_fail (m != NULL);
     g_free (m->mcc);
     g_free (m->mnc);
-    g_slice_free (NMAGsmMccMnc, m);
+    g_slice_free (NMAMccMnc, m);
 }
 
 /******************************************************************************/
@@ -98,10 +98,10 @@ struct _NMAMobileAccessMethod {
     char *gateway;
     GSList *dns; /* GSList of 'char *' */
 
-    /* Only used with NMA_PROVIDER_TYPE_GSM */
-    char *gsm_apn;
+    /* Only used with 3GPP family type providers */
+    char *apn;
 
-    NMAMobileAccessMethodType type;
+    NMAMobileFamily family;
 };
 
 static NMAMobileAccessMethod *
@@ -141,7 +141,7 @@ nma_mobile_access_method_unref (NMAMobileAccessMethod *method)
         g_free (method->username);
         g_free (method->password);
         g_free (method->gateway);
-        g_free (method->gsm_apn);
+        g_free (method->apn);
         g_slist_foreach (method->dns, (GFunc) g_free, NULL);
         g_slist_free (method->dns);
 
@@ -215,29 +215,29 @@ nma_mobile_access_method_get_dns (NMAMobileAccessMethod *method)
 }
 
 /**
- * nma_mobile_access_method_get_gsm_apn:
+ * nma_mobile_access_method_get_3gpp_apn:
  *
- * Returns: (transfer none): the GSM APN.
+ * Returns: (transfer none): the 3GPP APN.
  */
 const gchar *
-nma_mobile_access_method_get_gsm_apn (NMAMobileAccessMethod *method)
+nma_mobile_access_method_get_3gpp_apn (NMAMobileAccessMethod *method)
 {
     g_return_val_if_fail (method != NULL, NULL);
 
-    return method->gsm_apn;
+    return method->apn;
 }
 
 /**
- * nma_mobile_access_method_get_method_type:
+ * nma_mobile_access_method_get_family:
  *
- * Returns: a #NMAMobileAccessMethodType.
+ * Returns: a #NMAMobileFamily.
  */
-NMAMobileAccessMethodType
-nma_mobile_access_method_get_method_type (NMAMobileAccessMethod *method)
+NMAMobileFamily
+nma_mobile_access_method_get_family (NMAMobileAccessMethod *method)
 {
-    g_return_val_if_fail (method != NULL, NMA_MOBILE_ACCESS_METHOD_TYPE_UNKNOWN);
+    g_return_val_if_fail (method != NULL, NMA_MOBILE_FAMILY_UNKNOWN);
 
-    return method->type;
+    return method->family;
 }
 
 /******************************************************************************/
@@ -257,7 +257,7 @@ struct _NMAMobileProvider {
 
     GSList *methods; /* GSList of NmaMobileAccessMethod */
 
-    GSList *gsm_mcc_mnc; /* GSList of NmaGsmMccMnc */
+    GSList *mcc_mnc;  /* GSList of NmaMccMnc */
     GSList *cdma_sid; /* GSList of guint32 */
 };
 
@@ -296,8 +296,8 @@ nma_mobile_provider_unref (NMAMobileProvider *provider)
         g_slist_foreach (provider->methods, (GFunc) nma_mobile_access_method_unref, NULL);
         g_slist_free (provider->methods);
 
-        g_slist_foreach (provider->gsm_mcc_mnc, (GFunc) mcc_mnc_free, NULL);
-        g_slist_free (provider->gsm_mcc_mnc);
+        g_slist_foreach (provider->mcc_mnc, (GFunc) mcc_mnc_free, NULL);
+        g_slist_free (provider->mcc_mnc);
 
         g_slist_free (provider->cdma_sid);
 
@@ -334,18 +334,18 @@ nma_mobile_provider_get_methods (NMAMobileProvider *provider)
 }
 
 /**
- * nma_mobile_provider_get_gsm_mcc_mnc:
+ * nma_mobile_provider_get_3gpp_mcc_mnc:
  * @provider: a #NMAMobileProvider
  *
- * Returns: (element-type NMGtk.GsmMccMnc) (transfer none): the
- *   list of #NMAGsmMccMnc this provider exposes
+ * Returns: (element-type NMGtk.MccMnc) (transfer none): the
+ *   list of #NMAMccMnc this provider exposes
  */
 GSList *
-nma_mobile_provider_get_gsm_mcc_mnc (NMAMobileProvider *provider)
+nma_mobile_provider_get_3gpp_mcc_mnc (NMAMobileProvider *provider)
 {
     g_return_val_if_fail (provider != NULL, NULL);
 
-    return provider->gsm_mcc_mnc;
+    return provider->mcc_mnc;
 }
 
 /**
@@ -668,8 +668,8 @@ parser_gsm_start (MobileParser *parser,
                 mnc = attribute_values[i];
 
             if (mcc && strlen (mcc) && mnc && strlen (mnc)) {
-                parser->current_provider->gsm_mcc_mnc = g_slist_prepend (parser->current_provider->gsm_mcc_mnc,
-                                                                         mcc_mnc_new (mcc, mnc));
+                parser->current_provider->mcc_mnc = g_slist_prepend (parser->current_provider->mcc_mnc,
+                                                                     mcc_mnc_new (mcc, mnc));
                 break;
             }
         }
@@ -681,7 +681,7 @@ parser_gsm_start (MobileParser *parser,
 
                 parser->state = PARSER_METHOD_GSM_APN;
                 parser->current_method = access_method_new ();
-                parser->current_method->gsm_apn = g_strstrip (g_strdup (attribute_values[i]));
+                parser->current_method->apn = g_strstrip (g_strdup (attribute_values[i]));
                 break;
             }
         }
@@ -780,7 +780,7 @@ parser_provider_end (MobileParser *parser,
     } else if (!strcmp (name, "provider")) {
         parser->current_provider->methods = g_slist_reverse (parser->current_provider->methods);
 
-        parser->current_provider->gsm_mcc_mnc = g_slist_reverse (parser->current_provider->gsm_mcc_mnc);
+        parser->current_provider->mcc_mnc = g_slist_reverse (parser->current_provider->mcc_mnc);
         parser->current_provider->cdma_sid = g_slist_reverse (parser->current_provider->cdma_sid);
 
         parser->current_providers = g_slist_prepend (parser->current_providers, parser->current_provider);
@@ -823,7 +823,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 = NMA_MOBILE_ACCESS_METHOD_TYPE_GSM;
+        parser->current_method->family = NMA_MOBILE_FAMILY_3GPP;
         parser->current_method->dns = g_slist_reverse (parser->current_method->dns);
 
         if (!parser->current_method->name)
@@ -854,7 +854,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 = NMA_MOBILE_ACCESS_METHOD_TYPE_CDMA;
+        parser->current_method->family = NMA_MOBILE_FAMILY_CDMA;
         parser->current_method->dns = g_slist_reverse (parser->current_method->dns);
 
         if (!parser->current_method->name)
@@ -1041,9 +1041,9 @@ dump_cdma (NMAMobileAccessMethod *method)
 }
 
 static void
-dump_gsm (NMAMobileAccessMethod *method)
+dump_3gpp (NMAMobileAccessMethod *method)
 {
-    g_print ("     APN: %s (%s)\n", method->name, method->gsm_apn);
+    g_print ("     APN: %s (%s)\n", method->name, method->apn);
 
     dump_generic (method);
 }
@@ -1067,20 +1067,20 @@ dump_country (gpointer key, gpointer value, gpointer user_data)
             GSList *liter;
 
 
-            for (liter = provider->gsm_mcc_mnc; liter; liter = g_slist_next (liter)) {
-                NMAGsmMccMnc *m = liter->data;
+            for (liter = provider->mcc_mnc; liter; liter = g_slist_next (liter)) {
+                NMAMccMnc *m = liter->data;
                 g_print ("        MCC/MNC: %s-%s\n", m->mcc, m->mnc);
             }
 
             for (liter = provider->cdma_sid; liter; liter = g_slist_next (liter))
                 g_print ("        SID: %d\n", GPOINTER_TO_UINT (liter->data));
 
-            switch (method->type) {
-            case NMA_MOBILE_ACCESS_METHOD_TYPE_CDMA:
+            switch (method->family) {
+            case NMA_MOBILE_FAMILY_CDMA:
                 dump_cdma (method);
                 break;
-            case NMA_MOBILE_ACCESS_METHOD_TYPE_GSM:
-                dump_gsm (method);
+            case NMA_MOBILE_FAMILY_3GPP:
+                dump_3gpp (method);
                 break;
             default:
                 break;
@@ -1098,15 +1098,15 @@ nma_mobile_providers_dump (GHashTable *country_infos)
 }
 
 /**
- * nma_mobile_providers_find_for_mcc_mnc:
+ * nma_mobile_providers_find_for_3gpp_mcc_mnc:
  * @country_infos: (element-type utf8 NMGtk.CountryInfo) (transfer none): the table of country infos.
  * @mccmnc: the MCC/MNC string to look for.
  *
  * Returns: (transfer none): a #NMAMobileProvider.
  */
 NMAMobileProvider *
-nma_mobile_providers_find_for_mcc_mnc (GHashTable  *country_infos,
-                                       const gchar *mccmnc)
+nma_mobile_providers_find_for_3gpp_mcc_mnc (GHashTable  *country_infos,
+                                            const gchar *mccmnc)
 {
 	GHashTableIter iter;
 	gpointer value;
@@ -1128,10 +1128,10 @@ nma_mobile_providers_find_for_mcc_mnc (GHashTable  *country_infos,
 			NMAMobileProvider *provider = piter->data;
 
 			/* Search through MCC/MNC list */
-			for (siter = nma_mobile_provider_get_gsm_mcc_mnc (provider);
+			for (siter = nma_mobile_provider_get_3gpp_mcc_mnc (provider);
 			     siter;
 			     siter = g_slist_next (siter)) {
-				NMAGsmMccMnc *mcc = siter->data;
+				NMAMccMnc *mcc = siter->data;
 
 				/* Match both 2-digit and 3-digit MNC; prefer a
 				 * 3-digit match if found, otherwise a 2-digit one.
@@ -1158,15 +1158,15 @@ nma_mobile_providers_find_for_mcc_mnc (GHashTable  *country_infos,
 }
 
 /**
- * nma_mobile_providers_find_for_sid:
+ * nma_mobile_providers_find_for_cdma_sid:
  * @country_infos: (element-type utf8 NMGtk.CountryInfo) (transfer none): the table of country infos.
  * @sid: the SID to look for.
  *
  * Returns: (transfer none): a #NMAMobileProvider.
  */
 NMAMobileProvider *
-nma_mobile_providers_find_for_sid (GHashTable  *country_infos,
-                                   guint32 sid)
+nma_mobile_providers_find_for_cdma_sid (GHashTable  *country_infos,
+                                        guint32 sid)
 {
 	GHashTableIter iter;
 	gpointer value;
diff --git a/src/libnm-gtk/nm-mobile-providers.h b/src/libnm-gtk/nm-mobile-providers.h
index 98febc2..5d54ef0 100644
--- a/src/libnm-gtk/nm-mobile-providers.h
+++ b/src/libnm-gtk/nm-mobile-providers.h
@@ -33,40 +33,40 @@
 #include <glib-object.h>
 
 /******************************************************************************/
-/* GSM MCCMNC type */
+/* MCCMNC type */
 
-#define NMA_TYPE_GSM_MCC_MNC (nma_gsm_mcc_mnc_get_type ())
+#define NMA_TYPE_MCC_MNC (nma_mcc_mnc_get_type ())
 
 typedef struct {
     char *mcc;
     char *mnc;
-} NMAGsmMccMnc;
+} NMAMccMnc;
 
-GType nma_gsm_mcc_mnc_get_type (void);
+GType nma_mcc_mnc_get_type (void);
 
 /******************************************************************************/
 /* Access method type */
 
 typedef enum {
-    NMA_MOBILE_ACCESS_METHOD_TYPE_UNKNOWN = 0,
-    NMA_MOBILE_ACCESS_METHOD_TYPE_GSM,
-    NMA_MOBILE_ACCESS_METHOD_TYPE_CDMA
-} NMAMobileAccessMethodType;
+    NMA_MOBILE_FAMILY_UNKNOWN = 0,
+    NMA_MOBILE_FAMILY_3GPP,
+    NMA_MOBILE_FAMILY_CDMA
+} NMAMobileFamily;
 
 #define NMA_TYPE_MOBILE_ACCESS_METHOD (nma_mobile_access_method_get_type ())
 
 typedef struct _NMAMobileAccessMethod NMAMobileAccessMethod;
 
-GType                      nma_mobile_access_method_get_type        (void);
-NMAMobileAccessMethod     *nma_mobile_access_method_ref             (NMAMobileAccessMethod *method);
-void                       nma_mobile_access_method_unref           (NMAMobileAccessMethod *method);
-const gchar               *nma_mobile_access_method_get_name        (NMAMobileAccessMethod *method);
-const gchar               *nma_mobile_access_method_get_username    (NMAMobileAccessMethod *method);
-const gchar               *nma_mobile_access_method_get_password    (NMAMobileAccessMethod *method);
-const gchar               *nma_mobile_access_method_get_gateway     (NMAMobileAccessMethod *method);
-const GSList              *nma_mobile_access_method_get_dns         (NMAMobileAccessMethod *method);
-const gchar               *nma_mobile_access_method_get_gsm_apn     (NMAMobileAccessMethod *method);
-NMAMobileAccessMethodType  nma_mobile_access_method_get_method_type (NMAMobileAccessMethod *method);
+GType                  nma_mobile_access_method_get_type     (void);
+NMAMobileAccessMethod *nma_mobile_access_method_ref          (NMAMobileAccessMethod *method);
+void                   nma_mobile_access_method_unref        (NMAMobileAccessMethod *method);
+const gchar           *nma_mobile_access_method_get_name     (NMAMobileAccessMethod *method);
+const gchar           *nma_mobile_access_method_get_username (NMAMobileAccessMethod *method);
+const gchar           *nma_mobile_access_method_get_password (NMAMobileAccessMethod *method);
+const gchar           *nma_mobile_access_method_get_gateway  (NMAMobileAccessMethod *method);
+const GSList          *nma_mobile_access_method_get_dns      (NMAMobileAccessMethod *method);
+const gchar           *nma_mobile_access_method_get_3gpp_apn (NMAMobileAccessMethod *method);
+NMAMobileFamily        nma_mobile_access_method_get_family   (NMAMobileAccessMethod *method);
 
 /******************************************************************************/
 /* Mobile provider type */
@@ -75,13 +75,13 @@ NMAMobileAccessMethodType  nma_mobile_access_method_get_method_type (NMAMobileAc
 
 typedef struct _NMAMobileProvider NMAMobileProvider;
 
-GType              nma_mobile_provider_get_type        (void);
-NMAMobileProvider *nma_mobile_provider_ref             (NMAMobileProvider *provider);
-void               nma_mobile_provider_unref           (NMAMobileProvider *provider);
-const gchar       *nma_mobile_provider_get_name        (NMAMobileProvider *provider);
-GSList            *nma_mobile_provider_get_methods     (NMAMobileProvider *provider);
-GSList            *nma_mobile_provider_get_gsm_mcc_mnc (NMAMobileProvider *provider);
-GSList            *nma_mobile_provider_get_cdma_sid    (NMAMobileProvider *provider);
+GType              nma_mobile_provider_get_type         (void);
+NMAMobileProvider *nma_mobile_provider_ref              (NMAMobileProvider *provider);
+void               nma_mobile_provider_unref            (NMAMobileProvider *provider);
+const gchar       *nma_mobile_provider_get_name         (NMAMobileProvider *provider);
+GSList            *nma_mobile_provider_get_methods      (NMAMobileProvider *provider);
+GSList            *nma_mobile_provider_get_3gpp_mcc_mnc (NMAMobileProvider *provider);
+GSList            *nma_mobile_provider_get_cdma_sid     (NMAMobileProvider *provider);
 
 /******************************************************************************/
 /* Country Info type */
@@ -102,12 +102,12 @@ GSList         *nma_country_info_get_providers    (NMACountryInfo *country_info)
 
 /* Returns a table where keys are country codes and values are NMACountryInfo
  * values */
-GHashTable        *nma_mobile_providers_parse            (const gchar *country_codes,
-                                                          const gchar *service_providers);
-void               nma_mobile_providers_dump             (GHashTable *country_infos);
-NMAMobileProvider *nma_mobile_providers_find_for_mcc_mnc (GHashTable  *country_infos,
-                                                          const gchar *mccmnc);
-NMAMobileProvider *nma_mobile_providers_find_for_sid     (GHashTable  *country_infos,
-                                                          guint32      sid);
+GHashTable        *nma_mobile_providers_parse                 (const gchar *country_codes,
+                                                               const gchar *service_providers);
+void               nma_mobile_providers_dump                  (GHashTable *country_infos);
+NMAMobileProvider *nma_mobile_providers_find_for_3gpp_mcc_mnc (GHashTable  *country_infos,
+                                                               const gchar *mccmnc);
+NMAMobileProvider *nma_mobile_providers_find_for_cdma_sid     (GHashTable  *country_infos,
+                                                               guint32      sid);
 
 #endif /* NM_MOBILE_PROVIDERS_H */
diff --git a/src/libnm-gtk/nm-mobile-wizard.c b/src/libnm-gtk/nm-mobile-wizard.c
index 9fbfa14..4d86f18 100644
--- a/src/libnm-gtk/nm-mobile-wizard.c
+++ b/src/libnm-gtk/nm-mobile-wizard.c
@@ -45,7 +45,7 @@
 
 static NMACountryInfo *get_selected_country (NMAMobileWizard *self);
 static NMAMobileProvider *get_selected_provider (NMAMobileWizard *self);
-static NMAMobileAccessMethodType get_provider_unlisted_type (NMAMobileWizard *self);
+static NMAMobileFamily get_provider_unlisted_type (NMAMobileWizard *self);
 static NMAMobileAccessMethod *get_selected_method (NMAMobileWizard *self, gboolean *manual);
 
 struct NMAMobileWizard {
@@ -53,8 +53,8 @@ struct NMAMobileWizard {
 	NMAMobileWizardCallback callback;
 	gpointer user_data;
 	GHashTable *country_infos;
-	NMAMobileAccessMethodType method_type;
-	gboolean initial_method_type;
+	NMAMobileFamily family;
+	gboolean initial_family;
 	gboolean will_connect_after;
 
 	/* Intro page */
@@ -114,17 +114,17 @@ assistant_closed (GtkButton *button, gpointer user_data)
 	NMAMobileProvider *provider;
 	NMAMobileAccessMethod *method;
 	NMAMobileWizardAccessMethod *wiz_method;
-	NMAMobileAccessMethodType method_type = self->method_type;
+	NMAMobileFamily family = self->family;
 
 	wiz_method = g_malloc0 (sizeof (NMAMobileWizardAccessMethod));
 
 	provider = get_selected_provider (self);
 	if (!provider) {
-		if (method_type == NMA_MOBILE_ACCESS_METHOD_TYPE_UNKNOWN)
-			method_type = get_provider_unlisted_type (self);
+		if (family == NMA_MOBILE_FAMILY_UNKNOWN)
+			family = get_provider_unlisted_type (self);
 
 		wiz_method->provider_name = g_strdup (gtk_entry_get_text (GTK_ENTRY (self->provider_unlisted_entry)));
-		if (method_type == NMA_MOBILE_ACCESS_METHOD_TYPE_GSM)
+		if (family == NMA_MOBILE_FAMILY_3GPP)
 			wiz_method->gsm_apn = g_strdup (gtk_entry_get_text (GTK_ENTRY (self->plan_unlisted_entry)));
 	} else {
 		gboolean manual = FALSE;
@@ -132,17 +132,17 @@ assistant_closed (GtkButton *button, gpointer user_data)
 		wiz_method->provider_name = g_strdup (nma_mobile_provider_get_name (provider));
 		method = get_selected_method (self, &manual);
 		if (method) {
-			method_type = nma_mobile_access_method_get_method_type (method);
+			family = nma_mobile_access_method_get_family (method);
 			wiz_method->plan_name = g_strdup (nma_mobile_access_method_get_name (method));
 			wiz_method->username = g_strdup (nma_mobile_access_method_get_username (method));
 			wiz_method->password = g_strdup (nma_mobile_access_method_get_password (method));
-			if (method_type == NMA_MOBILE_ACCESS_METHOD_TYPE_GSM)
-				wiz_method->gsm_apn = g_strdup (nma_mobile_access_method_get_gsm_apn (method));
+			if (family == NMA_MOBILE_FAMILY_3GPP)
+				wiz_method->gsm_apn = g_strdup (nma_mobile_access_method_get_3gpp_apn (method));
 		} else {
 			if (self->provider_only_cdma) {
 				GSList *methods;
 
-				method_type = NMA_MOBILE_ACCESS_METHOD_TYPE_CDMA;
+				family = NMA_MOBILE_FAMILY_CDMA;
 
 				methods = nma_mobile_provider_get_methods (provider);
 				/* Take username and password from the first (only) method for CDMA only provider */
@@ -152,17 +152,17 @@ assistant_closed (GtkButton *button, gpointer user_data)
 					wiz_method->password = g_strdup (nma_mobile_access_method_get_password (method));
 				}
 			} else {
-				method_type = NMA_MOBILE_ACCESS_METHOD_TYPE_GSM;
+				family = NMA_MOBILE_FAMILY_3GPP;
 				wiz_method->gsm_apn = g_strdup (gtk_entry_get_text (GTK_ENTRY (self->plan_unlisted_entry)));
 			}
 		}
 	}
 
-	switch (method_type) {
-	case NMA_MOBILE_ACCESS_METHOD_TYPE_GSM:
+	switch (family) {
+	case NMA_MOBILE_FAMILY_3GPP:
 		wiz_method->devtype = NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS;
 		break;
-	case NMA_MOBILE_ACCESS_METHOD_TYPE_CDMA:
+	case NMA_MOBILE_FAMILY_CDMA:
 		wiz_method->devtype = NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO;
 		break;
 	default:
@@ -333,7 +333,7 @@ confirm_prepare (NMAMobileWizard *self)
 
 		if (method) {
 			gtk_label_set_text (GTK_LABEL (self->confirm_plan), nma_mobile_access_method_get_name (method));
-			apn = nma_mobile_access_method_get_gsm_apn (method);
+			apn = nma_mobile_access_method_get_3gpp_apn (method);
 		} else {
 			gtk_label_set_text (GTK_LABEL (self->confirm_plan), _("Unlisted"));
 			apn = gtk_entry_get_text (GTK_ENTRY (self->plan_unlisted_entry));
@@ -412,7 +412,7 @@ plan_combo_changed (NMAMobileWizard *self)
 
 	method = get_selected_method (self, &is_manual);
 	if (method) {
-		gtk_entry_set_text (GTK_ENTRY (self->plan_unlisted_entry), nma_mobile_access_method_get_gsm_apn (method));
+		gtk_entry_set_text (GTK_ENTRY (self->plan_unlisted_entry), nma_mobile_access_method_get_3gpp_apn (method));
 		gtk_widget_set_sensitive (self->plan_unlisted_entry, FALSE);
 	} else {
 		gtk_entry_set_text (GTK_ENTRY (self->plan_unlisted_entry), "");
@@ -568,8 +568,8 @@ plan_prepare (NMAMobileWizard *self)
 		for (iter = nma_mobile_provider_get_methods (provider); iter; iter = g_slist_next (iter)) {
 			NMAMobileAccessMethod *method = iter->data;
 
-			if (   (self->method_type != NMA_MOBILE_ACCESS_METHOD_TYPE_UNKNOWN)
-			    && (nma_mobile_access_method_get_method_type (method) != self->method_type))
+			if (   (self->family != NMA_MOBILE_FAMILY_UNKNOWN)
+			    && (nma_mobile_access_method_get_family (method) != self->family))
 				continue;
 
 			gtk_tree_store_append (GTK_TREE_STORE (self->plan_store), &method_iter, NULL);
@@ -723,16 +723,16 @@ providers_radio_toggled (GtkToggleButton *button, gpointer user_data)
 	providers_update_complete (self);
 }
 
-static NMAMobileAccessMethodType
+static NMAMobileFamily
 get_provider_unlisted_type (NMAMobileWizard *self)
 {
 	switch (gtk_combo_box_get_active (GTK_COMBO_BOX (self->provider_unlisted_type_combo))) {
 	case 0:
-		return NMA_MOBILE_ACCESS_METHOD_TYPE_GSM;
+		return NMA_MOBILE_FAMILY_3GPP;
 	case 1:
-		return NMA_MOBILE_ACCESS_METHOD_TYPE_CDMA;
+		return NMA_MOBILE_FAMILY_CDMA;
 	default:
-		return NMA_MOBILE_ACCESS_METHOD_TYPE_UNKNOWN;
+		return NMA_MOBILE_FAMILY_UNKNOWN;
 	}
 }
 
@@ -837,7 +837,7 @@ providers_setup (NMAMobileWizard *self)
 	                  1, 2, 1, 2, 0, 0, 6, 6);
 
 	/* Only show the CDMA/GSM combo if we don't know the device type */
-	if (self->method_type != NMA_MOBILE_ACCESS_METHOD_TYPE_UNKNOWN)
+	if (self->family != NMA_MOBILE_FAMILY_UNKNOWN)
 		gtk_widget_hide (self->provider_unlisted_type_combo);
 
 	self->providers_idx = gtk_assistant_append_page (GTK_ASSISTANT (self->assistant), vbox);
@@ -873,14 +873,14 @@ providers_prepare (NMAMobileWizard *self)
 		GtkTreeIter provider_iter;
 
 		/* Ignore providers that don't match the current device type */
-		if (self->method_type != NMA_MOBILE_ACCESS_METHOD_TYPE_UNKNOWN) {
+		if (self->family != NMA_MOBILE_FAMILY_UNKNOWN) {
 			GSList *miter;
 			guint32 count = 0;
 
 			for (miter = nma_mobile_provider_get_methods (provider); miter; miter = g_slist_next (miter)) {
 				NMAMobileAccessMethod *method = miter->data;
 
-				if (self->method_type == nma_mobile_access_method_get_method_type (method))
+				if (self->family == nma_mobile_access_method_get_family (method))
 					count++;
 			}
 
@@ -931,7 +931,7 @@ done:
 	providers_update_complete (self);
 
 	/* If there's already a selected device, hide the GSM/CDMA radios */
-	if (self->method_type != NMA_MOBILE_ACCESS_METHOD_TYPE_UNKNOWN)
+	if (self->family != NMA_MOBILE_FAMILY_UNKNOWN)
 		gtk_widget_hide (self->provider_unlisted_type_combo);
 	else
 		gtk_widget_show (self->provider_unlisted_type_combo);
@@ -1371,9 +1371,9 @@ intro_combo_changed (NMAMobileWizard *self)
 		self->dev_desc = g_strdup (nma_utils_get_device_description (selected));
 		caps = nm_device_modem_get_current_capabilities (NM_DEVICE_MODEM (selected));
 		if (caps & NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS)
-			self->method_type = NMA_MOBILE_ACCESS_METHOD_TYPE_GSM;
+			self->family = NMA_MOBILE_FAMILY_3GPP;
 		else if (caps & NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO)
-			self->method_type = NMA_MOBILE_ACCESS_METHOD_TYPE_CDMA;
+			self->family = NMA_MOBILE_FAMILY_CDMA;
 		else
 			g_warning ("%s: unknown modem capabilities 0x%X", __func__, caps);
 
@@ -1434,7 +1434,7 @@ intro_setup (NMAMobileWizard *self)
 	gtk_box_pack_start (GTK_BOX (info_vbox), label, FALSE, TRUE, 0);
 
 	/* Device combo; only built if the wizard's caller didn't pass one in */
-	if (!self->initial_method_type) {
+	if (!self->initial_family) {
 		GtkTreeIter iter;
 
 		self->client = nm_client_new ();
@@ -1536,14 +1536,14 @@ forward_func (gint current_page, gpointer user_data)
 	NMAMobileWizard *self = user_data;
 
 	if (current_page == self->providers_idx) {
-		NMAMobileAccessMethodType method_type = self->method_type;
+		NMAMobileFamily family = self->family;
 
 		/* If the provider is unlisted, we can skip ahead of the user's
 		 * access technology is CDMA.
 		 */
 		if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (self->provider_unlisted_radio))) {
-			if (method_type == NMA_MOBILE_ACCESS_METHOD_TYPE_UNKNOWN)
-				method_type = get_provider_unlisted_type (self);
+			if (family == NMA_MOBILE_FAMILY_UNKNOWN)
+				family = get_provider_unlisted_type (self);
 		} else {
 			/* Or, if the provider is only CDMA, then we can also skip ahead */
 			NMAMobileProvider *provider;
@@ -1555,20 +1555,20 @@ forward_func (gint current_page, gpointer user_data)
 				for (iter = nma_mobile_provider_get_methods (provider); iter; iter = g_slist_next (iter)) {
 					NMAMobileAccessMethod *method = iter->data;
 
-					if (nma_mobile_access_method_get_method_type (method) == NMA_MOBILE_ACCESS_METHOD_TYPE_CDMA)
+					if (nma_mobile_access_method_get_family (method) == NMA_MOBILE_FAMILY_CDMA)
 						cdma = TRUE;
-					else if (nma_mobile_access_method_get_method_type (method) == NMA_MOBILE_ACCESS_METHOD_TYPE_GSM)
+					else if (nma_mobile_access_method_get_family (method) == NMA_MOBILE_FAMILY_3GPP)
 						gsm = TRUE;
 				}
 				nma_mobile_provider_unref (provider);
 
 				if (cdma && !gsm)
-					method_type = NMA_MOBILE_ACCESS_METHOD_TYPE_CDMA;
+					family = NMA_MOBILE_FAMILY_CDMA;
 			}
 		}
 
 		/* Skip to the confirm page if we know its CDMA */
-		if (method_type == NMA_MOBILE_ACCESS_METHOD_TYPE_CDMA) {
+		if (family == NMA_MOBILE_FAMILY_CDMA) {
 			self->provider_only_cdma = TRUE;
 			return self->confirm_idx;
 		} else
@@ -1642,11 +1642,11 @@ nma_mobile_wizard_new (GtkWindow *parent,
 	self->callback = cb;
 	self->user_data = user_data;
 	if (modem_caps & NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS)
-		self->method_type = NMA_MOBILE_ACCESS_METHOD_TYPE_GSM;
+		self->family = NMA_MOBILE_FAMILY_3GPP;
 	else if (modem_caps & NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO)
-		self->method_type = NMA_MOBILE_ACCESS_METHOD_TYPE_CDMA;
-	if (self->method_type)
-		self->initial_method_type = TRUE;  /* Skip device selection */
+		self->family = NMA_MOBILE_FAMILY_CDMA;
+	if (self->family)
+		self->initial_family = TRUE;  /* Skip device selection */
 
 	self->assistant = gtk_assistant_new ();
 	gtk_assistant_set_forward_page_func (GTK_ASSISTANT (self->assistant),



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