From ee5a0b876a796f762195addeb43ef41e6bdd4013 Mon Sep 17 00:00:00 2001 From: Frederic Peters Date: Sat, 19 Apr 2008 11:18:56 +0000 Subject: Added a --no-connect option. Fixes: #526208. (Frederic Peters) svn path=/trunk/; revision=965 --- src/empathy.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/empathy.c') diff --git a/src/empathy.c b/src/empathy.c index bd76eed13..11eb3c5d7 100644 --- a/src/empathy.c +++ b/src/empathy.c @@ -376,7 +376,15 @@ main (int argc, char *argv[]) EmpathyIdle *idle; EmpathyChandler *chandler; gboolean autoconnect = TRUE; + gboolean no_connect = FALSE; GError *error = NULL; + GOptionEntry options[] = { + { "no-connect", 'n', + 0, G_OPTION_ARG_NONE, &no_connect, + N_("Don't connect on startup"), + NULL }, + { NULL } + }; bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); @@ -386,7 +394,7 @@ main (int argc, char *argv[]) if (!gtk_init_with_args (&argc, &argv, _("- Empathy Instant Messenger"), - NULL, GETTEXT_PACKAGE, &error)) { + options, GETTEXT_PACKAGE, &error)) { empathy_debug (DEBUG_DOMAIN, error->message); return EXIT_FAILURE; } @@ -444,7 +452,7 @@ main (int argc, char *argv[]) empathy_conf_get_bool (empathy_conf_get(), EMPATHY_PREFS_AUTOCONNECT, &autoconnect); - if (autoconnect && + if (autoconnect && ! no_connect && empathy_idle_get_state (idle) <= MC_PRESENCE_OFFLINE) { empathy_idle_set_state (idle, MC_PRESENCE_AVAILABLE); } -- cgit v1.2.3