Drop usage of HildonCheckButton in settings dialogs.
[modest] / src / hildon2 / modest-maemo-security-options-view.c
1 /* Copyright (c) 2008, Nokia Corporation
2  * All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are
6  * met:
7  *
8  * * Redistributions of source code must retain the above copyright
9  *   notice, this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright
11  *   notice, this list of conditions and the following disclaimer in the
12  *   documentation and/or other materials provided with the distribution.
13  * * Neither the name of the Nokia Corporation nor the names of its
14  *   contributors may be used to endorse or promote products derived from
15  *   this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
18  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
20  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
21  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28  */
29
30 #include "modest-runtime.h"
31 #include "modest-security-options-view-priv.h"
32 #include "modest-maemo-security-options-view.h"
33 #include "modest-text-utils.h"
34 #include "modest-platform.h"
35 #include "modest-account-protocol.h"
36 #include "widgets/modest-ui-constants.h"
37 #include "widgets/modest-validating-entry.h"
38 #include "modest-serversecurity-picker.h"
39 #include "modest-secureauth-picker.h"
40 #include "modest-maemo-utils.h"
41 #include <modest-number-editor.h>
42 #include "modest-hildon-includes.h"
43
44 #define PORT_MIN 1
45 #define PORT_MAX 65535
46
47 typedef struct _ModestMaemoSecurityOptionsViewPrivate ModestMaemoSecurityOptionsViewPrivate;
48 struct _ModestMaemoSecurityOptionsViewPrivate {
49         gboolean missing_data;
50 };
51
52 #define MODEST_MAEMO_SECURITY_OPTIONS_VIEW_GET_PRIVATE(o) \
53         (G_TYPE_INSTANCE_GET_PRIVATE((o), \
54                                      MODEST_TYPE_MAEMO_SECURITY_OPTIONS_VIEW, \
55                                      ModestMaemoSecurityOptionsViewPrivate))
56
57 static void modest_maemo_security_options_view_init (ModestMaemoSecurityOptionsView *obj);
58 static void modest_maemo_security_options_view_finalize (GObject *obj);
59 static void modest_maemo_security_options_view_class_init (ModestMaemoSecurityOptionsViewClass *klass);
60
61 G_DEFINE_TYPE (ModestMaemoSecurityOptionsView, 
62                modest_maemo_security_options_view, 
63                MODEST_TYPE_SECURITY_OPTIONS_VIEW);
64
65 static void on_entry_changed (GtkEditable *editable, gpointer user_data);
66
67 static void on_valid_changed (ModestNumberEditor *editor, gboolean valid, ModestSecurityOptionsView *self);
68
69 /* Tracks changes in the incoming security picker */
70 static void
71 on_security_changed (GtkWidget *widget, 
72                      ModestMaemoSecurityOptionsView *self)
73 {
74         ModestSecurityOptionsViewPrivate* ppriv;
75         ModestServersecurityPicker *picker;
76         ModestProtocolType proto_type;
77         ModestProtocolRegistry *proto_registry;
78         gboolean is_secure;
79
80         ppriv = MODEST_SECURITY_OPTIONS_VIEW_GET_PRIVATE (self);
81
82         proto_registry = modest_runtime_get_protocol_registry ();
83         picker = MODEST_SERVERSECURITY_PICKER (ppriv->security_view);
84         proto_type = modest_serversecurity_picker_get_active_serversecurity (picker);
85
86         is_secure = modest_protocol_registry_protocol_type_has_tag (proto_registry, proto_type, 
87                                                                     MODEST_PROTOCOL_REGISTRY_SECURE_PROTOCOLS);
88
89         if (MODEST_SECURITY_OPTIONS_VIEW (self)->type == MODEST_SECURITY_OPTIONS_INCOMING) {
90                 /* Activate and dim checkbutton if it's secure */
91                 modest_togglable_set_active (ppriv->auth_view,
92                                              is_secure);
93                 gtk_widget_set_sensitive (ppriv->auth_view, !is_secure);
94         } else {
95
96         }
97
98         if (ppriv->full) {
99                 gint port_number = 
100                         modest_serversecurity_picker_get_active_serversecurity_port (MODEST_SERVERSECURITY_PICKER (ppriv->security_view));
101                 
102                 if(port_number) {
103                         modest_number_editor_set_value (MODEST_NUMBER_EDITOR (ppriv->port_view), 
104                                                         port_number);
105                 }
106         }
107 }
108
109 static void
110 on_auth_changed (GtkWidget *widget, 
111                  ModestMaemoSecurityOptionsView *self)
112 {
113         ModestSecurityOptionsViewPrivate* ppriv;
114         ModestSecureauthPicker *picker;
115         ModestProtocolRegistry *protocol_registry;
116         ModestProtocolType auth_proto;
117         gboolean secureauth_used;
118         GtkWidget *user_caption, *pwd_caption;
119
120         ppriv = MODEST_SECURITY_OPTIONS_VIEW_GET_PRIVATE (self);
121         protocol_registry = modest_runtime_get_protocol_registry ();
122         picker = MODEST_SECUREAUTH_PICKER (ppriv->auth_view);
123
124         auth_proto = modest_secureauth_picker_get_active_secureauth (picker);
125         secureauth_used = modest_protocol_registry_protocol_type_is_secure (protocol_registry, 
126                                                                             auth_proto);
127
128         /* Get captions, well dimm the whole widget */
129         user_caption = gtk_widget_get_parent (ppriv->user_entry);
130         pwd_caption = gtk_widget_get_parent (ppriv->pwd_entry);
131         
132         /* Enable / disable */
133         gtk_widget_set_sensitive (user_caption, secureauth_used);
134         gtk_widget_set_sensitive (pwd_caption, secureauth_used);
135
136         /* Check if mandatory data is missing */
137         on_entry_changed (GTK_EDITABLE (ppriv->user_entry), (gpointer) self);
138 }
139
140 static void
141 create_incoming_security (ModestSecurityOptionsView* self,
142                           GtkSizeGroup *title_size_group,
143                           GtkSizeGroup *value_size_group)
144 {
145         ModestSecurityOptionsViewPrivate *ppriv;
146         GtkWidget *entry_caption = NULL;
147
148         ppriv = MODEST_SECURITY_OPTIONS_VIEW_GET_PRIVATE (self);
149
150         /* Create widgets for incoming security */
151         ppriv->security_view = GTK_WIDGET (modest_serversecurity_picker_new (MODEST_EDITABLE_SIZE,
152                                                                              HILDON_BUTTON_ARRANGEMENT_HORIZONTAL));
153         modest_serversecurity_picker_fill (MODEST_SERVERSECURITY_PICKER (ppriv->security_view), 
154                                            modest_protocol_registry_get_pop_type_id ());
155         modest_maemo_utils_set_hbutton_layout (title_size_group,
156                                                value_size_group,
157                                                _("mcen_li_emailsetup_secure_connection"), 
158                                                ppriv->security_view);
159
160         ppriv->auth_view = modest_toolkit_factory_create_check_button (modest_runtime_get_toolkit_factory (),
161                                                                        _("mcen_li_emailsetup_secure_authentication"));
162
163         /* Track changes in UI */
164         g_signal_connect (G_OBJECT (ppriv->security_view), "value-changed",
165                           G_CALLBACK (on_security_changed), self);
166
167         /* Pack into container & show */
168         gtk_box_pack_start (GTK_BOX (self), ppriv->auth_view, FALSE, FALSE, 0);
169         gtk_box_pack_start (GTK_BOX (self), ppriv->security_view, FALSE, FALSE, 0);
170         gtk_widget_show (ppriv->security_view);
171         gtk_widget_show (ppriv->auth_view);
172
173         if (ppriv->full) {
174                 ppriv->port_view = GTK_WIDGET (modest_number_editor_new (PORT_MIN, PORT_MAX));
175                 entry_caption =
176                         modest_maemo_utils_create_captioned_with_size_type (title_size_group,
177                                                                             value_size_group,
178                                                                             _("mcen_fi_emailsetup_port"),
179                                                                             FALSE,
180                                                                             ppriv->port_view,
181                                                                             MODEST_EDITABLE_SIZE);
182                 /* Pack & show widgets */
183                 gtk_box_pack_start (GTK_BOX (self), entry_caption, FALSE, FALSE, 0);
184                 gtk_widget_show (ppriv->port_view);
185                 gtk_widget_show (entry_caption);
186
187                 /* Track changes in UI */
188                 g_signal_connect (G_OBJECT (ppriv->port_view), "valid-changed",
189                                             G_CALLBACK (on_valid_changed), self);
190         }
191 }
192
193 static void
194 on_entry_max (ModestValidatingEntry *self, 
195               gpointer user_data)
196 {
197         modest_platform_information_banner (GTK_WIDGET (self), NULL, 
198                                             _CS("ckdg_ib_maximum_characters_reached"));
199 }
200
201 /*
202  * TODO: call this whenever the auth picker changes. If we set it
203  * explicitely at the beggining to a value then there is no need to
204  * call this handler directly at the beginning
205  */
206 static void
207 on_entry_changed (GtkEditable *editable, 
208                   gpointer user_data)
209 {
210         ModestSecurityOptionsView* self;
211         ModestMaemoSecurityOptionsViewPrivate *priv;
212         ModestSecurityOptionsViewPrivate *ppriv;
213         ModestSecureauthPicker *picker;
214         gboolean is_secure = FALSE;
215         ModestProtocolRegistry *protocol_registry;
216
217         self = MODEST_SECURITY_OPTIONS_VIEW (user_data);
218         priv = MODEST_MAEMO_SECURITY_OPTIONS_VIEW_GET_PRIVATE (self);
219         ppriv = MODEST_SECURITY_OPTIONS_VIEW_GET_PRIVATE (self);
220         protocol_registry = modest_runtime_get_protocol_registry ();
221
222         /* Check if it's a secure protocol */
223         if (MODEST_IS_SECUREAUTH_PICKER (ppriv->auth_view)) {
224                 ModestProtocolType auth_proto;
225                 picker = MODEST_SECUREAUTH_PICKER (ppriv->auth_view);
226                 auth_proto = modest_secureauth_picker_get_active_secureauth (picker);
227                 is_secure = modest_protocol_registry_protocol_type_is_secure (protocol_registry,
228                                                                               auth_proto);
229         } else if (modest_is_togglable (ppriv->auth_view)) {
230                 is_secure = modest_togglable_get_active (ppriv->auth_view);
231         }
232
233         if (is_secure &&
234             !g_strcmp0 (hildon_entry_get_text (HILDON_ENTRY (ppriv->user_entry)), "")) {
235                 priv->missing_data = TRUE;
236         } else {
237                 priv->missing_data = FALSE;
238         }
239
240         if (!priv->missing_data &&
241             ppriv->full &&
242             !modest_number_editor_is_valid (MODEST_NUMBER_EDITOR (ppriv->port_view)))
243                 priv->missing_data = TRUE;
244
245         /* Emit a signal to notify if mandatory data is missing */
246         g_signal_emit_by_name (G_OBJECT (self), "missing_mandatory_data",
247                                priv->missing_data, NULL);
248 }
249
250 static void
251 on_valid_changed (ModestNumberEditor *editor,
252                   gboolean valid,
253                   ModestSecurityOptionsView *self)
254 {
255         on_entry_changed (NULL, (gpointer) self);
256 }
257
258 static void
259 create_outgoing_security (ModestSecurityOptionsView* self,
260                           GtkSizeGroup *title_size_group,
261                           GtkSizeGroup *value_size_group)
262 {
263         ModestSecurityOptionsViewPrivate *ppriv;
264         GtkWidget *user_caption = NULL;
265         GtkWidget *pwd_caption = NULL, *port_caption = NULL;
266
267         ppriv = MODEST_SECURITY_OPTIONS_VIEW_GET_PRIVATE (self);
268         
269         /* The secure connection widgets */
270         ppriv->security_view = GTK_WIDGET (modest_serversecurity_picker_new (MODEST_EDITABLE_SIZE,
271                                                                              HILDON_BUTTON_ARRANGEMENT_HORIZONTAL));
272         modest_serversecurity_picker_fill (MODEST_SERVERSECURITY_PICKER (ppriv->security_view), 
273                                               MODEST_PROTOCOLS_TRANSPORT_SMTP);
274         modest_maemo_utils_set_hbutton_layout (title_size_group,
275                                                value_size_group,
276                                                _("mcen_li_emailsetup_secure_connection"), 
277                                                ppriv->security_view);
278         
279         /* The secure authentication widgets */
280         ppriv->auth_view = GTK_WIDGET (modest_secureauth_picker_new (MODEST_EDITABLE_SIZE,
281                                                                      HILDON_BUTTON_ARRANGEMENT_HORIZONTAL));
282         modest_maemo_utils_set_hbutton_layout (title_size_group,
283                                                value_size_group,
284                                                _("mcen_li_emailsetup_secure_authentication"), 
285                                                ppriv->auth_view);
286
287         if (ppriv->full) {
288                 gchar *user_label;
289
290                 /* Username widgets */
291                 ppriv->user_entry = GTK_WIDGET (modest_validating_entry_new ());
292
293                 /* Auto-capitalization is the default, so let's turn it off: */
294                 hildon_gtk_entry_set_input_mode (GTK_ENTRY (ppriv->user_entry), 
295                                                  HILDON_GTK_INPUT_MODE_FULL);
296
297                 user_label = g_strdup_printf("%s*", _("mail_fi_username"));
298                 user_caption = modest_maemo_utils_create_captioned_with_size_type (title_size_group,
299                                                                                    value_size_group,
300                                                                                    user_label,
301                                                                                    FALSE,
302                                                                                    ppriv->user_entry,
303                                                                                    MODEST_EDITABLE_SIZE);
304                 g_free (user_label);
305         
306                 /* Prevent the use of some characters. Limit the max
307                    length as well */
308                 modest_validating_entry_set_unallowed_characters_whitespace (
309                      MODEST_VALIDATING_ENTRY (ppriv->user_entry));      
310                 gtk_entry_set_max_length (GTK_ENTRY (ppriv->user_entry), 64);
311                 modest_validating_entry_set_max_func (MODEST_VALIDATING_ENTRY (ppriv->user_entry),
312                                                       on_entry_max, self);
313                 
314                 /* Password widgets */
315                 ppriv->pwd_entry = hildon_entry_new (MODEST_EDITABLE_SIZE);
316
317                 /* Auto-capitalization is the default, so let's turn it off */
318                 hildon_gtk_entry_set_input_mode (GTK_ENTRY (ppriv->pwd_entry),
319                                                  HILDON_GTK_INPUT_MODE_FULL | 
320                                                  HILDON_GTK_INPUT_MODE_INVISIBLE);
321                 gtk_entry_set_visibility (GTK_ENTRY (ppriv->pwd_entry), FALSE);
322
323                 pwd_caption =
324                         modest_maemo_utils_create_captioned_with_size_type (title_size_group,
325                                                                             value_size_group,
326                                                                             _("mail_fi_password"),
327                                                                             FALSE,
328                                                                             ppriv->pwd_entry,
329                                                                             MODEST_EDITABLE_SIZE);
330
331                 ppriv->port_view = GTK_WIDGET (modest_number_editor_new (PORT_MIN, PORT_MAX));
332                 port_caption =
333                         modest_maemo_utils_create_captioned_with_size_type (title_size_group,
334                                                                             value_size_group,
335                                                                             _("mcen_fi_emailsetup_port"),
336                                                                             FALSE,
337                                                                             ppriv->port_view,
338                                                                             MODEST_EDITABLE_SIZE);
339         }
340
341         /* Track changes in UI */       
342         g_signal_connect (G_OBJECT (ppriv->security_view), "value-changed",
343                           G_CALLBACK (on_security_changed), self);
344         if (ppriv->full) {
345                 g_signal_connect (G_OBJECT (ppriv->auth_view), "value-changed",
346                                   G_CALLBACK (on_auth_changed), self);
347                 g_signal_connect (G_OBJECT (ppriv->user_entry), "changed",
348                                   G_CALLBACK (on_entry_changed), self);
349                 g_signal_connect (G_OBJECT (ppriv->port_view), "valid-changed",
350                                             G_CALLBACK (on_valid_changed), self);
351         }
352
353         /* Initialize widgets */
354         modest_serversecurity_picker_set_active_serversecurity (
355                 MODEST_SERVERSECURITY_PICKER (ppriv->security_view), 
356                 MODEST_PROTOCOLS_CONNECTION_NONE);
357         modest_secureauth_picker_set_active_secureauth (
358            MODEST_SECUREAUTH_PICKER (ppriv->auth_view),
359            MODEST_PROTOCOLS_AUTH_NONE);
360
361         /* Pack into container */
362         if (ppriv->full) {
363                 gtk_box_pack_start (GTK_BOX (self), ppriv->auth_view, FALSE, FALSE, 0);
364                 gtk_box_pack_start (GTK_BOX (self), user_caption, FALSE, FALSE, 0);
365                 gtk_box_pack_start (GTK_BOX (self), pwd_caption, FALSE, FALSE, 0);
366                 gtk_box_pack_start (GTK_BOX (self), ppriv->security_view, FALSE, FALSE, 0);
367                 gtk_box_pack_start (GTK_BOX (self), port_caption, FALSE, FALSE, 0);
368         } else {
369                 gtk_box_pack_start (GTK_BOX (self), ppriv->auth_view, FALSE, FALSE, 0);
370                 gtk_box_pack_start (GTK_BOX (self), ppriv->security_view, FALSE, FALSE, 0);
371         }
372
373         /* Show widgets */
374         if (ppriv->full) {
375                 gtk_widget_show (ppriv->pwd_entry);
376                 gtk_widget_show (ppriv->user_entry);
377                 gtk_widget_show (ppriv->port_view);
378                 gtk_widget_show (pwd_caption);
379                 gtk_widget_show (user_caption);
380                 gtk_widget_show (port_caption);
381         }
382         gtk_widget_show (ppriv->security_view);
383         gtk_widget_show (ppriv->auth_view);
384 }
385
386 GtkWidget *    
387 modest_maemo_security_options_view_new  (ModestSecurityOptionsType type,
388                                          gboolean full,
389                                          GtkSizeGroup *title_size_group,
390                                          GtkSizeGroup *value_size_group)
391 {
392         ModestSecurityOptionsView* self;
393         ModestSecurityOptionsViewPrivate *ppriv;
394
395         self = (ModestSecurityOptionsView *)
396                 g_object_new (MODEST_TYPE_MAEMO_SECURITY_OPTIONS_VIEW, NULL);
397         ppriv = MODEST_SECURITY_OPTIONS_VIEW_GET_PRIVATE (self);
398
399         ppriv->full = full;
400         self->type = type;
401         if (self->type == MODEST_SECURITY_OPTIONS_INCOMING)
402                 create_incoming_security (self, title_size_group, value_size_group);
403         else
404                 create_outgoing_security (self, title_size_group, value_size_group);
405
406         return (GtkWidget *) self;
407 }
408
409 gboolean
410 modest_security_options_view_has_missing_mandatory_data (ModestSecurityOptionsView* self)
411 {
412         ModestMaemoSecurityOptionsViewPrivate *priv;
413
414         priv = MODEST_MAEMO_SECURITY_OPTIONS_VIEW_GET_PRIVATE (self);
415
416         return priv->missing_data;
417 }
418
419 static void
420 modest_maemo_security_options_view_load_settings (ModestSecurityOptionsView* self,
421                                                   ModestAccountSettings *settings)
422 {
423         ModestSecurityOptionsViewPrivate *ppriv;
424         ModestServerAccountSettings *server_settings;
425         gint port_number;
426
427         ppriv = MODEST_SECURITY_OPTIONS_VIEW_GET_PRIVATE (self);
428
429         if (self->type == MODEST_SECURITY_OPTIONS_INCOMING)
430                 server_settings = modest_account_settings_get_store_settings (settings);
431         else
432                 server_settings = modest_account_settings_get_transport_settings (settings);
433         port_number = modest_server_account_settings_get_port (server_settings);
434
435         if (port_number == 0) {
436                 /* Show the appropriate port number */
437                 on_security_changed (ppriv->security_view, 
438                                      MODEST_MAEMO_SECURITY_OPTIONS_VIEW (self));
439         } else if (ppriv->full) {
440                 /* Keep the user-entered port-number, or the
441                  * already-appropriate automatic port number */
442                 modest_number_editor_set_value (MODEST_NUMBER_EDITOR (ppriv->port_view), 
443                                                 port_number);
444         }
445         /* Frees */
446         g_object_unref (server_settings);
447 }
448
449 static void
450 modest_maemo_security_options_view_save_settings (ModestSecurityOptionsView* self, 
451                                                   ModestAccountSettings *settings)
452 {
453         ModestServerAccountSettings *server_settings;
454         ModestSecurityOptionsViewPrivate *ppriv;
455         gint server_port;
456
457         ppriv = MODEST_SECURITY_OPTIONS_VIEW_GET_PRIVATE (self);
458
459         if (self->type == MODEST_SECURITY_OPTIONS_INCOMING)
460                 server_settings = modest_account_settings_get_store_settings (settings);
461         else
462                 server_settings = modest_account_settings_get_transport_settings (settings);
463
464         if (ppriv->full) {
465                 server_port = modest_number_editor_get_value (MODEST_NUMBER_EDITOR (ppriv->port_view));
466         } else {
467                 server_port = modest_serversecurity_picker_get_active_serversecurity_port (MODEST_SERVERSECURITY_PICKER (ppriv->security_view));
468         }
469
470         modest_server_account_settings_set_port (server_settings, server_port);
471
472         /* Frees */
473         g_object_unref (server_settings);
474 }
475
476 static gboolean 
477 modest_maemo_security_options_view_changed (ModestSecurityOptionsView* self,
478                                             ModestAccountSettings *settings)
479 {
480         ModestServerAccountSettings *server_settings;
481         ModestSecurityOptionsViewPrivate *ppriv;
482         gint server_port;
483
484         ppriv = MODEST_SECURITY_OPTIONS_VIEW_GET_PRIVATE (self);
485         
486         /* If we're not showing the port number then it never changes */
487         if (!ppriv->full)
488                 return FALSE;
489
490         if (self->type == MODEST_SECURITY_OPTIONS_INCOMING)
491                 server_settings = modest_account_settings_get_store_settings (settings);
492         else
493                 server_settings = modest_account_settings_get_transport_settings (settings);
494         
495         server_port = 
496                 modest_number_editor_get_value (MODEST_NUMBER_EDITOR (ppriv->port_view));
497
498         /* Frees */
499         g_object_unref (server_settings);
500
501         if (server_port != ppriv->initial_state.port)
502                 return TRUE;
503         else
504                 return FALSE;
505 }
506
507 static void
508 modest_maemo_security_options_view_init (ModestMaemoSecurityOptionsView *obj)
509 {
510 }
511
512 static void
513 modest_maemo_security_options_view_finalize (GObject *obj)
514 {
515         G_OBJECT_CLASS (modest_maemo_security_options_view_parent_class)->finalize (obj);
516 }
517
518
519 static void     
520 modest_maemo_security_options_view_class_init (ModestMaemoSecurityOptionsViewClass *klass)
521 {
522         GObjectClass *gobject_class = (GObjectClass*) klass;
523
524         modest_maemo_security_options_view_parent_class = g_type_class_peek_parent (klass);
525
526         g_type_class_add_private (gobject_class, sizeof (ModestMaemoSecurityOptionsViewPrivate));
527         gobject_class->finalize = modest_maemo_security_options_view_finalize;
528
529         MODEST_SECURITY_OPTIONS_VIEW_CLASS (klass)->load_settings = 
530                 modest_maemo_security_options_view_load_settings;
531         MODEST_SECURITY_OPTIONS_VIEW_CLASS (klass)->save_settings = 
532                 modest_maemo_security_options_view_save_settings;
533         MODEST_SECURITY_OPTIONS_VIEW_CLASS (klass)->changed = 
534                 modest_maemo_security_options_view_changed;
535 }