mirror of https://github.com/GNOME/gimp.git
added alternative actions "vectors-selection-from-vectors" and
2004-06-03 Michael Natterer <mitch@gimp.org> * app/actions/vectors-actions.c: added alternative actions "vectors-selection-from-vectors" and "vectors-selection-to-vectors-short" with different labels suited for the "Select" menu. * app/actions/select-actions.c: removed "select-from-vectors" and "select-to-vectors" (to vectors was crashing anyway). * app/actions/select-commands.[ch]: removed select_from_vectors_cmd_callback(). Fixes code dupliction. * menus/image-menu.xml.in * menus/selection-editor-menu.xml: changed accordingly.
This commit is contained in:
parent
28fb8280d0
commit
421b2a0d0e
16
ChangeLog
16
ChangeLog
|
@ -1,3 +1,19 @@
|
|||
2004-06-03 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/actions/vectors-actions.c: added alternative actions
|
||||
"vectors-selection-from-vectors" and
|
||||
"vectors-selection-to-vectors-short" with different labels suited
|
||||
for the "Select" menu.
|
||||
|
||||
* app/actions/select-actions.c: removed "select-from-vectors"
|
||||
and "select-to-vectors" (to vectors was crashing anyway).
|
||||
|
||||
* app/actions/select-commands.[ch]: removed
|
||||
select_from_vectors_cmd_callback(). Fixes code dupliction.
|
||||
|
||||
* menus/image-menu.xml.in
|
||||
* menus/selection-editor-menu.xml: changed accordingly.
|
||||
|
||||
2004-06-03 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/widgets/gimpgradienteditor.c (control_motion): use the newly
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
#include "actions.h"
|
||||
#include "select-actions.h"
|
||||
#include "select-commands.h"
|
||||
#include "vectors-commands.h"
|
||||
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
@ -65,11 +64,6 @@ static GimpActionEntry select_actions[] =
|
|||
G_CALLBACK (select_invert_cmd_callback),
|
||||
GIMP_HELP_SELECTION_INVERT },
|
||||
|
||||
{ "select-from-vectors", GIMP_STOCK_SELECTION_REPLACE,
|
||||
N_("Fr_om Path"), "<shift>V", NULL,
|
||||
G_CALLBACK (select_from_vectors_cmd_callback),
|
||||
NULL /* FIXME */ },
|
||||
|
||||
{ "select-float", GIMP_STOCK_FLOATING_SELECTION,
|
||||
N_("_Float"), "<control><shift>L", NULL,
|
||||
G_CALLBACK (select_float_cmd_callback),
|
||||
|
@ -110,13 +104,7 @@ static GimpActionEntry select_actions[] =
|
|||
N_("_Stroke Selection..."), NULL,
|
||||
N_("Stroke selection"),
|
||||
G_CALLBACK (select_stroke_cmd_callback),
|
||||
GIMP_HELP_SELECTION_STROKE },
|
||||
|
||||
{ "select-to-vectors", GIMP_STOCK_SELECTION_TO_PATH,
|
||||
N_("To _Path"), NULL,
|
||||
N_("Selection to path"),
|
||||
G_CALLBACK (vectors_selection_to_vectors_cmd_callback),
|
||||
GIMP_HELP_SELECTION_TO_PATH }
|
||||
GIMP_HELP_SELECTION_STROKE }
|
||||
};
|
||||
|
||||
|
||||
|
@ -134,7 +122,6 @@ select_actions_update (GimpActionGroup *group,
|
|||
{
|
||||
GimpImage *gimage;
|
||||
GimpDrawable *drawable = NULL;
|
||||
GimpVectors *vectors = NULL;
|
||||
gboolean fs = FALSE;
|
||||
gboolean sel = FALSE;
|
||||
|
||||
|
@ -143,7 +130,6 @@ select_actions_update (GimpActionGroup *group,
|
|||
if (gimage)
|
||||
{
|
||||
drawable = gimp_image_active_drawable (gimage);
|
||||
vectors = gimp_image_get_active_vectors (gimage);
|
||||
|
||||
fs = (gimp_image_floating_sel (gimage) != NULL);
|
||||
sel = ! gimp_channel_is_empty (gimp_image_get_mask (gimage));
|
||||
|
@ -152,21 +138,19 @@ select_actions_update (GimpActionGroup *group,
|
|||
#define SET_SENSITIVE(action,condition) \
|
||||
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
|
||||
|
||||
SET_SENSITIVE ("select-all", drawable);
|
||||
SET_SENSITIVE ("select-none", drawable && sel);
|
||||
SET_SENSITIVE ("select-invert", drawable);
|
||||
SET_SENSITIVE ("select-from-vectors", vectors);
|
||||
SET_SENSITIVE ("select-float", drawable && sel);
|
||||
SET_SENSITIVE ("select-all", drawable);
|
||||
SET_SENSITIVE ("select-none", drawable && sel);
|
||||
SET_SENSITIVE ("select-invert", drawable);
|
||||
SET_SENSITIVE ("select-float", drawable && sel);
|
||||
|
||||
SET_SENSITIVE ("select-feather", drawable && sel);
|
||||
SET_SENSITIVE ("select-sharpen", drawable && sel);
|
||||
SET_SENSITIVE ("select-shrink", drawable && sel);
|
||||
SET_SENSITIVE ("select-grow", drawable && sel);
|
||||
SET_SENSITIVE ("select-border", drawable && sel);
|
||||
SET_SENSITIVE ("select-feather", drawable && sel);
|
||||
SET_SENSITIVE ("select-sharpen", drawable && sel);
|
||||
SET_SENSITIVE ("select-shrink", drawable && sel);
|
||||
SET_SENSITIVE ("select-grow", drawable && sel);
|
||||
SET_SENSITIVE ("select-border", drawable && sel);
|
||||
|
||||
SET_SENSITIVE ("select-save", drawable && sel && !fs);
|
||||
SET_SENSITIVE ("select-stroke", drawable && sel);
|
||||
SET_SENSITIVE ("select-to-vectors", drawable && sel && !fs);
|
||||
SET_SENSITIVE ("select-save", drawable && sel && !fs);
|
||||
SET_SENSITIVE ("select-stroke", drawable && sel);
|
||||
|
||||
#undef SET_SENSITIVE
|
||||
}
|
||||
|
|
|
@ -107,26 +107,6 @@ select_none_cmd_callback (GtkAction *action,
|
|||
gimp_image_flush (gimage);
|
||||
}
|
||||
|
||||
void
|
||||
select_from_vectors_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
{
|
||||
GimpImage *gimage;
|
||||
GimpVectors *vectors;
|
||||
return_if_no_image (gimage, data);
|
||||
|
||||
vectors = gimp_image_get_active_vectors (gimage);
|
||||
if (!vectors)
|
||||
return;
|
||||
|
||||
gimp_channel_select_vectors (gimp_image_get_mask (gimage),
|
||||
_("Path to Selection"),
|
||||
vectors,
|
||||
GIMP_CHANNEL_OP_REPLACE,
|
||||
TRUE, FALSE, 0, 0);
|
||||
gimp_image_flush (gimage);
|
||||
}
|
||||
|
||||
void
|
||||
select_float_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
|
|
|
@ -20,30 +20,28 @@
|
|||
#define __SELECT_COMMANDS_H__
|
||||
|
||||
|
||||
void select_invert_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void select_all_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void select_none_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void select_from_vectors_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void select_float_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void select_feather_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void select_sharpen_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void select_shrink_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void select_border_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void select_grow_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void select_save_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void select_stroke_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void select_invert_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void select_all_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void select_none_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void select_float_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void select_feather_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void select_sharpen_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void select_shrink_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void select_border_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void select_grow_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void select_save_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
void select_stroke_cmd_callback (GtkAction *action,
|
||||
gpointer data);
|
||||
|
||||
|
||||
#endif /* __SELECT_COMMANDS_H__ */
|
||||
|
|
|
@ -127,6 +127,11 @@ static GimpEnumActionEntry vectors_to_selection_actions[] =
|
|||
GIMP_CHANNEL_OP_REPLACE,
|
||||
GIMP_HELP_PATH_SELECTION_REPLACE },
|
||||
|
||||
{ "vectors-selection-from-vectors", GIMP_STOCK_SELECTION_REPLACE,
|
||||
N_("Fr_om Path"), "<shift>V", NULL,
|
||||
GIMP_CHANNEL_OP_REPLACE,
|
||||
GIMP_HELP_PATH_SELECTION_REPLACE },
|
||||
|
||||
{ "vectors-selection-add", GIMP_STOCK_SELECTION_ADD,
|
||||
N_("_Add to Selection"), NULL, NULL,
|
||||
GIMP_CHANNEL_OP_ADD,
|
||||
|
@ -150,6 +155,11 @@ static GimpEnumActionEntry vectors_selection_to_vectors_actions[] =
|
|||
FALSE,
|
||||
GIMP_HELP_SELECTION_TO_PATH },
|
||||
|
||||
{ "vectors-selection-to-vectors-short", GIMP_STOCK_SELECTION_TO_PATH,
|
||||
N_("To _Path"), NULL, NULL,
|
||||
FALSE,
|
||||
GIMP_HELP_SELECTION_TO_PATH },
|
||||
|
||||
{ "vectors-selection-to-vectors-advanced", GIMP_STOCK_SELECTION_TO_PATH,
|
||||
N_("Selection to Path (_Advanced)"), NULL, NULL,
|
||||
TRUE,
|
||||
|
@ -230,18 +240,21 @@ vectors_actions_update (GimpActionGroup *group,
|
|||
SET_SENSITIVE ("vectors-lower", vectors && next);
|
||||
SET_SENSITIVE ("vectors-lower-to-bottom", vectors && next);
|
||||
|
||||
SET_SENSITIVE ("vectors-selection-to-vectors", ! mask_empty);
|
||||
SET_SENSITIVE ("vectors-stroke", vectors);
|
||||
SET_SENSITIVE ("vectors-selection-to-vectors", ! mask_empty);
|
||||
SET_SENSITIVE ("vectors-selection-to-vectors-short", ! mask_empty);
|
||||
SET_SENSITIVE ("vectors-selection-to-vectors-advanced", ! mask_empty);
|
||||
SET_SENSITIVE ("vectors-stroke", vectors);
|
||||
|
||||
SET_SENSITIVE ("vectors-copy", vectors);
|
||||
SET_SENSITIVE ("vectors-paste", global_buf);
|
||||
SET_SENSITIVE ("vectors-import", gimage);
|
||||
SET_SENSITIVE ("vectors-export", vectors);
|
||||
|
||||
SET_SENSITIVE ("vectors-selection-replace", vectors);
|
||||
SET_SENSITIVE ("vectors-selection-add", vectors);
|
||||
SET_SENSITIVE ("vectors-selection-subtract", vectors);
|
||||
SET_SENSITIVE ("vectors-selection-intersect", vectors);
|
||||
SET_SENSITIVE ("vectors-selection-replace", vectors);
|
||||
SET_SENSITIVE ("vectors-selection-from-vectors", vectors);
|
||||
SET_SENSITIVE ("vectors-selection-add", vectors);
|
||||
SET_SENSITIVE ("vectors-selection-subtract", vectors);
|
||||
SET_SENSITIVE ("vectors-selection-intersect", vectors);
|
||||
|
||||
#undef SET_SENSITIVE
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
<menuitem action="select-all" />
|
||||
<menuitem action="select-none" />
|
||||
<menuitem action="select-invert" />
|
||||
<menuitem action="select-from-vectors" />
|
||||
<menuitem action="vectors-selection-from-vectors" />
|
||||
<menuitem action="select-float" />
|
||||
<menuitem action="tools-by-color-select-short" />
|
||||
<separator />
|
||||
|
@ -90,7 +90,7 @@
|
|||
<separator />
|
||||
<menuitem action="qmask-toggle" />
|
||||
<menuitem action="select-save" />
|
||||
<menuitem action="select-to-vectors" />
|
||||
<menuitem action="vectors-selection-to-vectors-short" />
|
||||
<separator />
|
||||
</menu>
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<menuitem action="select-all" />
|
||||
<menuitem action="select-none" />
|
||||
<menuitem action="select-invert" />
|
||||
<menuitem action="select-from-vectors" />
|
||||
<menuitem action="vectors-selection-from-vectors" />
|
||||
<menuitem action="select-float" />
|
||||
<separator />
|
||||
<placeholder name="Outline">
|
||||
|
@ -18,7 +18,7 @@
|
|||
</placeholder>
|
||||
<separator />
|
||||
<menuitem action="select-save" />
|
||||
<menuitem action="select-to-vectors" />
|
||||
<menuitem action="vectors-selection-to-vectors-short" />
|
||||
<menuitem action="select-stroke" />
|
||||
</popup>
|
||||
</ui>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<menuitem action="select-all" />
|
||||
<menuitem action="select-none" />
|
||||
<menuitem action="select-invert" />
|
||||
<menuitem action="select-from-vectors" />
|
||||
<menuitem action="vectors-selection-from-vectors" />
|
||||
<menuitem action="select-float" />
|
||||
<separator />
|
||||
<placeholder name="Outline">
|
||||
|
@ -18,7 +18,7 @@
|
|||
</placeholder>
|
||||
<separator />
|
||||
<menuitem action="select-save" />
|
||||
<menuitem action="select-to-vectors" />
|
||||
<menuitem action="vectors-selection-to-vectors-short" />
|
||||
<menuitem action="select-stroke" />
|
||||
</popup>
|
||||
</ui>
|
||||
|
|
Loading…
Reference in New Issue