HildonGetPasswordDialog

HildonGetPasswordDialog — A widget used to get a password

Synopsis




#define     HILDON_GET_PASSWORD_DIALOG_TITLE
#define     HILDON_GET_PASSWORD_DIALOG_PASSWORD
#define     HILDON_GET_PASSWORD_DIALOG_OK
#define     HILDON_GET_PASSWORD_DIALOG_CANCEL
#define     HILDON_GET_PASSWORD_VERIFY_DIALOG_TITLE
#define     HILDON_GET_PASSWORD_VERIFY_DIALOG_PASSWORD
#define     HILDON_GET_PASSWORD_VERIFY_DIALOG_OK
#define     HILDON_GET_PASSWORD_VERIFY_DIALOG_CANCEL
#define     HILDON_GET_PASSWORD_DIALOG_MAX_CHARS
GtkWidget*  hildon_get_password_dialog_new  (GtkWindow *parent,
                                             gboolean get_old);
GtkWidget*  hildon_get_password_dialog_new_with_default
                                            (GtkWindow *parent,
                                             const gchar *password,
                                             gboolean get_old);
void        hildon_get_password_dialog_set_domain
                                            (HildonGetPasswordDialog *dialog,
                                             const gchar *domain);
void        hildon_get_password_dialog_set_caption
                                            (HildonGetPasswordDialog *dialog,
                                             const gchar *new_caption);
void        hildon_get_password_dialog_set_max_characters
                                            (HildonGetPasswordDialog *dialog,
                                             gint max_characters);
const gchar* hildon_get_password_dialog_get_password
                                            (HildonGetPasswordDialog *dialog);
void        hildon_get_password_dialog_set_title
                                            (HildonGetPasswordDialog *dialog,
                                             const gchar *new_title);

Description

HildonGetPasswordDialog prompts the user for a password. It allows inputting password, with an optional configurable label eg. for showing the domain. The maximum length of the password can be set.

	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));
}

Details

HILDON_GET_PASSWORD_DIALOG_TITLE

#define HILDON_GET_PASSWORD_DIALOG_TITLE           "ecdg_ti_get_old_password"


HILDON_GET_PASSWORD_DIALOG_PASSWORD

#define HILDON_GET_PASSWORD_DIALOG_PASSWORD        "ecdg_fi_get_old_pwd_enter_pwd"


HILDON_GET_PASSWORD_DIALOG_OK

#define HILDON_GET_PASSWORD_DIALOG_OK              "ecdg_bd_get_old_password_dialog_ok"


HILDON_GET_PASSWORD_DIALOG_CANCEL

#define HILDON_GET_PASSWORD_DIALOG_CANCEL          "ecdg_bd_get_old_password_dialog_cancel"


HILDON_GET_PASSWORD_VERIFY_DIALOG_TITLE

#define HILDON_GET_PASSWORD_VERIFY_DIALOG_TITLE    "ecdg_ti_verify_password"


HILDON_GET_PASSWORD_VERIFY_DIALOG_PASSWORD

#define HILDON_GET_PASSWORD_VERIFY_DIALOG_PASSWORD "ecdg_fi_verify_pwd_enter_pwd"


HILDON_GET_PASSWORD_VERIFY_DIALOG_OK

#define HILDON_GET_PASSWORD_VERIFY_DIALOG_OK       "ecdg_bd_verify_password_dialog_ok"


HILDON_GET_PASSWORD_VERIFY_DIALOG_CANCEL

#define HILDON_GET_PASSWORD_VERIFY_DIALOG_CANCEL   "ecdg_bd_verify_password_dialog_cancel"


HILDON_GET_PASSWORD_DIALOG_MAX_CHARS

#define HILDON_GET_PASSWORD_DIALOG_MAX_CHARS       "ckdg_ib_maximum_characters_reached"


hildon_get_password_dialog_new ()

GtkWidget*  hildon_get_password_dialog_new  (GtkWindow *parent,
                                             gboolean get_old);

Construct a new HildonGetPasswordDialog.

parent : parent window; can be NULL
get_old : FALSE creates a new get password dialog and 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.
Returns : a new GtkWidget of type HildonGetPasswordDialog

hildon_get_password_dialog_new_with_default ()

GtkWidget*  hildon_get_password_dialog_new_with_default
                                            (GtkWindow *parent,
                                             const gchar *password,
                                             gboolean get_old);

Same as hildon_get_password_dialog_new but with a default password in password field.

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, if the password to be obtained is the old password, this parameter is specified TRUE.
Returns : a new GtkWidget of type HildonGetPasswordDialog

hildon_get_password_dialog_set_domain ()

void        hildon_get_password_dialog_set_domain
                                            (HildonGetPasswordDialog *dialog,
                                             const gchar *domain);

Sets the optional descriptive text.

dialog : the dialog
domain : the domain or some other descriptive text to be set

hildon_get_password_dialog_set_caption ()

void        hildon_get_password_dialog_set_caption
                                            (HildonGetPasswordDialog *dialog,
                                             const gchar *new_caption);

Sets the password entry field's neigbouring label.

dialog : the dialog
new_caption : the text to be set as the caption label

hildon_get_password_dialog_set_max_characters ()

void        hildon_get_password_dialog_set_max_characters
                                            (HildonGetPasswordDialog *dialog,
                                             gint max_characters);

sets the maximum number of characters allowed as the password

dialog : the dialog
max_characters : the maximum number of characters the password dialog accepts

hildon_get_password_dialog_get_password ()

const gchar* hildon_get_password_dialog_get_password
                                            (HildonGetPasswordDialog *dialog);

Gets the currently inputted password.

dialog : pointer to HildonSetPasswordDialog
Returns : current password ( if the dialog is successfully accepted with 'OK' )

hildon_get_password_dialog_set_title ()

void        hildon_get_password_dialog_set_title
                                            (HildonGetPasswordDialog *dialog,
                                             const gchar *new_title);

Sets the dialog title.

DEPRECATED! use gtk_window_set_title instead.

dialog : the dialog
new_title : the text to be set as the dialog title

See Also

HildonSetPasswordDialog