X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fwidgets%2Fmodest-security-options-view.c;h=571a2939191743797c542aa18aed15015df7f50b;hb=43146a5b6e3b25f94d8650f77b71eb046a611724;hp=db7e10099c1aa2b767fc4bea01999867d8c763f1;hpb=dc31aa7811ffd978755af927b8719c8e18bac4a0;p=modest diff --git a/src/widgets/modest-security-options-view.c b/src/widgets/modest-security-options-view.c index db7e100..571a293 100644 --- a/src/widgets/modest-security-options-view.c +++ b/src/widgets/modest-security-options-view.c @@ -37,6 +37,7 @@ #ifdef MODEST_TOOLKIT_HILDON2 #include "modest-serversecurity-picker.h" #include "modest-secureauth-picker.h" +#include #else #include "widgets/modest-serversecurity-combo-box.h" #include "widgets/modest-secureauth-combo-box.h" @@ -104,8 +105,13 @@ modest_security_options_view_load_settings (ModestSecurityOptionsView* self, /* Active the authentication checkbox */ if (modest_protocol_registry_protocol_type_is_secure (modest_runtime_get_protocol_registry (), secure_auth)) +#ifdef MODEST_TOOLKIT_HILDON2 + hildon_check_button_set_active (HILDON_CHECK_BUTTON (priv->auth_view), + TRUE); +#else gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->auth_view), TRUE); +#endif } else { #ifdef MODEST_TOOLKIT_HILDON2 modest_secureauth_picker_set_active_secureauth ( @@ -151,7 +157,11 @@ modest_security_options_view_save_settings (ModestSecurityOptionsView* self, #endif if (self->type == MODEST_SECURITY_OPTIONS_INCOMING) { +#ifdef MODEST_TOOLKIT_HILDON2 + if (hildon_check_button_get_active (HILDON_CHECK_BUTTON (priv->auth_view))) { +#else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->auth_view))) { +#endif if (!modest_protocol_registry_protocol_type_is_secure (proto_registry, security_proto)) { /* TODO */ @@ -241,7 +251,11 @@ get_current_state (ModestSecurityOptionsView* self, if (priv->full) { } } else { +#ifdef MODEST_TOOLKIT_HILDON2 + if (hildon_check_button_get_active (HILDON_CHECK_BUTTON (priv->auth_view))) +#else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->auth_view))) +#endif state->auth = priv->initial_state.auth; else state->auth = MODEST_PROTOCOLS_AUTH_NONE; @@ -316,8 +330,13 @@ modest_security_options_view_auth_check (ModestSecurityOptionsView* self) modest_serversecurity_combo_box_get_active_serversecurity (MODEST_SERVERSECURITY_COMBO_BOX (priv->security_view)); #endif +#ifdef MODEST_TOOLKIT_HILDON2 + auth_active = + hildon_check_button_get_active (HILDON_CHECK_BUTTON (priv->auth_view)); +#else auth_active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->auth_view)); +#endif is_secure = modest_protocol_registry_protocol_type_has_tag (protocol_registry, security_incoming_type, @@ -329,75 +348,75 @@ modest_security_options_view_auth_check (ModestSecurityOptionsView* self) return FALSE; } -GList* -modest_security_options_view_get_supported_auth_methods (ModestSecurityOptionsView *self, - const gchar *hostname, - const gchar *username, - ModestProtocolType server_type) -{ - GtkWindow *window; - GError *error = NULL; - GList *list_auth_methods, *retval = NULL; - ModestSecurityOptionsViewPrivate *priv; - ModestAccountSettings current_settings; - ModestServerAccountSettings *server_settings; +/* GList* */ +/* modest_security_options_view_get_supported_auth_methods (ModestSecurityOptionsView *self, */ +/* const gchar *hostname, */ +/* const gchar *username, */ +/* ModestProtocolType server_type) */ +/* { */ +/* GtkWindow *window; */ +/* GError *error = NULL; */ +/* GList *list_auth_methods, *retval = NULL; */ +/* ModestSecurityOptionsViewPrivate *priv; */ +/* ModestAccountSettings current_settings; */ +/* ModestServerAccountSettings *server_settings; */ - priv = MODEST_SECURITY_OPTIONS_VIEW_GET_PRIVATE (self); - - window = GTK_WINDOW (gtk_widget_get_ancestor (GTK_WIDGET (self), GTK_TYPE_WINDOW)); - - /* Get current settings */ - modest_security_options_view_save_settings (self, ¤t_settings); - - if (self->type == MODEST_SECURITY_OPTIONS_INCOMING) - server_settings = modest_account_settings_get_store_settings (¤t_settings); - else - server_settings = modest_account_settings_get_transport_settings (¤t_settings); - - list_auth_methods = - modest_utils_get_supported_secure_authentication_methods (server_type, - hostname, - modest_server_account_settings_get_port (server_settings), - username, - window, - &error); - - if (list_auth_methods) { - GList *list = NULL, *method = NULL; - ModestProtocolRegistry *registry = modest_runtime_get_protocol_registry (); - - for (method = list_auth_methods; method != NULL; method = g_list_next(method)) { - ModestProtocolType auth_protocol_type = - (ModestProtocolType) (GPOINTER_TO_INT(method->data)); - if (modest_protocol_registry_protocol_type_is_secure (registry, - auth_protocol_type)) { - list = g_list_append(list, GINT_TO_POINTER(auth_protocol_type)); - } - } - g_list_free(list_auth_methods); - if (list) { - retval = list; - goto end; - } - } - - if(error == NULL || - error->domain != modest_utils_get_supported_secure_authentication_error_quark() || - error->code != MODEST_UTILS_GET_SUPPORTED_SECURE_AUTHENTICATION_ERROR_CANCELED) { - modest_platform_information_banner (GTK_WIDGET(self), - NULL, - _("mcen_ib_unableto_discover_auth_methods")); - } - - if(error != NULL) - g_error_free(error); - - end: - /* Frees */ - g_object_unref (server_settings); - - return retval; -} +/* priv = MODEST_SECURITY_OPTIONS_VIEW_GET_PRIVATE (self); */ + +/* window = GTK_WINDOW (gtk_widget_get_ancestor (GTK_WIDGET (self), GTK_TYPE_WINDOW)); */ + +/* /\* Get current settings *\/ */ +/* modest_security_options_view_save_settings (self, ¤t_settings); */ + +/* if (self->type == MODEST_SECURITY_OPTIONS_INCOMING) */ +/* server_settings = modest_account_settings_get_store_settings (¤t_settings); */ +/* else */ +/* server_settings = modest_account_settings_get_transport_settings (¤t_settings); */ + +/* list_auth_methods = */ +/* modest_utils_get_supported_secure_authentication_methods (server_type, */ +/* hostname, */ +/* modest_server_account_settings_get_port (server_settings), */ +/* username, */ +/* window, */ +/* &error); */ + +/* if (list_auth_methods) { */ +/* GList *list = NULL, *method = NULL; */ +/* ModestProtocolRegistry *registry = modest_runtime_get_protocol_registry (); */ + +/* for (method = list_auth_methods; method != NULL; method = g_list_next(method)) { */ +/* ModestProtocolType auth_protocol_type = */ +/* (ModestProtocolType) (GPOINTER_TO_INT(method->data)); */ +/* if (modest_protocol_registry_protocol_type_is_secure (registry, */ +/* auth_protocol_type)) { */ +/* list = g_list_append(list, GINT_TO_POINTER(auth_protocol_type)); */ +/* } */ +/* } */ +/* g_list_free(list_auth_methods); */ +/* if (list) { */ +/* retval = list; */ +/* goto end; */ +/* } */ +/* } */ + +/* if(error != NULL && */ +/* error->domain == modest_utils_get_supported_secure_authentication_error_quark() && */ +/* error->code != MODEST_UTILS_GET_SUPPORTED_SECURE_AUTHENTICATION_ERROR_CANCELED) { */ +/* modest_platform_information_banner (GTK_WIDGET(self), */ +/* NULL, */ +/* _("mcen_ib_unableto_discover_auth_methods")); */ +/* } */ + +/* if(error != NULL) */ +/* g_error_free(error); */ + +/* end: */ +/* /\* Frees *\/ */ +/* g_object_unref (server_settings); */ + +/* return retval; */ +/* } */ static void modest_security_options_view_init (ModestSecurityOptionsView *self) @@ -411,6 +430,8 @@ modest_security_options_view_init (ModestSecurityOptionsView *self) priv->auth_view = NULL; priv->user_entry = NULL; priv->pwd_entry = NULL; + priv->full = FALSE; + priv->changed = FALSE; } static void