X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-ui-actions.c;h=d69a7962525f183e5fbd865b17d5620589596d8f;hp=f7d2a47c005f04fd62279d4c8449920ea0d371f9;hb=5619278be034c3032ce89fc8ce0a2d52ef351e7b;hpb=7c8a19df4e4793891f82d8d2c462b33d89f1c18f diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index f7d2a47..d69a796 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -140,8 +140,7 @@ static void _on_send_receive_progress_changed (ModestMailOperation *mail_op 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 @@ -717,16 +716,17 @@ modest_ui_actions_on_new_msg (GtkAction *action, ModestWindow *win) 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"); @@ -741,7 +741,7 @@ modest_ui_actions_on_new_msg (GtkAction *action, ModestWindow *win) /* 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); @@ -1172,8 +1172,7 @@ cleanup: */ static gboolean download_uncached_messages (TnyList *header_list, - GtkWindow *win, - gboolean reply_fwd) + GtkWindow *win) { TnyIterator *iter; gboolean retval; @@ -1197,21 +1196,20 @@ download_uncached_messages (TnyList *header_list, /* 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; @@ -1252,7 +1250,7 @@ reply_forward (ReplyForwardAction action, ModestWindow *win) /* 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; @@ -2092,17 +2090,6 @@ modest_ui_actions_on_send (GtkWidget *widget, ModestMsgEditWindow *edit_window) 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; @@ -2856,7 +2843,7 @@ modest_ui_actions_on_copy (GtkAction *action, /* 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);