When realizing the widget, set the window transiency.
[hildon] / src / hildon-get-password-dialog.c
index ae669cc..67cc948 100644 (file)
@@ -8,7 +8,7 @@
  * 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
@@ -79,7 +79,6 @@
 #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>
@@ -128,10 +127,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 +171,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 +211,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 +231,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:
@@ -412,7 +421,9 @@ create_contents                                 (HildonGetPasswordDialog *dialog
     control = gtk_entry_new ();
     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 +511,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 +637,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 +646,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 +661,4 @@ invalid_input                                   (GtkWidget *widget,
         hildon_banner_show_information (widget, NULL, _(HILDON_GET_PASSWORD_DIALOG_MAX_CHARS));
     }
 }
+#endif