/* Copyright (c) 2006, Nokia Corporation
- * All rights reserved.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
GtkWidget *parent_window;
} ReplyForwardHelper;
+typedef struct _MoveToHelper {
+ ModestMailOperation *mail_op;
+ TnyFolder *folder;
+} MoveToHelper;
+
typedef struct _PasteAsAttachmentHelper {
ModestMsgEditWindow *window;
GtkWidget *banner;
}
static void
-reply_forward_cb (ModestMailOperation *mail_op,
- TnyHeader *header,
- TnyMsg *msg,
+reply_forward_cb (ModestMailOperation *mail_op, TnyHeader *header, TnyMsg *msg,
gpointer user_data)
{
TnyMsg *new_msg;
/* Check if folder is empty and set headers view contents style */
folder_empty = (tny_folder_get_all_count (folder) == 0);
all_marked_as_deleted = modest_header_view_is_empty (MODEST_HEADER_VIEW(header_view));
- folder_empty = folder_empty || all_marked_as_deleted ;
- if (folder_empty) {
-
- printf ("DEBUG: %s: tny_folder_get_all_count() returned 0.\n", __FUNCTION__);
+ if (folder_empty || all_marked_as_deleted)
modest_main_window_set_contents_style (win,
MODEST_MAIN_WINDOW_CONTENTS_STYLE_EMPTY);
- } else {
- printf ("DEBUG: %s: tny_folder_get_all_count() returned >0.\n", __FUNCTION__);
- }
}
void
modest_folder_view_select_folder (MODEST_FOLDER_VIEW(folder_view),
TNY_FOLDER(folder), TRUE);
+ /* Actually rename the folder */
modest_mail_operation_rename_folder (mail_op,
TNY_FOLDER (folder),
(const gchar *) folder_name);
gtk_widget_destroy (GTK_WIDGET(user_data));
}
+
static void
paste_as_attachment_free (gpointer data)
{
modest_ui_actions_move_folder_error_handler (ModestMailOperation *mail_op,
gpointer user_data)
{
+ ModestMainWindow *main_window = NULL;
+ GtkWidget *folder_view = NULL;
GObject *win = modest_mail_operation_get_source (mail_op);
const GError *error = NULL;
const gchar *message = NULL;
message = _("mail_in_ui_folder_move_target_error");
}
+ /* Disable next automatic folder selection */
+ if (MODEST_IS_MAIN_WINDOW (user_data)) {
+ main_window = MODEST_MAIN_WINDOW(user_data);
+ folder_view = modest_main_window_get_child_widget (main_window,
+ MODEST_WIDGET_TYPE_FOLDER_VIEW);
+ modest_folder_view_disable_next_folder_selection (MODEST_FOLDER_VIEW(folder_view));
+ }
+
/* Show notification dialog */
modest_platform_run_information_dialog ((win) ? GTK_WINDOW (win) : NULL, message);
g_object_unref (win);
modest_mail_operation_new_with_error_handling (MODEST_MAIL_OPERATION_TYPE_RECEIVE,
G_OBJECT(win),
modest_ui_actions_move_folder_error_handler,
- NULL);
+ win);
modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (),
mail_op);
+ /* Select *after* the changes */
+ /* TODO: this function hangs UI after transfer */
+/* modest_folder_view_select_folder (MODEST_FOLDER_VIEW(folder_view), */
+/* TNY_FOLDER (src_folder), TRUE); */
+
modest_mail_operation_xfer_folder (mail_op,
TNY_FOLDER (src_folder),
dst_folder,
const gchar *help_id = NULL;
if (MODEST_IS_MAIN_WINDOW (win)) {
- const gchar *action_name;
- action_name = gtk_action_get_name (action);
-
- if (!strcmp (action_name, "FolderViewCSMHelp") ||
- !strcmp (action_name, "HeaderViewCSMHelp")) {
- GtkWidget *folder_view;
- TnyFolderStore *folder_store;
- /* Get selected folder */
- folder_view = modest_main_window_get_child_widget (MODEST_MAIN_WINDOW (win),
- MODEST_WIDGET_TYPE_FOLDER_VIEW);
- folder_store = modest_folder_view_get_selected (MODEST_FOLDER_VIEW (folder_view));
-
- /* Switch help_id */
- if (TNY_IS_FOLDER (folder_store)) {
- switch (modest_tny_folder_guess_folder_type (TNY_FOLDER (folder_store))) {
- case TNY_FOLDER_TYPE_NORMAL:
- help_id = "applications_email_managefolders";
- break;
- case TNY_FOLDER_TYPE_INBOX:
- help_id = "applications_email_inbox";
- break;
- case TNY_FOLDER_TYPE_OUTBOX:
- help_id = "applications_email_outbox";
- break;
- case TNY_FOLDER_TYPE_SENT:
- help_id = "applications_email_sent";
- break;
- case TNY_FOLDER_TYPE_DRAFTS:
- help_id = "applications_email_drafts";
- break;
- case TNY_FOLDER_TYPE_ARCHIVE:
- help_id = "applications_email_managefolders";
- break;
- default:
- help_id = "applications_email_managefolders";
- }
- } else {
- help_id = "applications_email_mainview";
+ GtkWidget *folder_view;
+ TnyFolderStore *folder_store;
+
+ /* Get selected folder */
+ folder_view = modest_main_window_get_child_widget (MODEST_MAIN_WINDOW (win),
+ MODEST_WIDGET_TYPE_FOLDER_VIEW);
+ folder_store = modest_folder_view_get_selected (MODEST_FOLDER_VIEW (folder_view));
+
+ /* Switch help_id */
+ if (TNY_IS_FOLDER (folder_store)) {
+ switch (modest_tny_folder_guess_folder_type (TNY_FOLDER (folder_store))) {
+ case TNY_FOLDER_TYPE_NORMAL:
+ help_id = "applications_email_managefolders";
+ break;
+ case TNY_FOLDER_TYPE_INBOX:
+ help_id = "applications_email_inbox";
+ break;
+ case TNY_FOLDER_TYPE_OUTBOX:
+ help_id = "applications_email_outbox";
+ break;
+ case TNY_FOLDER_TYPE_SENT:
+ help_id = "applications_email_sent";
+ break;
+ case TNY_FOLDER_TYPE_DRAFTS:
+ help_id = "applications_email_drafts";
+ break;
+ case TNY_FOLDER_TYPE_ARCHIVE:
+ help_id = "applications_email_managefolders";
+ break;
+ default:
+ help_id = "applications_email_managefolders";
}
- g_object_unref (folder_store);
} else {
- help_id = "applications_email_mainview";
+ help_id = "applications_email_mainview";
}
+ g_object_unref (folder_store);
} else if (MODEST_IS_MSG_VIEW_WINDOW (win)) {
help_id = "applications_email_viewer";
} else if (MODEST_IS_MSG_EDIT_WINDOW (win))