* src/maemo/modest-msg-edit-window.c:
authorJose Dapena Paz <jdapena@igalia.com>
Thu, 20 Sep 2007 19:32:53 +0000 (19:32 +0000)
committerJose Dapena Paz <jdapena@igalia.com>
Thu, 20 Sep 2007 19:32:53 +0000 (19:32 +0000)
        * Now, if we add characters to the subject field, and it's
          already in the max size (1000 characters), show proper
          information banner (fixes NB#66473).
* src/modest-conf.c:
        * Fix a compilation warning.

pmo-trunk-r3379

src/maemo/modest-msg-edit-window.c
src/modest-conf.c

index 2e56205..64c5759 100644 (file)
@@ -2842,6 +2842,11 @@ subject_field_insert_text (GtkEditable *editable,
        GString *result = g_string_new ("");
        gchar *current;
        gint result_len = 0;
+       const gchar *entry_text = NULL;
+       gint old_length;
+
+       entry_text = gtk_entry_get_text (GTK_ENTRY (editable));
+       old_length = g_utf8_strlen (entry_text, -1);
 
        for (current = new_text; current != NULL && *current != '\0'; current = g_utf8_next_char (current)) {
                gunichar c = g_utf8_get_char_validated (current, 8);
@@ -2867,6 +2872,12 @@ subject_field_insert_text (GtkEditable *editable,
                       g_signal_handlers_unblock_by_func(G_OBJECT(editable), G_CALLBACK(subject_field_insert_text), window);
                }
        }
+
+       if (result_len + old_length > 1000) {
+               hildon_banner_show_information (GTK_WIDGET (window), NULL, 
+                                               dgettext("hildon-common-strings",
+                                                        "ckdg_ib_maximum_characters_reached"));
+       }
        
        g_string_free (result, TRUE);
 }
index 7536ec5..b6d82b3 100644 (file)
@@ -115,7 +115,6 @@ modest_conf_init (ModestConf *obj)
 {
        GConfClient *conf = NULL;
        ModestConfPrivate *priv = MODEST_CONF_GET_PRIVATE(obj);
-       GError *err      = NULL;
 
        priv->gconf_client = NULL;