Index: gnome-panel-screenshot.c
===================================================================
RCS file: /cvs/gnome/gnome-panel/gnome-panel/gnome-panel-screenshot.c,v
retrieving revision 1.27
diff -u -r1.27 gnome-panel-screenshot.c
--- gnome-panel-screenshot.c	18 Apr 2002 09:13:06 -0000	1.27
+++ gnome-panel-screenshot.c	19 Apr 2002 07:48:19 -0000
@@ -92,6 +92,7 @@
 
 /* some local prototypes */
 static gchar * add_file_to_path (const gchar *path);
+gint shot_delay_callback (gpointer data);
 
 
 /* helper functions */
@@ -1004,6 +1005,25 @@
 	start_temporary ();
 }
 
+gint
+shot_delay_callback (gpointer data)
+{
+	gint *seconds_left = (gint *) data;
+
+	(*seconds_left)--;
+	if (!*seconds_left)
+		gtk_main_quit ();
+	return *seconds_left;
+}
+
+static void
+shot_delay (gint delay)
+{
+	gint timeout;
+	
+	timeout = gtk_timeout_add (1000, shot_delay_callback, &delay);
+	gtk_main ();
+}
 
 /* main */
 int
@@ -1016,9 +1036,12 @@
 	struct stat s;
 	gchar *file;
 	gboolean window = FALSE;
-	gint width, height;
+	gint width, height; 
+	guint delay = 0;
+
 	struct poptOption opts[] = {
 		{"window", '\0', POPT_ARG_NONE, &window, 0, N_("Grab a window instead of the entire screen"), NULL},
+		{"delay", '\0', POPT_ARG_INT, &delay, 0, N_("Take screenshot after specified delay [in seconds]"), NULL},
 		{NULL, '\0', 0, NULL, 0, NULL, NULL}
 	};
 
@@ -1036,7 +1059,10 @@
 	glade_gnome_init();
 	client = gnome_master_client ();
 	gnome_client_set_restart_style (client, GNOME_RESTART_NEVER);
-
+	
+	if (delay > 0)
+		shot_delay (delay);
+	
 	if (window)
 		take_window_shot ();
 	else
