const gchar *new_account);
static GtkWidget *_create_addressbook_box (GtkSizeGroup *title_size_group, GtkSizeGroup *value_size_group,
const gchar *label, GtkWidget *control);
+static void max_chars_banner_unref (ModestMsgEditWindow *self, GObject *old_ref);
static void DEBUG_BUFFER (WPTextBuffer *buffer)
{
#ifdef DEBUG
GtkTextIter iter;
- g_message ("BEGIN BUFFER OF SIZE %d", gtk_text_buffer_get_char_count (GTK_TEXT_BUFFER (buffer)));
+ g_debug ("BEGIN BUFFER OF SIZE %d", gtk_text_buffer_get_char_count (GTK_TEXT_BUFFER (buffer)));
gtk_text_buffer_get_start_iter (GTK_TEXT_BUFFER (buffer), &iter);
while (!gtk_text_iter_is_end (&iter)) {
g_string_append (output, " ");
}
output = g_string_append (output, "]\n");
- g_message ("%s", output->str);
+ g_debug ("%s", output->str);
g_string_free (output, TRUE);
gtk_text_iter_forward_to_tag_toggle (&iter, NULL);
}
- g_message ("END BUFFER");
+ g_debug ("END BUFFER");
#endif
}
GtkWidget *app_menu;
GtkWidget *cc_button;
GtkWidget *bcc_button;
+
+ GtkWidget *max_chars_banner;
};
#define MODEST_MSG_EDIT_WINDOW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), \
priv->references = NULL;
priv->in_reply_to = NULL;
+ priv->max_chars_banner = NULL;
if (!is_wp_text_buffer_started) {
is_wp_text_buffer_started = TRUE;
modest_msg_edit_window_finalize (GObject *obj)
{
ModestMsgEditWindowPrivate *priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (obj);
-
+
+ if (priv->max_chars_banner) {
+ g_object_weak_unref (G_OBJECT (priv->max_chars_banner), (GWeakNotify) max_chars_banner_unref, obj);
+ priv->max_chars_banner = FALSE;
+ }
+
/* Sanity check: shouldn't be needed, the window mgr should
call this function before */
modest_msg_edit_window_disconnect_signals (MODEST_WINDOW (obj));
modest_msg_edit_window_attach_file_one (window, uri, allowed_size);
if (total_size > allowed_size) {
- g_warning ("%s: total size: %u",
+ g_debug ("%s: total size: %u",
__FUNCTION__, (unsigned int)total_size);
break;
}
return 0;
}
} else
- g_warning ("%s: could not get attachment size", __FUNCTION__);
+ g_debug ("%s: could not get attachment size", __FUNCTION__);
stream = create_stream_for_uri (uri);
gint offset;
glong utf8_len;
+ ModestMsgEditWindowPrivate *priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (window);
+
gtk_text_buffer_get_end_iter (GTK_TEXT_BUFFER (buffer), &end_iter);
offset = gtk_text_iter_get_offset (&end_iter);
}
if (offset + utf8_len > MAX_BODY_LENGTH) {
- hildon_banner_show_information (GTK_WIDGET (window), NULL,
- _CS("ckdg_ib_maximum_characters_reached"));
+ if (priv->max_chars_banner == NULL) {
+ priv->max_chars_banner = hildon_banner_show_information (GTK_WIDGET (window), NULL,
+ _CS("ckdg_ib_maximum_characters_reached"));
+ g_object_weak_ref (G_OBJECT (priv->max_chars_banner), (GWeakNotify) max_chars_banner_unref, window);
+ }
}
}
result = TRUE;
if (!gtk_text_iter_forward_search (iter, found_text, GTK_TEXT_SEARCH_VISIBLE_ONLY|GTK_TEXT_SEARCH_TEXT_ONLY,
match_start, match_end, NULL)) {
- g_warning ("Matched string with collate, but not matched in model");
+ g_debug ("Matched string with collate, but not matched in model");
}
g_free (found_text);
}
return box;
}
+
+static void
+max_chars_banner_unref (ModestMsgEditWindow *self, GObject *old_ref)
+{
+ ModestMsgEditWindowPrivate *priv = NULL;
+
+ g_return_if_fail (MODEST_IS_MSG_EDIT_WINDOW(self));
+
+ priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (self);
+ priv->max_chars_banner = NULL;
+}