Commit fd6d30fd authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

When there are variants of actions with and without dialog, let the

2004-10-23  Michael Natterer  <mitch@gimp.org>

	When there are variants of actions with and without dialog, let
	the dialog-less actions try to use the values from the last dialog
	invocation:

	* app/actions/channels-actions.c
	* app/actions/channels-commands.[ch]
	* app/actions/layers-actions.c
	* app/actions/layers-commands.[ch]
	* app/actions/vectors-actions.c
	* app/actions/vectors-commands.[ch]: renamed the foo-new-defaults
	actions to foo-new-last-values and use the last values entered in
	the dialogs.

	* app/widgets/gimpchanneltreeview.c
	* app/widgets/gimpitemtreeview.c
	* app/widgets/gimplayertreeview.c
	* app/widgets/gimpvectorstreeview.c: changed accordingly. Show
	the dialog on clicking "New" and call the last-values action on
	<shift>+click.

	* app/actions/select-actions.c
	* app/actions/vectors-commands.c: renamed the foo-stroke-last-vals
	to -last-values.

	* app/widgets/gimpselectioneditor.c
	* app/widgets/gimpvectorstreeview.c: stroke with last values on
	<shift> clicking the stroke buttons.
parent 00ff7e3f
2004-10-23 Michael Natterer <mitch@gimp.org>
When there are variants of actions with and without dialog, let
the dialog-less actions try to use the values from the last dialog
invocation:
* app/actions/channels-actions.c
* app/actions/channels-commands.[ch]
* app/actions/layers-actions.c
* app/actions/layers-commands.[ch]
* app/actions/vectors-actions.c
* app/actions/vectors-commands.[ch]: renamed the foo-new-defaults
actions to foo-new-last-values and use the last values entered in
the dialogs.
* app/widgets/gimpchanneltreeview.c
* app/widgets/gimpitemtreeview.c
* app/widgets/gimplayertreeview.c
* app/widgets/gimpvectorstreeview.c: changed accordingly. Show
the dialog on clicking "New" and call the last-values action on
<shift>+click.
* app/actions/select-actions.c
* app/actions/vectors-commands.c: renamed the foo-stroke-last-vals
to -last-values.
* app/widgets/gimpselectioneditor.c
* app/widgets/gimpvectorstreeview.c: stroke with last values on
<shift> clicking the stroke buttons.
2004-10-23 Sven Neumann <sven@gimp.org>
* libgimpthumb/gimpthumbnail.c (gimp_thumbnail_save): save to a
......
......@@ -52,14 +52,14 @@ static GimpActionEntry channels_actions[] =
{ "channels-new", GTK_STOCK_NEW,
N_("_New Channel..."), "",
N_("New channel dialog"),
N_("New channel..."),
G_CALLBACK (channels_new_cmd_callback),
GIMP_HELP_CHANNEL_NEW },
{ "channels-new-default", GTK_STOCK_NEW,
{ "channels-new-last-values", GTK_STOCK_NEW,
N_("_New Channel"), "",
N_("New channel"),
G_CALLBACK (channels_new_default_cmd_callback),
N_("New channel with last values"),
G_CALLBACK (channels_new_last_vals_cmd_callback),
GIMP_HELP_CHANNEL_NEW },
{ "channels-duplicate", GIMP_STOCK_DUPLICATE,
......@@ -185,7 +185,7 @@ channels_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("channels-edit-attributes", !fs && channel);
SET_SENSITIVE ("channels-new", !fs && gimage);
SET_SENSITIVE ("channels-new-default", !fs && gimage);
SET_SENSITIVE ("channels-new-last-values", !fs && gimage);
SET_SENSITIVE ("channels-duplicate", !fs && (channel || component));
SET_SENSITIVE ("channels-delete", !fs && channel);
......
......@@ -130,8 +130,8 @@ channels_new_cmd_callback (GtkAction *action,
}
void
channels_new_default_cmd_callback (GtkAction *action,
gpointer data)
channels_new_last_vals_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
GimpChannel *new_channel;
......@@ -151,14 +151,15 @@ channels_new_default_cmd_callback (GtkAction *action,
{
width = gimp_image_get_width (gimage);
height = gimp_image_get_height (gimage);
gimp_rgba_set (&color, 0.0, 0.0, 0.0, 0.5);
color = channel_color;
}
gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_EDIT_PASTE,
_("New Channel"));
new_channel = gimp_channel_new (gimage, width, height,
_("Empty Channel"), &color);
channel_name ? channel_name :
_("New Channel"), &color);
gimp_drawable_fill_by_type (GIMP_DRAWABLE (new_channel),
action_data_get_context (data),
......
......@@ -24,7 +24,7 @@ void channels_edit_attributes_cmd_callback (GtkAction *action,
gpointer data);
void channels_new_cmd_callback (GtkAction *action,
gpointer data);
void channels_new_default_cmd_callback (GtkAction *action,
void channels_new_last_vals_cmd_callback (GtkAction *action,
gpointer data);
void channels_raise_cmd_callback (GtkAction *action,
......
......@@ -72,14 +72,14 @@ static GimpActionEntry layers_actions[] =
{ "layers-new", GTK_STOCK_NEW,
N_("_New Layer..."), "",
N_("New layer dialog"),
N_("New layer..."),
G_CALLBACK (layers_new_cmd_callback),
GIMP_HELP_LAYER_NEW },
{ "layers-new-default", GTK_STOCK_NEW,
{ "layers-new-last-values", GTK_STOCK_NEW,
N_("_New Layer"), "",
N_("New layer"),
G_CALLBACK (layers_new_default_cmd_callback),
N_("New layer with last values"),
G_CALLBACK (layers_new_last_vals_cmd_callback),
GIMP_HELP_LAYER_NEW },
{ "layers-duplicate", GIMP_STOCK_DUPLICATE,
......@@ -440,10 +440,10 @@ layers_actions_update (GimpActionGroup *group,
SET_VISIBLE ("layers-text-tool", text_layer && !ac);
SET_SENSITIVE ("layers-edit-attributes", layer && !fs && !ac);
SET_SENSITIVE ("layers-new", gimage);
SET_SENSITIVE ("layers-new-default", gimage);
SET_SENSITIVE ("layers-duplicate", layer && !fs && !ac);
SET_SENSITIVE ("layers-delete", layer && !ac);
SET_SENSITIVE ("layers-new", gimage);
SET_SENSITIVE ("layers-new-last-values", gimage);
SET_SENSITIVE ("layers-duplicate", layer && !fs && !ac);
SET_SENSITIVE ("layers-delete", layer && !ac);
SET_SENSITIVE ("layers-select-top", layer && !fs && !ac && prev);
SET_SENSITIVE ("layers-select-bottom", layer && !fs && !ac && next);
......
......@@ -256,8 +256,8 @@ layers_new_cmd_callback (GtkAction *action,
}
void
layers_new_default_cmd_callback (GtkAction *action,
gpointer data)
layers_new_last_vals_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
GimpLayer *floating_sel;
......@@ -303,11 +303,12 @@ layers_new_default_cmd_callback (GtkAction *action,
new_layer = gimp_layer_new (gimage, width, height,
gimp_image_base_type_with_alpha (gimage),
_("Empty Layer"), opacity, mode);
layer_name ? layer_name : _("New Layer"),
opacity, mode);
gimp_drawable_fill_by_type (GIMP_DRAWABLE (new_layer),
action_data_get_context (data),
GIMP_TRANSPARENT_FILL);
fill_type);
gimp_item_translate (GIMP_ITEM (new_layer), off_x, off_y, FALSE);
gimp_image_add_layer (gimage, new_layer, -1);
......
......@@ -26,7 +26,7 @@ void layers_edit_attributes_cmd_callback (GtkAction *action,
gpointer data);
void layers_new_cmd_callback (GtkAction *action,
gpointer data);
void layers_new_default_cmd_callback (GtkAction *action,
void layers_new_last_vals_cmd_callback (GtkAction *action,
gpointer data);
void layers_select_cmd_callback (GtkAction *action,
......
......@@ -102,12 +102,13 @@ static GimpActionEntry select_actions[] =
{ "select-stroke", GIMP_STOCK_SELECTION_STROKE,
N_("_Stroke Selection..."), NULL,
N_("Stroke selection"),
N_("Stroke selection..."),
G_CALLBACK (select_stroke_cmd_callback),
GIMP_HELP_SELECTION_STROKE },
{ "select-stroke-last-vals", GIMP_STOCK_SELECTION_STROKE,
"Stroke Selection with last Values", NULL, NULL,
{ "select-stroke-last-values", GIMP_STOCK_SELECTION_STROKE,
N_("_Stroke Selection"), NULL,
N_("Stroke selection with last values"),
G_CALLBACK (select_stroke_last_vals_cmd_callback),
GIMP_HELP_SELECTION_STROKE }
};
......@@ -152,9 +153,9 @@ select_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("select-grow", drawable && sel);
SET_SENSITIVE ("select-border", drawable && sel);
SET_SENSITIVE ("select-save", drawable && !fs);
SET_SENSITIVE ("select-stroke", drawable && sel);
SET_SENSITIVE ("select-stroke-last-vals", drawable && sel);
SET_SENSITIVE ("select-save", drawable && !fs);
SET_SENSITIVE ("select-stroke", drawable && sel);
SET_SENSITIVE ("select-stroke-last-values", drawable && sel);
#undef SET_SENSITIVE
}
......@@ -57,14 +57,14 @@ static GimpActionEntry vectors_actions[] =
{ "vectors-new", GTK_STOCK_NEW,
N_("_New Path..."), "",
N_("New path dialog"),
N_("New path..."),
G_CALLBACK (vectors_new_cmd_callback),
GIMP_HELP_PATH_NEW },
{ "vectors-new-default", GTK_STOCK_NEW,
{ "vectors-new-last-values", GTK_STOCK_NEW,
N_("_New Path"), "",
N_("New path"),
G_CALLBACK (vectors_new_default_cmd_callback),
N_("New path with last values"),
G_CALLBACK (vectors_new_last_vals_cmd_callback),
GIMP_HELP_PATH_NEW },
{ "vectors-duplicate", GIMP_STOCK_DUPLICATE,
......@@ -110,12 +110,13 @@ static GimpActionEntry vectors_actions[] =
{ "vectors-stroke", GIMP_STOCK_PATH_STROKE,
N_("Stro_ke Path..."), NULL,
N_("Stroke path"),
N_("Stroke path..."),
G_CALLBACK (vectors_stroke_cmd_callback),
GIMP_HELP_PATH_STROKE },
{ "vectors-stroke-last-vals", GIMP_STOCK_PATH_STROKE,
"Stroke Path with last Values", NULL, NULL,
{ "vectors-stroke-last-values", GIMP_STOCK_PATH_STROKE,
N_("Stro_ke Path"), NULL,
N_("Stroke path with last values"),
G_CALLBACK (vectors_stroke_last_vals_cmd_callback),
GIMP_HELP_PATH_STROKE },
......@@ -278,11 +279,11 @@ vectors_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("vectors-path-tool", vectors);
SET_SENSITIVE ("vectors-edit-attributes", vectors);
SET_SENSITIVE ("vectors-new", gimage);
SET_SENSITIVE ("vectors-new-default", gimage);
SET_SENSITIVE ("vectors-duplicate", vectors);
SET_SENSITIVE ("vectors-delete", vectors);
SET_SENSITIVE ("vectors-merge-visible", n_vectors > 1);
SET_SENSITIVE ("vectors-new", gimage);
SET_SENSITIVE ("vectors-new-last-values", gimage);
SET_SENSITIVE ("vectors-duplicate", vectors);
SET_SENSITIVE ("vectors-delete", vectors);
SET_SENSITIVE ("vectors-merge-visible", n_vectors > 1);
SET_SENSITIVE ("vectors-raise", vectors && prev);
SET_SENSITIVE ("vectors-raise-to-top", vectors && prev);
......@@ -304,7 +305,7 @@ vectors_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("vectors-selection-to-vectors-short", gimage && !mask_empty);
SET_SENSITIVE ("vectors-selection-to-vectors-advanced", gimage && !mask_empty);
SET_SENSITIVE ("vectors-stroke", vectors);
SET_SENSITIVE ("vectors-stroke-last-vals", vectors);
SET_SENSITIVE ("vectors-stroke-last-values", vectors);
SET_SENSITIVE ("vectors-selection-replace", vectors);
SET_SENSITIVE ("vectors-selection-from-vectors", vectors);
......
......@@ -174,14 +174,15 @@ vectors_new_cmd_callback (GtkAction *action,
}
void
vectors_new_default_cmd_callback (GtkAction *action,
gpointer data)
vectors_new_last_vals_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *gimage;
GimpVectors *new_vectors;
return_if_no_image (gimage, data);
new_vectors = gimp_vectors_new (gimage, _("Empty Path"));
new_vectors = gimp_vectors_new (gimage,
vectors_name ? vectors_name : _("New Path"));
gimp_image_add_vectors (gimage, new_vectors, -1);
......
......@@ -26,7 +26,7 @@ void vectors_edit_attributes_cmd_callback (GtkAction *action,
gpointer data);
void vectors_new_cmd_callback (GtkAction *action,
gpointer data);
void vectors_new_default_cmd_callback (GtkAction *action,
void vectors_new_last_vals_cmd_callback (GtkAction *action,
gpointer data);
void vectors_raise_cmd_callback (GtkAction *action,
......
......@@ -127,7 +127,7 @@ gimp_channel_tree_view_class_init (GimpChannelTreeViewClass *klass)
item_view_class->activate_action = "channels-edit-attributes";
item_view_class->edit_action = "channels-edit-attributes";
item_view_class->new_action = "channels-new";
item_view_class->new_default_action = "channels-new-default";
item_view_class->new_default_action = "channels-new-last-values";
item_view_class->raise_action = "channels-raise";
item_view_class->raise_top_action = "channels-raise-to-top";
item_view_class->lower_action = "channels-lower";
......
......@@ -418,8 +418,8 @@ gimp_item_tree_view_constructor (GType type,
item_view->new_button =
gimp_editor_add_action_button (editor, item_view_class->action_group,
item_view_class->new_default_action,
item_view_class->new_action,
item_view_class->new_default_action,
GDK_SHIFT_MASK,
NULL);
/* connect "drop to new" manually as it makes a difference whether
......
......@@ -240,7 +240,7 @@ gimp_layer_tree_view_class_init (GimpLayerTreeViewClass *klass)
item_view_class->activate_action = "layers-text-tool";
item_view_class->edit_action = "layers-edit-attributes";
item_view_class->new_action = "layers-new";
item_view_class->new_default_action = "layers-new-default";
item_view_class->new_default_action = "layers-new-last-values";
item_view_class->raise_action = "layers-raise";
item_view_class->raise_top_action = "layers-raise-to-top";
item_view_class->lower_action = "layers-lower";
......
......@@ -187,7 +187,10 @@ gimp_selection_editor_constructor (GType type,
editor->stroke_button =
gimp_editor_add_action_button (GIMP_EDITOR (editor), "select",
"select-stroke", NULL);
"select-stroke",
"select-stroke-last-values",
GDK_SHIFT_MASK,
NULL);
return object;
}
......
......@@ -141,7 +141,7 @@ gimp_vectors_tree_view_class_init (GimpVectorsTreeViewClass *klass)
item_view_class->activate_action = "vectors-path-tool";
item_view_class->edit_action = "vectors-edit-attributes";
item_view_class->new_action = "vectors-new";
item_view_class->new_default_action = "vectors-new-default";
item_view_class->new_default_action = "vectors-new-last-values";
item_view_class->raise_action = "vectors-raise";
item_view_class->raise_top_action = "vectors-raise-to-top";
item_view_class->lower_action = "vectors-lower";
......@@ -210,7 +210,10 @@ gimp_vectors_tree_view_constructor (GType type,
view->stroke_button =
gimp_editor_add_action_button (editor, "vectors",
"vectors-stroke", NULL);
"vectors-stroke",
"vectors-stroke-last-values",
GDK_SHIFT_MASK,
NULL);
gimp_container_view_enable_dnd (GIMP_CONTAINER_VIEW (editor),
GTK_BUTTON (view->stroke_button),
GIMP_TYPE_VECTORS);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment