2009-02-05 Claudio Saavedra <csaavedra@igalia.com>
authorClaudio Saavedra <csaavedra@igalia.com>
Thu, 5 Feb 2009 11:59:11 +0000 (11:59 +0000)
committerClaudio Saavedra <csaavedra@igalia.com>
Thu, 5 Feb 2009 11:59:11 +0000 (11:59 +0000)
* src/hildon-touch-selector-entry.c:
(hildon_touch_selector_entry_init): Disable unsupported
input modes.
(hildon_touch_selector_entry_get_text_column): Emit a warning
if an unsupported input modes is used and explicitile state
these modes in the documentation.

Fixes: NB#99802 (Hildon touch selector entry not working properly
for some of the input modes)

ChangeLog
src/hildon-touch-selector-entry.c

index 37b32e3..ded010c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2009-02-05  Claudio Saavedra  <csaavedra@igalia.com>
+
+       * src/hildon-touch-selector-entry.c:
+       (hildon_touch_selector_entry_init): Disable unsupported
+       input modes.
+       (hildon_touch_selector_entry_get_text_column): Emit a warning
+       if an unsupported input modes is used and explicitile state
+       these modes in the documentation.
+
+       Fixes: NB#99802 (Hildon touch selector entry not working properly
+       for some of the input modes)
+
 2009-02-05  Alejandro G. Castro  <alex@igalia.com>
 
        * src/hildon-pannable-area.c,
index b6e7e62..65c087f 100644 (file)
@@ -164,11 +164,20 @@ hildon_touch_selector_entry_init (HildonTouchSelectorEntry *self)
 {
   HildonTouchSelectorEntryPrivate *priv;
   GtkEntryCompletion *completion;
+  HildonGtkInputMode input_mode;
 
   priv = HILDON_TOUCH_SELECTOR_ENTRY_GET_PRIVATE (self);
 
   priv->entry = hildon_entry_new (HILDON_SIZE_AUTO);
   gtk_entry_set_activates_default (GTK_ENTRY (priv->entry), TRUE);
+  input_mode = hildon_gtk_entry_get_input_mode (GTK_ENTRY (priv->entry));
+
+  /* Disable unsupported input modes. */
+  input_mode &= ~HILDON_GTK_INPUT_MODE_MULTILINE;
+  input_mode &= ~HILDON_GTK_INPUT_MODE_INVISIBLE;
+  input_mode &= ~HILDON_GTK_INPUT_MODE_DICTIONARY;
+
+  hildon_gtk_entry_set_input_mode (GTK_ENTRY (priv->entry), input_mode);
 
   completion = gtk_entry_completion_new ();
   gtk_entry_completion_set_inline_completion (completion, TRUE);
@@ -314,6 +323,12 @@ hildon_touch_selector_entry_get_text_column (HildonTouchSelectorEntry *selector)
  * Sets the input mode to be used in the #GtkEntry in @selector. See hildon_gtk_entry_set_input_mode()
  * for details.
  *
+ * It must be noted that not all input modes are available for the
+ * entry in @selector. In particular,
+ * %HILDON_GTK_INPUT_MODE_MULTILINE, %HILDON_GTK_INPUT_MODE_INVISIBLE,
+ * %HILDON_GTK_INPUT_MODE_DICTIONARY are disabled, since these are irrelevant
+ * for #HildonTouchSelectorEntry.
+ *
  * Since: 2.2
  **/
 void
@@ -323,6 +338,10 @@ hildon_touch_selector_entry_set_input_mode (HildonTouchSelectorEntry * selector,
   HildonTouchSelectorEntryPrivate *priv;
 
   g_return_if_fail (HILDON_IS_TOUCH_SELECTOR_ENTRY (selector));
+  g_return_if_fail (!(input_mode & (HILDON_GTK_INPUT_MODE_MULTILINE |
+                                   HILDON_GTK_INPUT_MODE_INVISIBLE |
+                                   HILDON_GTK_INPUT_MODE_DICTIONARY)));
+
   priv = HILDON_TOUCH_SELECTOR_ENTRY_GET_PRIVATE (selector);
 
   hildon_gtk_entry_set_input_mode (GTK_ENTRY (priv->entry), input_mode);