* Fixes NB#91689. fixes a wrong check for ASCII
[modest] / src / hildon2 / modest-country-picker.c
index 686cb05..91b2088 100644 (file)
@@ -266,7 +266,10 @@ modest_country_picker_init (ModestCountryPicker *self)
 void
 modest_country_picker_load_data(ModestCountryPicker *self)
 {
+       GtkCellRenderer *renderer;
+       GtkWidget *selector;
        GtkListStore *model;
+       HildonTouchSelectorColumn *column;
 
        /* Create a tree model for the combo box,
         * with a string for the name, and an int for the MCC ID.
@@ -276,13 +279,13 @@ modest_country_picker_load_data(ModestCountryPicker *self)
        
        /* Country column:
         * The ID model column in not shown in the view. */
-       GtkCellRenderer *renderer = gtk_cell_renderer_text_new ();
+       renderer = gtk_cell_renderer_text_new ();
        g_object_set (G_OBJECT (renderer), "ellipsize", PANGO_ELLIPSIZE_END, NULL);
 
-       GtkWidget *selector = hildon_touch_selector_new ();
-       hildon_picker_button_set_selector (HILDON_PICKER_BUTTON (self), HILDON_TOUCH_SELECTOR (selector));
-       hildon_touch_selector_append_column (HILDON_TOUCH_SELECTOR (selector), GTK_TREE_MODEL (model),
-                                            renderer, "text", MODEL_COL_NAME, NULL);
+       selector = hildon_touch_selector_new ();
+       column = hildon_touch_selector_append_column (HILDON_TOUCH_SELECTOR (selector), GTK_TREE_MODEL (model),
+                                                     renderer, "text", MODEL_COL_NAME, NULL);
+       g_object_set (G_OBJECT (column), "text-column", MODEL_COL_NAME, NULL);
 
        /* Fill the model with rows: */
        load_from_file (self, model);
@@ -290,15 +293,18 @@ modest_country_picker_load_data(ModestCountryPicker *self)
        /* Set this _after_ loading from file, it makes loading faster */
        hildon_touch_selector_set_model (HILDON_TOUCH_SELECTOR (selector),
                                         0, GTK_TREE_MODEL (model));
+       hildon_picker_button_set_selector (HILDON_PICKER_BUTTON (self), HILDON_TOUCH_SELECTOR (selector));
+
        g_object_unref (model);
 }
 
 ModestCountryPicker*
-modest_country_picker_new (void)
+modest_country_picker_new (HildonSizeType size,
+                          HildonButtonArrangement arrangement)
 {
        return g_object_new (MODEST_TYPE_COUNTRY_PICKER, 
-                            "arrangement", HILDON_BUTTON_ARRANGEMENT_VERTICAL,
-                            "size", HILDON_SIZE_AUTO,
+                            "arrangement", arrangement,
+                            "size", size,
                             NULL);
 }