gpointer user_data);
static gboolean
-download_uncached_messages (TnyList *header_list, GtkWindow *win,
- gboolean reply_fwd);
+download_uncached_messages (TnyList *header_list, GtkWindow *win);
static gint
goto cleanup;
}
- if (modest_account_mgr_get_bool (modest_runtime_get_account_mgr (), account_name,
- MODEST_ACCOUNT_USE_SIGNATURE, FALSE)) {
- signature = modest_account_mgr_get_string (modest_runtime_get_account_mgr (), account_name,
- MODEST_ACCOUNT_SIGNATURE, FALSE);
+ gboolean use_signature = FALSE;
+ signature = modest_account_mgr_get_signature (modest_runtime_get_account_mgr (), account_name, &use_signature);
+
+ if (use_signature) {
blank_and_signature = g_strconcat ("\n", signature, NULL);
- g_free (signature);
} else {
blank_and_signature = g_strdup ("");
}
+ g_free (signature);
+
msg = modest_tny_msg_new ("", from_str, "", "", "", blank_and_signature, NULL);
if (!msg) {
g_printerr ("modest: failed to create new msg\n");
/* Create and register edit window */
- /* This is destroyed by TOOD. */
+ /* This is destroyed by TODO. */
msg_win = modest_msg_edit_window_new (msg, account_name, FALSE);
mgr = modest_runtime_get_window_mgr ();
modest_window_mgr_register_window (mgr, msg_win);
g_list_foreach (sel_list, (GFunc) gtk_tree_path_free, NULL);
g_list_free (sel_list);
- win = modest_msg_view_window_new_with_header_model (msg,
- account,
- (const gchar*) uid,
- model,
- row_reference);
+ win = modest_msg_view_window_new_with_header_model (
+ msg, account, (const gchar*) uid,
+ model, row_reference);
gtk_tree_row_reference_free (row_reference);
} else {
- win = modest_msg_view_window_new (msg, account, (const gchar*) uid);
+ win = modest_msg_view_window_new_for_attachment (msg, account, (const gchar*) uid);
}
} else {
- win = modest_msg_view_window_new (msg, account, (const gchar*) uid);
+ win = modest_msg_view_window_new_for_attachment (msg, account, (const gchar*) uid);
}
g_free (uid);
}
*/
static gboolean
download_uncached_messages (TnyList *header_list,
- GtkWindow *win,
- gboolean reply_fwd)
+ GtkWindow *win)
{
TnyIterator *iter;
gboolean retval;
/* Ask for user permission to download the messages */
retval = TRUE;
if (uncached_messages > 0) {
- GtkResponseType response;
- if (reply_fwd)
- response = modest_platform_run_confirmation_dialog (GTK_WINDOW (win),
- _("emev_nc_include_original"));
- else
- response =
+ gboolean download = TRUE;
+ if (!tny_device_is_online (modest_runtime_get_device())) {
+ GtkResponseType response =
modest_platform_run_confirmation_dialog (GTK_WINDOW (win),
ngettext("mcen_nc_get_msg",
"mcen_nc_get_msgs",
uncached_messages));
- if (response == GTK_RESPONSE_CANCEL)
- retval = FALSE;
- else {
+ if (response == GTK_RESPONSE_CANCEL) download = FALSE;
+ }
+ if (download) {
/* If a download will be necessary, make sure that we have a connection: */
retval = modest_platform_connect_and_wait(win, NULL);
+ } else {
+ retval = FALSE;
}
}
return retval;
/* Check that the messages have been previously downloaded */
do_retrieve = (action == ACTION_FORWARD) || (reply_forward_type != MODEST_TNY_MSG_REPLY_TYPE_CITE);
if (do_retrieve)
- continue_download = download_uncached_messages (header_list, GTK_WINDOW (win), TRUE);
+ continue_download = download_uncached_messages (header_list, GTK_WINDOW (win));
if (!continue_download) {
g_object_unref (header_list);
return;
gchar *from = modest_account_mgr_get_from_string (account_mgr, account_name);
- /* mail content checks and dialogs */
- if (data->subject == NULL || data->subject[0] == '\0') {
- GtkResponseType response;
- response = modest_platform_run_confirmation_dialog (GTK_WINDOW (edit_window),
- _("mcen_nc_subject_is_empty_send"));
- if (response == GTK_RESPONSE_CANCEL) {
- g_free (account_name);
- return;
- }
- }
-
if (data->plain_body == NULL || data->plain_body[0] == '\0') {
GtkResponseType response;
gchar *note_message;
/* Check that the messages have been previously downloaded */
gboolean continue_download = TRUE;
if (ask)
- continue_download = download_uncached_messages (header_list, GTK_WINDOW (window), FALSE);
+ continue_download = download_uncached_messages (header_list, GTK_WINDOW (window));
if (continue_download)
modest_header_view_copy_selection (MODEST_HEADER_VIEW (focused_widget));
g_object_unref (header_list);