aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-10-17 21:40:36 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-10-19 00:32:37 +0800
commit35e55a8d6e3455efa92abd669680d191e3e4cbac (patch)
tree303d479aaaf12538d73f611f52db1157da64549b /modules
parentb674a37a381d0328a7273bafa62d80203c8cdf70 (diff)
downloadgsoc2013-evolution-35e55a8d6e3455efa92abd669680d191e3e4cbac.tar
gsoc2013-evolution-35e55a8d6e3455efa92abd669680d191e3e4cbac.tar.gz
gsoc2013-evolution-35e55a8d6e3455efa92abd669680d191e3e4cbac.tar.bz2
gsoc2013-evolution-35e55a8d6e3455efa92abd669680d191e3e4cbac.tar.lz
gsoc2013-evolution-35e55a8d6e3455efa92abd669680d191e3e4cbac.tar.xz
gsoc2013-evolution-35e55a8d6e3455efa92abd669680d191e3e4cbac.tar.zst
gsoc2013-evolution-35e55a8d6e3455efa92abd669680d191e3e4cbac.zip
Send errors to an EAlertSink instead of the task bar.
This marks the end of unintrusive error dialogs, which were too unintrusive. We now show errors directly in the main window using the EAlert / EAlertSink framework.
Diffstat (limited to 'modules')
-rw-r--r--modules/mail/e-mail-junk-hook.c11
-rw-r--r--modules/mail/e-mail-shell-backend.c4
-rw-r--r--modules/mail/e-mail-shell-view-actions.c46
3 files changed, 33 insertions, 28 deletions
diff --git a/modules/mail/e-mail-junk-hook.c b/modules/mail/e-mail-junk-hook.c
index ac88f1ea4c..24c1ac77fc 100644
--- a/modules/mail/e-mail-junk-hook.c
+++ b/modules/mail/e-mail-junk-hook.c
@@ -28,6 +28,7 @@
#include "mail/em-junk.h"
#include "mail/em-utils.h"
+#include "mail/e-mail-backend.h"
#include "mail/e-mail-session.h"
#define E_MAIL_JUNK_HOOK_GET_PRIVATE(obj) \
@@ -49,11 +50,15 @@ static GType mail_junk_hook_type;
static gboolean
mail_junk_hook_idle_cb (struct ErrorData *data)
{
- GtkWidget *widget;
+ EShell *shell;
+ EShellBackend *shell_backend;
+
+ shell = e_shell_get_default ();
+ shell_backend = e_shell_get_backend_by_name (shell, "mail");
- widget = e_alert_dialog_new_for_args (e_shell_get_active_window (NULL),
+ e_mail_backend_submit_alert (
+ E_MAIL_BACKEND (shell_backend),
data->error_message, data->error->message, NULL);
- em_utils_show_error_silent (widget);
g_error_free (data->error);
g_slice_free (struct ErrorData, data);
diff --git a/modules/mail/e-mail-shell-backend.c b/modules/mail/e-mail-shell-backend.c
index 36e4cbdfb3..73386911ec 100644
--- a/modules/mail/e-mail-shell-backend.c
+++ b/modules/mail/e-mail-shell-backend.c
@@ -526,7 +526,6 @@ mail_shell_backend_start (EShellBackend *shell_backend)
EShell *shell;
EShellSettings *shell_settings;
EMailBackend *backend;
- EMailSession *session;
gboolean enable_search_folders;
priv = E_MAIL_SHELL_BACKEND_GET_PRIVATE (shell_backend);
@@ -535,12 +534,11 @@ mail_shell_backend_start (EShellBackend *shell_backend)
shell_settings = e_shell_get_shell_settings (shell);
backend = E_MAIL_BACKEND (shell_backend);
- session = e_mail_backend_get_session (backend);
enable_search_folders = e_shell_settings_get_boolean (
shell_settings, "mail-enable-search-folders");
if (enable_search_folders)
- vfolder_load_storage (session);
+ vfolder_load_storage (backend);
mail_autoreceive_init (backend);
diff --git a/modules/mail/e-mail-shell-view-actions.c b/modules/mail/e-mail-shell-view-actions.c
index fa083bf6f2..7548b5e54a 100644
--- a/modules/mail/e-mail-shell-view-actions.c
+++ b/modules/mail/e-mail-shell-view-actions.c
@@ -118,8 +118,6 @@ action_mail_create_search_folder_cb (GtkAction *action,
mail_view = e_mail_shell_content_get_mail_view (mail_shell_content);
searchbar = e_mail_shell_content_get_searchbar (mail_shell_content);
- vfolder_load_storage (session);
-
search_rule = e_shell_view_get_search_rule (shell_view);
g_return_if_fail (search_rule != NULL);
@@ -181,8 +179,6 @@ action_mail_folder_copy_cb (GtkAction *action,
EShellBackend *shell_backend;
EShellWindow *shell_window;
EShellView *shell_view;
- EMailBackend *backend;
- EMailSession *session;
CamelFolderInfo *folder_info;
EMFolderTree *folder_tree;
@@ -190,9 +186,6 @@ action_mail_folder_copy_cb (GtkAction *action,
shell_window = e_shell_view_get_shell_window (shell_view);
shell_backend = e_shell_view_get_shell_backend (shell_view);
- backend = E_MAIL_BACKEND (shell_backend);
- session = e_mail_backend_get_session (backend);
-
mail_shell_sidebar = mail_shell_view->priv->mail_shell_sidebar;
folder_tree = e_mail_shell_sidebar_get_folder_tree (mail_shell_sidebar);
folder_info = em_folder_tree_get_selected_folder_info (folder_tree);
@@ -200,7 +193,9 @@ action_mail_folder_copy_cb (GtkAction *action,
/* XXX Leaking folder_info? */
em_folder_utils_copy_folder (
- GTK_WINDOW (shell_window), session, folder_info, FALSE);
+ GTK_WINDOW (shell_window),
+ E_MAIL_BACKEND (shell_backend),
+ folder_info, FALSE);
}
static void
@@ -208,15 +203,21 @@ action_mail_folder_delete_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
EMailShellSidebar *mail_shell_sidebar;
+ EShellBackend *shell_backend;
+ EShellView *shell_view;
EMFolderTree *folder_tree;
CamelFolder *folder;
+ shell_view = E_SHELL_VIEW (mail_shell_view);
+ shell_backend = e_shell_view_get_shell_backend (shell_view);
+
mail_shell_sidebar = mail_shell_view->priv->mail_shell_sidebar;
folder_tree = e_mail_shell_sidebar_get_folder_tree (mail_shell_sidebar);
folder = em_folder_tree_get_selected_folder (folder_tree);
g_return_if_fail (folder != NULL);
- em_folder_utils_delete_folder (folder);
+ em_folder_utils_delete_folder (
+ E_MAIL_BACKEND (shell_backend), folder);
}
static void
@@ -255,11 +256,14 @@ action_mail_folder_mark_all_as_read_cb (GtkAction *action,
{
EShellView *shell_view;
EShellWindow *shell_window;
+ EShellBackend *shell_backend;
EMailShellContent *mail_shell_content;
EMailReader *reader;
EMailView *mail_view;
CamelFolder *folder;
GtkWindow *parent;
+ EMailBackend *backend;
+ EMailSession *session;
MailFolderCache *cache;
GtkWidget *message_list;
GPtrArray *uids;
@@ -269,6 +273,7 @@ action_mail_folder_mark_all_as_read_cb (GtkAction *action,
shell_view = E_SHELL_VIEW (mail_shell_view);
shell_window = e_shell_view_get_shell_window (shell_view);
+ shell_backend = e_shell_view_get_shell_backend (shell_view);
parent = GTK_WINDOW (shell_window);
mail_shell_content = mail_shell_view->priv->mail_shell_content;
@@ -279,8 +284,11 @@ action_mail_folder_mark_all_as_read_cb (GtkAction *action,
folder = e_mail_reader_get_folder (reader);
g_return_if_fail (folder != NULL);
- cache = mail_folder_cache_get_default ();
+ backend = E_MAIL_BACKEND (shell_backend);
+ session = e_mail_backend_get_session (backend);
+ cache = e_mail_session_get_folder_cache (session);
key = "/apps/evolution/mail/prompts/mark_all_read";
+
if (mail_folder_cache_get_folder_has_children (cache, folder, NULL))
prompt = "mail:ask-mark-all-read-sub";
else
@@ -312,8 +320,6 @@ action_mail_folder_move_cb (GtkAction *action,
EShellBackend *shell_backend;
EShellWindow *shell_window;
EShellView *shell_view;
- EMailBackend *backend;
- EMailSession *session;
CamelFolderInfo *folder_info;
EMFolderTree *folder_tree;
@@ -321,9 +327,6 @@ action_mail_folder_move_cb (GtkAction *action,
shell_window = e_shell_view_get_shell_window (shell_view);
shell_backend = e_shell_view_get_shell_backend (shell_view);
- backend = E_MAIL_BACKEND (shell_backend);
- session = e_mail_backend_get_session (backend);
-
mail_shell_sidebar = mail_shell_view->priv->mail_shell_sidebar;
folder_tree = e_mail_shell_sidebar_get_folder_tree (mail_shell_sidebar);
folder_info = em_folder_tree_get_selected_folder_info (folder_tree);
@@ -331,7 +334,9 @@ action_mail_folder_move_cb (GtkAction *action,
/* XXX Leaking folder_info? */
em_folder_utils_copy_folder (
- GTK_WINDOW (shell_window), session, folder_info, TRUE);
+ GTK_WINDOW (shell_window),
+ E_MAIL_BACKEND (shell_backend),
+ folder_info, TRUE);
}
static void
@@ -1017,17 +1022,14 @@ action_mail_tools_filters_cb (GtkAction *action,
EShellBackend *shell_backend;
EShellWindow *shell_window;
EShellView *shell_view;
- EMailBackend *backend;
- EMailSession *session;
shell_view = E_SHELL_VIEW (mail_shell_view);
shell_window = e_shell_view_get_shell_window (shell_view);
shell_backend = e_shell_view_get_shell_backend (shell_view);
- backend = E_MAIL_BACKEND (shell_backend);
- session = e_mail_backend_get_session (backend);
-
- em_utils_edit_filters (GTK_WIDGET (shell_window), session);
+ em_utils_edit_filters (
+ GTK_WIDGET (shell_window),
+ E_MAIL_BACKEND (shell_backend));
}
static void