renamed action "qmask-toggle" to "qmask-active" and added new action

2004-05-02  Michael Natterer  <mitch@gimp.org>

	* app/actions/qmask-actions.c: renamed action "qmask-toggle" to
	"qmask-active" and added new action "qmask-toggle" with a label
	and shortcut suited for the "Select" menu.

	* app/actions/select-actions.c: removed "select-toggle-qmask".

	* app/actions/select-commands.[ch]: removed callback
	select_toggle_quickmask_cmd_callback().

	* app/actions/channels-actions.c (channels_actions_update)
	* app/actions/vectors-actions.c (vectors_actions_update): handle
	"data" being both GimpDisplay and GimpDisplayShell so the actions
	can be used in the image menu.

	* menus/image-menu.xml.in: s/select-toggle-qmask/qmask-toggle/.

	* menus/qmask-menu.xml: s/qmask-toggle/qmask-active/.
This commit is contained in:
Michael Natterer 2004-05-02 19:37:17 +00:00 committed by Michael Natterer
parent b9b3134a12
commit 8895917db2
10 changed files with 77 additions and 49 deletions

View File

@ -1,3 +1,23 @@
2004-05-02 Michael Natterer <mitch@gimp.org>
* app/actions/qmask-actions.c: renamed action "qmask-toggle" to
"qmask-active" and added new action "qmask-toggle" with a label
and shortcut suited for the "Select" menu.
* app/actions/select-actions.c: removed "select-toggle-qmask".
* app/actions/select-commands.[ch]: removed callback
select_toggle_quickmask_cmd_callback().
* app/actions/channels-actions.c (channels_actions_update)
* app/actions/vectors-actions.c (vectors_actions_update): handle
"data" being both GimpDisplay and GimpDisplayShell so the actions
can be used in the image menu.
* menus/image-menu.xml.in: s/select-toggle-qmask/qmask-toggle/.
* menus/qmask-menu.xml: s/qmask-toggle/qmask-active/.
2004-05-02 Sven Neumann <sven@gimp.org>
* menus/image-menu.xml.in
@ -21,7 +41,7 @@
* menus/menus.xsl: allow inclusion of menuitems using XInclude.
2004-05-02 Michael Natterer <mitch@convergence.de>
2004-05-02 Michael Natterer <mitch@gimp.org>
* app/actions/Makefile.am
* app/actions/file-dialog-actions.[ch]: new files containing

View File

