aboutsummaryrefslogtreecommitdiffstats
path: root/shell/main.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-11-26 23:25:08 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-11-26 23:28:31 +0800
commitaa3152a2ec7b38232d71b32d085958e899cdc7c5 (patch)
treede50f0dd73d001b5a05724a80b6342be2be7d12e /shell/main.c
parent00e1de6f7d333da5177548cc45be669b1e4e2195 (diff)
downloadgsoc2013-evolution-aa3152a2ec7b38232d71b32d085958e899cdc7c5.tar
gsoc2013-evolution-aa3152a2ec7b38232d71b32d085958e899cdc7c5.tar.gz
gsoc2013-evolution-aa3152a2ec7b38232d71b32d085958e899cdc7c5.tar.bz2
gsoc2013-evolution-aa3152a2ec7b38232d71b32d085958e899cdc7c5.tar.lz
gsoc2013-evolution-aa3152a2ec7b38232d71b32d085958e899cdc7c5.tar.xz
gsoc2013-evolution-aa3152a2ec7b38232d71b32d085958e899cdc7c5.tar.zst
gsoc2013-evolution-aa3152a2ec7b38232d71b32d085958e899cdc7c5.zip
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.
Diffstat (limited to 'shell/main.c')
-rw-r--r--shell/main.c8
1 files changed, 6 insertions, 2 deletions
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 }
};