X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fhildon2%2Fmodest-secureauth-picker.c;h=954a17c176e0b21eb593c65314c8e08238b00b28;hb=fd1d9e254d08ad38779f8a1bb5c4d6d350040a9b;hp=103226ba11b65054d52f36b83f744a1e59a11bc8;hpb=dc31aa7811ffd978755af927b8719c8e18bac4a0;p=modest diff --git a/src/hildon2/modest-secureauth-picker.c b/src/hildon2/modest-secureauth-picker.c index 103226b..954a17c 100644 --- a/src/hildon2/modest-secureauth-picker.c +++ b/src/hildon2/modest-secureauth-picker.c @@ -79,10 +79,10 @@ enum MODEL_COLS { MODEL_COL_ID = 1 /* an int. */ }; -void modest_secureauth_picker_fill (ModestSecureauthPicker *picker); +static void modest_secureauth_picker_fill (ModestSecureauthPicker *picker); static gchar * -touch_selector_print_func (HildonTouchSelector *selector) +touch_selector_print_func (HildonTouchSelector *selector, gpointer userdata) { GtkTreeIter iter; if (hildon_touch_selector_get_selected (HILDON_TOUCH_SELECTOR (selector), 0, &iter)) { @@ -105,7 +105,8 @@ modest_secureauth_picker_init (ModestSecureauthPicker *self) } ModestSecureauthPicker* -modest_secureauth_picker_new (void) +modest_secureauth_picker_new (HildonSizeType size, + HildonButtonArrangement arrangement) { ModestSecureauthPicker *self; ModestSecureauthPickerPrivate *priv; @@ -113,8 +114,8 @@ modest_secureauth_picker_new (void) GtkWidget *selector; self = g_object_new (MODEST_TYPE_SECUREAUTH_PICKER, - "arrangement", HILDON_BUTTON_ARRANGEMENT_VERTICAL, - "size", HILDON_SIZE_AUTO, + "arrangement", arrangement, + "size", size, NULL); priv = MODEST_SECUREAUTH_PICKER_GET_PRIVATE (self); @@ -131,12 +132,15 @@ modest_secureauth_picker_new (void) renderer, "text", MODEL_COL_NAME, NULL); hildon_touch_selector_set_model (HILDON_TOUCH_SELECTOR (selector), 0, GTK_TREE_MODEL (priv->model)); - hildon_touch_selector_set_print_func (HILDON_TOUCH_SELECTOR (selector), touch_selector_print_func); + hildon_touch_selector_set_print_func (HILDON_TOUCH_SELECTOR (selector), (HildonTouchSelectorPrintFunc) touch_selector_print_func); hildon_picker_button_set_selector (HILDON_PICKER_BUTTON (self), HILDON_TOUCH_SELECTOR (selector)); modest_secureauth_picker_fill (self); + /* For theming purpouses. Widget name must end in Button-finger */ + gtk_widget_set_name ((GtkWidget *) self, "ModestSecureauthPickerButton-finger"); + return self; } @@ -144,7 +148,8 @@ modest_secureauth_picker_new (void) * #picker: The combo box. * @protocol: IMAP or POP. */ -void modest_secureauth_picker_fill (ModestSecureauthPicker *picker) +static void +modest_secureauth_picker_fill (ModestSecureauthPicker *picker) { ModestSecureauthPickerPrivate *priv; GtkListStore *liststore; @@ -170,6 +175,14 @@ void modest_secureauth_picker_fill (ModestSecureauthPicker *picker) MODEL_COL_ID, (gint)modest_protocol_get_type_id (protocol), MODEL_COL_NAME, modest_protocol_get_display_name (protocol), -1); + if (modest_protocol_get_type_id (protocol) == MODEST_PROTOCOLS_AUTH_NONE) { + HildonTouchSelector *selector; + selector = hildon_picker_button_get_selector (HILDON_PICKER_BUTTON (picker)); + hildon_touch_selector_select_iter (HILDON_TOUCH_SELECTOR (selector), 0, &iter, TRUE); + hildon_button_set_value (HILDON_BUTTON (picker), + hildon_touch_selector_get_current_text (HILDON_TOUCH_SELECTOR (selector))); + + } } }