X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fmaemo%2Fmodest-msg-view-window.c;h=facfbc4b842e2cd786f2cfe9726815a5ba42fa3f;hb=cc7f0117682ebf3e45c13fa1355eca3251fd3b80;hp=af1f1160cd086ae4d07e3946e3274464e85d7e33;hpb=cc379b2109f5c1b1a70419454d1a0e53c26559e6;p=modest diff --git a/src/maemo/modest-msg-view-window.c b/src/maemo/modest-msg-view-window.c index af1f116..facfbc4 100644 --- a/src/maemo/modest-msg-view-window.c +++ b/src/maemo/modest-msg-view-window.c @@ -775,6 +775,7 @@ select_next_valid_row (GtkTreeModel *model, if (msg_is_visible (header, is_outbox)) { next = gtk_tree_model_get_path (model, &tmp_iter); *row_reference = gtk_tree_row_reference_new (model, next); + gtk_tree_path_free (next); retval = TRUE; finished = TRUE; } @@ -804,6 +805,7 @@ select_next_valid_row (GtkTreeModel *model, message */ finished = TRUE; } + gtk_tree_path_free (next); } else { /* If there are no more messages and we don't want to start again in the first one then @@ -814,8 +816,6 @@ select_next_valid_row (GtkTreeModel *model, /* Free */ gtk_tree_path_free (path); - if (next) - gtk_tree_path_free (next); return retval; } @@ -1425,6 +1425,7 @@ modest_msg_view_window_toggle_find_toolbar (GtkToggleAction *toggle, hildon_find_toolbar_highlight_entry (HILDON_FIND_TOOLBAR (priv->find_toolbar), TRUE); } else { gtk_widget_hide (priv->find_toolbar); + modest_msg_view_grab_focus (MODEST_MSG_VIEW (priv->msg_view)); } /* update the toggle buttons status */ @@ -1467,7 +1468,7 @@ modest_msg_view_window_find_toolbar_search (GtkWidget *widget, if ((current_search == NULL) || (strcmp (current_search, "") == 0)) { g_free (current_search); - hildon_banner_show_information (NULL, NULL, dgettext("hildon-common-strings", "ecdg_ib_find_rep_enter_text")); + hildon_banner_show_information (NULL, NULL, _CS("ecdg_ib_find_rep_enter_text")); return; } @@ -1478,7 +1479,7 @@ modest_msg_view_window_find_toolbar_search (GtkWidget *widget, result = modest_isearch_view_search (MODEST_ISEARCH_VIEW (priv->msg_view), priv->last_search); if (!result) { - hildon_banner_show_information (NULL, NULL, dgettext("hildon-libs", "ckct_ib_find_no_matches")); + hildon_banner_show_information (NULL, NULL, _HL("ckct_ib_find_no_matches")); g_free (priv->last_search); priv->last_search = NULL; } else { @@ -1487,7 +1488,7 @@ modest_msg_view_window_find_toolbar_search (GtkWidget *widget, } } else { if (!modest_isearch_view_search_next (MODEST_ISEARCH_VIEW (priv->msg_view))) { - hildon_banner_show_information (NULL, NULL, dgettext("hildon-libs", "ckct_ib_find_search_complete")); + hildon_banner_show_information (NULL, NULL, _HL("ckct_ib_find_search_complete")); g_free (priv->last_search); priv->last_search = NULL; } else { @@ -1546,7 +1547,7 @@ modest_msg_view_window_zoom_plus (ModestWindow *window) group = gtk_radio_action_get_group (zoom_radio_action); if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (group->data))) { - hildon_banner_show_information (NULL, NULL, dgettext("hildon-common-strings", "ckct_ib_max_zoom_level_reached")); + hildon_banner_show_information (NULL, NULL, _CS("ckct_ib_max_zoom_level_reached")); return FALSE; } @@ -1578,7 +1579,8 @@ modest_msg_view_window_zoom_minus (ModestWindow *window) gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (node->next->data), TRUE); return TRUE; } else { - hildon_banner_show_information (NULL, NULL, dgettext("hildon-common-strings", "ckct_ib_min_zoom_level_reached")); + hildon_banner_show_information (NULL, NULL, + _CS("ckct_ib_min_zoom_level_reached")); return FALSE; } break; @@ -2531,7 +2533,7 @@ on_decode_to_stream_async_handler (TnyMimePart *mime_part, g_chmod(helper->filepath, 0444); /* Activate the file */ - modest_platform_activate_file (helper->filepath, tny_mime_part_get_content_type (mime_part)); + modest_platform_activate_file (helper->filepath, modest_tny_mime_part_get_content_type (mime_part)); free: /* Frees */ @@ -2549,6 +2551,7 @@ modest_msg_view_window_view_attachment (ModestMsgViewWindow *window, gchar *attachment_uid = NULL; gint attachment_index = 0; TnyList *attachments; + TnyMimePart *window_msg; g_return_if_fail (MODEST_IS_MSG_VIEW_WINDOW (window)); g_return_if_fail (TNY_IS_MIME_PART (mime_part) || (mime_part == NULL)); @@ -2590,7 +2593,11 @@ modest_msg_view_window_view_attachment (ModestMsgViewWindow *window, return; } - if (!modest_tny_mime_part_is_msg (mime_part)) { + /* we also check for mime_part == priv->msg, as this means it's a direct attachment + * shown as attachment, so it should behave as a file */ + window_msg = TNY_MIME_PART (tny_msg_view_get_msg (TNY_MSG_VIEW (priv->msg_view))); + if (!modest_tny_mime_part_is_msg (mime_part)|| + mime_part == window_msg) { gchar *filepath = NULL; const gchar *att_filename = tny_mime_part_get_filename (mime_part); gboolean show_error_banner = FALSE; @@ -2615,7 +2622,7 @@ modest_msg_view_window_view_attachment (ModestMsgViewWindow *window, const gchar *content_type; /* the file may already exist but it isn't writable, * let's try to open it anyway */ - content_type = tny_mime_part_get_content_type (mime_part); + content_type = modest_tny_mime_part_get_content_type (mime_part); modest_platform_activate_file (filepath, content_type); } else { g_warning ("%s: modest_utils_create_temp_stream failed", __FUNCTION__); @@ -2657,6 +2664,7 @@ modest_msg_view_window_view_attachment (ModestMsgViewWindow *window, gtk_widget_show_all (GTK_WIDGET (msg_win)); } } + g_object_unref (window_msg); g_object_unref (mime_part); } @@ -2711,10 +2719,11 @@ idle_save_mime_part_show_result (SaveMimePartInfo *info) if (info->result == GNOME_VFS_OK) { hildon_banner_show_information (NULL, NULL, _CS("sfil_ib_saved")); } else if (info->result == GNOME_VFS_ERROR_NO_SPACE) { - hildon_banner_show_information (NULL, NULL, dgettext("ke-recv", - "cerm_device_memory_full")); + hildon_banner_show_information (NULL, NULL, + _KR("cerm_device_memory_full")); } else { - hildon_banner_show_information (NULL, NULL, _("mail_ib_file_operation_failed")); + hildon_banner_show_information (NULL, NULL, + _("mail_ib_file_operation_failed")); } gdk_threads_leave (); /* CHECKED */ } @@ -2805,7 +2814,7 @@ save_attachments_response (GtkDialog *dialog, if (!modest_utils_folder_writable (chooser_uri)) { hildon_banner_show_information - (NULL, NULL, dgettext("hildon-fm", "sfil_ib_readonly_location")); + (NULL, NULL, _FM("sfil_ib_readonly_location")); } else { TnyIterator *iter; @@ -2817,7 +2826,7 @@ save_attachments_response (GtkDialog *dialog, !tny_mime_part_is_purged (mime_part) && (tny_mime_part_get_filename (mime_part) != NULL)) { SaveMimePartPair *pair; - + pair = g_slice_new0 (SaveMimePartPair); if (tny_list_get_length (mime_parts) > 1) { @@ -2858,6 +2867,7 @@ modest_msg_view_window_save_attachments (ModestMsgViewWindow *window, TnyList *m gchar *folder = NULL; gchar *filename = NULL; gchar *save_multiple_str = NULL; + TnyMsg *window_msg; g_return_if_fail (MODEST_IS_MSG_VIEW_WINDOW (window)); priv = MODEST_MSG_VIEW_WINDOW_GET_PRIVATE (window); @@ -2870,6 +2880,7 @@ modest_msg_view_window_save_attachments (ModestMsgViewWindow *window, TnyList *m g_object_ref (mime_parts); } + window_msg = tny_msg_view_get_msg (TNY_MSG_VIEW (priv->msg_view)); /* prepare dialog */ if (tny_list_get_length (mime_parts) == 1) { TnyIterator *iter; @@ -2892,6 +2903,7 @@ modest_msg_view_window_save_attachments (ModestMsgViewWindow *window, TnyList *m save_multiple_str = g_strdup_printf (_FM("sfil_va_number_of_objects_attachments"), tny_list_get_length (mime_parts)); } + g_object_unref (window_msg); save_dialog = hildon_file_chooser_dialog_new (GTK_WINDOW (window), GTK_FILE_CHOOSER_ACTION_SAVE); @@ -3198,3 +3210,11 @@ on_fetch_image (ModestMsgView *msgview, return TRUE;; } + +void +modest_msg_view_window_add_to_contacts (ModestMsgViewWindow *self) +{ + modest_ui_actions_on_add_to_contacts (NULL, MODEST_WINDOW (self)); +} + +