@ -32,6 +32,9 @@
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpitemtreeview.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
#include "channels-actions.h"
#include "channels-commands.h"
@ -144,7 +147,12 @@ channels_actions_update (GimpActionGroup *group,
}
else
{
gimage = GIMP_ITEM_TREE_VIEW (data)->gimage;
if (GIMP_IS_ITEM_TREE_VIEW (data))
gimage = GIMP_ITEM_TREE_VIEW (data)->gimage;
else if (GIMP_IS_DISPLAY_SHELL (data))
gimage = GIMP_DISPLAY_SHELL (data)->gdisp->gimage;
else if (GIMP_IS_DISPLAY (data))
gimage = GIMP_DISPLAY (data)->gimage;
if (gimage)
{

View File

@ -51,11 +51,17 @@ static GimpActionEntry qmask_actions[] =
static GimpToggleActionEntry qmask_toggle_actions[] =
{
{ "qmask-toggle", NULL,
{ "qmask-active", NULL,
N_("_QMask Active"), NULL, NULL,
G_CALLBACK (qmask_toggle_cmd_callback),
FALSE,
GIMP_HELP_QMASK_TOGGLE },
{ "qmask-toggle", GIMP_STOCK_QMASK_ON,
N_("Toggle _QuickMask"), "<shift>Q", NULL,
G_CALLBACK (qmask_toggle_cmd_callback),
GIMP_HELP_QMASK_TOGGLE }
};
static GimpRadioActionEntry qmask_invert_actions[] =
@ -117,6 +123,7 @@ qmask_actions_update (GimpActionGroup *group,
#define SET_COLOR(action,color) \
gimp_action_group_set_action_color (group, action, (color), FALSE)
SET_ACTIVE ("qmask-active", gimage && gimage->qmask_state);
SET_ACTIVE ("qmask-toggle", gimage && gimage->qmask_state);
if (gimage && gimage->qmask_inverted)

View File

@ -51,11 +51,17 @@ static GimpActionEntry qmask_actions[] =
static GimpToggleActionEntry qmask_toggle_actions[] =
{
{ "qmask-toggle", NULL,
{ "qmask-active", NULL,
N_("_QMask Active"), NULL, NULL,
G_CALLBACK (qmask_toggle_cmd_callback),
FALSE,
GIMP_HELP_QMASK_TOGGLE },
{ "qmask-toggle", GIMP_STOCK_QMASK_ON,
N_("Toggle _QuickMask"), "<shift>Q", NULL,
G_CALLBACK (qmask_toggle_cmd_callback),
GIMP_HELP_QMASK_TOGGLE }
};
static GimpRadioActionEntry qmask_invert_actions[] =
@ -117,6 +123,7 @@ qmask_actions_update (GimpActionGroup *group,
#define SET_COLOR(action,color) \
gimp_action_group_set_action_color (group, action, (color), FALSE)
SET_ACTIVE ("qmask-active", gimage && gimage->qmask_state);
SET_ACTIVE ("qmask-toggle", gimage && gimage->qmask_state);
if (gimage && gimage->qmask_inverted)

View File

@ -97,11 +97,6 @@ static GimpActionEntry select_actions[] =
G_CALLBACK (select_border_cmd_callback),
GIMP_HELP_SELECTION_BORDER },
{ "select-toggle-qmask", GIMP_STOCK_QMASK_ON,
N_("Toggle _QuickMask"), "<shift>Q", NULL,
G_CALLBACK (select_toggle_quickmask_cmd_callback),
GIMP_HELP_QMASK_TOGGLE },
{ "select-save", GIMP_STOCK_SELECTION_TO_CHANNEL,
N_("Save to _Channel"), NULL, NULL,
G_CALLBACK (select_save_cmd_callback),
@ -186,8 +181,6 @@ select_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("select-grow", lp && sel);
SET_SENSITIVE ("select-border", lp && sel);
SET_SENSITIVE ("select-toggle-qmask", gdisp);
SET_SENSITIVE ("select-save", sel && !fs);
SET_SENSITIVE ("select-to-vectors", sel && !fs);

View File

@ -30,7 +30,6 @@
#include "core/gimpchannel-select.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "core/gimpimage-qmask.h"
#include "core/gimpselection.h"
#include "widgets/gimpdock.h"
@ -299,17 +298,6 @@ select_save_cmd_callback (GtkAction *action,
"gimp-channel-list", -1);
}
void
select_toggle_quickmask_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
return_if_no_image (gimage, data);
gimp_image_set_qmask_state (gimage, !gimp_image_get_qmask_state (gimage));
gimp_image_flush (gimage);
}
/* private functions */

View File

@ -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_toggle_quickmask_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_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);
#endif /* __SELECT_COMMANDS_H__ */

View File

@ -32,6 +32,9 @@
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpitemtreeview.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
#include "vectors-actions.h"
#include "vectors-commands.h"
@ -174,6 +177,10 @@ vectors_actions_update (GimpActionGroup *group,
if (GIMP_IS_ITEM_TREE_VIEW (data))
gimage = GIMP_ITEM_TREE_VIEW (data)->gimage;
else if (GIMP_IS_DISPLAY_SHELL (data))
gimage = GIMP_DISPLAY_SHELL (data)->gdisp->gimage;
else if (GIMP_IS_DISPLAY (data))
gimage = GIMP_DISPLAY (data)->gimage;
if (gimage)
{

View File

@ -72,7 +72,7 @@
<menuitem action="select-grow" />
<menuitem action="select-border" />
<separator />
<menuitem action="select-toggle-qmask" />
<menuitem action="qmask-toggle" />
<menuitem action="select-save" />
<menuitem action="select-to-vectors" />
</menu>

View File

@ -3,7 +3,7 @@
<ui>
<popup action="qmask-popup">
<menuitem action="qmask-toggle" />
<menuitem action="qmask-active" />
<separator />
<menuitem action="qmask-invert-on" />
<menuitem action="qmask-invert-off" />