? listb.txt
? backend/.deps
? comics/.deps
? comics/Makefile
? comics/Makefile.in
? cut-n-paste/recent-files/.deps
? cut-n-paste/toolbar-editor/.deps
? cut-n-paste/zoom-control/.deps
? djvu/.deps
? dvi/.deps
? dvi/mdvi-lib/.deps
? lib/.deps
? pdf/.deps
? pixbuf/.deps
? po/stamp-it
? properties/.deps
? ps/.deps
? ps/.ps-document.c.swp
? shell/.deps
? thumbnailer/.deps
? tiff/.deps
Index: shell/ev-application.c
===================================================================
RCS file: /cvs/gnome/evince/shell/ev-application.c,v
retrieving revision 1.30
diff -u -p -r1.30 ev-application.c
--- shell/ev-application.c	12 Feb 2006 18:26:25 -0000	1.30
+++ shell/ev-application.c	12 Feb 2006 19:24:01 -0000
@@ -38,6 +38,8 @@
 #include <gtk/gtkmain.h>
 #include <libgnomeui/gnome-client.h>
 #include <string.h>
+#include <libgnomevfs/gnome-vfs.h>
+#include <libgnomevfs/gnome-vfs-mime-utils.h>
 
 #ifdef ENABLE_DBUS
 #include "ev-application-service.h"
@@ -236,6 +238,40 @@ ev_application_get_uri_window (EvApplica
 	return uri_window;
 }
 
+
+/*
+ * Bug #320868 : tell the user if can't find gs
+ */
+static gboolean
+check_for_gs (EvWindow *ev_window, const char *uri)
+{
+	char *mime_type = gnome_vfs_get_mime_type(uri);
+	
+	if (mime_type)
+		{
+			if (strcmp(mime_type,"application/postscript") == 0  && !g_file_test (GS_PATH,G_FILE_TEST_IS_EXECUTABLE))
+				{
+					GString *title = g_string_new("");
+					GtkWidget*  dialog;
+					
+					g_string_printf(title,gettext("Unable to execute %s.\nGhostscript must be installed in order to read %s."), GS_PATH, uri);
+					dialog = gtk_message_dialog_new(GTK_WINDOW(ev_window),
+									GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+									GTK_MESSAGE_ERROR,
+									GTK_BUTTONS_OK,
+									title->str);
+					gtk_widget_show (GTK_WIDGET (ev_window));
+					gtk_dialog_run(GTK_DIALOG(dialog));
+					gtk_widget_destroy(dialog);
+					g_string_free(title,TRUE);
+					return FALSE;
+				}
+			
+		}
+	return TRUE;
+}
+
+
 gboolean
 ev_application_open_uri (EvApplication  *application,
 			 const char     *uri,
@@ -244,7 +280,6 @@ ev_application_open_uri (EvApplication  
 			 GError        **error)
 {
 	EvWindow *new_window;
-
 	g_return_val_if_fail (uri != NULL, FALSE);
 
 	new_window = ev_application_get_uri_window (application, uri);
@@ -263,23 +298,30 @@ ev_application_open_uri (EvApplication  
 	if (new_window == NULL) {
 		new_window = EV_WINDOW (ev_window_new ());
 	}
+	if (check_for_gs(new_window,uri))
+	  {
 
-	/* We need to load uri before showing the window, so
-	   we can restore window size without flickering */	
-	ev_window_open_uri (new_window, uri);
-
-	gtk_widget_show (GTK_WIDGET (new_window));
-
+	    /* We need to load uri before showing the window, so
+	       we can restore window size without flickering */	
+	    ev_window_open_uri (new_window, uri);
+	    
+	    gtk_widget_show (GTK_WIDGET (new_window));
+	    
 #ifdef HAVE_GTK_WINDOW_PRESENT_WITH_TIME
-	gtk_window_present_with_time (GTK_WINDOW (new_window),
-				      timestamp);
+	    gtk_window_present_with_time (GTK_WINDOW (new_window),
+					  timestamp);
 #else
-	gtk_window_present (GTK_WINDOW (new_window));
+	    gtk_window_present (GTK_WINDOW (new_window));
 #endif
-
-	if (page_label != NULL) {
-		ev_window_open_page_label (new_window, page_label);
-	}
+	    
+	    if (page_label != NULL) {
+	      ev_window_open_page_label (new_window, page_label);
+	    }
+	  }
+	else
+	  {
+	    return FALSE;
+	  }
 
 	return TRUE;
 }
