Drop usage of HildonCheckButton in settings dialogs.
[modest] / src / widgets / modest-security-options-view.c
index c7552f6..c3cd853 100644 (file)
@@ -105,13 +105,8 @@ 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
+                       modest_togglable_set_active (priv->auth_view,
+                                                    TRUE);
        } else {
 #ifdef MODEST_TOOLKIT_HILDON2
                modest_secureauth_picker_set_active_secureauth (
@@ -157,11 +152,7 @@ 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_togglable_get_active (priv->auth_view)) {
                        if (!modest_protocol_registry_protocol_type_is_secure (proto_registry,
                                                                               security_proto)) {
                                /* TODO */
@@ -255,11 +246,7 @@ 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
+               if (modest_togglable_get_active (priv->auth_view))
                        state->auth = priv->initial_state.auth;
                else
                        state->auth = MODEST_PROTOCOLS_AUTH_NONE;
@@ -334,13 +321,8 @@ 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
+               modest_togglable_get_active (priv->auth_view);
        is_secure = 
                modest_protocol_registry_protocol_type_has_tag (protocol_registry, 
                                                                security_incoming_type,