X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fhildon-get-password-dialog.c;h=7db3d9b62c06e617054bccfa1653e6505009961e;hb=7d3f0468795e7298a98578fbb054b5cb9908d523;hp=ae669cc52360c53f9206eafe4ba187d3a1ca92fa;hpb=bcd8bd04e4a43ea8d1e32b93638ebd6e6ce38887;p=hildon diff --git a/src/hildon-get-password-dialog.c b/src/hildon-get-password-dialog.c index ae669cc..7db3d9b 100644 --- a/src/hildon-get-password-dialog.c +++ b/src/hildon-get-password-dialog.c @@ -3,12 +3,12 @@ * * Copyright (C) 2005, 2006 Nokia Corporation, all rights reserved. * - * Contact: Michael Dominic Kostrzewa + * Contact: Rodrigo Novo * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; version 2.1 of - * the License. + * the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -24,7 +24,7 @@ /** * 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 @@ -67,22 +67,22 @@ * */ +#undef HILDON_DISABLE_DEPRECATED + #ifdef HAVE_CONFIG_H #include #endif -#include "hildon-get-password-dialog.h" -#include #include #include #include #include #include -#include -#include "hildon-input-mode-hint.h" +#include + +#include "hildon-get-password-dialog.h" #include "hildon-caption.h" #include "hildon-banner.h" -#include #include "hildon-get-password-dialog-private.h" #define _(String) dgettext("hildon-libs", String) @@ -128,10 +128,12 @@ hildon_get_password_get_property (GObject *object, static void create_contents (HildonGetPasswordDialog *dialog); +#ifdef MAEMO_GTK static void invalid_input (GtkWidget *widget, GtkInvalidInputType reason, gpointer unused); +#endif enum { @@ -170,13 +172,15 @@ hildon_get_password_set_property (GObject *object, break; case PROP_NUMBERS_ONLY: +#ifdef MAEMO_GTK /* Set input mode for the password entry */ g_object_set(G_OBJECT (gtk_bin_get_child GTK_BIN ((priv->password_entry))), - "input-mode", + "hildon-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); +#endif break; case PROP_CAPTION_LABEL: @@ -208,7 +212,9 @@ hildon_get_password_get_property (GObject *object, HildonGetPasswordDialogPrivate *priv; const gchar *string; gint max_length; +#ifdef MAEMO_GTK gint input_mode; +#endif priv = HILDON_GET_PASSWORD_DIALOG_GET_PRIVATE (dialog); g_assert (priv); @@ -226,12 +232,16 @@ hildon_get_password_get_property (GObject *object, break; case PROP_NUMBERS_ONLY: +#ifdef MAEMO_GTK /* This property is set if and only if the input mode of the password entry has been set to numeric only */ g_object_get (G_OBJECT (gtk_bin_get_child (GTK_BIN (priv->password_entry))), - "input-mode", &input_mode, NULL); + "hildon-input-mode", &input_mode, NULL); g_value_set_boolean (value, - (input_mode == HILDON_INPUT_MODE_HINT_NUMERIC)); + (input_mode == HILDON_GTK_INPUT_MODE_NUMERIC)); +#else + g_value_set_boolean (value, FALSE); +#endif break; case PROP_CAPTION_LABEL: @@ -377,6 +387,7 @@ create_contents (HildonGetPasswordDialog *dialog HildonGetPasswordDialogPrivate *priv; GtkSizeGroup * group; GtkWidget *control; + AtkObject *atk_aux = NULL; /* Cache private pointer for faster member access */ priv = HILDON_GET_PASSWORD_DIALOG_GET_PRIVATE (dialog); @@ -410,9 +421,16 @@ create_contents (HildonGetPasswordDialog *dialog /* Create password text entry */ control = gtk_entry_new (); + if ((atk_aux = gtk_widget_get_accessible(control))) + { + atk_object_set_name(atk_aux, _("Passwd")); + } + gtk_entry_set_width_chars (GTK_ENTRY (control), 20); +#ifdef MAEMO_GTK g_object_set (control, "hildon-input-mode", HILDON_GTK_INPUT_MODE_FULL, NULL); +#endif gtk_entry_set_visibility (GTK_ENTRY(control), FALSE); priv->password_entry = HILDON_CAPTION @@ -500,7 +518,7 @@ hildon_get_password_dialog_new (GtkWindow *parent, * @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. * @@ -626,6 +644,7 @@ hildon_get_password_dialog_set_max_characters (HildonGetPasswordDialog *dialog * disconnected before connecting the new signal. Besides, this * should go into the constructor */ +#ifdef MAEMO_GTK /* Connect callback to show error banner if the limit is exceeded */ g_signal_connect (GTK_ENTRY (gtk_bin_get_child @@ -634,8 +653,10 @@ hildon_get_password_dialog_set_max_characters (HildonGetPasswordDialog *dialog G_CALLBACK (invalid_input), NULL ); +#endif } +#ifdef MAEMO_GTK /* Callback that gets called when maximum chars is reached in the entry */ static void invalid_input (GtkWidget *widget, @@ -647,3 +668,4 @@ invalid_input (GtkWidget *widget, hildon_banner_show_information (widget, NULL, _(HILDON_GET_PASSWORD_DIALOG_MAX_CHARS)); } } +#endif