app: more accurate undo names.

Don't just name all alpha-selection actions the same "Alpha to
Selection". Have some more accurate naming like "Substract Alpha from
Selection", etc.

Also improve the action names to make them more accurate as these names
are not only in menus anymore, but also in search actions (and we want
to avoid duplicate naming).
This commit is contained in:
Jehan 2020-05-20 21:18:20 +02:00
parent 09870d4b15
commit 081ebf19f0
2 changed files with 22 additions and 5 deletions

View File

@ -534,21 +534,21 @@ static const GimpEnumActionEntry layers_alpha_to_selection_actions[] =
GIMP_HELP_LAYER_ALPHA_SELECTION_REPLACE },
{ "layers-alpha-selection-add", GIMP_ICON_SELECTION_ADD,
NC_("layers-action", "A_dd to Selection"), NULL,
NC_("layers-action", "A_dd Alpha to Selection"), NULL,
NC_("layers-action",
"Add the layer's alpha channel to the current selection"),
GIMP_CHANNEL_OP_ADD, FALSE,
GIMP_HELP_LAYER_ALPHA_SELECTION_ADD },
{ "layers-alpha-selection-subtract", GIMP_ICON_SELECTION_SUBTRACT,
NC_("layers-action", "_Subtract from Selection"), NULL,
NC_("layers-action", "_Subtract Alpha from Selection"), NULL,
NC_("layers-action",
"Subtract the layer's alpha channel from the current selection"),
GIMP_CHANNEL_OP_SUBTRACT, FALSE,
GIMP_HELP_LAYER_ALPHA_SELECTION_SUBTRACT },
{ "layers-alpha-selection-intersect", GIMP_ICON_SELECTION_INTERSECT,
NC_("layers-action", "_Intersect with Selection"), NULL,
NC_("layers-action", "_Intersect Alpha with Selection"), NULL,
NC_("layers-action",
"Intersect the layer's alpha channel with the current selection"),
GIMP_CHANNEL_OP_INTERSECT, FALSE,

View File

@ -1562,8 +1562,25 @@ layers_alpha_to_selection_cmd_callback (GimpAction *action,
operation = (GimpChannelOps) g_variant_get_int32 (value);
gimp_channel_push_undo (gimp_image_get_mask (image),
C_("undo-type", "Alpha to Selection"));
switch (operation)
{
case GIMP_CHANNEL_OP_REPLACE:
gimp_channel_push_undo (gimp_image_get_mask (image),
C_("undo-type", "Alpha to Selection"));
break;
case GIMP_CHANNEL_OP_ADD:
gimp_channel_push_undo (gimp_image_get_mask (image),
C_("undo-type", "Add Alpha to Selection"));
break;
case GIMP_CHANNEL_OP_SUBTRACT:
gimp_channel_push_undo (gimp_image_get_mask (image),
C_("undo-type", "Subtract Alpha from Selection"));
break;
case GIMP_CHANNEL_OP_INTERSECT:
gimp_channel_push_undo (gimp_image_get_mask (image),
C_("undo-type", "Intersect Alpha with Selection"));
break;
}
gimp_channel_combine_items (gimp_image_get_mask (image),
layers, operation);
gimp_image_flush (image);