Index: main.c =================================================================== RCS file: /cvsroot/galeon/galeon/src/Attic/main.c,v retrieving revision 1.173.2.10 diff -u -r1.173.2.10 main.c --- main.c 27 May 2002 00:56:21 -0000 1.173.2.10 +++ main.c 19 Jun 2002 09:35:55 -0000 @@ -87,6 +87,7 @@ gboolean galeon_server_mode = FALSE; gint galeon_server_timeout = -1; gboolean galeon_panel_mode = FALSE; +gboolean new_process = FALSE; gboolean galeon_exiting = FALSE; Galeon_Browser galeon_automation_client = NULL; @@ -161,6 +162,9 @@ { "quit", 'q', POPT_ARG_NONE, &quit_option, 0, N_("Same as --close, but exits server mode too"), NULL }, + { "newprocess", '\0', POPT_ARG_NONE, &new_process, 0, + N_("Forces new process (Could be harmful to your bookmarks, history, ...) - no session saving with this option"), + NULL }, /* terminator, must be last */ { NULL, 0, 0, NULL, 0, NULL, NULL } @@ -468,9 +472,16 @@ /* check if we found one */ if (CORBA_Object_is_nil (client, &corba_env)) { + /* if this is the first process, ignore command-line option + * in order to save prefs and everything + */ + new_process = FALSE; + return FALSE; + } + + if (new_process) { return FALSE; } - /* load the session if requested */ if (session_filename) { @@ -494,7 +505,9 @@ } /* otherwise we'll be opening windows, so warn */ - g_message (_("Galeon already running, using existing process")); + g_message (_("Galeon already running, using existing process\n" + "Use --newprocess option if you want to force a\n" + "new process to be run - with no session saving.")); /* provided with urls? */ if (n_urls == 0) @@ -622,7 +635,8 @@ #endif /* resume a crashed session, if any */ - if (!disable_crash_recovery) session_recovery = session_autoresume (); + if (!disable_crash_recovery && !new_process) + session_recovery = session_autoresume (); else session_recovery = FALSE; /* attach session-manager callbacks */ @@ -780,10 +794,10 @@ mime_db_shutdown (); bookmarks_exit (); history_exit (); - mozilla_save_prefs (); + if (!new_process) mozilla_save_prefs (); favicon_key_files_close (); js_console_exit (); - session_history_save (); + if (!new_process) session_history_save (); /* check... */ g_assert (g_list_length (all_embeds) == 0); @@ -819,7 +833,7 @@ GnomeInteractStyle interact_style, gint fast) { /* save session */ - session_save (); + if (!new_process) session_save (); /* we're done */ return TRUE;