+2009-04-03 Claudio Saavedra <csaavedra@igalia.com>
+
+ Based on a patch by Mox Soini (ext-mox.soini@nokia.com)
+
+ * src/hildon-get-password-dialog.c
+ (hildon_get_password_set_property),
+ (hildon_get_password_get_property), (create_contents):
+ * src/hildon-login-dialog-private.h:
+ * src/hildon-login-dialog.c (hildon_login_dialog_set_property),
+ (hildon_login_dialog_init), (hildon_login_dialog_get_username),
+ (hildon_login_dialog_get_password):
+ * src/hildon-set-password-dialog-private.h:
+ * src/hildon-set-password-dialog.c
+ (hildon_set_password_set_property),
+ (hildon_set_password_get_property), (create_contents),
+ (hildon_set_password_response_change),
+ (hildon_set_password_response_set), (hildon_checkbox_toggled):
+
+ Pimp these dialogs, to make them use HildonEntry and HildonCheckBox
+ instead and look more Fremantle style.
+
+ Fixes: NB#109639 (Update hildon passwd dialogs to Hildon 2.2)
+
2009-04-03 Alberto Garcia <agarcia@igalia.com>
* doc/hildon-sections.txt
#include "hildon-login-dialog.h"
#include "hildon-caption.h"
#include "hildon-login-dialog-private.h"
+#include "hildon-entry.h"
enum
{
case PROP_USERNAME:
/* Set the current username displayed in the dialog */
- gtk_entry_set_text (priv->username_entry, g_value_get_string (value));
+ hildon_entry_set_text (HILDON_ENTRY (priv->username_entry), g_value_get_string (value));
break;
case PROP_PASSWORD:
/* Set the currently entered password */
- gtk_entry_set_text (priv->password_entry, g_value_get_string (value));
+ hildon_entry_set_text (HILDON_ENTRY (priv->password_entry), g_value_get_string (value));
break;
default:
gtk_dialog_add_button (GTK_DIALOG (dialog), _(HILDON_LOGIN_DIALOG_OK), GTK_RESPONSE_OK);
/* Setup username entry */
- priv->username_entry = GTK_ENTRY (gtk_entry_new ());
+ priv->username_entry = hildon_entry_new (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH);
#ifdef MAEMO_GTK
g_object_set (priv->username_entry, "hildon-input-mode", HILDON_GTK_INPUT_MODE_FULL, NULL);
GTK_WIDGET (caption), FALSE, FALSE, 0);
/* Setup password entry */
- priv->password_entry = GTK_ENTRY (gtk_entry_new ());
+ priv->password_entry = hildon_entry_new (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH);
#ifdef MAEMO_GTK
g_object_set (priv->password_entry, "hildon-input-mode", HILDON_GTK_INPUT_MODE_FULL, NULL);
priv = HILDON_LOGIN_DIALOG_GET_PRIVATE (dialog);
g_assert (priv);
- return gtk_entry_get_text (priv->username_entry);
+ return hildon_entry_get_text (HILDON_ENTRY (priv->username_entry));
}
/**
priv = HILDON_LOGIN_DIALOG_GET_PRIVATE (dialog);
g_assert (priv);
- return gtk_entry_get_text (priv->password_entry);
+ return hildon_entry_get_text (HILDON_ENTRY (priv->password_entry));
}
/**
#include "hildon-defines.h"
#include "hildon-banner.h"
#include "hildon-set-password-dialog-private.h"
+#include "hildon-entry.h"
+#include "hildon-check-button.h"
#define HILDON_SET_PASSWORD_DIALOG_TITLE "ecdg_ti_set_password"
case PROP_PASSWORD:
/* Update password entry to display new value */
- gtk_entry_set_text (GTK_ENTRY (priv->pwd1st_entry), g_value_get_string (value));
+ hildon_entry_set_text (HILDON_ENTRY (priv->pwd1st_entry), g_value_get_string (value));
break;
case PROP_HILDON_PASSWORD_DIALOG:
case PROP_PASSWORD:
g_value_set_string (value,
- gtk_entry_get_text (GTK_ENTRY (priv->pwd1st_entry)));
+ hildon_entry_get_text (HILDON_ENTRY (priv->pwd1st_entry)));
break;
case PROP_HILDON_PASSWORD_DIALOG:
priv->pwd2nd_caption_string = _(HILDON_SET_MODIFY_PASSWORD_DIALOG_VERIFY_PASSWORD);
/* Setup checkbox to enable/disable password protection */
- priv->checkbox = gtk_check_button_new ();
- gtk_widget_show (priv->checkbox);
- priv->checkbox_caption = hildon_caption_new
- (group,
- _(HILDON_SET_MODIFY_PASSWORD_DIALOG_LABEL),
- priv->checkbox,
- NULL, HILDON_CAPTION_OPTIONAL);
- hildon_caption_set_separator (HILDON_CAPTION (priv->checkbox_caption), "");
+ priv->checkbox = hildon_check_button_new (HILDON_SIZE_AUTO_WIDTH | HILDON_SIZE_FINGER_HEIGHT);
+ gtk_button_set_label (GTK_BUTTON (priv->checkbox), _(HILDON_SET_MODIFY_PASSWORD_DIALOG_LABEL));
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
- priv->checkbox_caption, TRUE, TRUE, 0);
- gtk_widget_show (priv->checkbox_caption);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->checkbox),
+ priv->checkbox, TRUE, TRUE, 0);
+ gtk_widget_show (priv->checkbox);
+ hildon_check_button_set_active (HILDON_CHECK_BUTTON (priv->checkbox),
TRUE);
gtk_signal_connect (GTK_OBJECT (priv->checkbox), "toggled",
G_CALLBACK (hildon_checkbox_toggled), dialog);
}
/* Create the password field */
- priv->pwd1st_entry = gtk_entry_new ();
+ priv->pwd1st_entry = hildon_entry_new (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH);
if ((atk_aux = gtk_widget_get_accessible(priv->pwd1st_entry)))
{
atk_object_set_name(atk_aux, "Old Passwd");
gtk_widget_show (priv->pwd1st_caption);
/* Create the password verify field */
- priv->pwd2nd_entry = gtk_entry_new();
+ priv->pwd2nd_entry = hildon_entry_new (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH);
if ((atk_aux = gtk_widget_get_accessible(priv->pwd2nd_entry)))
{
atk_object_set_name(atk_aux, "New Passwd");
? HILDON_SET_MODIFY_PASSWORD_DIALOG_OK
: HILDON_SET_PASSWORD_DIALOG_OK), GTK_RESPONSE_OK);
- gtk_dialog_add_button (GTK_DIALOG (dialog), _(priv->protection
- ? HILDON_SET_MODIFY_PASSWORD_DIALOG_CANCEL
- : HILDON_SET_PASSWORD_DIALOG_CANCEL), GTK_RESPONSE_CANCEL);
-
gtk_widget_show_all (GTK_DIALOG (dialog)->vbox);
gtk_widget_show_all (GTK_DIALOG (dialog)->action_area);
/* User accepted the dialog */
if (arg1 == GTK_RESPONSE_OK) {
/* Is the checkbox marked, so password protection is still in use? */
- if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->checkbox))){
+ if (hildon_check_button_get_active (HILDON_CHECK_BUTTON (priv->checkbox))){
/* Yes, Something is given as password as well? */
if (text1[0] != '\0') {
if (strcmp (text1, text2) == 0) {
g_signal_stop_emission_by_name (G_OBJECT(dialog),
"response");
- gtk_entry_set_text (pwd1st_entry, "");
- gtk_entry_set_text (pwd2nd_entry, "");
+ hildon_entry_set_text (HILDON_ENTRY (pwd1st_entry), "");
+ hildon_entry_set_text (HILDON_ENTRY (pwd2nd_entry), "");
hildon_banner_show_information (GTK_WIDGET (dialog), NULL,
c_(HILDON_SET_PASSWORD_DIALOG_MISMATCH));
/* Error: Second field doesn't match
the empty first field, so start over */
hildon_banner_show_information (GTK_WIDGET (dialog), NULL, c_(HILDON_SET_PASSWORD_DIALOG_MISMATCH));
- gtk_entry_set_text(pwd2nd_entry, "");
+ hildon_entry_set_text (HILDON_ENTRY (pwd2nd_entry), "");
}
gtk_widget_grab_focus (GTK_WIDGET (pwd1st_entry));
} else {
/* Error: Passwords don't match, so start over */
g_signal_stop_emission_by_name (G_OBJECT(dialog), "response");
- gtk_entry_set_text (pwd1st_entry, "");
- gtk_entry_set_text (pwd2nd_entry, "");
+ hildon_entry_set_text (HILDON_ENTRY (pwd1st_entry), "");
+ hildon_entry_set_text (HILDON_ENTRY (pwd2nd_entry), "");
hildon_banner_show_information (GTK_WIDGET (dialog), NULL, c_(HILDON_SET_PASSWORD_DIALOG_MISMATCH));
gtk_widget_grab_focus (GTK_WIDGET (priv->pwd1st_entry));
/* Error: Second field doesn't match
the empty first field, so start over */
hildon_banner_show_information (GTK_WIDGET (dialog), NULL, c_(HILDON_SET_PASSWORD_DIALOG_MISMATCH));
- gtk_entry_set_text (pwd2nd_entry, "");
+ hildon_entry_set_text (HILDON_ENTRY (pwd2nd_entry), "");
}
gtk_widget_grab_focus (GTK_WIDGET (pwd1st_entry));
/* If the user enabled/disabled the password protection feature
we enable/disable password entries accordingly */
- active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
+ active = hildon_check_button_get_active (HILDON_CHECK_BUTTON (widget));
gtk_widget_set_sensitive (GTK_WIDGET (priv->pwd1st_entry), active);
gtk_widget_set_sensitive (GTK_WIDGET (priv->pwd2nd_entry), active);
}