From 6639e17c0d536275b52adee134d5c343bdf96252 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Sun, 17 Dec 2000 00:28:32 +0000 Subject: [PATCH] preview the curve settings in the image window when initializing the tool. 2000-12-17 Sven Neumann * app/curves.c: preview the curve settings in the image window when initializing the tool. This way the new curves behaviour (init with last settings) is visible. * app/user_install.c: check that strings are non-NULL before passing them to strcmp. * libgimp/gimpfileselection: do not try to pass a NULL text to gtk_entry_set_text, use an empty string instead. --- ChangeLog | 12 ++++++++++++ app/base/curves.c | 13 +++++++++---- app/curves.c | 13 +++++++++---- app/dialogs/user-install-dialog.c | 3 ++- app/gui/user-install-dialog.c | 3 ++- app/tools/curves.c | 13 +++++++++---- app/tools/gimpcurvestool.c | 13 +++++++++---- app/user_install.c | 3 ++- configure.in | 4 ++-- libgimp/gimpfileselection.c | 2 +- libgimpwidgets/gimpfileentry.c | 2 +- libgimpwidgets/gimpfileselection.c | 2 +- 12 files changed, 59 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2fdbee0006..125e34d839 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2000-12-17 Sven Neumann + + * app/curves.c: preview the curve settings in the image window when + initializing the tool. This way the new curves behaviour (init with + last settings) is visible. + + * app/user_install.c: check that strings are non-NULL before passing + them to strcmp. + + * libgimp/gimpfileselection: do not try to pass a NULL text to + gtk_entry_set_text, use an empty string instead. + 2000-12-16 Sven Neumann * app/gimppreviewcache.h diff --git a/app/base/curves.c b/app/base/curves.c index 335dadfb8c..f9793040f4 100644 --- a/app/base/curves.c +++ b/app/base/curves.c @@ -466,8 +466,8 @@ curves_initialize (GDisplay *gdisp) } } - curves_dialog->drawable = gimage_active_drawable (gdisp->gimage); - curves_dialog->color = drawable_color (curves_dialog->drawable); + curves_dialog->drawable = gimage_active_drawable (gdisp->gimage); + curves_dialog->color = drawable_color (curves_dialog->drawable); curves_dialog->image_map = image_map_create (gdisp, curves_dialog->drawable); /* check for alpha channel */ @@ -488,13 +488,18 @@ curves_initialize (GDisplay *gdisp) gtk_option_menu_set_history (GTK_OPTION_MENU (curves_dialog->channel_menu), curves_dialog->channel); - gimp_lut_setup (curves_dialog->lut, (GimpLutFunc) curves_lut_func, - (void *) curves_dialog, gimp_drawable_bytes (curves_dialog->drawable)); + gimp_lut_setup (curves_dialog->lut, + (GimpLutFunc) curves_lut_func, + (void *) curves_dialog, + gimp_drawable_bytes (curves_dialog->drawable)); if (!GTK_WIDGET_VISIBLE (curves_dialog->shell)) gtk_widget_show (curves_dialog->shell); curves_update (curves_dialog, GRAPH | DRAW); + + if (curves_dialog->preview) + curves_preview (curves_dialog); } void diff --git a/app/curves.c b/app/curves.c index 335dadfb8c..f9793040f4 100644 --- a/app/curves.c +++ b/app/curves.c @@ -466,8 +466,8 @@ curves_initialize (GDisplay *gdisp) } } - curves_dialog->drawable = gimage_active_drawable (gdisp->gimage); - curves_dialog->color = drawable_color (curves_dialog->drawable); + curves_dialog->drawable = gimage_active_drawable (gdisp->gimage); + curves_dialog->color = drawable_color (curves_dialog->drawable); curves_dialog->image_map = image_map_create (gdisp, curves_dialog->drawable); /* check for alpha channel */ @@ -488,13 +488,18 @@ curves_initialize (GDisplay *gdisp) gtk_option_menu_set_history (GTK_OPTION_MENU (curves_dialog->channel_menu), curves_dialog->channel); - gimp_lut_setup (curves_dialog->lut, (GimpLutFunc) curves_lut_func, - (void *) curves_dialog, gimp_drawable_bytes (curves_dialog->drawable)); + gimp_lut_setup (curves_dialog->lut, + (GimpLutFunc) curves_lut_func, + (void *) curves_dialog, + gimp_drawable_bytes (curves_dialog->drawable)); if (!GTK_WIDGET_VISIBLE (curves_dialog->shell)) gtk_widget_show (curves_dialog->shell); curves_update (curves_dialog, GRAPH | DRAW); + + if (curves_dialog->preview) + curves_preview (curves_dialog); } void diff --git a/app/dialogs/user-install-dialog.c b/app/dialogs/user-install-dialog.c index 67d0f208b3..baf1078ad0 100644 --- a/app/dialogs/user-install-dialog.c +++ b/app/dialogs/user-install-dialog.c @@ -1292,7 +1292,8 @@ user_install_resolution_done (void) tile_cache_size = new_tile_cache_size; update = g_list_append (update, "tile-cache-size"); } - if (strcmp (swap_path, new_swap_path)) + if (swap_path && new_swap_path && + strcmp (swap_path, new_swap_path)) { g_free (swap_path); swap_path = new_swap_path; update = g_list_append (update, "swap-path"); diff --git a/app/gui/user-install-dialog.c b/app/gui/user-install-dialog.c index 67d0f208b3..baf1078ad0 100644 --- a/app/gui/user-install-dialog.c +++ b/app/gui/user-install-dialog.c @@ -1292,7 +1292,8 @@ user_install_resolution_done (void) tile_cache_size = new_tile_cache_size; update = g_list_append (update, "tile-cache-size"); } - if (strcmp (swap_path, new_swap_path)) + if (swap_path && new_swap_path && + strcmp (swap_path, new_swap_path)) { g_free (swap_path); swap_path = new_swap_path; update = g_list_append (update, "swap-path"); diff --git a/app/tools/curves.c b/app/tools/curves.c index 335dadfb8c..f9793040f4 100644 --- a/app/tools/curves.c +++ b/app/tools/curves.c @@ -466,8 +466,8 @@ curves_initialize (GDisplay *gdisp) } } - curves_dialog->drawable = gimage_active_drawable (gdisp->gimage); - curves_dialog->color = drawable_color (curves_dialog->drawable); + curves_dialog->drawable = gimage_active_drawable (gdisp->gimage); + curves_dialog->color = drawable_color (curves_dialog->drawable); curves_dialog->image_map = image_map_create (gdisp, curves_dialog->drawable); /* check for alpha channel */ @@ -488,13 +488,18 @@ curves_initialize (GDisplay *gdisp) gtk_option_menu_set_history (GTK_OPTION_MENU (curves_dialog->channel_menu), curves_dialog->channel); - gimp_lut_setup (curves_dialog->lut, (GimpLutFunc) curves_lut_func, - (void *) curves_dialog, gimp_drawable_bytes (curves_dialog->drawable)); + gimp_lut_setup (curves_dialog->lut, + (GimpLutFunc) curves_lut_func, + (void *) curves_dialog, + gimp_drawable_bytes (curves_dialog->drawable)); if (!GTK_WIDGET_VISIBLE (curves_dialog->shell)) gtk_widget_show (curves_dialog->shell); curves_update (curves_dialog, GRAPH | DRAW); + + if (curves_dialog->preview) + curves_preview (curves_dialog); } void diff --git a/app/tools/gimpcurvestool.c b/app/tools/gimpcurvestool.c index 335dadfb8c..f9793040f4 100644 --- a/app/tools/gimpcurvestool.c +++ b/app/tools/gimpcurvestool.c @@ -466,8 +466,8 @@ curves_initialize (GDisplay *gdisp) } } - curves_dialog->drawable = gimage_active_drawable (gdisp->gimage); - curves_dialog->color = drawable_color (curves_dialog->drawable); + curves_dialog->drawable = gimage_active_drawable (gdisp->gimage); + curves_dialog->color = drawable_color (curves_dialog->drawable); curves_dialog->image_map = image_map_create (gdisp, curves_dialog->drawable); /* check for alpha channel */ @@ -488,13 +488,18 @@ curves_initialize (GDisplay *gdisp) gtk_option_menu_set_history (GTK_OPTION_MENU (curves_dialog->channel_menu), curves_dialog->channel); - gimp_lut_setup (curves_dialog->lut, (GimpLutFunc) curves_lut_func, - (void *) curves_dialog, gimp_drawable_bytes (curves_dialog->drawable)); + gimp_lut_setup (curves_dialog->lut, + (GimpLutFunc) curves_lut_func, + (void *) curves_dialog, + gimp_drawable_bytes (curves_dialog->drawable)); if (!GTK_WIDGET_VISIBLE (curves_dialog->shell)) gtk_widget_show (curves_dialog->shell); curves_update (curves_dialog, GRAPH | DRAW); + + if (curves_dialog->preview) + curves_preview (curves_dialog); } void diff --git a/app/user_install.c b/app/user_install.c index 67d0f208b3..baf1078ad0 100644 --- a/app/user_install.c +++ b/app/user_install.c @@ -1292,7 +1292,8 @@ user_install_resolution_done (void) tile_cache_size = new_tile_cache_size; update = g_list_append (update, "tile-cache-size"); } - if (strcmp (swap_path, new_swap_path)) + if (swap_path && new_swap_path && + strcmp (swap_path, new_swap_path)) { g_free (swap_path); swap_path = new_swap_path; update = g_list_append (update, "swap-path"); diff --git a/configure.in b/configure.in index 32d2231554..93641efad2 100644 --- a/configure.in +++ b/configure.in @@ -3,8 +3,8 @@ AC_INIT(gimprc.in) dnl Initialize automake stuff GIMP_MAJOR_VERSION=1 -GIMP_MINOR_VERSION=1 -GIMP_MICRO_VERSION=30 +GIMP_MINOR_VERSION=2 +GIMP_MICRO_VERSION=0 GIMP_INTERFACE_AGE=0 GIMP_BINARY_AGE=0 GIMP_VERSION=$GIMP_MAJOR_VERSION.$GIMP_MINOR_VERSION.$GIMP_MICRO_VERSION diff --git a/libgimp/gimpfileselection.c b/libgimp/gimpfileselection.c index ffcb26bf6c..2b3b45b2ba 100644 --- a/libgimp/gimpfileselection.c +++ b/libgimp/gimpfileselection.c @@ -254,7 +254,7 @@ gimp_file_selection_set_filename (GimpFileSelection *gfs, g_return_if_fail (gfs != NULL); g_return_if_fail (GIMP_IS_FILE_SELECTION (gfs)); - gtk_entry_set_text (GTK_ENTRY (gfs->entry), filename); + gtk_entry_set_text (GTK_ENTRY (gfs->entry), filename ? filename : ""); /* update everything */ diff --git a/libgimpwidgets/gimpfileentry.c b/libgimpwidgets/gimpfileentry.c index ffcb26bf6c..2b3b45b2ba 100644 --- a/libgimpwidgets/gimpfileentry.c +++ b/libgimpwidgets/gimpfileentry.c @@ -254,7 +254,7 @@ gimp_file_selection_set_filename (GimpFileSelection *gfs, g_return_if_fail (gfs != NULL); g_return_if_fail (GIMP_IS_FILE_SELECTION (gfs)); - gtk_entry_set_text (GTK_ENTRY (gfs->entry), filename); + gtk_entry_set_text (GTK_ENTRY (gfs->entry), filename ? filename : ""); /* update everything */ diff --git a/libgimpwidgets/gimpfileselection.c b/libgimpwidgets/gimpfileselection.c index ffcb26bf6c..2b3b45b2ba 100644 --- a/libgimpwidgets/gimpfileselection.c +++ b/libgimpwidgets/gimpfileselection.c @@ -254,7 +254,7 @@ gimp_file_selection_set_filename (GimpFileSelection *gfs, g_return_if_fail (gfs != NULL); g_return_if_fail (GIMP_IS_FILE_SELECTION (gfs)); - gtk_entry_set_text (GTK_ENTRY (gfs->entry), filename); + gtk_entry_set_text (GTK_ENTRY (gfs->entry), filename ? filename : ""); /* update everything */