From 2d442d4842e21c45959ed73a5d9ee3896a2ada08 Mon Sep 17 00:00:00 2001 From: Manish Singh Date: Mon, 8 Dec 1997 10:36:19 +0000 Subject: [PATCH] Added Nathan Summers fix for the about dialog (and put my name in the credits :) ) Added Michael Natterer's escaped menu accelerator fix Added Andy Thomas's active_tool NULL check for undo --- ChangeLog | 11 ++++ app/about_dialog.c | 107 +++++++++++++++------------------ app/core/gimpimage-undo-push.c | 8 +++ app/dialogs/about-dialog.c | 107 +++++++++++++++------------------ app/gui/about-dialog.c | 107 +++++++++++++++------------------ app/gui/menus.c | 14 ++++- app/menus.c | 14 ++++- app/menus/menus.c | 14 ++++- app/undo.c | 8 +++ app/widgets/gimpitemfactory.c | 14 ++++- 10 files changed, 229 insertions(+), 175 deletions(-) diff --git a/ChangeLog b/ChangeLog index 25b1e356af..45f7973d48 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +Mon Dec 8 02:13:36 PST 1997 Manish Singh + + * app/about_dialog.c: Added Nathan Summers patch to make it + work better + + * app/menus.c: Added Michael Natterer's patch to save menu + accelerators with chars that need to be escaped properly + + * app/undo.c: Added Andy Thomas's patch to check for a NULL + active_tool in the undo (so it can work with plugins) + Sun Dec 7 17:05:32 PST 1997 Manish Singh * added Sven Neumann's patch to the scale and resize dialogs for ratio input fields (app/resize.h, app/resize.c) diff --git a/app/about_dialog.c b/app/about_dialog.c index 61fbb8c9a8..4af16b767f 100644 --- a/app/about_dialog.c +++ b/app/about_dialog.c @@ -6,13 +6,12 @@ #include "interface.h" #define ANIMATION_STEPS 16 - +#define ANIMATION_SIZE 2 static int about_dialog_load_logo (GtkWidget *window); static void about_dialog_destroy (void); static void about_dialog_unmap (void); static int about_dialog_logo_expose (GtkWidget *widget, GdkEventExpose *event); -static int about_dialog_scroll_expose (GtkWidget *widget, GdkEventExpose *event); static int about_dialog_button (GtkWidget *widget, GdkEventButton *event); static int about_dialog_timer (gpointer data); @@ -79,6 +78,7 @@ static char *scroll_text[] = "James Robinson", "Mike Schaeffer", "Tracy Scott", + "Manish Singh", "Eiichi Takamori", "Tristan Tarrant", "Owen Taylor", @@ -98,7 +98,7 @@ about_dialog_create (int timeout) { GtkStyle *style; GtkWidget *vbox; - GtkWidget *frame; + GtkWidget *aboutframe; GtkWidget *label; GtkWidget *alignment; gint max_width; @@ -132,18 +132,18 @@ about_dialog_create (int timeout) gtk_container_add (GTK_CONTAINER (about_dialog), vbox); gtk_widget_show (vbox); - frame = gtk_frame_new (NULL); - gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); - gtk_container_border_width (GTK_CONTAINER (frame), 0); - gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0); - gtk_widget_show (frame); + aboutframe = gtk_frame_new (NULL); + gtk_frame_set_shadow_type (GTK_FRAME (aboutframe), GTK_SHADOW_IN); + gtk_container_border_width (GTK_CONTAINER (aboutframe), 0); + gtk_box_pack_start (GTK_BOX (vbox), aboutframe, TRUE, TRUE, 0); + gtk_widget_show (aboutframe); logo_area = gtk_drawing_area_new (); gtk_signal_connect (GTK_OBJECT (logo_area), "expose_event", (GtkSignalFunc) about_dialog_logo_expose, NULL); gtk_drawing_area_size (GTK_DRAWING_AREA (logo_area), logo_width, logo_height); gtk_widget_set_events (logo_area, GDK_EXPOSURE_MASK); - gtk_container_add (GTK_CONTAINER (frame), logo_area); + gtk_container_add (GTK_CONTAINER (aboutframe), logo_area); gtk_widget_show (logo_area); gtk_widget_realize (logo_area); @@ -170,28 +170,26 @@ about_dialog_create (int timeout) gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, TRUE, 0); gtk_widget_show (alignment); - frame = gtk_frame_new (NULL); - gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); - gtk_container_border_width (GTK_CONTAINER (frame), 0); - gtk_container_add (GTK_CONTAINER (alignment), frame); - gtk_widget_show (frame); + aboutframe = gtk_frame_new (NULL); + gtk_frame_set_shadow_type (GTK_FRAME (aboutframe), GTK_SHADOW_IN); + gtk_container_border_width (GTK_CONTAINER (aboutframe), 0); + gtk_container_add (GTK_CONTAINER (alignment), aboutframe); + gtk_widget_show (aboutframe); max_width = 0; for (i = 0; i < nscroll_texts; i++) { - scroll_text_widths[i] = gdk_string_width (frame->style->font, scroll_text[i]); + scroll_text_widths[i] = gdk_string_width (aboutframe->style->font, scroll_text[i]); max_width = MAX (max_width, scroll_text_widths[i]); } scroll_area = gtk_drawing_area_new (); - gtk_signal_connect (GTK_OBJECT (scroll_area), "expose_event", - (GtkSignalFunc) about_dialog_scroll_expose, NULL); gtk_drawing_area_size (GTK_DRAWING_AREA (scroll_area), max_width + 10, - frame->style->font->ascent + - frame->style->font->descent); - gtk_widget_set_events (scroll_area, GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK); - gtk_container_add (GTK_CONTAINER (frame), scroll_area); + aboutframe->style->font->ascent + + aboutframe->style->font->descent); + gtk_widget_set_events (scroll_area, GDK_BUTTON_PRESS_MASK); + gtk_container_add (GTK_CONTAINER (aboutframe), scroll_area); gtk_widget_show (scroll_area); gtk_widget_realize (scroll_area); @@ -300,8 +298,8 @@ about_dialog_load_logo (GtkWidget *window) fclose (fp); - dissolve_width = logo_width / 2; - dissolve_height = logo_height / 2; + dissolve_width = (logo_width / ANIMATION_SIZE)+(logo_width % ANIMATION_SIZE ==0 ?0 : 1); + dissolve_height = (logo_height / ANIMATION_SIZE)+(logo_height % ANIMATION_SIZE ==0 ?0 : 1); dissolve_map = g_new (guchar, dissolve_width * dissolve_height); @@ -363,21 +361,6 @@ about_dialog_logo_expose (GtkWidget *widget, return FALSE; } -static int -about_dialog_scroll_expose (GtkWidget *widget, - GdkEventExpose *event) -{ - if (!scroll_pixmap) - scroll_pixmap = gdk_pixmap_new (widget->window, - widget->allocation.width, - widget->allocation.height, - -1); - - gdk_window_clear (scroll_area->window); - - return FALSE; -} - static int about_dialog_button (GtkWidget *widget, GdkEventButton *event) @@ -402,33 +385,43 @@ about_dialog_timer (gpointer data) if (do_animation) { - for (i = 0, k = 0; i < dissolve_height; i++) - for (j = 0; j < dissolve_width; j++, k++) - if (frame == dissolve_map[k]) - { - gdk_draw_pixmap (logo_area->window, - logo_area->style->black_gc, - logo_pixmap, - j * 2, i * 2, j * 2, i * 2, - 2, 2); - } - - frame += 1; - - if (frame == ANIMATION_STEPS) + if(logo_area->allocation.width != 1) { - do_animation = FALSE; - do_scrolling = TRUE; - frame = 0; + for (i = 0, k = 0; i < dissolve_height; i++) + for (j = 0; j < dissolve_width; j++, k++) + if (frame >= dissolve_map[k]) + { + gdk_draw_pixmap (logo_area->window, + logo_area->style->black_gc, + logo_pixmap, + j * ANIMATION_SIZE, i * ANIMATION_SIZE, j * ANIMATION_SIZE, i * ANIMATION_SIZE, + ANIMATION_SIZE, ANIMATION_SIZE); + } - timer = gtk_timeout_add (75, about_dialog_timer, NULL); + frame += 1; - return FALSE; + if (frame == ANIMATION_STEPS) + { + do_animation = FALSE; + do_scrolling = TRUE; + frame = 0; + + timer = gtk_timeout_add (75, about_dialog_timer, NULL); + + return FALSE; + } } } if (do_scrolling) { + if (!scroll_pixmap) + scroll_pixmap = gdk_pixmap_new (scroll_area->window, + scroll_area->allocation.width, + scroll_area->allocation.height, + -1); + + switch (scroll_state) { case 1: diff --git a/app/core/gimpimage-undo-push.c b/app/core/gimpimage-undo-push.c index daf0bd9d02..0a2234aca9 100644 --- a/app/core/gimpimage-undo-push.c +++ b/app/core/gimpimage-undo-push.c @@ -865,6 +865,10 @@ undo_pop_transform (GImage *gimage, double d; int i; + /* Can't have ANY tool selected - maybe a plugin running */ + if (active_tool == NULL) + return TRUE; + tc = (TransformCore *) active_tool->private; tu = (TransformUndo *) tu_ptr; @@ -952,6 +956,10 @@ undo_pop_paint (GImage *gimage, PaintUndo * pu; double tmp; + /* Can't have ANY tool selected - maybe a plugin running */ + if (active_tool == NULL) + return TRUE; + pc = (PaintCore *) active_tool->private; pu = (PaintUndo *) pu_ptr; diff --git a/app/dialogs/about-dialog.c b/app/dialogs/about-dialog.c index 61fbb8c9a8..4af16b767f 100644 --- a/app/dialogs/about-dialog.c +++ b/app/dialogs/about-dialog.c @@ -6,13 +6,12 @@ #include "interface.h" #define ANIMATION_STEPS 16 - +#define ANIMATION_SIZE 2 static int about_dialog_load_logo (GtkWidget *window); static void about_dialog_destroy (void); static void about_dialog_unmap (void); static int about_dialog_logo_expose (GtkWidget *widget, GdkEventExpose *event); -static int about_dialog_scroll_expose (GtkWidget *widget, GdkEventExpose *event); static int about_dialog_button (GtkWidget *widget, GdkEventButton *event); static int about_dialog_timer (gpointer data); @@ -79,6 +78,7 @@ static char *scroll_text[] = "James Robinson", "Mike Schaeffer", "Tracy Scott", + "Manish Singh", "Eiichi Takamori", "Tristan Tarrant", "Owen Taylor", @@ -98,7 +98,7 @@ about_dialog_create (int timeout) { GtkStyle *style; GtkWidget *vbox; - GtkWidget *frame; + GtkWidget *aboutframe; GtkWidget *label; GtkWidget *alignment; gint max_width; @@ -132,18 +132,18 @@ about_dialog_create (int timeout) gtk_container_add (GTK_CONTAINER (about_dialog), vbox); gtk_widget_show (vbox); - frame = gtk_frame_new (NULL); - gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); - gtk_container_border_width (GTK_CONTAINER (frame), 0); - gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0); - gtk_widget_show (frame); + aboutframe = gtk_frame_new (NULL); + gtk_frame_set_shadow_type (GTK_FRAME (aboutframe), GTK_SHADOW_IN); + gtk_container_border_width (GTK_CONTAINER (aboutframe), 0); + gtk_box_pack_start (GTK_BOX (vbox), aboutframe, TRUE, TRUE, 0); + gtk_widget_show (aboutframe); logo_area = gtk_drawing_area_new (); gtk_signal_connect (GTK_OBJECT (logo_area), "expose_event", (GtkSignalFunc) about_dialog_logo_expose, NULL); gtk_drawing_area_size (GTK_DRAWING_AREA (logo_area), logo_width, logo_height); gtk_widget_set_events (logo_area, GDK_EXPOSURE_MASK); - gtk_container_add (GTK_CONTAINER (frame), logo_area); + gtk_container_add (GTK_CONTAINER (aboutframe), logo_area); gtk_widget_show (logo_area); gtk_widget_realize (logo_area); @@ -170,28 +170,26 @@ about_dialog_create (int timeout) gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, TRUE, 0); gtk_widget_show (alignment); - frame = gtk_frame_new (NULL); - gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); - gtk_container_border_width (GTK_CONTAINER (frame), 0); - gtk_container_add (GTK_CONTAINER (alignment), frame); - gtk_widget_show (frame); + aboutframe = gtk_frame_new (NULL); + gtk_frame_set_shadow_type (GTK_FRAME (aboutframe), GTK_SHADOW_IN); + gtk_container_border_width (GTK_CONTAINER (aboutframe), 0); + gtk_container_add (GTK_CONTAINER (alignment), aboutframe); + gtk_widget_show (aboutframe); max_width = 0; for (i = 0; i < nscroll_texts; i++) { - scroll_text_widths[i] = gdk_string_width (frame->style->font, scroll_text[i]); + scroll_text_widths[i] = gdk_string_width (aboutframe->style->font, scroll_text[i]); max_width = MAX (max_width, scroll_text_widths[i]); } scroll_area = gtk_drawing_area_new (); - gtk_signal_connect (GTK_OBJECT (scroll_area), "expose_event", - (GtkSignalFunc) about_dialog_scroll_expose, NULL); gtk_drawing_area_size (GTK_DRAWING_AREA (scroll_area), max_width + 10, - frame->style->font->ascent + - frame->style->font->descent); - gtk_widget_set_events (scroll_area, GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK); - gtk_container_add (GTK_CONTAINER (frame), scroll_area); + aboutframe->style->font->ascent + + aboutframe->style->font->descent); + gtk_widget_set_events (scroll_area, GDK_BUTTON_PRESS_MASK); + gtk_container_add (GTK_CONTAINER (aboutframe), scroll_area); gtk_widget_show (scroll_area); gtk_widget_realize (scroll_area); @@ -300,8 +298,8 @@ about_dialog_load_logo (GtkWidget *window) fclose (fp); - dissolve_width = logo_width / 2; - dissolve_height = logo_height / 2; + dissolve_width = (logo_width / ANIMATION_SIZE)+(logo_width % ANIMATION_SIZE ==0 ?0 : 1); + dissolve_height = (logo_height / ANIMATION_SIZE)+(logo_height % ANIMATION_SIZE ==0 ?0 : 1); dissolve_map = g_new (guchar, dissolve_width * dissolve_height); @@ -363,21 +361,6 @@ about_dialog_logo_expose (GtkWidget *widget, return FALSE; } -static int -about_dialog_scroll_expose (GtkWidget *widget, - GdkEventExpose *event) -{ - if (!scroll_pixmap) - scroll_pixmap = gdk_pixmap_new (widget->window, - widget->allocation.width, - widget->allocation.height, - -1); - - gdk_window_clear (scroll_area->window); - - return FALSE; -} - static int about_dialog_button (GtkWidget *widget, GdkEventButton *event) @@ -402,33 +385,43 @@ about_dialog_timer (gpointer data) if (do_animation) { - for (i = 0, k = 0; i < dissolve_height; i++) - for (j = 0; j < dissolve_width; j++, k++) - if (frame == dissolve_map[k]) - { - gdk_draw_pixmap (logo_area->window, - logo_area->style->black_gc, - logo_pixmap, - j * 2, i * 2, j * 2, i * 2, - 2, 2); - } - - frame += 1; - - if (frame == ANIMATION_STEPS) + if(logo_area->allocation.width != 1) { - do_animation = FALSE; - do_scrolling = TRUE; - frame = 0; + for (i = 0, k = 0; i < dissolve_height; i++) + for (j = 0; j < dissolve_width; j++, k++) + if (frame >= dissolve_map[k]) + { + gdk_draw_pixmap (logo_area->window, + logo_area->style->black_gc, + logo_pixmap, + j * ANIMATION_SIZE, i * ANIMATION_SIZE, j * ANIMATION_SIZE, i * ANIMATION_SIZE, + ANIMATION_SIZE, ANIMATION_SIZE); + } - timer = gtk_timeout_add (75, about_dialog_timer, NULL); + frame += 1; - return FALSE; + if (frame == ANIMATION_STEPS) + { + do_animation = FALSE; + do_scrolling = TRUE; + frame = 0; + + timer = gtk_timeout_add (75, about_dialog_timer, NULL); + + return FALSE; + } } } if (do_scrolling) { + if (!scroll_pixmap) + scroll_pixmap = gdk_pixmap_new (scroll_area->window, + scroll_area->allocation.width, + scroll_area->allocation.height, + -1); + + switch (scroll_state) { case 1: diff --git a/app/gui/about-dialog.c b/app/gui/about-dialog.c index 61fbb8c9a8..4af16b767f 100644 --- a/app/gui/about-dialog.c +++ b/app/gui/about-dialog.c @@ -6,13 +6,12 @@ #include "interface.h" #define ANIMATION_STEPS 16 - +#define ANIMATION_SIZE 2 static int about_dialog_load_logo (GtkWidget *window); static void about_dialog_destroy (void); static void about_dialog_unmap (void); static int about_dialog_logo_expose (GtkWidget *widget, GdkEventExpose *event); -static int about_dialog_scroll_expose (GtkWidget *widget, GdkEventExpose *event); static int about_dialog_button (GtkWidget *widget, GdkEventButton *event); static int about_dialog_timer (gpointer data); @@ -79,6 +78,7 @@ static char *scroll_text[] = "James Robinson", "Mike Schaeffer", "Tracy Scott", + "Manish Singh", "Eiichi Takamori", "Tristan Tarrant", "Owen Taylor", @@ -98,7 +98,7 @@ about_dialog_create (int timeout) { GtkStyle *style; GtkWidget *vbox; - GtkWidget *frame; + GtkWidget *aboutframe; GtkWidget *label; GtkWidget *alignment; gint max_width; @@ -132,18 +132,18 @@ about_dialog_create (int timeout) gtk_container_add (GTK_CONTAINER (about_dialog), vbox); gtk_widget_show (vbox); - frame = gtk_frame_new (NULL); - gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); - gtk_container_border_width (GTK_CONTAINER (frame), 0); - gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0); - gtk_widget_show (frame); + aboutframe = gtk_frame_new (NULL); + gtk_frame_set_shadow_type (GTK_FRAME (aboutframe), GTK_SHADOW_IN); + gtk_container_border_width (GTK_CONTAINER (aboutframe), 0); + gtk_box_pack_start (GTK_BOX (vbox), aboutframe, TRUE, TRUE, 0); + gtk_widget_show (aboutframe); logo_area = gtk_drawing_area_new (); gtk_signal_connect (GTK_OBJECT (logo_area), "expose_event", (GtkSignalFunc) about_dialog_logo_expose, NULL); gtk_drawing_area_size (GTK_DRAWING_AREA (logo_area), logo_width, logo_height); gtk_widget_set_events (logo_area, GDK_EXPOSURE_MASK); - gtk_container_add (GTK_CONTAINER (frame), logo_area); + gtk_container_add (GTK_CONTAINER (aboutframe), logo_area); gtk_widget_show (logo_area); gtk_widget_realize (logo_area); @@ -170,28 +170,26 @@ about_dialog_create (int timeout) gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, TRUE, 0); gtk_widget_show (alignment); - frame = gtk_frame_new (NULL); - gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); - gtk_container_border_width (GTK_CONTAINER (frame), 0); - gtk_container_add (GTK_CONTAINER (alignment), frame); - gtk_widget_show (frame); + aboutframe = gtk_frame_new (NULL); + gtk_frame_set_shadow_type (GTK_FRAME (aboutframe), GTK_SHADOW_IN); + gtk_container_border_width (GTK_CONTAINER (aboutframe), 0); + gtk_container_add (GTK_CONTAINER (alignment), aboutframe); + gtk_widget_show (aboutframe); max_width = 0; for (i = 0; i < nscroll_texts; i++) { - scroll_text_widths[i] = gdk_string_width (frame->style->font, scroll_text[i]); + scroll_text_widths[i] = gdk_string_width (aboutframe->style->font, scroll_text[i]); max_width = MAX (max_width, scroll_text_widths[i]); } scroll_area = gtk_drawing_area_new (); - gtk_signal_connect (GTK_OBJECT (scroll_area), "expose_event", - (GtkSignalFunc) about_dialog_scroll_expose, NULL); gtk_drawing_area_size (GTK_DRAWING_AREA (scroll_area), max_width + 10, - frame->style->font->ascent + - frame->style->font->descent); - gtk_widget_set_events (scroll_area, GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK); - gtk_container_add (GTK_CONTAINER (frame), scroll_area); + aboutframe->style->font->ascent + + aboutframe->style->font->descent); + gtk_widget_set_events (scroll_area, GDK_BUTTON_PRESS_MASK); + gtk_container_add (GTK_CONTAINER (aboutframe), scroll_area); gtk_widget_show (scroll_area); gtk_widget_realize (scroll_area); @@ -300,8 +298,8 @@ about_dialog_load_logo (GtkWidget *window) fclose (fp); - dissolve_width = logo_width / 2; - dissolve_height = logo_height / 2; + dissolve_width = (logo_width / ANIMATION_SIZE)+(logo_width % ANIMATION_SIZE ==0 ?0 : 1); + dissolve_height = (logo_height / ANIMATION_SIZE)+(logo_height % ANIMATION_SIZE ==0 ?0 : 1); dissolve_map = g_new (guchar, dissolve_width * dissolve_height); @@ -363,21 +361,6 @@ about_dialog_logo_expose (GtkWidget *widget, return FALSE; } -static int -about_dialog_scroll_expose (GtkWidget *widget, - GdkEventExpose *event) -{ - if (!scroll_pixmap) - scroll_pixmap = gdk_pixmap_new (widget->window, - widget->allocation.width, - widget->allocation.height, - -1); - - gdk_window_clear (scroll_area->window); - - return FALSE; -} - static int about_dialog_button (GtkWidget *widget, GdkEventButton *event) @@ -402,33 +385,43 @@ about_dialog_timer (gpointer data) if (do_animation) { - for (i = 0, k = 0; i < dissolve_height; i++) - for (j = 0; j < dissolve_width; j++, k++) - if (frame == dissolve_map[k]) - { - gdk_draw_pixmap (logo_area->window, - logo_area->style->black_gc, - logo_pixmap, - j * 2, i * 2, j * 2, i * 2, - 2, 2); - } - - frame += 1; - - if (frame == ANIMATION_STEPS) + if(logo_area->allocation.width != 1) { - do_animation = FALSE; - do_scrolling = TRUE; - frame = 0; + for (i = 0, k = 0; i < dissolve_height; i++) + for (j = 0; j < dissolve_width; j++, k++) + if (frame >= dissolve_map[k]) + { + gdk_draw_pixmap (logo_area->window, + logo_area->style->black_gc, + logo_pixmap, + j * ANIMATION_SIZE, i * ANIMATION_SIZE, j * ANIMATION_SIZE, i * ANIMATION_SIZE, + ANIMATION_SIZE, ANIMATION_SIZE); + } - timer = gtk_timeout_add (75, about_dialog_timer, NULL); + frame += 1; - return FALSE; + if (frame == ANIMATION_STEPS) + { + do_animation = FALSE; + do_scrolling = TRUE; + frame = 0; + + timer = gtk_timeout_add (75, about_dialog_timer, NULL); + + return FALSE; + } } } if (do_scrolling) { + if (!scroll_pixmap) + scroll_pixmap = gdk_pixmap_new (scroll_area->window, + scroll_area->allocation.width, + scroll_area->allocation.height, + -1); + + switch (scroll_state) { case 1: diff --git a/app/gui/menus.c b/app/gui/menus.c index 6f01953636..ef912904d1 100644 --- a/app/gui/menus.c +++ b/app/gui/menus.c @@ -415,7 +415,19 @@ menus_foreach (gpointer key, gpointer value, gpointer user_data) { - fprintf ((FILE*) user_data, "(menu-path \"%s\" \"%s\")\n", (char*) key, (char*) value); + char accel[64]; + int i, j; + + for (i = j = 0; ((char*) value)[i] != '\0'; i++, j++) + { + if (((char *) value)[i] == '"' || ((char *) value)[i] == '\\') + accel[j++] = '\\'; + accel[j] = ((char *) value)[i]; + } + + accel[j] = '\0'; + + fprintf ((FILE*) user_data, "(menu-path \"%s\" \"%s\")\n", (char*) key, accel); } static gint diff --git a/app/menus.c b/app/menus.c index 6f01953636..ef912904d1 100644 --- a/app/menus.c +++ b/app/menus.c @@ -415,7 +415,19 @@ menus_foreach (gpointer key, gpointer value, gpointer user_data) { - fprintf ((FILE*) user_data, "(menu-path \"%s\" \"%s\")\n", (char*) key, (char*) value); + char accel[64]; + int i, j; + + for (i = j = 0; ((char*) value)[i] != '\0'; i++, j++) + { + if (((char *) value)[i] == '"' || ((char *) value)[i] == '\\') + accel[j++] = '\\'; + accel[j] = ((char *) value)[i]; + } + + accel[j] = '\0'; + + fprintf ((FILE*) user_data, "(menu-path \"%s\" \"%s\")\n", (char*) key, accel); } static gint diff --git a/app/menus/menus.c b/app/menus/menus.c index 6f01953636..ef912904d1 100644 --- a/app/menus/menus.c +++ b/app/menus/menus.c @@ -415,7 +415,19 @@ menus_foreach (gpointer key, gpointer value, gpointer user_data) { - fprintf ((FILE*) user_data, "(menu-path \"%s\" \"%s\")\n", (char*) key, (char*) value); + char accel[64]; + int i, j; + + for (i = j = 0; ((char*) value)[i] != '\0'; i++, j++) + { + if (((char *) value)[i] == '"' || ((char *) value)[i] == '\\') + accel[j++] = '\\'; + accel[j] = ((char *) value)[i]; + } + + accel[j] = '\0'; + + fprintf ((FILE*) user_data, "(menu-path \"%s\" \"%s\")\n", (char*) key, accel); } static gint diff --git a/app/undo.c b/app/undo.c index daf0bd9d02..0a2234aca9 100644 --- a/app/undo.c +++ b/app/undo.c @@ -865,6 +865,10 @@ undo_pop_transform (GImage *gimage, double d; int i; + /* Can't have ANY tool selected - maybe a plugin running */ + if (active_tool == NULL) + return TRUE; + tc = (TransformCore *) active_tool->private; tu = (TransformUndo *) tu_ptr; @@ -952,6 +956,10 @@ undo_pop_paint (GImage *gimage, PaintUndo * pu; double tmp; + /* Can't have ANY tool selected - maybe a plugin running */ + if (active_tool == NULL) + return TRUE; + pc = (PaintCore *) active_tool->private; pu = (PaintUndo *) pu_ptr; diff --git a/app/widgets/gimpitemfactory.c b/app/widgets/gimpitemfactory.c index 6f01953636..ef912904d1 100644 --- a/app/widgets/gimpitemfactory.c +++ b/app/widgets/gimpitemfactory.c @@ -415,7 +415,19 @@ menus_foreach (gpointer key, gpointer value, gpointer user_data) { - fprintf ((FILE*) user_data, "(menu-path \"%s\" \"%s\")\n", (char*) key, (char*) value); + char accel[64]; + int i, j; + + for (i = j = 0; ((char*) value)[i] != '\0'; i++, j++) + { + if (((char *) value)[i] == '"' || ((char *) value)[i] == '\\') + accel[j++] = '\\'; + accel[j] = ((char *) value)[i]; + } + + accel[j] = '\0'; + + fprintf ((FILE*) user_data, "(menu-path \"%s\" \"%s\")\n", (char*) key, accel); } static gint