aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-component.c
diff options
context:
space:
mode:
authorShreyas Srinivasan <sshreyas@novell.com>2005-12-22 10:12:34 +0800
committerShreyas Srinivasan <shres@src.gnome.org>2005-12-22 10:12:34 +0800
commit87a09855fa42b43e11769b39c89336660f3467e7 (patch)
tree8e2880c7b49f68d3e2c4b54101e5731f1a64bab6 /mail/mail-component.c
parent3de1a0bf0ef4a1db6664cb51bfc33eeba0e56c9e (diff)
downloadgsoc2013-evolution-87a09855fa42b43e11769b39c89336660f3467e7.tar.gz
gsoc2013-evolution-87a09855fa42b43e11769b39c89336660f3467e7.tar.zst
gsoc2013-evolution-87a09855fa42b43e11769b39c89336660f3467e7.zip
Evolution is now Network Aware, the day of complete awareness beckons, The
2005-12-22 Shreyas Srinivasan <sshreyas@novell.com> * Evolution is now Network Aware, the day of complete awareness beckons, The machines are taking over... * Network Manager support for evolution svn path=/trunk/; revision=30926
Diffstat (limited to 'mail/mail-component.c')
-rw-r--r--mail/mail-component.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/mail/mail-component.c b/mail/mail-component.c
index 9a0533f338..96285c997a 100644
--- a/mail/mail-component.c
+++ b/mail/mail-component.c
@@ -73,6 +73,7 @@
#include <gtk/gtklabel.h>
#include <e-util/e-mktemp.h>
+#include <Evolution.h>
#include <table/e-tree.h>
#include <table/e-tree-memory.h>
@@ -95,6 +96,9 @@ static void create_local_item_cb(EUserCreatableItemsHandler *handler, const char
#define PARENT_TYPE evolution_component_get_type ()
static BonoboObjectClass *parent_class = NULL;
+#define OFFLINE 0
+#define ONLINE 1
+
struct _store_info {
CamelStore *store;
char *name;
@@ -973,10 +977,36 @@ setline_check(void *key, void *value, void *data)
}
}
+int
+status_check (GNOME_Evolution_ShellState shell_state)
+{
+ int status;
+
+ switch (shell_state)
+ {
+ case GNOME_Evolution_USER_OFFLINE:
+ status = OFFLINE;
+ break;
+ case GNOME_Evolution_FORCED_OFFLINE:
+ /*Network is down so change network state on the camel session*/
+ status = OFFLINE;
+ /* Cancel all operations as they wont happen anyway cos Network is down*/
+ mail_cancel_all ();
+ camel_session_set_network_state (session, FALSE);
+ break;
+ case GNOME_Evolution_USER_ONLINE:
+ camel_session_set_network_state (session, TRUE);
+ status = ONLINE;
+ }
+
+ return status;
+}
+
static void
-impl_setLineStatus(PortableServer_Servant servant, CORBA_boolean status, GNOME_Evolution_Listener listener, CORBA_Environment *ev)
+impl_setLineStatus(PortableServer_Servant servant, GNOME_Evolution_ShellState shell_state, GNOME_Evolution_Listener listener, CORBA_Environment *ev)
{
struct _setline_data *sd;
+ int status = status_check(shell_state);
/* This will dis/enable further auto-mail-check action. */
/* FIXME: If send/receive active, wait for it to finish? */