HildonSetPasswordDialog

HildonSetPasswordDialog — A dialog used to set, change or remove a password

Synopsis




#define     HILDON_SET_PASSWORD_DIALOG_TITLE
#define     HILDON_SET_PASSWORD_DIALOG_PASSWORD
#define     HILDON_SET_PASSWORD_DIALOG_VERIFY_PASSWORD
#define     HILDON_SET_PASSWORD_DIALOG_OK
#define     HILDON_SET_PASSWORD_DIALOG_CANCEL
#define     HILDON_SET_MODIFY_PASSWORD_DIALOG_TITLE
#define     HILDON_SET_MODIFY_PASSWORD_DIALOG_LABEL
#define     HILDON_SET_MODIFY_PASSWORD_DIALOG_PASSWORD
#define     HILDON_SET_MODIFY_PASSWORD_DIALOG_VERIFY_PASSWORD
#define     HILDON_SET_MODIFY_PASSWORD_DIALOG_OK
#define     HILDON_SET_MODIFY_PASSWORD_DIALOG_CANCEL
#define     HILDON_SET_PASSWORD_DIALOG_MISMATCH
#define     HILDON_SET_PASSWORD_DIALOG_EMPTY
#define     HILDON_SET_PASSWORD_DIALOG_REMOVE_PROTECTION
#define     HILDON_REMOVE_PROTECTION_CONFIRMATION_REMOVE
#define     HILDON_REMOVE_PROTECTION_CONFIRMATION_CANCEL
GtkWidget*  hildon_set_password_dialog_new  (GtkWindow *parent,
                                             gboolean modify_protection);
GtkWidget*  hildon_set_password_dialog_new_with_default
                                            (GtkWindow *parent,
                                             const gchar *password,
                                             gboolean modify_protection);
const gchar* hildon_set_password_dialog_get_password
                                            (HildonSetPasswordDialog *dialog);
gboolean    hildon_set_password_dialog_get_protected
                                            (HildonSetPasswordDialog *dialog);
void        hildon_set_password_dialog_set_domain
                                            (HildonSetPasswordDialog *dialog,
                                             const gchar *domain);

Description

HildonSetPasswordDialog allows setting and changing a password.

In Change mode: Dialog is used to change or remove an existing password. Unselecting the check box dims the password fields below it. If the dialog is accepted with 'OK' while the check box is unselected, a Confirmation Note is shown. If the Confirmation Note Dialog is accepted with 'Remove', the password protection is removed.

In Set mode: Set Password Dialog is used to define a password, or change a password that cannot be removed.

Example:
	HildonGetPasswordDialog *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);
	}

Details

HILDON_SET_PASSWORD_DIALOG_TITLE

#define HILDON_SET_PASSWORD_DIALOG_TITLE                  "ecdg_ti_set_password"


HILDON_SET_PASSWORD_DIALOG_PASSWORD

#define HILDON_SET_PASSWORD_DIALOG_PASSWORD               "ecdg_fi_set_passwd_enter_pwd"


HILDON_SET_PASSWORD_DIALOG_VERIFY_PASSWORD

#define HILDON_SET_PASSWORD_DIALOG_VERIFY_PASSWORD        "ecdg_fi_set_passwd_confirm"


HILDON_SET_PASSWORD_DIALOG_OK

#define HILDON_SET_PASSWORD_DIALOG_OK                     "ecdg_bd_set_password_dialog_ok"


HILDON_SET_PASSWORD_DIALOG_CANCEL

#define HILDON_SET_PASSWORD_DIALOG_CANCEL                 "ecdg_bd_set_password_dialog_cancel"


HILDON_SET_MODIFY_PASSWORD_DIALOG_TITLE

#define HILDON_SET_MODIFY_PASSWORD_DIALOG_TITLE           "ckdg_ti_dialog_c_passwd_change_password"


HILDON_SET_MODIFY_PASSWORD_DIALOG_LABEL

