diff --git a/ChangeLog b/ChangeLog index a7258a30d5..090c9ca95e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2006-08-18 Sven Neumann + + * libgimp/gimppaletteselectbutton.c + (gimp_palette_select_button_set_palette): check that the palette + name actually refers to an existing palette and use the active + palette if name is NULL or empty (like the other select buttons). + + * plug-ins/pygimp/plug-ins/palette-offset.py: use an integer value + for a PF_INT parameter. + 2006-08-18 Sven Neumann * plug-ins/pygimp/gimpfu.py: check if the menupath starts with diff --git a/libgimp/gimppaletteselectbutton.c b/libgimp/gimppaletteselectbutton.c index 5a0bcc0446..50ae4e1b34 100644 --- a/libgimp/gimppaletteselectbutton.c +++ b/libgimp/gimppaletteselectbutton.c @@ -204,13 +204,13 @@ gimp_palette_select_button_new (const gchar *title, if (title) button = g_object_new (GIMP_TYPE_PALETTE_SELECT_BUTTON, - "title", title, - "palette-name", palette_name, - NULL); + "title", title, + "palette-name", palette_name, + NULL); else button = g_object_new (GIMP_TYPE_PALETTE_SELECT_BUTTON, - "palette-name", palette_name, - NULL); + "palette-name", palette_name, + NULL); return button; } @@ -256,9 +256,24 @@ gimp_palette_select_button_set_palette (GimpPaletteSelectButton *button, select_button = GIMP_SELECT_BUTTON (button); if (select_button->temp_callback) - gimp_palettes_set_popup (select_button->temp_callback, palette_name); + { + gimp_palettes_set_popup (select_button->temp_callback, palette_name); + } else - gimp_palette_select_button_callback (palette_name, FALSE, button); + { + gchar *name; + gint num_colors; + + if (palette_name && *palette_name) + name = g_strdup (palette_name); + else + name = gimp_context_get_palette (); + + if (gimp_palette_get_info (name, &num_colors)) + gimp_palette_select_button_callback (name, FALSE, button); + + g_free (name); + } } diff --git a/plug-ins/pygimp/plug-ins/palette-offset.py b/plug-ins/pygimp/plug-ins/palette-offset.py index 6057f5b202..6a3d2c48e2 100644 --- a/plug-ins/pygimp/plug-ins/palette-offset.py +++ b/plug-ins/pygimp/plug-ins/palette-offset.py @@ -53,7 +53,7 @@ register( "", [ (PF_PALETTE, "palette", "Name of palette to offset", ""), - (PF_INT, "amount", "Amount of colors to offset", ""), + (PF_INT, "amount", "Amount of colors to offset", 1), (PF_BOOL, "forward", "Offset the palette forward?", True) ], [(PF_PALETTE, "new-palette", "Name of offset palette.")],