use radio items for the Image mode as suggested in bug #344871.
2006-06-14 Sven Neumann <sven@gimp.org> * app/actions/image-actions.c: use radio items for the Image mode as suggested in bug #344871. * app/actions/image-commands.[ch] (image_convert_cmd_callback): changed accordingly.
This commit is contained in:

committed by
Sven Neumann

parent
940998a946
commit
ab22402033
@ -1,3 +1,11 @@
|
|||||||
|
2006-06-14 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* app/actions/image-actions.c: use radio items for the Image mode
|
||||||
|
as suggested in bug #344871.
|
||||||
|
|
||||||
|
* app/actions/image-commands.[ch] (image_convert_cmd_callback):
|
||||||
|
changed accordingly.
|
||||||
|
|
||||||
2006-06-14 Michael Natterer <mitch@gimp.org>
|
2006-06-14 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* tools/pdbgen/pdb/[many].pdb: in help texts, refer to other
|
* tools/pdbgen/pdb/[many].pdb: in help texts, refer to other
|
||||||
|
@ -141,25 +141,22 @@ static const GimpActionEntry image_actions[] =
|
|||||||
GIMP_HELP_IMAGE_PROPERTIES }
|
GIMP_HELP_IMAGE_PROPERTIES }
|
||||||
};
|
};
|
||||||
|
|
||||||
static const GimpEnumActionEntry image_convert_actions[] =
|
static const GimpRadioActionEntry image_convert_actions[] =
|
||||||
{
|
{
|
||||||
{ "image-convert-rgb", GIMP_STOCK_CONVERT_RGB,
|
{ "image-convert-rgb", GIMP_STOCK_CONVERT_RGB,
|
||||||
N_("_RGB"), NULL,
|
N_("_RGB"), NULL,
|
||||||
N_("Convert the image to the RGB colorspace"),
|
N_("Convert the image to the RGB colorspace"),
|
||||||
GIMP_RGB, FALSE,
|
GIMP_RGB, GIMP_HELP_IMAGE_CONVERT_RGB },
|
||||||
GIMP_HELP_IMAGE_CONVERT_RGB },
|
|
||||||
|
|
||||||
{ "image-convert-grayscale", GIMP_STOCK_CONVERT_GRAYSCALE,
|
{ "image-convert-grayscale", GIMP_STOCK_CONVERT_GRAYSCALE,
|
||||||
N_("_Grayscale"), NULL,
|
N_("_Grayscale"), NULL,
|
||||||
N_("Convert the image to grayscale"),
|
N_("Convert the image to grayscale"),
|
||||||
GIMP_GRAY, FALSE,
|
GIMP_GRAY, GIMP_HELP_IMAGE_CONVERT_GRAYSCALE },
|
||||||
GIMP_HELP_IMAGE_CONVERT_GRAYSCALE },
|
|
||||||
|
|
||||||
{ "image-convert-indexed", GIMP_STOCK_CONVERT_INDEXED,
|
{ "image-convert-indexed", GIMP_STOCK_CONVERT_INDEXED,
|
||||||
N_("_Indexed..."), NULL,
|
N_("_Indexed..."), NULL,
|
||||||
N_("Convert the image to indexed colors"),
|
N_("Convert the image to indexed colors"),
|
||||||
GIMP_INDEXED, FALSE,
|
GIMP_INDEXED, GIMP_HELP_IMAGE_CONVERT_INDEXED }
|
||||||
GIMP_HELP_IMAGE_CONVERT_INDEXED }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const GimpEnumActionEntry image_flip_actions[] =
|
static const GimpEnumActionEntry image_flip_actions[] =
|
||||||
@ -212,9 +209,10 @@ image_actions_setup (GimpActionGroup *group)
|
|||||||
"image-new-from-image");
|
"image-new-from-image");
|
||||||
gtk_action_set_accel_path (action, "<Actions>/image/image-new");
|
gtk_action_set_accel_path (action, "<Actions>/image/image-new");
|
||||||
|
|
||||||
gimp_action_group_add_enum_actions (group,
|
gimp_action_group_add_radio_actions (group,
|
||||||
image_convert_actions,
|
image_convert_actions,
|
||||||
G_N_ELEMENTS (image_convert_actions),
|
G_N_ELEMENTS (image_convert_actions),
|
||||||
|
NULL, 0,
|
||||||
G_CALLBACK (image_convert_cmd_callback));
|
G_CALLBACK (image_convert_cmd_callback));
|
||||||
|
|
||||||
gimp_action_group_add_enum_actions (group,
|
gimp_action_group_add_enum_actions (group,
|
||||||
@ -257,12 +255,14 @@ image_actions_update (GimpActionGroup *group,
|
|||||||
sel = ! gimp_channel_is_empty (gimp_image_get_mask (image));
|
sel = ! gimp_channel_is_empty (gimp_image_get_mask (image));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define SET_ACTIVE(action,condition) \
|
||||||
|
gimp_action_group_set_action_active (group, action, (condition) != 0)
|
||||||
#define SET_SENSITIVE(action,condition) \
|
#define SET_SENSITIVE(action,condition) \
|
||||||
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
|
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
|
||||||
|
|
||||||
SET_SENSITIVE ("image-convert-rgb", image && ! is_rgb);
|
SET_ACTIVE ("image-convert-rgb", image && is_rgb);
|
||||||
SET_SENSITIVE ("image-convert-grayscale", image && ! is_gray);
|
SET_ACTIVE ("image-convert-grayscale", image && is_gray);
|
||||||
SET_SENSITIVE ("image-convert-indexed", image && ! is_indexed);
|
SET_ACTIVE ("image-convert-indexed", image && is_indexed);
|
||||||
|
|
||||||
SET_SENSITIVE ("image-flip-horizontal", image);
|
SET_SENSITIVE ("image-flip-horizontal", image);
|
||||||
SET_SENSITIVE ("image-flip-vertical", image);
|
SET_SENSITIVE ("image-flip-vertical", image);
|
||||||
|
@ -148,22 +148,27 @@ image_new_from_image_cmd_callback (GtkAction *action,
|
|||||||
|
|
||||||
void
|
void
|
||||||
image_convert_cmd_callback (GtkAction *action,
|
image_convert_cmd_callback (GtkAction *action,
|
||||||
gint value,
|
GtkAction *current,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpImage *image;
|
GimpImage *image;
|
||||||
GtkWidget *widget;
|
GtkWidget *widget;
|
||||||
GimpDisplay *display;
|
GimpDisplay *display;
|
||||||
|
GimpImageBaseType value;
|
||||||
return_if_no_image (image, data);
|
return_if_no_image (image, data);
|
||||||
return_if_no_widget (widget, data);
|
return_if_no_widget (widget, data);
|
||||||
return_if_no_display (display, data);
|
return_if_no_display (display, data);
|
||||||
|
|
||||||
switch ((GimpImageBaseType) value)
|
value = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (action));
|
||||||
|
|
||||||
|
if (value == gimp_image_base_type (image))
|
||||||
|
return;
|
||||||
|
|
||||||
|
switch (value)
|
||||||
{
|
{
|
||||||
case GIMP_RGB:
|
case GIMP_RGB:
|
||||||
case GIMP_GRAY:
|
case GIMP_GRAY:
|
||||||
gimp_image_convert (image, (GimpImageBaseType) value,
|
gimp_image_convert (image, value, 0, 0, FALSE, FALSE, 0, NULL, NULL);
|
||||||
0, 0, FALSE, FALSE, 0, NULL, NULL);
|
|
||||||
gimp_image_flush (image);
|
gimp_image_flush (image);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ void image_new_from_image_cmd_callback (GtkAction *action,
|
|||||||
gpointer data);
|
gpointer data);
|
||||||
|
|
||||||
void image_convert_cmd_callback (GtkAction *action,
|
void image_convert_cmd_callback (GtkAction *action,
|
||||||
gint value,
|
GtkAction *current,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
|
|
||||||
void image_resize_cmd_callback (GtkAction *action,
|
void image_resize_cmd_callback (GtkAction *action,
|
||||||
|
Reference in New Issue
Block a user