From fd6d30fd305a62c37b4175471571b445552563e9 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Sat, 23 Oct 2004 00:53:48 +0000 Subject: [PATCH] When there are variants of actions with and without dialog, let the 2004-10-23 Michael Natterer 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 +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 clicking the stroke buttons. --- ChangeLog | 30 ++++++++++++++++++++++++++++++ app/actions/channels-actions.c | 10 +++++----- app/actions/channels-commands.c | 9 +++++---- app/actions/channels-commands.h | 2 +- app/actions/layers-actions.c | 16 ++++++++-------- app/actions/layers-commands.c | 9 +++++---- app/actions/layers-commands.h | 2 +- app/actions/select-actions.c | 13 +++++++------ app/actions/vectors-actions.c | 27 ++++++++++++++------------- app/actions/vectors-commands.c | 7 ++++--- app/actions/vectors-commands.h | 2 +- app/widgets/gimpchanneltreeview.c | 2 +- app/widgets/gimpitemtreeview.c | 2 +- app/widgets/gimplayertreeview.c | 2 +- app/widgets/gimpselectioneditor.c | 5 ++++- app/widgets/gimpvectorstreeview.c | 7 +++++-- 16 files changed, 93 insertions(+), 52 deletions(-) diff --git a/ChangeLog b/ChangeLog index 967024b833..2c357f9b0c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,33 @@ +2004-10-23 Michael Natterer + + 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 + +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 + clicking the stroke buttons. + 2004-10-23 Sven Neumann * libgimpthumb/gimpthumbnail.c (gimp_thumbnail_save): save to a diff --git a/app/actions/channels-actions.c b/app/actions/channels-actions.c index 84da8057f7..f3fc00e6ea 100644 --- a/app/actions/channels-actions.c +++ b/app/actions/channels-actions.c @@ -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); diff --git a/app/actions/channels-commands.c b/app/actions/channels-commands.c index 67c5c2ecf6..59eff2b134 100644 --- a/app/actions/channels-commands.c +++ b/app/actions/channels-commands.c @@ -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), diff --git a/app/actions/channels-commands.h b/app/actions/channels-commands.h index 5895331990..95242fba47 100644 --- a/app/actions/channels-commands.h +++ b/app/actions/channels-commands.h @@ -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, diff --git a/app/actions/layers-actions.c b/app/actions/layers-actions.c index 571cdb2c4a..a0a26cd95c 100644 --- a/app/actions/layers-actions.c +++ b/app/actions/layers-actions.c @@ -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); diff --git a/app/actions/layers-commands.c b/app/actions/layers-commands.c index 758226168d..c201082c83 100644 --- a/app/actions/layers-commands.c +++ b/app/actions/layers-commands.c @@ -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); diff --git a/app/actions/layers-commands.h b/app/actions/layers-commands.h index eaf586a760..840144145d 100644 --- a/app/actions/layers-commands.h +++ b/app/actions/layers-commands.h @@ -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, diff --git a/app/actions/select-actions.c b/app/actions/select-actions.c index 13c31ff079..5373faa31a 100644 --- a/app/actions/select-actions.c +++ b/app/actions/select-actions.c @@ -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 } diff --git a/app/actions/vectors-actions.c b/app/actions/vectors-actions.c index 79c946f219..b9d1fc520a 100644 --- a/app/actions/vectors-actions.c +++ b/app/actions/vectors-actions.c @@ -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); diff --git a/app/actions/vectors-commands.c b/app/actions/vectors-commands.c index c0038f176c..63d221e702 100644 --- a/app/actions/vectors-commands.c +++ b/app/actions/vectors-commands.c @@ -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); diff --git a/app/actions/vectors-commands.h b/app/actions/vectors-commands.h index 4895abce26..64ee1ceb82 100644 --- a/app/actions/vectors-commands.h +++ b/app/actions/vectors-commands.h @@ -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, diff --git a/app/widgets/gimpchanneltreeview.c b/app/widgets/gimpchanneltreeview.c index ff2f176b7a..f9c424389d 100644 --- a/app/widgets/gimpchanneltreeview.c +++ b/app/widgets/gimpchanneltreeview.c @@ -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"; diff --git a/app/widgets/gimpitemtreeview.c b/app/widgets/gimpitemtreeview.c index 1245ccc537..176179349c 100644 --- a/app/widgets/gimpitemtreeview.c +++ b/app/widgets/gimpitemtreeview.c @@ -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 diff --git a/app/widgets/gimplayertreeview.c b/app/widgets/gimplayertreeview.c index 035e53e6c0..13a0e6a33c 100644 --- a/app/widgets/gimplayertreeview.c +++ b/app/widgets/gimplayertreeview.c @@ -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"; diff --git a/app/widgets/gimpselectioneditor.c b/app/widgets/gimpselectioneditor.c index c9d8f7273c..6b146bb755 100644 --- a/app/widgets/gimpselectioneditor.c +++ b/app/widgets/gimpselectioneditor.c @@ -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; } diff --git a/app/widgets/gimpvectorstreeview.c b/app/widgets/gimpvectorstreeview.c index 3a7ce463ef..48900bfa44 100644 --- a/app/widgets/gimpvectorstreeview.c +++ b/app/widgets/gimpvectorstreeview.c @@ -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);