Re: [Evolution] Suspending/resuming

There is no such command line option (in any version!).

Though you could probably write a very small program which triggers it.
Or a fairly trivial patch which adds the command line option.

The shell interface can be retrieved using bonobo-activation, and it has
a simple method which should do it (although as with any shell methods,
what they appear they should do, and what they will do aren't always in

e.g. something like this might work (haven't tried compiling it, I leave
it as exercise to reader to get it to compile and/or even work).
Although it will start evolution if it isn't already running which is
probably an undesirable side-effect - solve that yourself too.

#include <stdio.h>
#include <string.h>

#include <libbonobo.h>

/* could just compile the idl separately, no need for shell */
#include "shell/Evolution.h"

int main(int argc, char **argv)
        int state = 1, i;
        GNOME_Evolution_Shell shell;

        bonobo_init(&argc, argv);

        for (i=1;i<argc;i++) {
                if (!strcmp(argv[i], "--offline"))
                        state = 0;
                else if (!strcmp(argv[i], "--offline"))
                        state = 1;

        /* version might need changing to suit evolution version */
        shell =
0, NULL, &ev);
        if (ev._major != CORBA_NO_EXCEPTION) {
                printf("Cannot activate shell\n");
                return 1;

        GNOME_Evolution_Shell_setLineStatus(shell, state, &ev);
        if (ev._major != CORBA_NO_EXCEPTION) {
                printf("Cannot set line state\n");
                return 1;

        return 0;

On Thu, 2005-08-04 at 18:38 +0200, Koen Vermeer wrote:
Hi Harish,

On Thu, 2005-08-04 at 20:42 +0530, Harish Krishnaswamy wrote:
 Which version of evolution are you using ?

Sorry, I didn't mention that explicitly. It's 2.2.3.

there isn't any desktop-wide standard yet on how an application might 
know if the network has gone down (as a whole) or if it is just its
connection with a given server that is somehow in trouble.

I know, but I could think of ways to handle that, such as trying again
after a timeout. I'm not saying that's what Evolution should do, I just
don't know all the internals of Evolution.

You could have evolution go offline by clicking on the 'network icon' on
the bottom left of your application window - so it explicitly drops the
connections.  You may observe that depending on your settings, evolution
takes some time to download content for offline use and
hence might not go offline instantly.

I know about the offline mode, which is what I use sometimes as well.
But if I know I'll be online after the next resume, I'd rather not do
that. Besides, hibernating/suspending the computer should be done by
just a press on the right key. Otherwise, I'll end up shutting down all
the programs manually first, and then suspending :-)
So, I was just wondering if maybe there is a command-line interface to
Evolution that would take care of it. Some option to cause Evo to
reconnect (or go offline) or something like that.


evolution maillist  -  evolution lists ximian com
adfa(evolution-2.4:20087): gtkhtml-WARNING **: cannot find icon:
'stock_insert-url' in gnome 

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]