From aa3152a2ec7b38232d71b32d085958e899cdc7c5 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 26 Nov 2009 10:25:08 -0500 Subject: Add a --quit command-line option. This -asks- an existing Evolution process to quit. It is equivalent to selecting File->Quit in the main window. It does not kill the process. My plan is to use this as part of a new --force-shutdown implementation. --- shell/main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'shell/main.c') diff --git a/shell/main.c b/shell/main.c index e96620ab24..3e3268b673 100644 --- a/shell/main.c +++ b/shell/main.c @@ -87,7 +87,7 @@ static gboolean force_migrate = FALSE; static gboolean disable_eplugin = FALSE; static gboolean disable_preview = FALSE; static gboolean import_uris = FALSE; -static gboolean idle_cb (gchar **uris); +static gboolean quit = FALSE; static gchar *geometry = NULL; static gchar *requested_view = NULL; @@ -237,7 +237,9 @@ idle_cb (gchar **uris) /* These calls do the right thing when another Evolution * process is running. */ - if (uris != NULL && *uris != NULL) { + if (quit) + e_shell_quit (shell); + else if (uris != NULL && *uris != NULL) { if (e_shell_handle_uris (shell, uris, import_uris) == 0) gtk_main_quit (); } else @@ -334,6 +336,8 @@ static GOptionEntry entries[] = { &setup_only, NULL, NULL }, { "import", 'i', 0, G_OPTION_ARG_NONE, &import_uris, N_("Import URIs or file names given as rest of arguments."), NULL }, + { "quit", 'q', 0, G_OPTION_ARG_NONE, &quit, + N_("Request a running Evolution process to quit"), NULL }, { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &remaining_args, NULL, NULL }, { NULL } }; -- cgit v1.2.3