/*
- * This file is part of hildon-libs
+ * This file is a part of hildon
*
* Copyright (C) 2005, 2006 Nokia Corporation, all rights reserved.
*
/**
* SECTION:hildon-get-password-dialog
- * @short_description: A widget used to get a password
+ * @short_description: A widget used to get a password.
* @see_also: #HildonSetPasswordDialog
*
* HildonGetPasswordDialog prompts the user for a password. It allows
* inputting password, with an optional configurable label eg. for
* showing a custom message. The maximum length of the password can be set.
+ *
+ * <example>
+ * <title>HildonGetPassword example</title>
+ * <programlisting>
+ * get_dialog = HILDON_GET_PASSWORD_DIALOG (hildon_get_password_dialog_new (parent, FALSE));
+ * <!-- -->
+ * gtk_widget_show (GTK_WIDGET (get_dialog));
+ * <!-- -->
+ * i = gtk_dialog_run (GTK_DIALOG (get_dialog));
+ * <!-- -->
+ * pass = hildon_get_password_dialog_get_password (get_dialog);
+ * <!-- -->
+ * if (i == GTK_RESPONSE_OK && (strcmp (pass, dialog.current_password) != 0))
+ * {
+ * gtk_infoprint (GTK_WINDOW (parent), STR_PASSWORD_INCORRECT);
+ * gtk_widget_set_sensitive (GTK_WIDGET (dialog.button2), FALSE);
+ * gtk_widget_set_sensitive (GTK_WIDGET (dialog.button3), FALSE);
+ * gtk_widget_set_sensitive (GTK_WIDGET (dialog.button4), FALSE);
+ * }
+ * <!-- -->
+ * else if (i == GTK_RESPONSE_OK)
+ * {
+ * gtk_widget_set_sensitive( GTK_WIDGET( dialog.button2 ), TRUE);
+ * }
+ * <!-- -->
+ * else
+ * {
+ * gtk_widget_set_sensitive (GTK_WIDGET (dialog.button2), FALSE);
+ * gtk_widget_set_sensitive (GTK_WIDGET (dialog.button3), FALSE);
+ * gtk_widget_set_sensitive (GTK_WIDGET (dialog.button4), FALSE);
+ * }
+ * gtk_widget_destroy (GTK_WIDGET (get_dialog));
+ * }
+ * </programlisting>
+ * </example>
*/
#ifdef HAVE_CONFIG_H
#include <unistd.h>
#include <stdio.h>
#include <gtk/gtk.h>
-#include "hildon-input-mode-hint.h"
#include "hildon-caption.h"
#include "hildon-banner.h"
#include <libintl.h>
#include "hildon-get-password-dialog-private.h"
-#define _(String) dgettext(PACKAGE, String)
+#define _(String) dgettext("hildon-libs", String)
#define HILDON_GET_PASSWORD_DIALOG_TITLE "ecdg_ti_get_old_password"
g_object_set(G_OBJECT (gtk_bin_get_child GTK_BIN ((priv->password_entry))),
"input-mode",
(g_value_get_boolean (value)
- ? HILDON_INPUT_MODE_HINT_NUMERIC
- : HILDON_INPUT_MODE_HINT_ALPHANUMERICSPECIAL),
+ ? HILDON_GTK_INPUT_MODE_NUMERIC
+ : HILDON_GTK_INPUT_MODE_FULL),
NULL);
break;
g_object_get (G_OBJECT (gtk_bin_get_child (GTK_BIN (priv->password_entry))),
"input-mode", &input_mode, NULL);
g_value_set_boolean (value,
- (input_mode == HILDON_INPUT_MODE_HINT_NUMERIC));
+ (input_mode == HILDON_GTK_INPUT_MODE_NUMERIC));
break;
case PROP_CAPTION_LABEL:
object_class->get_property = hildon_get_password_get_property;
/* Install new properties */
+
+ /**
+ * HildonGetPasswordDialog:message:
+ *
+ * Optional message displayed to the user.
+ */
g_object_class_install_property
(object_class,
PROP_MESSAGE,
NULL,
G_PARAM_READWRITE));
+ /**
+ * HildonGetPasswordDialog:password:
+ *
+ * Password field contents.
+ */
g_object_class_install_property
(object_class,
PROP_PASSWORD,
"DEFAULT",
G_PARAM_READWRITE));
+ /**
+ * HildonGetPasswordDialog:numbers-only:
+ *
+ * If the password entry field is operating in numbers-only mode.
+ */
g_object_class_install_property
(object_class,
PROP_NUMBERS_ONLY,
- g_param_spec_boolean ("numbers_only",
+ g_param_spec_boolean ("numbers-only",
"NumbersOnly",
"Set entry to accept only numeric values",
FALSE,
G_PARAM_READWRITE));
+ /**
+ * HildonGetPasswordDialog:caption-label:
+ *
+ * Caption label.
+ */
g_object_class_install_property
(object_class,
PROP_CAPTION_LABEL,
"The text to be set as the caption label",
NULL,
G_PARAM_READWRITE));
-
+
+ /**
+ * HildonGetPasswordDialog:max-characters:
+ *
+ * Maximum characters than can be entered.
+ */
g_object_class_install_property
(object_class,
PROP_MAX_CHARS,
0,
G_PARAM_READWRITE));
+ /**
+ * HildonGetPasswordDialog:get-old:
+ *
+ * If the dialog is used to retrieve an old password or set a new one.
+ */
g_object_class_install_property
(object_class,
PROP_GET_OLD,
* @parent: parent window; can be NULL
* @password: a default password to be shown in password field
* @get_old: FALSE creates a new get password dialog and
- * TRUE creates a new get old password dialog.That is,
+ * TRUE creates a new get old password dialog. That is,
* if the password to be obtained is the old password,
* this parameter is specified TRUE.
*
* hildon_get_password_dialog_get_password:
* @dialog: pointer to HildonSetPasswordDialog
*
- * Gets the currently entered password.
+ * Gets the currently entered password. The string should not be freed.
*
* Returns: current password entered by the user.
*/
* @dialog: the dialog
* @message: a custom message or some other descriptive text to be set
*
- * Sets the optional descriptive text.
+ * Sets the optional descriptive text displayed at the top of the dialog.
*/
void
hildon_get_password_dialog_set_message (HildonGetPasswordDialog *dialog,
* @dialog: the dialog
* @max_characters: the maximum number of characters the password dialog
* accepts
- * @new_caption: the text to be set as the caption label
*
* sets the maximum number of characters allowed as the password
*/