attach the first radio button as object data to the returned frame.

2003-10-19  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimppropwidgets.c (gimp_prop_enum_radio_frame_new)
	(gimp_prop_boolean_radio_frame_new): attach the first radio button
	as object data to the returned frame.

	* app/tools/gimpmoveoptions.c: change labels and sensitivity of
	the Tool Toggle frame depending on the selected move-type.

	* app/tools/gimpcropoptions.c: use the term "Active Layer" instead
	of "Current Layer". Please object if you dislike this change.
This commit is contained in:
Sven Neumann 2003-10-19 15:38:10 +00:00 committed by Sven Neumann
parent 5939356507
commit 28e1ecebfc
5 changed files with 74 additions and 14 deletions

View File

@ -1,3 +1,15 @@
2003-10-19 Sven Neumann <sven@gimp.org>
* app/widgets/gimppropwidgets.c (gimp_prop_enum_radio_frame_new)
(gimp_prop_boolean_radio_frame_new): attach the first radio button
as object data to the returned frame.
* app/tools/gimpmoveoptions.c: change labels and sensitivity of
the Tool Toggle frame depending on the selected move-type.
* app/tools/gimpcropoptions.c: use the term "Active Layer" instead
of "Current Layer". Please object if you dislike this change.
2003-10-19 Maurits Rijk <lpeek.mrijk@consunet.nl>
* Makefile.am

View File

@ -195,7 +195,7 @@ gimp_crop_options_gui (GimpToolOptions *tool_options)
/* layer toggle */
button = gimp_prop_check_button_new (config, "layer-only",
_("Current Layer only"));
_("Active Layer only"));
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);

View File

@ -123,9 +123,7 @@ gimp_move_options_set_property (GObject *object,
const GValue *value,
GParamSpec *pspec)
{
GimpMoveOptions *options;
options = GIMP_MOVE_OPTIONS (object);
GimpMoveOptions *options = GIMP_MOVE_OPTIONS (object);
switch (property_id)
{
@ -147,9 +145,7 @@ gimp_move_options_get_property (GObject *object,
GValue *value,
GParamSpec *pspec)
{
GimpMoveOptions *options;
options = GIMP_MOVE_OPTIONS (object);
GimpMoveOptions *options = GIMP_MOVE_OPTIONS (object);
switch (property_id)
{
@ -165,6 +161,46 @@ gimp_move_options_get_property (GObject *object,
}
}
static void
gimp_move_options_notify_type (GimpMoveOptions *move_options,
GParamSpec *pspec,
GtkWidget *frame)
{
const gchar *false_label = NULL;
const gchar *true_label = NULL;
GtkWidget *button;
GSList *group;
button = g_object_get_data (G_OBJECT (frame), "radio-button");
switch (move_options->move_type)
{
case GIMP_TRANSFORM_TYPE_LAYER:
false_label = _("Pick a Layer or Guide to Move");
true_label = _("Move the Active Layer");
break;
case GIMP_TRANSFORM_TYPE_SELECTION:
false_label = _("Move Selection");
true_label = _("Move Selection");
break;
case GIMP_TRANSFORM_TYPE_PATH:
false_label = _("Pick a Path to Move");
true_label = _("Move the Active Path");
break;
}
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (button));
gtk_button_set_label (GTK_BUTTON (group->data), true_label);
group = g_slist_next (group);
gtk_button_set_label (GTK_BUTTON (group->data), false_label);
gtk_widget_set_sensitive (frame,
move_options->move_type != GIMP_TRANSFORM_TYPE_SELECTION);
}
GtkWidget *
gimp_move_options_gui (GimpToolOptions *tool_options)
{
@ -173,7 +209,7 @@ gimp_move_options_gui (GimpToolOptions *tool_options)
GtkWidget *hbox;
GtkWidget *label;
GtkWidget *frame;
gchar *str;
gchar *title;
config = G_OBJECT (tool_options);
@ -189,17 +225,21 @@ gimp_move_options_gui (GimpToolOptions *tool_options)
gtk_widget_show (label);
/* tool toggle */
str = g_strdup_printf (_("Tool Toggle %s"), gimp_get_mod_name_shift ());
title = g_strdup_printf (_("Tool Toggle %s"), gimp_get_mod_name_shift ());
frame = gimp_prop_boolean_radio_frame_new (config, "move-current",
str,
_("Move Current Layer or Path"),
_("Pick a Layer, Path\n"
"or Guide to Move"));
title, "true", "false");
gimp_move_options_notify_type (GIMP_MOVE_OPTIONS (config), NULL, frame);
g_signal_connect_object (config, "notify::move-type",
G_CALLBACK (gimp_move_options_notify_type),
frame, 0);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
g_free (str);
g_free (title);
return vbox;
}

View File

@ -508,6 +508,8 @@ gimp_prop_enum_radio_frame_new (GObject *config,
G_CALLBACK (gimp_prop_radio_button_notify),
button);
g_object_set_data (G_OBJECT (frame), "radio-button", button);
return frame;
}
@ -548,6 +550,8 @@ gimp_prop_boolean_radio_frame_new (GObject *config,
G_CALLBACK (gimp_prop_radio_button_notify),
button);
g_object_set_data (G_OBJECT (frame), "radio-button", button);
return frame;
}

View File

@ -508,6 +508,8 @@ gimp_prop_enum_radio_frame_new (GObject *config,
G_CALLBACK (gimp_prop_radio_button_notify),
button);
g_object_set_data (G_OBJECT (frame), "radio-button", button);
return frame;
}
@ -548,6 +550,8 @@ gimp_prop_boolean_radio_frame_new (GObject *config,
G_CALLBACK (gimp_prop_radio_button_notify),
button);
g_object_set_data (G_OBJECT (frame), "radio-button", button);
return frame;
}