X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmaemo%2Feasysetup%2Fmodest-easysetup-provider-combo-box.c;h=a7871cacdf0e03afcb329728bd0dceeeeb3ee2b3;hp=48914a0a9014d3c89021acfe33cd73052fad7adb;hb=15228caeb8df1140e75a6830ff47bd76ecc5c06f;hpb=82a238a17717bc6270221ae6d8c0eb87a0085361 diff --git a/src/maemo/easysetup/modest-easysetup-provider-combo-box.c b/src/maemo/easysetup/modest-easysetup-provider-combo-box.c index 48914a0..a7871ca 100644 --- a/src/maemo/easysetup/modest-easysetup-provider-combo-box.c +++ b/src/maemo/easysetup/modest-easysetup-provider-combo-box.c @@ -144,6 +144,15 @@ easysetup_provider_combo_box_new (void) void easysetup_provider_combo_box_fill (EasysetupProviderComboBox *combobox, ModestPresets *presets, GSList * list_country_id) { + /* If the list is empty then use mmc=0 to get the providers for all countries: */ + GSList *list = list_country_id; + GSList *fake_list = NULL; + if (!list_country_id) { + fake_list = g_slist_append(fake_list, GUINT_TO_POINTER(0)); + list = fake_list; + } + + EasysetupProviderComboBoxPrivate *priv = PROVIDER_COMBO_BOX_GET_PRIVATE (combobox); /* Remove any existing rows: */ @@ -152,7 +161,7 @@ void easysetup_provider_combo_box_fill (EasysetupProviderComboBox *combobox, Mod GSList *provider_ids_used_already = NULL; - GSList *iter_ids = list_country_id; + GSList *iter_ids = list; while (iter_ids) { const guint country_id = GPOINTER_TO_UINT (iter_ids->data); @@ -202,19 +211,21 @@ void easysetup_provider_combo_box_fill (EasysetupProviderComboBox *combobox, Mod iter_ids = g_slist_next (iter_ids); } - /* Add the "Other" item: */ /* Note that ID 0 means "Other" for us: */ /* TODO: We need a Logical ID for this text. */ GtkTreeIter iter; - gtk_list_store_append (liststore, &iter); - gtk_list_store_set (liststore, &iter, MODEL_COL_ID, 0, MODEL_COL_NAME, _("Other..."), -1); + gtk_list_store_prepend (liststore, &iter); + gtk_list_store_set (liststore, &iter, MODEL_COL_ID, 0, MODEL_COL_NAME, _("mcen_va_serviceprovider_other"), -1); /* Select the "Other" item: */ gtk_combo_box_set_active_iter (GTK_COMBO_BOX (combobox), &iter); g_slist_foreach (provider_ids_used_already, (GFunc)g_free, NULL); g_slist_free (provider_ids_used_already); + + if (fake_list) + g_slist_free (fake_list); } /**