[genius] Thu Oct 28 16:09:42 2010 Jiri (George) Lebl <jirka 5z com>



commit 3a50476a66fa839a27e91dd62dd5d8ad51cee6cc
Author: Jiri (George) Lebl <jirka 5z com>
Date:   Thu Oct 28 16:10:43 2010 -0700

    Thu Oct 28 16:09:42 2010  Jiri (George) Lebl <jirka 5z com>
    
    	* src/graphing.c: Don't run ps2epsi by default, and make it an option
    	  on the export dialog.  ps2epsi can take really really long
    	  sometimes, generate large files, and most of the time I found out
    	  you don't want it anyway.
    
    	* src/eval.c: fix 64 bit build

 ChangeLog      |    9 +++++++++
 src/eval.c     |    4 ++--
 src/graphing.c |   19 ++++++++++++++++++-
 3 files changed, 29 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 8d3ddb5..5653ded 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Thu Oct 28 16:09:42 2010  Jiri (George) Lebl <jirka 5z com>
+
+	* src/graphing.c: Don't run ps2epsi by default, and make it an option
+	  on the export dialog.  ps2epsi can take really really long
+	  sometimes, generate large files, and most of the time I found out
+	  you don't want it anyway.
+	
+	* src/eval.c: fix 64 bit build
+
 Sat Oct 09 12:23:07 2010  Jiri (George) Lebl <jirka 5z com>
 
 	* Makefile.am: apply patch from Dominique Leuenberger
diff --git a/src/eval.c b/src/eval.c
index 7e0e7b3..102acd5 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -270,7 +270,7 @@ gel_find_pre_function_modulo (GelCtx *ctx)
 		stack = stack->next;
 		iter = &(stack->stack[STACK_SIZE]);
 	}
-	while ((int)(*(iter-1)) != GE_FUNCCALL) {
+	while (GPOINTER_TO_INT(*(iter-1)) != GE_FUNCCALL) {
 		last = iter;
 		iter -= 2;
 		if ((gpointer)iter == (gpointer)stack) {
@@ -281,7 +281,7 @@ gel_find_pre_function_modulo (GelCtx *ctx)
 		}
 	}
 
-	if (last == NULL || (int)(*(last-1)) != GE_SETMODULO) {
+	if (last == NULL || GPOINTER_TO_INT(*(last-1)) != GE_SETMODULO) {
 		return NULL;
 	} else {
 		return *(last-2);
diff --git a/src/graphing.c b/src/graphing.c
index 8830ce8..d49936f 100644
--- a/src/graphing.c
+++ b/src/graphing.c
@@ -869,6 +869,8 @@ really_export_cb (GtkFileChooser *fs, int response, gpointer data)
 	char tmpfile[] = "/tmp/genius-ps-XXXXXX";
 	char *file_to_write = NULL;
 	int fd = -1;
+	gboolean run_epsi = FALSE;
+	GtkWidget *w;
 
 	eps = GPOINTER_TO_INT (data);
 
@@ -879,6 +881,13 @@ really_export_cb (GtkFileChooser *fs, int response, gpointer data)
 		return;
 	}
 
+	/* run epsi checkbox */
+	w = gtk_file_chooser_get_extra_widget (GTK_FILE_CHOOSER (fs));
+	if (w != NULL &&
+	    gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w))) {
+		run_epsi = TRUE;
+	}
+
 	s = g_strdup (gtk_file_chooser_get_filename (fs));
 
 	if (s == NULL)
@@ -911,7 +920,7 @@ really_export_cb (GtkFileChooser *fs, int response, gpointer data)
 	gtk_widget_set_sensitive (graph_window, TRUE);
 
 	file_to_write = s;
-	if (eps && ve_is_prog_in_path ("ps2epsi")) {
+	if (eps && run_epsi && ve_is_prog_in_path ("ps2epsi")) {
 		fd = g_mkstemp (tmpfile);
 		/* FIXME: tell about errors ?*/
 		if (fd >= 0) {
@@ -1108,6 +1117,14 @@ do_export_cb (int export_type)
 	gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (fs), filter_all);
 	gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (fs), filter_ps);
 
+	if (ve_is_prog_in_path ("ps2epsi")) {
+		GtkWidget *w;
+		w = gtk_check_button_new_with_label (_("Generate preview in EPS file (with ps2epsi)"));
+		gtk_widget_show (w);
+		gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER (fs), w);
+	}
+
+
 	g_signal_connect (G_OBJECT (fs), "destroy",
 			  G_CALLBACK (gtk_widget_destroyed), &fs);
 	if (export_type == EXPORT_EPS) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]