#define HILDON_SET_MODIFY_PASSWORD_DIALOG_LABEL           "ckdg_fi_dialog_c_passwd_pwd_protect"


HILDON_SET_MODIFY_PASSWORD_DIALOG_PASSWORD

#define HILDON_SET_MODIFY_PASSWORD_DIALOG_PASSWORD        "ckdg_fi_dialog_c_passwd_new_pwd"


HILDON_SET_MODIFY_PASSWORD_DIALOG_VERIFY_PASSWORD

#define HILDON_SET_MODIFY_PASSWORD_DIALOG_VERIFY_PASSWORD "ckdg_fi_dialog_c_passwd_ver_pwd"


HILDON_SET_MODIFY_PASSWORD_DIALOG_OK

#define HILDON_SET_MODIFY_PASSWORD_DIALOG_OK              "ckdg_bd_change_password_dialog_ok"


HILDON_SET_MODIFY_PASSWORD_DIALOG_CANCEL

#define HILDON_SET_MODIFY_PASSWORD_DIALOG_CANCEL          "ckdg_bd_change_password_dialog_cancel"


HILDON_SET_PASSWORD_DIALOG_MISMATCH

#define HILDON_SET_PASSWORD_DIALOG_MISMATCH               "ecdg_ib_passwords_do_not_match"


HILDON_SET_PASSWORD_DIALOG_EMPTY

#define HILDON_SET_PASSWORD_DIALOG_EMPTY                  "ecdg_ib_password_is_empty"


HILDON_SET_PASSWORD_DIALOG_REMOVE_PROTECTION

#define HILDON_SET_PASSWORD_DIALOG_REMOVE_PROTECTION      "ckdg_nc_dialog_c_passwd_remove_pwd"


HILDON_REMOVE_PROTECTION_CONFIRMATION_REMOVE

#define HILDON_REMOVE_PROTECTION_CONFIRMATION_REMOVE      "ckdg_bd_dialog_c_passwd_remove_button"


HILDON_REMOVE_PROTECTION_CONFIRMATION_CANCEL

#define HILDON_REMOVE_PROTECTION_CONFIRMATION_CANCEL      "ckdg_bd_dialog_c_passwd_cancel_button"


hildon_set_password_dialog_new ()

GtkWidget*  hildon_set_password_dialog_new  (GtkWindow *parent,
                                             gboolean modify_protection);

Constructs a new HildonSetPasswordDialog.

parent : parent window; can be NULL
modify_protection : TRUE creates a new change password dialog and FALSE creates a new set password dialog
Returns : a new GtkWidget of type HildonSetPasswordDialog

hildon_set_password_dialog_new_with_default ()

GtkWidget*  hildon_set_password_dialog_new_with_default
                                            (GtkWindow *parent,
                                             const gchar *password,
                                             gboolean modify_protection);

Same as hildon_set_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
modify_protection : TRUE creates a new change password dialog and FALSE creates a new set password dialog
Returns : a new GtkWidget of type HildonSetPasswordDialog

hildon_set_password_dialog_get_password ()

const gchar* hildon_set_password_dialog_get_password
                                            (HildonSetPasswordDialog *dialog);

Returns current password.

dialog : pointer to HildonSetPasswordDialog
Returns : changed password ( if the dialog is successfully accepted with 'OK' ( and when the check box is 'ON' ( in Change Password Dialog ))

hildon_set_password_dialog_get_protected ()

gboolean    hildon_set_password_dialog_get_protected
                                            (HildonSetPasswordDialog *dialog);

Returns the protection mode.

dialog : pointer to HildonSetPasswordDialog
Returns : password protection mode ( TRUE when the protection is 'ON' and FALSE when the protection is 'OFF' )

hildon_set_password_dialog_set_domain ()

void        hildon_set_password_dialog_set_domain
                                            (HildonSetPasswordDialog *dialog,
                                             const gchar *domain);

Sets the optional descriptive text.

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

See Also

HildonGetPasswordDialog