From: Sergio Villar Senin Date: Mon, 28 Jul 2008 18:40:00 +0000 (+0000) Subject: * Fixes NB#87174, show the proper information banner when an attachment can not... X-Git-Tag: git_migration_finished~1251 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=86ecad7f3b3e78d0e6699dd8a6cfdf671c6650cf * Fixes NB#87174, show the proper information banner when an attachment can not be added because is too big pmo-trunk-r5178 --- diff --git a/src/maemo/modest-msg-edit-window.c b/src/maemo/modest-msg-edit-window.c index 611f552..b340c34 100644 --- a/src/maemo/modest-msg-edit-window.c +++ b/src/maemo/modest-msg-edit-window.c @@ -2319,7 +2319,6 @@ modest_msg_edit_window_attach_file_one (ModestMsgEditWindow *window, ModestMsgEditWindowPrivate *priv; GnomeVFSResult result; GnomeVFSFileSize size = 0; - g_return_val_if_fail (window, 0); g_return_val_if_fail (uri, 0); @@ -2362,8 +2361,8 @@ modest_msg_edit_window_attach_file_one (ModestMsgEditWindow *window, info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_SIZE) { size = info->size; if (size > allowed_size) { - g_warning ("%s: attachment too big", __FUNCTION__); - modest_platform_information_banner (NULL, NULL, dgettext("hildon-fm", "sfil_ib_opening_not_allowed")); + modest_platform_information_banner (NULL, NULL, + dgettext("hildon-fm", "sfil_ib_opening_not_allowed")); return 0; } } else diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index de5e360..a6f1279 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -754,11 +754,15 @@ modest_ui_actions_compose_msg(ModestWindow *win, total_size = 0; allowed_size = MODEST_MAX_ATTACHMENT_SIZE; msg_win = modest_msg_edit_window_new (msg, account_name, FALSE); + + modest_window_mgr_register_window (modest_runtime_get_window_mgr(), msg_win); + modest_msg_edit_window_set_modified (MODEST_MSG_EDIT_WINDOW (msg_win), set_as_modified); + gtk_widget_show_all (GTK_WIDGET (msg_win)); + while (attachments) { total_size += - modest_msg_edit_window_attach_file_one( - (ModestMsgEditWindow *)msg_win, - attachments->data, allowed_size); + modest_msg_edit_window_attach_file_one((ModestMsgEditWindow *)msg_win, + attachments->data, allowed_size); if (total_size > allowed_size) { g_warning ("%s: total size: %u", @@ -769,10 +773,6 @@ modest_ui_actions_compose_msg(ModestWindow *win, attachments = g_slist_next(attachments); } - modest_window_mgr_register_window (modest_runtime_get_window_mgr(), msg_win); - modest_msg_edit_window_set_modified (MODEST_MSG_EDIT_WINDOW (msg_win), set_as_modified); - - gtk_widget_show_all (GTK_WIDGET (msg_win)); cleanup: g_free (from_str);