+
+void
+modest_ui_actions_on_help (GtkAction *action,
+ ModestWindow *win)
+{
+ const gchar *help_id;
+
+ 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 (tny_folder_get_folder_type (TNY_FOLDER (folder_store))) {
+ case TNY_FOLDER_TYPE_NORMAL:
+ help_id = "applications_email_userfolder";
+ 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_archive";
+ break;
+ default:
+ help_id = NULL;
+ }
+ }
+ } else {
+ help_id = "applications_email_mainview";
+ }
+ } else if (MODEST_IS_MSG_VIEW_WINDOW (win)) {
+ help_id = "applications_email_viewer";
+ } else if (MODEST_IS_MSG_EDIT_WINDOW (win))
+ help_id = "applications_email_editor";
+
+ modest_platform_show_help (GTK_WINDOW (win), help_id);
+}
+
+void
+modest_ui_actions_on_retrieve_msg_contents (GtkAction *action,
+ ModestWindow *window)
+{
+ ModestMailOperation *mail_op;
+ TnyList *headers;
+
+ /* Get headers */
+ headers = get_selected_headers (window);
+ if (!headers)
+ return;
+
+ /* Create mail operation */
+ mail_op = modest_mail_operation_new_with_error_handling (MODEST_MAIL_OPERATION_TYPE_RECEIVE,
+ G_OBJECT (window),
+ modest_ui_actions_get_msgs_full_error_handler,
+ NULL);
+ modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (), mail_op);
+ modest_mail_operation_get_msgs_full (mail_op, headers, NULL, NULL, NULL);
+
+ /* Frees */
+ g_object_unref (headers);
+ g_object_unref (mail_op);
+}
+
+void
+modest_ui_actions_on_email_menu_activated (GtkAction *action,
+ ModestWindow *window)
+{
+ g_return_if_fail (MODEST_IS_WINDOW (window));
+
+ /* Update dimmed */
+ modest_window_check_dimming_rules (window);
+}
+
+void
+modest_ui_actions_on_edit_menu_activated (GtkAction *action,
+ ModestWindow *window)
+{
+ g_return_if_fail (MODEST_IS_WINDOW (window));
+
+ /* Update dimmed */
+ modest_window_check_dimming_rules (window);
+}
+
+void
+modest_ui_actions_on_toolbar_csm_menu_activated (GtkAction *action,
+ ModestWindow *window)
+{
+ g_return_if_fail (MODEST_IS_WINDOW (window));
+
+ /* Update dimmed */
+ modest_window_check_dimming_rules (window);
+}
+
+void
+modest_ui_actions_on_folder_view_csm_menu_activated (GtkAction *action,
+ ModestWindow *window)
+{
+ g_return_if_fail (MODEST_IS_WINDOW (window));
+
+ /* Update dimmed */
+ modest_window_check_dimming_rules (window);
+}
+
+void
+modest_ui_actions_on_header_view_csm_menu_activated (GtkAction *action,
+ ModestWindow *window)
+{
+ g_return_if_fail (MODEST_IS_WINDOW (window));
+
+ /* Update dimmed */
+ modest_window_check_dimming_rules (window);
+}