gtk_tree_path_free (prev_path);
}
- /* Update window dimming state */
+ /* Update toolbar dimming state */
if (main_window)
- modest_ui_actions_check_window_dimming_rules (MODEST_WINDOW (main_window));
+ modest_ui_actions_check_toolbar_dimming_rules (MODEST_WINDOW (main_window));
/* Free */
g_list_foreach (sel_list, (GFunc) gtk_tree_path_free, NULL);
modest_ui_actions_compose_msg(win, NULL, NULL, NULL, NULL, NULL, NULL);
}
+void
+modest_ui_actions_on_new_msg_or_folder (GtkAction *action, ModestWindow *win)
+{
+ g_return_if_fail (MODEST_IS_WINDOW (win));
+
+ /* Check first if the header view has the focus */
+ if (MODEST_IS_MAIN_WINDOW (win)) {
+ GtkWidget *w;
+ w = modest_main_window_get_child_widget (MODEST_MAIN_WINDOW (win),
+ MODEST_MAIN_WINDOW_WIDGET_TYPE_FOLDER_VIEW);
+ if (gtk_widget_is_focus (w)) {
+ modest_ui_actions_on_new_folder (action, MODEST_MAIN_WINDOW(win));
+ return;
+ }
+ }
+
+ modest_ui_actions_on_new_msg (action, win);
+}
+
+
gboolean
modest_ui_actions_msg_retrieval_check (ModestMailOperation *mail_op,
TnyHeader *header,
gtk_widget_show_all (GTK_WIDGET(win));
}
- /* Update window dimming state */
+ /* Update toolbar dimming state */
if (MODEST_IS_MAIN_WINDOW (parent_win)) {
- modest_ui_actions_check_window_dimming_rules (MODEST_WINDOW (parent_win));
+ modest_ui_actions_check_toolbar_dimming_rules (MODEST_WINDOW (parent_win));
}
cleanup:
/* Connect to the account and perform */
if (uncached_msgs > 0) {
- modest_platform_connect_and_perform ((GtkWindow *) win, g_object_ref (account),
+ modest_platform_connect_and_perform ((GtkWindow *) win, TRUE, g_object_ref (account),
open_msgs_performer, g_object_ref (not_opened_headers));
} else {
/* Call directly the performer, do not need to connect */
TNY_ACCOUNT_TYPE_STORE);
/* Invoke the connect and perform */
- modest_platform_connect_and_perform ((win) ? GTK_WINDOW (win) : NULL, info->account,
+ modest_platform_connect_and_perform ((win) ? GTK_WINDOW (win) : NULL,
+ (win) ? TRUE : FALSE, info->account,
do_send_receive_performer, info);
}
if (!gtk_widget_is_focus (GTK_WIDGET(header_view)))
gtk_widget_grab_focus (GTK_WIDGET(header_view));
- /* Update window dimming state */
- modest_ui_actions_check_window_dimming_rules (MODEST_WINDOW (main_window));
+ /* Update toolbar dimming state */
+ modest_ui_actions_check_toolbar_dimming_rules (MODEST_WINDOW (main_window));
}
void
}
}
- /* Update window dimming state */
- modest_ui_actions_check_window_dimming_rules (MODEST_WINDOW (main_window));
+ /* Update toolbar dimming state */
+ modest_ui_actions_check_toolbar_dimming_rules (MODEST_WINDOW (main_window));
}
void
if (parent_folder) {
/* The parent folder will be freed in the callback */
modest_platform_connect_if_remote_and_perform (GTK_WINDOW (parent_window),
+ TRUE,
parent_folder,
create_folder_performer,
parent_folder);
RenameFolderInfo *rename_folder_data = g_new0 (RenameFolderInfo, 1);
rename_folder_data->folder = folder;
rename_folder_data->new_name = folder_name;
- modest_platform_connect_if_remote_and_perform (GTK_WINDOW(main_window),
+ modest_platform_connect_if_remote_and_perform (GTK_WINDOW(main_window), TRUE,
folder, on_rename_folder_performer, rename_folder_data);
}
}
g_object_ref (G_OBJECT (info->folder));
TnyAccount *account = tny_folder_get_account (TNY_FOLDER (folder));
modest_platform_connect_if_remote_and_perform (GTK_WINDOW (main_window),
+ TRUE,
TNY_FOLDER_STORE (account),
on_delete_folder_cb, info);
g_object_unref (account);
/* Enable window dimming management */
modest_window_enable_dimming (MODEST_WINDOW(window));
- modest_ui_actions_check_window_dimming_rules (MODEST_WINDOW (window));
+ modest_ui_actions_check_toolbar_dimming_rules (MODEST_WINDOW (window));
}
}
info->delete_original,
folder_move_to_cb,
helper);
-
- modest_folder_view_select_folder (MODEST_FOLDER_VIEW(info->folder_view),
- TNY_FOLDER (info->dst_folder), TRUE);
+
+ if (modest_mail_operation_get_status (mail_op) == MODEST_MAIL_OPERATION_STATUS_SUCCESS) {
+ modest_folder_view_select_folder (MODEST_FOLDER_VIEW(info->folder_view),
+ TNY_FOLDER (info->dst_folder), TRUE);
+ }
/* Unref mail operation */
g_object_unref (G_OBJECT (mail_op));
info->folder_view = folder_view;
g_object_ref (G_OBJECT (info->src_folder));
g_object_ref (G_OBJECT (info->dst_folder));
- modest_platform_connect_if_remote_and_perform(GTK_WINDOW (win),
+ modest_platform_connect_if_remote_and_perform(GTK_WINDOW (win), TRUE,
TNY_FOLDER_STORE (dst_folder), on_move_folder_cb, info);
}
} else if (gtk_widget_is_focus (GTK_WIDGET(header_view))) {
}
if (do_xfer) /* Transfer messages */ {
g_object_ref (dst_folder);
- modest_platform_connect_if_remote_and_perform(GTK_WINDOW (win),
+ modest_platform_connect_if_remote_and_perform(GTK_WINDOW (win), TRUE,
TNY_FOLDER_STORE (dst_folder), xfer_messages_from_move_to_cb, dst_folder);
}
}
if (do_xfer) {
g_object_ref (dst_folder);
- modest_platform_connect_if_remote_and_perform(GTK_WINDOW (win),
+ modest_platform_connect_if_remote_and_perform(GTK_WINDOW (win), TRUE,
TNY_FOLDER_STORE (dst_folder), xfer_messages_from_move_to_cb, dst_folder);
}
g_object_unref (account);
g_object_unref (iter);
/* Connect and perform the message retrieval */
- modest_platform_connect_and_perform ((GtkWindow *) window,
+ modest_platform_connect_and_perform ((GtkWindow *) window, TRUE,
g_object_ref (account),
retrieve_msg_contents_performer,
g_object_ref (headers));
}
void
-modest_ui_actions_check_window_dimming_rules (ModestWindow *window)
+modest_ui_actions_check_toolbar_dimming_rules (ModestWindow *window)
+{
+ g_return_if_fail (MODEST_IS_WINDOW (window));
+
+ /* Update dimmed */
+ modest_window_check_dimming_rules_group (window, MODEST_DIMMING_RULES_TOOLBAR);
+}
+
+void
+modest_ui_actions_check_menu_dimming_rules (ModestWindow *window)
+{
+ g_return_if_fail (MODEST_IS_WINDOW (window));
+
+ /* Update dimmed */
+ modest_window_check_dimming_rules_group (window, MODEST_DIMMING_RULES_MENU);
+}
+
+void
+modest_ui_actions_on_email_menu_activated (GtkAction *action,
+ ModestWindow *window)
+{
+ g_return_if_fail (MODEST_IS_WINDOW (window));
+
+ /* Update dimmed */
+ modest_ui_actions_check_menu_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_ui_actions_check_menu_dimming_rules (window);
+}
+
+void
+modest_ui_actions_on_view_menu_activated (GtkAction *action,
+ ModestWindow *window)
+{
+ g_return_if_fail (MODEST_IS_WINDOW (window));
+
+ /* Update dimmed */
+ modest_ui_actions_check_menu_dimming_rules (window);
+}
+
+void
+modest_ui_actions_on_format_menu_activated (GtkAction *action,
+ ModestWindow *window)
+{
+ g_return_if_fail (MODEST_IS_WINDOW (window));
+
+ /* Update dimmed */
+ modest_ui_actions_check_menu_dimming_rules (window);
+}
+
+void
+modest_ui_actions_on_tools_menu_activated (GtkAction *action,
+ ModestWindow *window)
+{
+ g_return_if_fail (MODEST_IS_WINDOW (window));
+
+ /* Update dimmed */
+ modest_ui_actions_check_menu_dimming_rules (window);
+}
+
+void
+modest_ui_actions_on_attachment_menu_activated (GtkAction *action,
+ ModestWindow *window)
+{
+ g_return_if_fail (MODEST_IS_WINDOW (window));
+
+ /* Update dimmed */
+ modest_ui_actions_check_menu_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_ui_actions_check_menu_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_ui_actions_check_menu_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_group (window, "ModestWindowDimmingRules");
+ /* Update dimmed */
+ modest_ui_actions_check_menu_dimming_rules (window);
}
void