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

removed "<>" around modifiers.

2005-09-14  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpwidgets-utils.c (gimp_get_mod_name_*): removed
	"<>" around modifiers.

	* app/tools/gimpbucketfilloptions.c
	* app/tools/gimpcolorpickeroptions.c
	* app/tools/gimpconvolvetool.c
	* app/tools/gimpcropoptions.c
	* app/tools/gimpdodgeburntool.c
	* app/tools/gimperasertool.c
	* app/tools/gimpflipoptions.c
	* app/tools/gimpimagemaptool.c
	* app/tools/gimpmagnifyoptions.c
	* app/tools/gimpmoveoptions.c
	* app/tools/gimpselectionoptions.c
	* app/tools/gimptransformoptions.c
	* app/widgets/gimpeditor.c
	* app/widgets/gimpthumbbox.c: added "()" around the whole modifier
	string where appropriate.

	* app/widgets/gimptoolbox.c (gimp_toolbox_button_accel_changed):
	use gimp_get_mod_string() instead of homebrewn variant of the same
	code.

	* app/widgets/gimpcontrollerkeyboard.c: replaced tons of static
	translatable strings containing modifiers by generated ones using
	gimp_get_mod_string() (traded for some more memory consumption).
parent 6017accc
2005-09-14 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpwidgets-utils.c (gimp_get_mod_name_*): removed
"<>" around modifiers.
* app/tools/gimpbucketfilloptions.c
* app/tools/gimpcolorpickeroptions.c
* app/tools/gimpconvolvetool.c
* app/tools/gimpcropoptions.c
* app/tools/gimpdodgeburntool.c
* app/tools/gimperasertool.c
* app/tools/gimpflipoptions.c
* app/tools/gimpimagemaptool.c
* app/tools/gimpmagnifyoptions.c
* app/tools/gimpmoveoptions.c
* app/tools/gimpselectionoptions.c
* app/tools/gimptransformoptions.c
* app/widgets/gimpeditor.c
* app/widgets/gimpthumbbox.c: added "()" around the whole modifier
string where appropriate.
* app/widgets/gimptoolbox.c (gimp_toolbox_button_accel_changed):
use gimp_get_mod_string() instead of homebrewn variant of the same
code.
* app/widgets/gimpcontrollerkeyboard.c: replaced tons of static
translatable strings containing modifiers by generated ones using
gimp_get_mod_string() (traded for some more memory consumption).
2005-09-13 Michael Natterer <mitch@gimp.org>
* app/actions/dockable-actions.c (dockable_actions_update): don't
......
......@@ -234,7 +234,7 @@ gimp_bucket_fill_options_gui (GimpToolOptions *tool_options)
vbox = gimp_paint_options_gui (tool_options);
/* fill type */
str = g_strdup_printf (_("Fill Type %s"),
str = g_strdup_printf (_("Fill Type (%s)"),
gimp_get_mod_string (GDK_CONTROL_MASK)),
frame = gimp_prop_enum_radio_frame_new (config, "fill-mode", str, 0, 0);
g_free (str);
......@@ -246,7 +246,7 @@ gimp_bucket_fill_options_gui (GimpToolOptions *tool_options)
gimp_enum_radio_frame_add (GTK_FRAME (frame), hbox, GIMP_PATTERN_BUCKET_FILL);
/* fill selection */
str = g_strdup_printf (_("Affected Area %s"),
str = g_strdup_printf (_("Affected Area (%s)"),
gimp_get_mod_string (GDK_SHIFT_MASK));
frame = gimp_prop_boolean_radio_frame_new (config, "fill-selection",
str,
......
......@@ -179,7 +179,7 @@ gimp_color_picker_options_gui (GimpToolOptions *tool_options)
gtk_widget_show (button);
/* the pick FG/BG frame */
str = g_strdup_printf (_("Pick Mode %s"),
str = g_strdup_printf (_("Pick Mode (%s)"),
gimp_get_mod_string (GDK_CONTROL_MASK));
frame = gimp_prop_enum_radio_frame_new (config, "pick-mode", str, -1, -1);
g_free (str);
......@@ -188,7 +188,7 @@ gimp_color_picker_options_gui (GimpToolOptions *tool_options)
gtk_widget_show (frame);
/* the add to palette toggle */
str = g_strdup_printf (_("Add to palette %s"),
str = g_strdup_printf (_("Add to palette (%s)"),
gimp_get_mod_string (GDK_SHIFT_MASK));
button = gimp_prop_check_button_new (config, "add-to-palette", str);
g_free (str);
......
......@@ -187,7 +187,7 @@ gimp_convolve_options_gui (GimpToolOptions *tool_options)
vbox = gimp_paint_options_gui (tool_options);
/* the type radio box */
str = g_strdup_printf (_("Convolve Type %s"),
str = g_strdup_printf (_("Convolve Type (%s)"),
gimp_get_mod_string (GDK_CONTROL_MASK));
frame = gimp_prop_enum_radio_frame_new (config, "type",
......
......@@ -218,7 +218,7 @@ gimp_crop_options_gui (GimpToolOptions *tool_options)
vbox = gimp_tool_options_gui (tool_options);
/* tool toggle */
str = g_strdup_printf (_("Tool Toggle %s"),
str = g_strdup_printf (_("Tool Toggle (%s)"),
gimp_get_mod_string (GDK_CONTROL_MASK));
frame = gimp_prop_enum_radio_frame_new (config, "crop-mode",
......
......@@ -188,7 +188,7 @@ gimp_dodge_burn_options_gui (GimpToolOptions *tool_options)
vbox = gimp_paint_options_gui (tool_options);
/* the type (dodge or burn) */
str = g_strdup_printf (_("Type %s"),
str = g_strdup_printf (_("Type (%s)"),
gimp_get_mod_string (GDK_CONTROL_MASK));
frame = gimp_prop_enum_radio_frame_new (config, "type",
......
......@@ -179,7 +179,7 @@ gimp_eraser_options_gui (GimpToolOptions *tool_options)
vbox = gimp_paint_options_gui (tool_options);
/* the anti_erase toggle */
str = g_strdup_printf (_("Anti erase %s"),
str = g_strdup_printf (_("Anti erase (%s)"),
gimp_get_mod_string (GDK_MOD1_MASK));
button = gimp_prop_check_button_new (config, "anti-erase", str);
......
......@@ -162,7 +162,7 @@ gimp_flip_options_gui (GimpToolOptions *tool_options)
gtk_widget_show (label);
/* tool toggle */
str = g_strdup_printf (_("Flip Type %s"),
str = g_strdup_printf (_("Flip Type (%s)"),
gimp_get_mod_string (GDK_CONTROL_MASK));
frame = gimp_prop_enum_radio_frame_new (config, "flip-type",
......
......@@ -291,7 +291,7 @@ gimp_image_map_tool_initialize (GimpTool *tool,
if (klass->load_button_tip)
{
gchar *str = g_strdup_printf ("%s\n"
"%s %s",
"(%s) %s",
klass->load_button_tip,
gimp_get_mod_string (GDK_SHIFT_MASK),
_("Quick Load"));
......@@ -320,7 +320,7 @@ gimp_image_map_tool_initialize (GimpTool *tool,
if (klass->save_button_tip)
{
gchar *str = g_strdup_printf ("%s\n"
"%s %s",
"(%s) %s",
klass->save_button_tip,
gimp_get_mod_string (GDK_SHIFT_MASK),
_("Quick Save"));
......
......@@ -203,7 +203,7 @@ gimp_magnify_options_gui (GimpToolOptions *tool_options)
gtk_widget_show (button);
/* tool toggle */
str = g_strdup_printf (_("Tool Toggle %s"),
str = g_strdup_printf (_("Tool Toggle (%s)"),
gimp_get_mod_string (GDK_CONTROL_MASK));
frame = gimp_prop_enum_radio_frame_new (config, "zoom-type",
......
......@@ -212,7 +212,7 @@ gimp_move_options_gui (GimpToolOptions *tool_options)
gtk_widget_show (label);
/* tool toggle */
title = g_strdup_printf (_("Tool Toggle %s"),
title = g_strdup_printf (_("Tool Toggle (%s)"),
gimp_get_mod_string (GDK_SHIFT_MASK));
frame = gimp_prop_boolean_radio_frame_new (config, "move-current",
......
......@@ -408,7 +408,7 @@ gimp_selection_options_gui (GimpToolOptions *tool_options)
if (data && data->tip_text)
{
gchar *tip = g_strdup_printf ("%s %s", data->tip_text, modifier);
gchar *tip = g_strdup_printf ("%s (%s)", data->tip_text, modifier);
gimp_help_set_help_data (button, tip, NULL);
g_free (tip);
......
......@@ -421,7 +421,7 @@ gimp_transform_options_gui (GimpToolOptions *tool_options)
{
gchar *str;
str = g_strdup_printf (_("15 degrees %s"),
str = g_strdup_printf (_("15 degrees (%s)"),
gimp_get_mod_string (GDK_CONTROL_MASK));
button = gimp_prop_check_button_new (config, "constrain-1", str);
......@@ -441,11 +441,11 @@ gimp_transform_options_gui (GimpToolOptions *tool_options)
initial = ((options->constrain_1 ? 1 : 0) +
(options->constrain_2 ? 2 : 0));
str1 = g_strdup_printf (_("Keep height %s"),
str1 = g_strdup_printf (_("Keep height (%s)"),
gimp_get_mod_string (GDK_CONTROL_MASK));
str2 = g_strdup_printf (_("Keep width %s"),
str2 = g_strdup_printf (_("Keep width (%s)"),
gimp_get_mod_string (GDK_MOD1_MASK));
str3 = g_strdup_printf (_("Keep aspect %s"),
str3 = g_strdup_printf (_("Keep aspect (%s)"),
gimp_get_mod_string (GDK_CONTROL_MASK |
GDK_MOD1_MASK));
......
......@@ -31,6 +31,7 @@
#include "gimpcontrollerkeyboard.h"
#include "gimphelp-ids.h"
#include "gimpwidgets-utils.h"
#include "gimp-intl.h"
......@@ -42,7 +43,7 @@ struct _KeyboardEvent
guint keyval;
GdkModifierType modifiers;
const gchar *name;
const gchar *blurb;
gchar *blurb;
};
......@@ -62,104 +63,104 @@ static const gchar * gimp_controller_keyboard_get_event_blurb (GimpController *c
static GimpControllerClass *parent_class = NULL;
static const KeyboardEvent keyboard_events[] =
static KeyboardEvent keyboard_events[] =
{
{ GDK_Up, GDK_MOD1_MASK | GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"key-up-shift-control-alt",
N_("Cursor Up (Shift + Control + Alt)") },
N_("Cursor Up") },
{ GDK_Up, GDK_MOD1_MASK | GDK_CONTROL_MASK,
"key-up-control-alt",
N_("Cursor Up (Control + Alt)") },
N_("Cursor Up") },
{ GDK_Up, GDK_MOD1_MASK | GDK_SHIFT_MASK,
"key-up-shift-alt",
N_("Cursor Up (Shift + Alt)") },
N_("Cursor Up") },
{ GDK_Up, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"key-up-shift-control",
N_("Cursor Up (Shift + Control)") },
N_("Cursor Up") },
{ GDK_Up, GDK_MOD1_MASK,
"key-up-alt",
N_("Cursor Up (Alt)") },
N_("Cursor Up") },
{ GDK_Up, GDK_CONTROL_MASK,
"key-up-control",
N_("Cursor Up (Control)") },
N_("Cursor Up") },
{ GDK_Up, GDK_SHIFT_MASK,
"key-up-shift",
N_("Cursor Up (Shift)") },
N_("Cursor Up") },
{ GDK_Up, 0,
"key-up",
N_("Cursor Up") },
{ GDK_Down, GDK_MOD1_MASK | GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"key-down-shift-control-alt",
N_("Cursor Down (Shift + Control + Alt)") },
N_("Cursor Down") },
{ GDK_Down, GDK_MOD1_MASK | GDK_CONTROL_MASK,
"key-down-control-alt",
N_("Cursor Down (Control + Alt)") },
N_("Cursor Down") },
{ GDK_Down, GDK_MOD1_MASK | GDK_SHIFT_MASK,
"key-down-shift-alt",
N_("Cursor Down (Shift + Alt)") },
N_("Cursor Down") },
{ GDK_Down, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"key-down-shift-control",
N_("Cursor Down (Shift + Control)") },
N_("Cursor Down") },
{ GDK_Down, GDK_MOD1_MASK,
"key-down-alt",
N_("Cursor Down (Alt)") },
N_("Cursor Down") },
{ GDK_Down, GDK_CONTROL_MASK,
"key-down-control",
N_("Cursor Down (Control)") },
N_("Cursor Down") },
{ GDK_Down, GDK_SHIFT_MASK,
"key-down-shift",
N_("Cursor Down (Shift)") },
N_("Cursor Down") },
{ GDK_Down, 0,
"key-down",
N_("Cursor Down") },
{ GDK_Left, GDK_MOD1_MASK | GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"key-left-shift-control-alt",
N_("Cursor Left (Shift + Control + Alt)") },
N_("Cursor Left") },
{ GDK_Left, GDK_MOD1_MASK | GDK_CONTROL_MASK,
"key-left-control-alt",
N_("Cursor Left (Control + Alt)") },
N_("Cursor Left") },
{ GDK_Left, GDK_MOD1_MASK | GDK_SHIFT_MASK,
"key-left-shift-alt",
N_("Cursor Left (Shift + Alt)") },
N_("Cursor Left") },
{ GDK_Left, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"key-left-shift-control",
N_("Cursor Left (Shift + Control)") },
N_("Cursor Left") },
{ GDK_Left, GDK_MOD1_MASK,
"key-left-alt",
N_("Cursor Left (Alt)") },
N_("Cursor Left") },
{ GDK_Left, GDK_CONTROL_MASK,
"key-left-control",
N_("Cursor Left (Control)") },
N_("Cursor Left") },
{ GDK_Left, GDK_SHIFT_MASK,
"key-left-shift",
N_("Cursor Left (Shift)") },
N_("Cursor Left") },
{ GDK_Left, 0,
"key-left",
N_("Cursor Left") },
{ GDK_Right, GDK_MOD1_MASK | GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"key-right-shift-control-alt",
N_("Cursor Right (Shift + Control + Alt)") },
N_("Cursor Right") },
{ GDK_Right, GDK_MOD1_MASK | GDK_CONTROL_MASK,
"key-right-control-alt",
N_("Cursor Right (Control + Alt)") },
N_("Cursor Right") },
{ GDK_Right, GDK_MOD1_MASK | GDK_SHIFT_MASK,
"key-right-shift-alt",
N_("Cursor Right (Shift + Alt)") },
N_("Cursor Right") },
{ GDK_Right, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
"key-right-shift-control",
N_("Cursor Right (Shift + Control)") },
N_("Cursor Right") },
{ GDK_Right, GDK_MOD1_MASK,
"key-right-alt",
N_("Cursor Right (Alt)") },
N_("Cursor Right") },
{ GDK_Right, GDK_CONTROL_MASK,
"key-right-control",
N_("Cursor Right (Control)") },
N_("Cursor Right") },
{ GDK_Right, GDK_SHIFT_MASK,
"key-right-shift",
N_("Cursor Right (Shift)") },
N_("Cursor Right") },
{ GDK_Right, 0,
"key-right",
N_("Cursor Right") }
......@@ -215,6 +216,26 @@ gimp_controller_keyboard_class_init (GimpControllerKeyboardClass *klass)
static void
gimp_controller_keyboard_init (GimpControllerKeyboard *keyboard)
{
static gboolean event_names_initialized = FALSE;
if (! event_names_initialized)
{
gint i;
for (i = 0; i < G_N_ELEMENTS (keyboard_events); i++)
{
KeyboardEvent *kevent = &keyboard_events[i];
if (kevent->modifiers != 0)
{
kevent->blurb =
g_strdup_printf ("%s (%s)", gettext (kevent->blurb),
gimp_get_mod_string (kevent->modifiers));
}
}
event_names_initialized = TRUE;
}
}
static GObject *
......
......@@ -705,9 +705,9 @@ gimp_editor_add_action_button (GimpEditor *editor,
if (ext_tooltip)
{
gchar *tmp = g_strconcat (tooltip, "\n",
gchar *tmp = g_strconcat (tooltip, "\n(",
gimp_get_mod_string (mod_mask),
" ", ext_tooltip, NULL);
") ", ext_tooltip, NULL);
g_free (ext_tooltip);
g_free (tooltip);
......
......@@ -349,9 +349,10 @@ gimp_thumb_box_new (Gimp *gimp)
box);
str = g_strdup_printf (_("Click to update preview\n"
"%s Click to force update even "
"%s%sClick to force update even "
"if preview is up-to-date"),
gimp_get_mod_string (GDK_CONTROL_MASK));
gimp_get_mod_string (GDK_CONTROL_MASK),
gimp_get_mod_separator ());
gimp_help_set_help_data (ebox, str, NULL);
......
......@@ -631,70 +631,11 @@ gimp_toolbox_button_accel_changed (GtkAccelGroup *accel_group,
accel_key->accel_key &&
accel_key->accel_flags & GTK_ACCEL_VISIBLE)
{
/* mostly taken from gtk-2-0/gtk/gtkaccellabel.c:1.46
*/
GtkAccelLabelClass *accel_label_class;
GString *gstring;
gboolean seen_mod = FALSE;
gunichar ch;
accel_label_class = g_type_class_peek (GTK_TYPE_ACCEL_LABEL);
gstring = g_string_new (tool_info->help);
g_string_append (gstring, " ");
if (accel_key->accel_mods & GDK_SHIFT_MASK)
{
g_string_append (gstring, accel_label_class->mod_name_shift);
seen_mod = TRUE;
}
if (accel_key->accel_mods & GDK_CONTROL_MASK)
{
if (seen_mod)
g_string_append (gstring, accel_label_class->mod_separator);
g_string_append (gstring, accel_label_class->mod_name_control);
seen_mod = TRUE;
}
if (accel_key->accel_mods & GDK_MOD1_MASK)
{
if (seen_mod)
g_string_append (gstring, accel_label_class->mod_separator);
g_string_append (gstring, accel_label_class->mod_name_alt);
seen_mod = TRUE;
}
if (seen_mod)
g_string_append (gstring, accel_label_class->mod_separator);
ch = gdk_keyval_to_unicode (accel_key->accel_key);
if (ch && (g_unichar_isgraph (ch) || ch == ' ') &&
(ch < 0x80 || accel_label_class->latin1_to_char))
{
switch (ch)
{
case ' ':
g_string_append (gstring, "Space");
break;
case '\\':
g_string_append (gstring, "Backslash");
break;
default:
g_string_append_unichar (gstring, g_unichar_toupper (ch));
break;
}
}
else
{
gchar *tmp;
tmp = gtk_accelerator_name (accel_key->accel_key, 0);
if (tmp[0] != 0 && tmp[1] == 0)
tmp[0] = g_ascii_toupper (tmp[0]);
gimp_toolbox_substitute_underscores (tmp);
g_string_append (gstring, tmp);
g_free (tmp);
}
tooltip = g_string_free (gstring, FALSE);
tooltip = g_strconcat (tool_info->help,
" ",
gimp_get_accel_string (accel_key->accel_key,
accel_key->accel_mods),
NULL);
}
else
{
......
......@@ -383,12 +383,6 @@ gimp_get_icon_size (GtkWidget *widget,
return icon_size;
}
/* The format string which is used to display modifier names
* <Shift>, <Ctrl> and <Alt>
*/
#define GIMP_MOD_NAME_FORMAT_STRING N_("<%s>")
const gchar *
gimp_get_mod_name_shift (void)
{
......@@ -399,8 +393,7 @@ gimp_get_mod_name_shift (void)
GtkAccelLabelClass *accel_label_class;
accel_label_class = g_type_class_ref (GTK_TYPE_ACCEL_LABEL);
mod_name_shift = g_strdup_printf (gettext (GIMP_MOD_NAME_FORMAT_STRING),
accel_label_class->mod_name_shift);
mod_name_shift = g_strdup (accel_label_class->mod_name_shift);
g_type_class_unref (accel_label_class);
}
......@@ -417,8 +410,7 @@ gimp_get_mod_name_control (void)
GtkAccelLabelClass *accel_label_class;
accel_label_class = g_type_class_ref (GTK_TYPE_ACCEL_LABEL);
mod_name_control = g_strdup_printf (gettext (GIMP_MOD_NAME_FORMAT_STRING),
accel_label_class->mod_name_control);
mod_name_control = g_strdup (accel_label_class->mod_name_control);
g_type_class_unref (accel_label_class);
}
......@@ -435,8 +427,7 @@ gimp_get_mod_name_alt (void)
GtkAccelLabelClass *accel_label_class;
accel_label_class = g_type_class_ref (GTK_TYPE_ACCEL_LABEL);
mod_name_alt = g_strdup_printf (gettext (GIMP_MOD_NAME_FORMAT_STRING),
accel_label_class->mod_name_alt);
mod_name_alt = g_strdup (accel_label_class->mod_name_alt);
g_type_class_unref (accel_label_class);
}
......
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