More checks for the case where the overshoot is bigger than the size of the widget.
[hildon] / src / hildon-get-password-dialog.c
1 /*
2  * This file is a part of hildon
3  *
4  * Copyright (C) 2005, 2006 Nokia Corporation, all rights reserved.
5  *
6  * Contact: Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation; version 2.1 of
11  * the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21  * 02110-1301 USA
22  *
23  */
24
25 /**
26  * SECTION:hildon-get-password-dialog
27  * @short_description: A widget used to get a password.
28  * @see_also: #HildonSetPasswordDialog
29  * 
30  * HildonGetPasswordDialog prompts the user for a password.  It allows
31  * inputting password, with an optional configurable label eg. for
32  * showing a custom message. The maximum length of the password can be set.
33  *
34  * <example>
35  * <title>HildonGetPassword example</title>
36  * <programlisting>
37  * get_dialog =  HILDON_GET_PASSWORD_DIALOG (hildon_get_password_dialog_new (parent, FALSE));
38  * <!-- -->
39  * gtk_widget_show (GTK_WIDGET (get_dialog));
40  * <!-- -->
41  * i = gtk_dialog_run (GTK_DIALOG (get_dialog));
42  * <!-- -->
43  * pass = hildon_get_password_dialog_get_password (get_dialog);
44  * <!-- -->
45  * if (i == GTK_RESPONSE_OK &amp;&amp; (strcmp (pass, dialog.current_password) != 0))
46  * {
47  *      gtk_infoprint (GTK_WINDOW (parent), STR_PASSWORD_INCORRECT);
48  *      gtk_widget_set_sensitive (GTK_WIDGET (dialog.button2), FALSE);
49  *      gtk_widget_set_sensitive (GTK_WIDGET (dialog.button3), FALSE);
50  *      gtk_widget_set_sensitive (GTK_WIDGET (dialog.button4), FALSE);
51  * }
52  * <!-- -->
53  * else if (i == GTK_RESPONSE_OK)
54  * {   
55  *      gtk_widget_set_sensitive( GTK_WIDGET( dialog.button2 ), TRUE);
56  * }
57  * <!-- -->
58  * else
59  * {
60  *      gtk_widget_set_sensitive (GTK_WIDGET (dialog.button2), FALSE);
61  *      gtk_widget_set_sensitive (GTK_WIDGET (dialog.button3), FALSE);
62  *      gtk_widget_set_sensitive (GTK_WIDGET (dialog.button4), FALSE);
63  * }
64  * gtk_widget_destroy (GTK_WIDGET (get_dialog));
65  * }
66  * </programlisting>
67  * </example>
68  */
69
70 #ifdef                                          HAVE_CONFIG_H
71 #include                                        <config.h>
72 #endif
73
74 #include                                        "hildon-get-password-dialog.h"
75 #include                                        <glib.h>
76 #include                                        <errno.h>
77 #include                                        <string.h>
78 #include                                        <strings.h>
79 #include                                        <unistd.h>
80 #include                                        <stdio.h>
81 #include                                        <gtk/gtk.h>
82 #include                                        "hildon-caption.h"
83 #include                                        "hildon-banner.h"
84 #include                                        <libintl.h>
85 #include                                        "hildon-get-password-dialog-private.h"
86
87 #define                                         _(String) dgettext("hildon-libs", String)
88
89 #define                                         HILDON_GET_PASSWORD_DIALOG_TITLE "ecdg_ti_get_old_password"
90
91 #define                                         HILDON_GET_PASSWORD_DIALOG_PASSWORD "ecdg_fi_get_old_pwd_enter_pwd"
92
93 #define                                         HILDON_GET_PASSWORD_DIALOG_OK "ecdg_bd_get_old_password_dialog_ok"
94
95 #define                                         HILDON_GET_PASSWORD_DIALOG_CANCEL "ecdg_bd_get_old_password_dialog_cancel"
96
97 #define                                         HILDON_GET_PASSWORD_VERIFY_DIALOG_TITLE "ecdg_ti_verify_password"
98
99 #define                                         HILDON_GET_PASSWORD_VERIFY_DIALOG_PASSWORD "ecdg_fi_verify_pwd_enter_pwd"
100
101 #define                                         HILDON_GET_PASSWORD_VERIFY_DIALOG_OK "ecdg_bd_verify_password_dialog_ok"
102
103 #define                                         HILDON_GET_PASSWORD_VERIFY_DIALOG_CANCEL "ecdg_bd_verify_password_dialog_cancel"
104
105 #define                                         HILDON_GET_PASSWORD_DIALOG_MAX_CHARS "ckdg_ib_maximum_characters_reached"
106
107 static GtkDialogClass*                          parent_class;
108
109 static void
110 hildon_get_password_dialog_class_init           (HildonGetPasswordDialogClass *class);
111
112 static void
113 hildon_get_password_dialog_init                 (HildonGetPasswordDialog *widget);
114
115 static void
116 hildon_get_password_set_property                (GObject *object,
117                                                  guint prop_id,
118                                                  const GValue *value,
119                                                  GParamSpec *pspec);
120
121 static void
122 hildon_get_password_get_property                (GObject *object,
123                                                  guint prop_id, 
124                                                  GValue *value,
125                                                  GParamSpec *pspec);
126
127 static void 
128 create_contents                                 (HildonGetPasswordDialog *dialog);
129
130 #ifdef MAEMO_GTK 
131 static void 
132 invalid_input                                   (GtkWidget *widget, 
133                                                  GtkInvalidInputType reason, 
134                                                  gpointer unused);
135 #endif
136
137 enum
138 {
139     PROP_0,
140     PROP_MESSAGE,
141     PROP_PASSWORD,
142     PROP_NUMBERS_ONLY,
143     PROP_CAPTION_LABEL,
144     PROP_MAX_CHARS,
145     PROP_GET_OLD
146 };
147
148 /* Private functions */
149 static void
150 hildon_get_password_set_property                (GObject *object,
151                                                  guint prop_id,
152                                                  const GValue *value, 
153                                                  GParamSpec *pspec)
154 {
155     HildonGetPasswordDialog *dialog = HILDON_GET_PASSWORD_DIALOG (object);
156     HildonGetPasswordDialogPrivate *priv;
157
158     priv = HILDON_GET_PASSWORD_DIALOG_GET_PRIVATE (object);
159     g_assert (priv);
160
161     switch (prop_id) {
162
163         case PROP_MESSAGE:
164             /* Set label text representing password domain */
165             gtk_label_set_text (priv->message_label, g_value_get_string (value));
166             break;
167
168         case PROP_PASSWORD:
169             gtk_entry_set_text(GTK_ENTRY (gtk_bin_get_child (GTK_BIN (priv->password_entry))), 
170                     g_value_get_string(value));
171             break;
172
173         case PROP_NUMBERS_ONLY:
174 #ifdef MAEMO_GTK 
175             /* Set input mode for the password entry */
176             g_object_set(G_OBJECT (gtk_bin_get_child GTK_BIN ((priv->password_entry))),
177                     "hildon-input-mode",
178                     (g_value_get_boolean (value)
179                      ? HILDON_GTK_INPUT_MODE_NUMERIC
180                      : HILDON_GTK_INPUT_MODE_FULL),
181                     NULL);
182 #endif
183             break;
184
185         case PROP_CAPTION_LABEL:
186             hildon_get_password_dialog_set_caption (dialog, g_value_get_string (value));
187             break;
188
189         case PROP_MAX_CHARS:
190             hildon_get_password_dialog_set_max_characters (dialog, g_value_get_int (value));
191             break;
192
193         case PROP_GET_OLD:
194             priv->get_old = g_value_get_boolean (value);
195             create_contents (dialog);
196             break;
197
198         default:
199             G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
200             break;
201     }
202 }
203
204 static void
205 hildon_get_password_get_property                (GObject *object,
206                                                  guint prop_id,
207                                                  GValue *value, 
208                                                  GParamSpec *pspec)
209 {
210     HildonGetPasswordDialog *dialog = HILDON_GET_PASSWORD_DIALOG (object);
211     HildonGetPasswordDialogPrivate *priv;
212     const gchar *string;
213     gint max_length;
214 #ifdef MAEMO_GTK 
215     gint input_mode;
216 #endif
217
218     priv = HILDON_GET_PASSWORD_DIALOG_GET_PRIVATE (dialog);
219     g_assert (priv);
220
221     switch (prop_id) {
222
223         case PROP_MESSAGE:
224             string = gtk_label_get_text (priv->message_label);
225             g_value_set_string (value, string);
226             break;
227
228         case PROP_PASSWORD:
229             string = gtk_entry_get_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (priv->password_entry))));
230             g_value_set_string (value, string);
231             break;
232
233         case PROP_NUMBERS_ONLY:
234 #ifdef MAEMO_GTK 
235             /* This property is set if and only if the input mode
236                of the password entry has been set to numeric only */
237             g_object_get (G_OBJECT (gtk_bin_get_child (GTK_BIN (priv->password_entry))),
238                     "hildon-input-mode", &input_mode, NULL);
239             g_value_set_boolean (value,
240                     (input_mode == HILDON_GTK_INPUT_MODE_NUMERIC));
241 #else
242             g_value_set_boolean (value, FALSE);
243 #endif
244             break;
245
246         case PROP_CAPTION_LABEL:
247             string = hildon_caption_get_label (priv->password_entry);
248             g_value_set_string (value, string);
249             break;
250
251         case PROP_MAX_CHARS:
252             max_length = gtk_entry_get_max_length 
253                     (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (priv->password_entry))));
254             g_value_set_int (value, max_length);
255             break;
256
257         case PROP_GET_OLD:
258             g_value_set_boolean (value, priv->get_old);
259             break;
260
261         default:
262             G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
263             break;
264     }
265 }
266
267 static void
268 hildon_get_password_dialog_class_init           (HildonGetPasswordDialogClass *class)
269 {
270     GObjectClass *object_class = G_OBJECT_CLASS (class);
271
272     parent_class = g_type_class_peek_parent (class);
273
274     /* Override virtual functions */
275     object_class->set_property = hildon_get_password_set_property;
276     object_class->get_property = hildon_get_password_get_property;
277
278     /* Install new properties */
279     
280     /**
281      * HildonGetPasswordDialog:message:
282      *
283      * Optional message displayed to the user.
284      */
285     g_object_class_install_property 
286         (object_class, 
287          PROP_MESSAGE, 
288          g_param_spec_string ("message",
289              "Message",
290              "Set optional message",
291              NULL,
292              G_PARAM_READWRITE));
293
294     /**
295      * HildonGetPasswordDialog:password:
296      *
297      * Password field contents.
298      */
299     g_object_class_install_property
300         (object_class, 
301          PROP_PASSWORD,
302          g_param_spec_string ("password",
303              "Password",
304              "Password field",
305              "DEFAULT",
306              G_PARAM_READWRITE));
307
308     /**
309      * HildonGetPasswordDialog:numbers-only:
310      *
311      * If the password entry field is operating in numbers-only mode.
312      */
313     g_object_class_install_property
314         (object_class, 
315          PROP_NUMBERS_ONLY,
316          g_param_spec_boolean ("numbers-only",
317              "NumbersOnly",
318              "Set entry to accept only numeric values",
319              FALSE,
320              G_PARAM_READWRITE));
321
322     /**
323      * HildonGetPasswordDialog:caption-label:
324      *
325      * Caption label.
326      */
327     g_object_class_install_property
328         (object_class, 
329          PROP_CAPTION_LABEL,
330          g_param_spec_string ("caption-label",
331              "Caption Label",
332              "The text to be set as the caption label",
333              NULL,
334              G_PARAM_READWRITE));
335     
336     /**
337      * HildonGetPasswordDialog:max-characters:
338      *
339      * Maximum characters than can be entered.
340      */
341     g_object_class_install_property
342         (object_class, 
343          PROP_MAX_CHARS,
344          g_param_spec_int ("max-characters",
345              "Maximum Characters",
346              "The maximum number of characters the password"
347              " dialog accepts",
348              G_MININT,
349              G_MAXINT,
350              0,
351              G_PARAM_READWRITE));
352
353     /**
354      * HildonGetPasswordDialog:get-old:
355      *
356      * If the dialog is used to retrieve an old password or set a new one.
357      */
358     g_object_class_install_property
359         (object_class,
360          PROP_GET_OLD,
361          g_param_spec_boolean ("get-old",
362              "Get Old Password",
363              "TRUE if dialog is a get old password dialog, "
364              "FALSE if dialog is a get password dialog",
365              FALSE,
366              G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
367
368     /* Install private structure */
369     g_type_class_add_private (class, sizeof (HildonGetPasswordDialogPrivate));
370 }
371
372 static void
373 hildon_get_password_dialog_init                 (HildonGetPasswordDialog *dialog)
374 {
375     /* Set initial properties for the dialog; the actual contents are
376        created once the 'get-old' property is set with g_object_new */
377
378     gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
379     gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
380     gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
381 }
382
383 static void
384 create_contents                                 (HildonGetPasswordDialog *dialog)
385 {
386     HildonGetPasswordDialogPrivate *priv;
387     GtkSizeGroup * group;
388     GtkWidget *control;
389     AtkObject *atk_aux = NULL;
390
391     /* Cache private pointer for faster member access */
392     priv = HILDON_GET_PASSWORD_DIALOG_GET_PRIVATE (dialog);
393     g_assert (priv);
394
395     /* Sizegroup for captions */
396     group = GTK_SIZE_GROUP (gtk_size_group_new
397             (GTK_SIZE_GROUP_HORIZONTAL));
398
399     /* Dialog title */
400     gtk_window_set_title (GTK_WINDOW (dialog),
401             priv->get_old
402             ? _(HILDON_GET_PASSWORD_DIALOG_TITLE)
403             : _(HILDON_GET_PASSWORD_VERIFY_DIALOG_TITLE));
404
405     /* Optional password domain label */
406     priv->message_label = GTK_LABEL (gtk_label_new (NULL));
407
408     /* Create buttons */
409     gtk_dialog_add_button (GTK_DIALOG (dialog),
410                     (priv->get_old
411                      ? _(HILDON_GET_PASSWORD_DIALOG_OK)
412                      : _(HILDON_GET_PASSWORD_VERIFY_DIALOG_OK)),
413                     GTK_RESPONSE_OK);
414
415     gtk_dialog_add_button (GTK_DIALOG (dialog),
416                     (priv->get_old
417                      ? _(HILDON_GET_PASSWORD_DIALOG_CANCEL)
418                      : _(HILDON_GET_PASSWORD_VERIFY_DIALOG_CANCEL)),
419                     GTK_RESPONSE_CANCEL);
420
421     /* Create password text entry */
422     control = gtk_entry_new ();
423     if ((atk_aux = gtk_widget_get_accessible(control)))
424       {
425         atk_object_set_name(atk_aux, _("Passwd"));
426       }
427
428     gtk_entry_set_width_chars (GTK_ENTRY (control), 20);
429
430 #ifdef MAEMO_GTK 
431     g_object_set (control, "hildon-input-mode", HILDON_GTK_INPUT_MODE_FULL, NULL);
432 #endif
433
434     gtk_entry_set_visibility (GTK_ENTRY(control), FALSE);
435     priv->password_entry = HILDON_CAPTION
436         (hildon_caption_new(group,
437                             (priv->get_old
438                              ? _(HILDON_GET_PASSWORD_DIALOG_PASSWORD)
439                              : _(HILDON_GET_PASSWORD_VERIFY_DIALOG_PASSWORD)),
440                             control, NULL,
441                             HILDON_CAPTION_OPTIONAL));
442     hildon_caption_set_separator (HILDON_CAPTION (priv->password_entry), "");
443
444     /* Do the basic layout */
445     gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
446             GTK_WIDGET (priv->message_label), FALSE, FALSE, 0);
447     gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
448             GTK_WIDGET (priv->password_entry), FALSE, FALSE, 0);
449     gtk_widget_show_all (GTK_DIALOG (dialog)->vbox);
450
451     /* Ensure group is freed when all its contents have been removed */
452     g_object_unref (group);
453 }
454
455 /**
456  * hildon_get_password_dialog_get_type:
457  *
458  * Returns GType for HildonGetPasswordDialog as produced by
459  * g_type_register_static().
460  *
461  * Returns: HildonGetPasswordDialog type
462  */
463 GType G_GNUC_CONST
464 hildon_get_password_dialog_get_type             (void)
465 {
466     static GType dialog_type = 0;
467
468     if (! dialog_type) {
469         static const GTypeInfo dialog_info = {
470             sizeof (HildonGetPasswordDialogClass),
471             NULL,       /* base_init */
472             NULL,       /* base_finalize */
473             (GClassInitFunc) hildon_get_password_dialog_class_init,
474             NULL,       /* class_finalize */
475             NULL,       /* class_data */
476             sizeof (HildonGetPasswordDialog),
477             0,  /* n_preallocs */
478             (GInstanceInitFunc) hildon_get_password_dialog_init
479         };
480
481         dialog_type = g_type_register_static (GTK_TYPE_DIALOG,
482                 "HildonGetPasswordDialog",
483                 &dialog_info, 0);
484     }
485     return dialog_type;
486 }
487
488 /**
489  * hildon_get_password_dialog_new:
490  * @parent: parent window; can be NULL
491  * @get_old: FALSE creates a new get password dialog and
492  *           TRUE creates a new get old password dialog. That is,
493  *           if the password to be obtained is the old password, 
494  *           this parameter is specified TRUE.  
495  * 
496  * Construct a new HildonGetPasswordDialog.
497  *
498  * Returns: a new #GtkWidget of type HildonGetPasswordDialog
499  */
500 GtkWidget*
501 hildon_get_password_dialog_new                  (GtkWindow *parent,
502                                                  gboolean get_old)
503 {
504     HildonGetPasswordDialog *dialog = g_object_new
505         (HILDON_TYPE_GET_PASSWORD_DIALOG,
506          "get-old", get_old, NULL);
507
508     if (parent != NULL) {
509         gtk_window_set_transient_for (GTK_WINDOW (dialog), parent);
510     }
511
512     return (GtkWidget *) dialog;
513 }
514
515 /**
516  * hildon_get_password_dialog_new_with_default:
517  * @parent: parent window; can be NULL
518  * @password: a default password to be shown in password field
519  * @get_old: FALSE creates a new get password dialog and
520  *           TRUE creates a new get old password dialog. That is,
521  *           if the password to be obtained is the old password,
522  *           this parameter is specified TRUE.
523  *                        
524  * 
525  * Same as #hildon_get_password_dialog_new but with a default password
526  * in password field.
527  *
528  * Returns: a new #GtkWidget of type HildonGetPasswordDialog
529  */
530 GtkWidget*
531 hildon_get_password_dialog_new_with_default     (GtkWindow *parent,
532                                                  const gchar *password,
533                                                  gboolean get_old)
534 {
535     GtkWidget *dialog;
536
537     dialog = hildon_get_password_dialog_new (parent, get_old);
538
539     if (password != NULL)
540         g_object_set (G_OBJECT (dialog), "password", password, NULL);
541
542     return GTK_WIDGET (dialog);
543 }
544
545 /**
546  * hildon_get_password_dialog_get_password:
547  * @dialog: pointer to HildonSetPasswordDialog
548  * 
549  * Gets the currently entered password. The string should not be freed.
550  *
551  * Returns: current password entered by the user.
552  */
553 const gchar*
554 hildon_get_password_dialog_get_password         (HildonGetPasswordDialog *dialog)
555 {
556     GtkEntry *entry1;
557     gchar *text1;
558
559     HildonGetPasswordDialogPrivate *priv;
560
561     g_return_val_if_fail (HILDON_IS_GET_PASSWORD_DIALOG (dialog), NULL);
562     priv = HILDON_GET_PASSWORD_DIALOG_GET_PRIVATE (dialog);
563     g_assert (priv);
564
565     /* Retrieve the password entry widget */
566     entry1 = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (priv->password_entry)));
567     text1 = GTK_ENTRY (entry1)->text;
568
569     return text1;
570 }
571
572 /**
573  * hildon_get_password_dialog_set_message
574  * @dialog: the dialog
575  * @message: a custom message or some other descriptive text to be set
576  * 
577  * Sets the optional descriptive text displayed at the top of the dialog.
578  */
579 void 
580 hildon_get_password_dialog_set_message          (HildonGetPasswordDialog *dialog, 
581                                                  const gchar *message)
582 {
583     HildonGetPasswordDialogPrivate *priv;
584
585     g_return_if_fail (HILDON_IS_GET_PASSWORD_DIALOG (dialog));
586
587     priv = HILDON_GET_PASSWORD_DIALOG_GET_PRIVATE (dialog);
588     g_assert (priv);
589
590     gtk_label_set_text (priv->message_label, message);
591
592 }
593
594 /**
595  * hildon_get_password_dialog_set_caption:
596  * @dialog: the dialog
597  * @new_caption: the text to be set as the caption label
598  * 
599  * Sets the password entry field's neigbouring label.
600  */
601 void 
602 hildon_get_password_dialog_set_caption          (HildonGetPasswordDialog *dialog,
603                                                  const gchar *new_caption)
604 {
605     HildonGetPasswordDialogPrivate *priv;
606
607     g_return_if_fail (HILDON_IS_GET_PASSWORD_DIALOG (dialog));
608     g_return_if_fail (new_caption != NULL);
609
610     priv = HILDON_GET_PASSWORD_DIALOG_GET_PRIVATE (dialog);
611     g_assert (priv);
612
613     hildon_caption_set_label (priv->password_entry, new_caption);
614 }
615
616 /**
617  * hildon_get_password_dialog_set_max_characters:
618  * @dialog: the dialog
619  * @max_characters: the maximum number of characters the password dialog
620  * accepts
621  * 
622  * sets the maximum number of characters allowed as the password
623  */
624 void 
625 hildon_get_password_dialog_set_max_characters   (HildonGetPasswordDialog *dialog, 
626                                                  gint max_characters)
627 {
628     HildonGetPasswordDialogPrivate *priv;
629
630     g_return_if_fail (max_characters > 0);
631     g_return_if_fail (HILDON_IS_GET_PASSWORD_DIALOG (dialog));
632
633     priv = HILDON_GET_PASSWORD_DIALOG_GET_PRIVATE (dialog);
634     g_assert (priv);
635
636     /* Apply the given length to password entry */
637     gtk_entry_set_max_length (GTK_ENTRY
638             (gtk_bin_get_child
639              GTK_BIN ((priv->password_entry))),
640              max_characters);
641
642     /* FIXME There is a bug here -- the prev. signal needs to be
643      * disconnected before connecting the new signal. Besides, this 
644      * should go into the constructor */
645
646 #ifdef MAEMO_GTK 
647     /* Connect callback to show error banner if the limit is exceeded */
648     g_signal_connect (GTK_ENTRY
649             (gtk_bin_get_child
650              GTK_BIN ((priv->password_entry))),
651             "invalid_input",
652             G_CALLBACK (invalid_input),
653             NULL
654             );
655 #endif
656 }
657
658 #ifdef MAEMO_GTK 
659 /* Callback that gets called when maximum chars is reached in the entry */
660 static void 
661 invalid_input                                   (GtkWidget *widget, 
662                                                  GtkInvalidInputType reason, 
663                                                  gpointer unused) 
664 {
665     if (reason == GTK_INVALID_INPUT_MAX_CHARS_REACHED) 
666     {
667         hildon_banner_show_information (widget, NULL, _(HILDON_GET_PASSWORD_DIALOG_MAX_CHARS));
668     }
669 }
670 #endif