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