diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2002-08-06 05:20:59 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2002-08-06 05:20:59 +0800 |
commit | ce3ae8856492d9654f08a0db8b949e2e9a9e1a6f (patch) | |
tree | f6982ed4be0258d3fb0a06b37f4c34223a29204f | |
parent | 01fb066a57ffdddeeae9b333f5bcbdcd169f5c75 (diff) | |
download | gsoc2013-evolution-ce3ae8856492d9654f08a0db8b949e2e9a9e1a6f.tar gsoc2013-evolution-ce3ae8856492d9654f08a0db8b949e2e9a9e1a6f.tar.gz gsoc2013-evolution-ce3ae8856492d9654f08a0db8b949e2e9a9e1a6f.tar.bz2 gsoc2013-evolution-ce3ae8856492d9654f08a0db8b949e2e9a9e1a6f.tar.lz gsoc2013-evolution-ce3ae8856492d9654f08a0db8b949e2e9a9e1a6f.tar.xz gsoc2013-evolution-ce3ae8856492d9654f08a0db8b949e2e9a9e1a6f.tar.zst gsoc2013-evolution-ce3ae8856492d9654f08a0db8b949e2e9a9e1a6f.zip |
If we are not in interactive mode, don't display error dialogs.
2002-08-05 Jeffrey Stedfast <fejj@ximian.com>
* mail-mt.c (mail_msg_check_error): If we are not in interactive
mode, don't display error dialogs.
* component-factory.c (interactive_cb): Updated to use the new
function mail_session_set_interactive().
(owner_unset_cb): Same here.
* mail-session.c (mail_session_set_interactive): Renamed from
mail_session_enable_interaction().
(mail_session_get_interactive): New function to get the
interactive state.
svn path=/trunk/; revision=17702
-rw-r--r-- | mail/ChangeLog | 14 | ||||
-rw-r--r-- | mail/component-factory.c | 4 | ||||
-rw-r--r-- | mail/mail-callbacks.c | 1 | ||||
-rw-r--r-- | mail/mail-mt.c | 9 | ||||
-rw-r--r-- | mail/mail-session.c | 20 | ||||
-rw-r--r-- | mail/mail-session.h | 3 | ||||
-rw-r--r-- | mail/message-list.c | 31 |
7 files changed, 60 insertions, 22 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 4fa2a6ba02..0246b8b847 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,17 @@ +2002-08-05 Jeffrey Stedfast <fejj@ximian.com> + + * mail-mt.c (mail_msg_check_error): If we are not in interactive + mode, don't display error dialogs. + + * component-factory.c (interactive_cb): Updated to use the new + function mail_session_set_interactive(). + (owner_unset_cb): Same here. + + * mail-session.c (mail_session_set_interactive): Renamed from + mail_session_enable_interaction(). + (mail_session_get_interactive): New function to get the + interactive state. + 2002-08-01 Peter Williams <peterw@ximian.com> * mail-offline-handler.c (struct _sync_info): Add a GHashTable pointer diff --git a/mail/component-factory.c b/mail/component-factory.c index 5a2651b789..e9b3c8482b 100644 --- a/mail/component-factory.c +++ b/mail/component-factory.c @@ -795,7 +795,7 @@ debug_cb (EvolutionShellComponent *shell_component, gpointer user_data) static void interactive_cb (EvolutionShellComponent *shell_component, gboolean on, gpointer user_data) { - mail_session_enable_interaction(on); + mail_session_set_interactive (on); } static void @@ -900,7 +900,7 @@ owner_unset_cb (EvolutionShellComponent *shell_component, gpointer user_data) mail_importer_uninit (); global_shell_client = NULL; - mail_session_enable_interaction (FALSE); + mail_session_set_interactive (FALSE); gtk_object_unref (GTK_OBJECT (search_context)); search_context = NULL; diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index 53a043c33f..1c46ac0e49 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -1395,7 +1395,6 @@ void post_message (GtkWidget *widget, gpointer user_data) { FolderBrowser *fb = FOLDER_BROWSER (user_data); - GtkWidget *composer; char *url; if (FOLDER_BROWSER_IS_DESTROYED (fb) || !check_send_configuration (fb)) diff --git a/mail/mail-mt.c b/mail/mail-mt.c index 0a3243a894..cf552dbdb5 100644 --- a/mail/mail-mt.c +++ b/mail/mail-mt.c @@ -30,6 +30,7 @@ #include "mail-config.h" #include "camel/camel-url.h" +#include "mail-session.h" #include "mail-mt.h" #include "component-factory.h" @@ -231,13 +232,17 @@ void mail_msg_check_error(void *msg) char *what = NULL; char *text; GnomeDialog *gd; - + #ifdef MALLOC_CHECK checkmem(m); checkmem(m->cancel); checkmem(m->priv); #endif - + + /* don't report any errors if we are not in interactive mode */ + if (!mail_session_get_interactive ()) + return; + if (!camel_exception_is_set(&m->ex) || m->ex.id == CAMEL_EXCEPTION_USER_CANCEL) return; diff --git a/mail/mail-session.c b/mail/mail-session.c index eebfa04a12..15221eba34 100644 --- a/mail/mail-session.c +++ b/mail/mail-session.c @@ -62,7 +62,7 @@ CamelSession *session; typedef struct _MailSession { CamelSession parent_object; - gboolean interaction_enabled; + gboolean interactive; FILE *filter_logfile; EMutex *lock; @@ -361,7 +361,7 @@ do_get_pass(struct _mail_msg *mm) } else if (m->key) { m->result = e_passwords_get_password(m->key); if (m->result == NULL) { - if (mail_session->interaction_enabled) { + if (mail_session->interactive) { request_password(m); return; } @@ -560,7 +560,7 @@ alert_user(CamelSession *session, CamelSessionAlertType type, const char *prompt EMsgPort *user_message_reply; gboolean ret; - if (!mail_session->interaction_enabled) + if (!mail_session->interactive) return FALSE; user_message_reply = e_msgport_new (); @@ -999,12 +999,18 @@ mail_session_init (void) g_free (camel_dir); } -void -mail_session_enable_interaction (gboolean enable) +gboolean +mail_session_get_interactive (void) { - MAIL_SESSION (session)->interaction_enabled = enable; + return MAIL_SESSION (session)->interactive; +} - if (!enable) { +void +mail_session_set_interactive (gboolean interactive) +{ + MAIL_SESSION (session)->interactive = interactive; + + if (!interactive) { struct _pass_msg *pm; struct _user_message_msg *um; diff --git a/mail/mail-session.h b/mail/mail-session.h index 60779156a7..72a2757fc4 100644 --- a/mail/mail-session.h +++ b/mail/mail-session.h @@ -33,7 +33,8 @@ extern "C" { #endif /* __cplusplus */ void mail_session_init (void); -void mail_session_enable_interaction (gboolean enable); +gboolean mail_session_get_interactive (void); +void mail_session_set_interactive (gboolean interactive); char *mail_session_request_dialog (const char *prompt, gboolean secret, const char *key, gboolean async); gboolean mail_session_accept_dialog (const char *prompt, const char *key, diff --git a/mail/message-list.c b/mail/message-list.c index ab2e95a0b0..0899c0071c 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -1,16 +1,28 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* - * message-list.c: Displays the messages. - * Implements CORBA's Evolution::MessageList + * Authors: Miguel de Icaza (miguel@ximian.com) + * Bertrand Guiheneuf (bg@aful.org) + * And just about everyone else in evolution ... * - * Author: - * Miguel de Icaza (miguel@ximian.com) - * Bertrand Guiheneuf (bg@aful.org) - * And just about everyone else in evolution ... + * Copyright 2000-2002 Ximian, Inc. (www.ximian.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. * - * (C) 2000 Ximian, Inc. */ + #ifdef HAVE_CONFIG_H #include <config.h> #endif @@ -429,6 +441,7 @@ search_func (ETreeModel *model, ETreePath path, struct search_func_data *data) return FALSE; } + /** * message_list_select: * @message_list: a MessageList @@ -1268,13 +1281,13 @@ message_list_destroy (GtkObject *object) gtk_object_unref (GTK_OBJECT (message_list->extras)); gtk_object_unref (GTK_OBJECT (message_list->model)); - + if (message_list->idle_id != 0) g_source_remove (message_list->idle_id); if (message_list->seen_id) gtk_timeout_remove (message_list->seen_id); - + if (message_list->hidden) { g_hash_table_destroy(message_list->hidden); e_mempool_destroy(message_list->hidden_pool); |