Commit d085c151 authored by Tomas Ogren's avatar Tomas Ogren Committed by Tomas Ögren

locale-wrapper for menus_set_sensitive (..._locale) and menus_set_state

1999-06-06  Tomas Ogren  <stric@ing.umu.se>

* app/menus.[ch]: locale-wrapper for menus_set_sensitive (..._locale)
  and menus_set_state (..._locale) which splits the menu-entry
  "<Foo>/Bar/Baz" into "<Foo>" and "/Bar/Baz" to remove double
  translations
* app/app_procs.c, app/channels_dialog.c, app/fileops.c, app/gdisplay.c
* app/gdisplay_ops.c, app/layers_dialog.c, app/paths_dialog.c
* app/plug_in.c:
  Use the _locale version from above
parent 79be4895
1999-06-06 Tomas Ogren <stric@ing.umu.se>
* app/menus.[ch]: locale-wrapper for menus_set_sensitive (..._locale)
and menus_set_state (..._locale) which splits the menu-entry
"<Foo>/Bar/Baz" into "<Foo>" and "/Bar/Baz" to remove double
translations
* app/app_procs.c, app/channels_dialog.c, app/fileops.c, app/gdisplay.c
* app/gdisplay_ops.c, app/layers_dialog.c, app/paths_dialog.c
* app/plug_in.c:
Use the _locale version from above
1999-06-06 Tomas Ogren <stric@ing.umu.se>
* app/{color_notebook.c,color_select.c,lc_dialog.c,temp_buf.c,tool_options.c,tools.c}:
......
......@@ -1275,11 +1275,11 @@ plug_in_set_menu_sensitivity (int base_type)
break;
}
menus_set_sensitive (gettext(proc_def->menu_path), sensitive);
menus_set_sensitive (proc_def->menu_path, sensitive);
if (last_plug_in && (last_plug_in == &(proc_def->db_info)))
{
menus_set_sensitive (_("<Image>/Filters/Repeat last"), sensitive);
menus_set_sensitive (_("<Image>/Filters/Re-show last"), sensitive);
menus_set_sensitive_locale ("<Image>", N_("/Filters/Repeat last"), sensitive);
menus_set_sensitive_locale ("<Image>", N_("/Filters/Re-show last"), sensitive);
}
}
}
......
......@@ -693,8 +693,8 @@ static void
really_quit_cancel_callback (GtkWidget *widget,
GtkWidget *dialog)
{
menus_set_sensitive (_("<Toolbox>/File/Quit"), TRUE);
menus_set_sensitive (_("<Image>/File/Quit"), TRUE);
menus_set_sensitive_locale ("<Toolbox>", N_("/File/Quit"), TRUE);
menus_set_sensitive_locale ("<Image>", N_("/File/Quit"), TRUE);
gtk_widget_destroy (dialog);
}
......@@ -714,8 +714,8 @@ really_quit_dialog (void)
GtkWidget *button;
GtkWidget *label;
menus_set_sensitive (_("<Toolbox>/File/Quit"), FALSE);
menus_set_sensitive (_("<Image>/File/Quit"), FALSE);
menus_set_sensitive_locale ("<Toolbox>", N_("/File/Quit"), FALSE);
menus_set_sensitive_locale ("<Image>", N_("/File/Quit"), FALSE);
dialog = gtk_dialog_new ();
gtk_window_set_wmclass (GTK_WINDOW (dialog), "really_quit", "Gimp");
......
......@@ -534,31 +534,31 @@ channels_dialog_set_menu_sensitivity ()
else
aux_sens = FALSE;
menus_set_sensitive (_("<Channels>/New Channel"), !fs_sens);
menus_set_sensitive_locale ("<Channels>", N_("/New Channel"), !fs_sens);
gtk_widget_set_sensitive (channels_ops_buttons[0].widget, !fs_sens);
menus_set_sensitive (_("<Channels>/Raise Channel"), !fs_sens && aux_sens);
menus_set_sensitive_locale ("<Channels>", N_("/Raise Channel"), !fs_sens && aux_sens);
gtk_widget_set_sensitive (channels_ops_buttons[1].widget,
!fs_sens && aux_sens);
menus_set_sensitive (_("<Channels>/Lower Channel"), !fs_sens && aux_sens);
menus_set_sensitive_locale ("<Channels>", N_("/Lower Channel"), !fs_sens && aux_sens);
gtk_widget_set_sensitive (channels_ops_buttons[2].widget,
!fs_sens && aux_sens);
menus_set_sensitive (_("<Channels>/Duplicate Channel"), !fs_sens && aux_sens);
menus_set_sensitive_locale ("<Channels>", N_("/Duplicate Channel"), !fs_sens && aux_sens);
gtk_widget_set_sensitive (channels_ops_buttons[3].widget,
!fs_sens && aux_sens);
menus_set_sensitive (_("<Channels>/Delete Channel"), !fs_sens && aux_sens);
menus_set_sensitive_locale ("<Channels>", N_("/Delete Channel"), !fs_sens && aux_sens);
gtk_widget_set_sensitive (channels_ops_buttons[4].widget,
!fs_sens && aux_sens);
menus_set_sensitive (_("<Channels>/Channel to Selection"), aux_sens);
menus_set_sensitive_locale ("<Channels>", N_("/Channel to Selection"), aux_sens);
gtk_widget_set_sensitive (channels_ops_buttons[5].widget, aux_sens);
menus_set_sensitive (_("<Channels>/Add to Selection"), aux_sens);
menus_set_sensitive (_("<Channels>/Subtract From Selection"), aux_sens);
menus_set_sensitive (_("<Channels>/Intersect With Selection"), aux_sens);
menus_set_sensitive_locale ("<Channels>", N_("/Add to Selection"), aux_sens);
menus_set_sensitive_locale ("<Channels>", N_("/Subtract From Selection"), aux_sens);
menus_set_sensitive_locale ("<Channels>", N_("/Intersect With Selection"), aux_sens);
}
......
......@@ -1568,62 +1568,62 @@ gdisplay_set_menu_sensitivity (GDisplay *gdisp)
lnum = g_slist_length (gdisp->gimage->layers);
}
menus_set_sensitive (_("<Image>/Layers/Stack/Previous Layer"), !fs && !aux && lp && lind > 0);
menus_set_sensitive (_("<Image>/Layers/Stack/Next Layer"), !fs && !aux && lp && lind < (lnum - 1));
menus_set_sensitive (_("<Image>/Layers/Stack/Raise Layer"), !fs && !aux && lp && alpha && lind > 0);
menus_set_sensitive (_("<Image>/Layers/Stack/Lower Layer"), !fs && !aux && lp && alpha && lind < (lnum - 1));
menus_set_sensitive (_("<Image>/Layers/Stack/Layer to Top"), !fs && !aux && lp && alpha && lind > 0);
menus_set_sensitive (_("<Image>/Layers/Stack/Layer to Bottom"), !fs && !aux && lp && alpha && lind < (lnum - 1));
menus_set_sensitive (_("<Image>/Layers/Anchor Layer"), fs && !aux && lp);
menus_set_sensitive (_("<Image>/Layers/Merge Visible Layers"), !fs && !aux && lp);
menus_set_sensitive (_("<Image>/Layers/Flatten Image"), !fs && !aux && lp);
menus_set_sensitive (_("<Image>/Layers/Alpha To Selection"), !aux && lp && alpha);
menus_set_sensitive (_("<Image>/Layers/Mask To Selection"), !aux && lm && lp);
menus_set_sensitive (_("<Image>/Layers/Add Alpha Channel"), !fs && !aux && lp && !lm && !alpha);
menus_set_sensitive (_("<Image>/Image/RGB"), (base_type != RGB));
menus_set_sensitive (_("<Image>/Image/Grayscale"), (base_type != GRAY));
menus_set_sensitive (_("<Image>/Image/Indexed"), (base_type != INDEXED));
menus_set_sensitive (_("<Image>/Image/Colors/Threshold"), (base_type != INDEXED));
menus_set_sensitive (_("<Image>/Image/Colors/Posterize") , (base_type != INDEXED));
menus_set_sensitive (_("<Image>/Image/Colors/Equalize"), (base_type != INDEXED));
menus_set_sensitive (_("<Image>/Image/Colors/Invert"), (base_type != INDEXED));
menus_set_sensitive (_("<Image>/Image/Colors/Color Balance"), (base_type == RGB));
menus_set_sensitive (_("<Image>/Image/Colors/Brightness-Contrast"), (base_type != INDEXED));
menus_set_sensitive (_("<Image>/Image/Colors/Hue-Saturation"), (base_type == RGB));
menus_set_sensitive (_("<Image>/Image/Colors/Curves"), (base_type != INDEXED));
menus_set_sensitive (_("<Image>/Image/Colors/Levels"), (base_type != INDEXED));
menus_set_sensitive (_("<Image>/Image/Colors/Desaturate"), (base_type == RGB));
menus_set_sensitive (_("<Image>/Image/Alpha/Add Alpha Channel"), !fs && !aux && lp && !lm && !alpha);
menus_set_sensitive (_("<Image>/Select"), lp);
menus_set_sensitive (_("<Image>/Edit/Cut"), lp);
menus_set_sensitive (_("<Image>/Edit/Copy"), lp);
menus_set_sensitive (_("<Image>/Edit/Paste"), lp);
menus_set_sensitive (_("<Image>/Edit/Paste Into"), lp);
menus_set_sensitive (_("<Image>/Edit/Clear"), lp);
menus_set_sensitive (_("<Image>/Edit/Fill"), lp);
menus_set_sensitive (_("<Image>/Edit/Stroke"), lp);
menus_set_sensitive (_("<Image>/Edit/Cut Named"), lp);
menus_set_sensitive (_("<Image>/Edit/Copy Named"), lp);
menus_set_sensitive (_("<Image>/Edit/Paste Named"), lp);
menus_set_sensitive (_("<Image>/Image/Colors"), lp);
menus_set_sensitive (_("<Image>/Image/Channel Ops/Offset"), lp);
menus_set_sensitive (_("<Image>/Image/Histogram"), lp);
menus_set_sensitive (_("<Image>/Filters"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Layers/Stack/Previous Layer"), !fs && !aux && lp && lind > 0);
menus_set_sensitive_locale ("<Image>", N_("/Layers/Stack/Next Layer"), !fs && !aux && lp && lind < (lnum - 1));
menus_set_sensitive_locale ("<Image>", N_("/Layers/Stack/Raise Layer"), !fs && !aux && lp && alpha && lind > 0);
menus_set_sensitive_locale ("<Image>", N_("/Layers/Stack/Lower Layer"), !fs && !aux && lp && alpha && lind < (lnum - 1));
menus_set_sensitive_locale ("<Image>", N_("/Layers/Stack/Layer to Top"), !fs && !aux && lp && alpha && lind > 0);
menus_set_sensitive_locale ("<Image>", N_("/Layers/Stack/Layer to Bottom"), !fs && !aux && lp && alpha && lind < (lnum - 1));
menus_set_sensitive_locale ("<Image>", N_("/Layers/Anchor Layer"), fs && !aux && lp);
menus_set_sensitive_locale ("<Image>", N_("/Layers/Merge Visible Layers"), !fs && !aux && lp);
menus_set_sensitive_locale ("<Image>", N_("/Layers/Flatten Image"), !fs && !aux && lp);
menus_set_sensitive_locale ("<Image>", N_("/Layers/Alpha To Selection"), !aux && lp && alpha);
menus_set_sensitive_locale ("<Image>", N_("/Layers/Mask To Selection"), !aux && lm && lp);
menus_set_sensitive_locale ("<Image>", N_("/Layers/Add Alpha Channel"), !fs && !aux && lp && !lm && !alpha);
menus_set_sensitive_locale ("<Image>", N_("/Image/RGB"), (base_type != RGB));
menus_set_sensitive_locale ("<Image>", N_("/Image/Grayscale"), (base_type != GRAY));
menus_set_sensitive_locale ("<Image>", N_("/Image/Indexed"), (base_type != INDEXED));
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors/Threshold"), (base_type != INDEXED));
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors/Posterize") , (base_type != INDEXED));
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors/Equalize"), (base_type != INDEXED));
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors/Invert"), (base_type != INDEXED));
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors/Color Balance"), (base_type == RGB));
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors/Brightness-Contrast"), (base_type != INDEXED));
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors/Hue-Saturation"), (base_type == RGB));
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors/Curves"), (base_type != INDEXED));
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors/Levels"), (base_type != INDEXED));
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors/Desaturate"), (base_type == RGB));
menus_set_sensitive_locale ("<Image>", N_("/Image/Alpha/Add Alpha Channel"), !fs && !aux && lp && !lm && !alpha);
menus_set_sensitive_locale ("<Image>", N_("/Select"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Edit/Cut"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Edit/Copy"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Edit/Paste"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Edit/Paste Into"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Edit/Clear"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Edit/Fill"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Edit/Stroke"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Edit/Cut Named"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Edit/Copy Named"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Edit/Paste Named"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Image/Channel Ops/Offset"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Image/Histogram"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Filters"), lp);
/* save selection to channel */
menus_set_sensitive (_("<Image>/Select/Save To Channel"), !fs);
menus_set_sensitive_locale ("<Image>", N_("/Select/Save To Channel"), !fs);
menus_set_state (_("<Image>/View/Toggle Rulers"), GTK_WIDGET_VISIBLE (gdisp->origin) ? 1 : 0);
menus_set_state (_("<Image>/View/Toggle Guides"), gdisp->draw_guides);
menus_set_state (_("<Image>/View/Snap To Guides"), gdisp->snap_to_guides);
menus_set_state (_("<Image>/View/Toggle Statusbar"), GTK_WIDGET_VISIBLE (gdisp->statusarea) ? 1 : 0);
menus_set_state (_("<Image>/View/Dot for dot"), gdisp->dot_for_dot);
menus_set_state_locale ("<Image>", N_("/View/Toggle Rulers"), GTK_WIDGET_VISIBLE (gdisp->origin) ? 1 : 0);
menus_set_state_locale ("<Image>", N_("/View/Toggle Guides"), gdisp->draw_guides);
menus_set_state_locale ("<Image>", N_("/View/Snap To Guides"), gdisp->snap_to_guides);
menus_set_state_locale ("<Image>", N_("/View/Toggle Statusbar"), GTK_WIDGET_VISIBLE (gdisp->statusarea) ? 1 : 0);
menus_set_state_locale ("<Image>", N_("/View/Dot for dot"), gdisp->dot_for_dot);
plug_in_set_menu_sensitivity (type);
}
......
......@@ -302,7 +302,7 @@ gdisplay_close_warning_callback (GtkWidget *w,
GDisplay *gdisp;
GtkWidget *mbox;
menus_set_sensitive (_("<Image>/File/Close"), TRUE);
menus_set_sensitive_locale ("<Image>", N_("/File/Close"), TRUE);
mbox = (GtkWidget *) client_data;
gdisp = (GDisplay *) gtk_object_get_user_data (GTK_OBJECT (mbox));
......@@ -321,7 +321,7 @@ gdisplay_cancel_warning_callback (GtkWidget *w,
{
GtkWidget *mbox;
menus_set_sensitive (_("<Image>/File/Close"), TRUE);
menus_set_sensitive_locale ("<Image>", N_("/File/Close"), TRUE);
mbox = (GtkWidget *) client_data;
gtk_widget_destroy (mbox);
}
......@@ -331,7 +331,7 @@ gdisplay_delete_warning_callback (GtkWidget *widget,
GdkEvent *event,
gpointer client_data)
{
menus_set_sensitive (_("<Image>/File/Close"), TRUE);
menus_set_sensitive_locale ("<Image>", N_("/File/Close"), TRUE);
return FALSE;
}
......@@ -367,7 +367,7 @@ gdisplay_close_warning_dialog (char *image_name,
return;
}
menus_set_sensitive (_("<Image>/File/Close"), FALSE);
menus_set_sensitive_locale ("<Image>", N_("/File/Close"), FALSE);
warning_dialog = mbox = gtk_dialog_new ();
/* should this be image_window or the actual image name??? */
......
......@@ -1568,62 +1568,62 @@ gdisplay_set_menu_sensitivity (GDisplay *gdisp)
lnum = g_slist_length (gdisp->gimage->layers);
}
menus_set_sensitive (_("<Image>/Layers/Stack/Previous Layer"), !fs && !aux && lp && lind > 0);
menus_set_sensitive (_("<Image>/Layers/Stack/Next Layer"), !fs && !aux && lp && lind < (lnum - 1));
menus_set_sensitive (_("<Image>/Layers/Stack/Raise Layer"), !fs && !aux && lp && alpha && lind > 0);
menus_set_sensitive (_("<Image>/Layers/Stack/Lower Layer"), !fs && !aux && lp && alpha && lind < (lnum - 1));
menus_set_sensitive (_("<Image>/Layers/Stack/Layer to Top"), !fs && !aux && lp && alpha && lind > 0);
menus_set_sensitive (_("<Image>/Layers/Stack/Layer to Bottom"), !fs && !aux && lp && alpha && lind < (lnum - 1));
menus_set_sensitive (_("<Image>/Layers/Anchor Layer"), fs && !aux && lp);
menus_set_sensitive (_("<Image>/Layers/Merge Visible Layers"), !fs && !aux && lp);
menus_set_sensitive (_("<Image>/Layers/Flatten Image"), !fs && !aux && lp);
menus_set_sensitive (_("<Image>/Layers/Alpha To Selection"), !aux && lp && alpha);
menus_set_sensitive (_("<Image>/Layers/Mask To Selection"), !aux && lm && lp);
menus_set_sensitive (_("<Image>/Layers/Add Alpha Channel"), !fs && !aux && lp && !lm && !alpha);
menus_set_sensitive (_("<Image>/Image/RGB"), (base_type != RGB));
menus_set_sensitive (_("<Image>/Image/Grayscale"), (base_type != GRAY));
menus_set_sensitive (_("<Image>/Image/Indexed"), (base_type != INDEXED));
menus_set_sensitive (_("<Image>/Image/Colors/Threshold"), (base_type != INDEXED));
menus_set_sensitive (_("<Image>/Image/Colors/Posterize") , (base_type != INDEXED));
menus_set_sensitive (_("<Image>/Image/Colors/Equalize"), (base_type != INDEXED));
menus_set_sensitive (_("<Image>/Image/Colors/Invert"), (base_type != INDEXED));
menus_set_sensitive (_("<Image>/Image/Colors/Color Balance"), (base_type == RGB));
menus_set_sensitive (_("<Image>/Image/Colors/Brightness-Contrast"), (base_type != INDEXED));
menus_set_sensitive (_("<Image>/Image/Colors/Hue-Saturation"), (base_type == RGB));
menus_set_sensitive (_("<Image>/Image/Colors/Curves"), (base_type != INDEXED));
menus_set_sensitive (_("<Image>/Image/Colors/Levels"), (base_type != INDEXED));
menus_set_sensitive (_("<Image>/Image/Colors/Desaturate"), (base_type == RGB));
menus_set_sensitive (_("<Image>/Image/Alpha/Add Alpha Channel"), !fs && !aux && lp && !lm && !alpha);
menus_set_sensitive (_("<Image>/Select"), lp);
menus_set_sensitive (_("<Image>/Edit/Cut"), lp);
menus_set_sensitive (_("<Image>/Edit/Copy"), lp);
menus_set_sensitive (_("<Image>/Edit/Paste"), lp);
menus_set_sensitive (_("<Image>/Edit/Paste Into"), lp);
menus_set_sensitive (_("<Image>/Edit/Clear"), lp);
menus_set_sensitive (_("<Image>/Edit/Fill"), lp);
menus_set_sensitive (_("<Image>/Edit/Stroke"), lp);
menus_set_sensitive (_("<Image>/Edit/Cut Named"), lp);
menus_set_sensitive (_("<Image>/Edit/Copy Named"), lp);
menus_set_sensitive (_("<Image>/Edit/Paste Named"), lp);
menus_set_sensitive (_("<Image>/Image/Colors"), lp);
menus_set_sensitive (_("<Image>/Image/Channel Ops/Offset"), lp);
menus_set_sensitive (_("<Image>/Image/Histogram"), lp);
menus_set_sensitive (_("<Image>/Filters"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Layers/Stack/Previous Layer"), !fs && !aux && lp && lind > 0);
menus_set_sensitive_locale ("<Image>", N_("/Layers/Stack/Next Layer"), !fs && !aux && lp && lind < (lnum - 1));
menus_set_sensitive_locale ("<Image>", N_("/Layers/Stack/Raise Layer"), !fs && !aux && lp && alpha && lind > 0);
menus_set_sensitive_locale ("<Image>", N_("/Layers/Stack/Lower Layer"), !fs && !aux && lp && alpha && lind < (lnum - 1));
menus_set_sensitive_locale ("<Image>", N_("/Layers/Stack/Layer to Top"), !fs && !aux && lp && alpha && lind > 0);
menus_set_sensitive_locale ("<Image>", N_("/Layers/Stack/Layer to Bottom"), !fs && !aux && lp && alpha && lind < (lnum - 1));
menus_set_sensitive_locale ("<Image>", N_("/Layers/Anchor Layer"), fs && !aux && lp);
menus_set_sensitive_locale ("<Image>", N_("/Layers/Merge Visible Layers"), !fs && !aux && lp);
menus_set_sensitive_locale ("<Image>", N_("/Layers/Flatten Image"), !fs && !aux && lp);
menus_set_sensitive_locale ("<Image>", N_("/Layers/Alpha To Selection"), !aux && lp && alpha);
menus_set_sensitive_locale ("<Image>", N_("/Layers/Mask To Selection"), !aux && lm && lp);
menus_set_sensitive_locale ("<Image>", N_("/Layers/Add Alpha Channel"), !fs && !aux && lp && !lm && !alpha);
menus_set_sensitive_locale ("<Image>", N_("/Image/RGB"), (base_type != RGB));
menus_set_sensitive_locale ("<Image>", N_("/Image/Grayscale"), (base_type != GRAY));
menus_set_sensitive_locale ("<Image>", N_("/Image/Indexed"), (base_type != INDEXED));
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors/Threshold"), (base_type != INDEXED));
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors/Posterize") , (base_type != INDEXED));
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors/Equalize"), (base_type != INDEXED));
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors/Invert"), (base_type != INDEXED));
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors/Color Balance"), (base_type == RGB));
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors/Brightness-Contrast"), (base_type != INDEXED));
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors/Hue-Saturation"), (base_type == RGB));
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors/Curves"), (base_type != INDEXED));
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors/Levels"), (base_type != INDEXED));
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors/Desaturate"), (base_type == RGB));
menus_set_sensitive_locale ("<Image>", N_("/Image/Alpha/Add Alpha Channel"), !fs && !aux && lp && !lm && !alpha);
menus_set_sensitive_locale ("<Image>", N_("/Select"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Edit/Cut"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Edit/Copy"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Edit/Paste"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Edit/Paste Into"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Edit/Clear"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Edit/Fill"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Edit/Stroke"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Edit/Cut Named"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Edit/Copy Named"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Edit/Paste Named"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Image/Channel Ops/Offset"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Image/Histogram"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Filters"), lp);
/* save selection to channel */
menus_set_sensitive (_("<Image>/Select/Save To Channel"), !fs);
menus_set_sensitive_locale ("<Image>", N_("/Select/Save To Channel"), !fs);
menus_set_state (_("<Image>/View/Toggle Rulers"), GTK_WIDGET_VISIBLE (gdisp->origin) ? 1 : 0);
menus_set_state (_("<Image>/View/Toggle Guides"), gdisp->draw_guides);
menus_set_state (_("<Image>/View/Snap To Guides"), gdisp->snap_to_guides);
menus_set_state (_("<Image>/View/Toggle Statusbar"), GTK_WIDGET_VISIBLE (gdisp->statusarea) ? 1 : 0);
menus_set_state (_("<Image>/View/Dot for dot"), gdisp->dot_for_dot);
menus_set_state_locale ("<Image>", N_("/View/Toggle Rulers"), GTK_WIDGET_VISIBLE (gdisp->origin) ? 1 : 0);
menus_set_state_locale ("<Image>", N_("/View/Toggle Guides"), gdisp->draw_guides);
menus_set_state_locale ("<Image>", N_("/View/Snap To Guides"), gdisp->snap_to_guides);
menus_set_state_locale ("<Image>", N_("/View/Toggle Statusbar"), GTK_WIDGET_VISIBLE (gdisp->statusarea) ? 1 : 0);
menus_set_state_locale ("<Image>", N_("/View/Dot for dot"), gdisp->dot_for_dot);
plug_in_set_menu_sensitivity (type);
}
......
......@@ -1534,10 +1534,10 @@ file_save_ok_callback (GtkWidget *w,
static void
file_dialog_show (GtkWidget *filesel)
{
menus_set_sensitive (_("<Toolbox>/File/Open"), FALSE);
menus_set_sensitive (_("<Image>/File/Open"), FALSE);
menus_set_sensitive (_("<Image>/File/Save"), FALSE);
menus_set_sensitive (_("<Image>/File/Save as"), FALSE);
menus_set_sensitive_locale ("<Toolbox>", N_("/File/Open"), FALSE);
menus_set_sensitive_locale ("<Image>", N_("/File/Open"), FALSE);
menus_set_sensitive_locale ("<Image>", N_("/File/Save"), FALSE);
menus_set_sensitive_locale ("<Image>", N_("/File/Save as"), FALSE);
gtk_widget_show (filesel);
}
......@@ -1547,10 +1547,10 @@ file_dialog_hide (GtkWidget *filesel)
{
gtk_widget_hide (filesel);
menus_set_sensitive (_("<Toolbox>/File/Open"), TRUE);
menus_set_sensitive (_("<Image>/File/Open"), TRUE);
menus_set_sensitive (_("<Image>/File/Save"), TRUE);
menus_set_sensitive (_("<Image>/File/Save as"), TRUE);
menus_set_sensitive_locale ("<Toolbox>", N_("/File/Open"), TRUE);
menus_set_sensitive_locale ("<Image>", N_("/File/Open"), TRUE);
menus_set_sensitive_locale ("<Image>", N_("/File/Save"), TRUE);
menus_set_sensitive_locale ("<Image>", N_("/File/Save as"), TRUE);
return TRUE;
}
......@@ -1996,6 +1996,6 @@ file_update_menus (GSList *procs,
procs = procs->next;
if (file_proc->db_info.proc_type != PDB_EXTENSION)
menus_set_sensitive (gettext(file_proc->menu_path), (file_proc->image_types_val & image_type));
menus_set_sensitive (file_proc->menu_path, (file_proc->image_types_val & image_type));
}
}
......@@ -1568,62 +1568,62 @@ gdisplay_set_menu_sensitivity (GDisplay *gdisp)
lnum = g_slist_length (gdisp->gimage->layers);
}
menus_set_sensitive (_("<Image>/Layers/Stack/Previous Layer"), !fs && !aux && lp && lind > 0);
menus_set_sensitive (_("<Image>/Layers/Stack/Next Layer"), !fs && !aux && lp && lind < (lnum - 1));
menus_set_sensitive (_("<Image>/Layers/Stack/Raise Layer"), !fs && !aux && lp && alpha && lind > 0);
menus_set_sensitive (_("<Image>/Layers/Stack/Lower Layer"), !fs && !aux && lp && alpha && lind < (lnum - 1));
menus_set_sensitive (_("<Image>/Layers/Stack/Layer to Top"), !fs && !aux && lp && alpha && lind > 0);
menus_set_sensitive (_("<Image>/Layers/Stack/Layer to Bottom"), !fs && !aux && lp && alpha && lind < (lnum - 1));
menus_set_sensitive (_("<Image>/Layers/Anchor Layer"), fs && !aux && lp);
menus_set_sensitive (_("<Image>/Layers/Merge Visible Layers"), !fs && !aux && lp);
menus_set_sensitive (_("<Image>/Layers/Flatten Image"), !fs && !aux && lp);
menus_set_sensitive (_("<Image>/Layers/Alpha To Selection"), !aux && lp && alpha);
menus_set_sensitive (_("<Image>/Layers/Mask To Selection"), !aux && lm && lp);
menus_set_sensitive (_("<Image>/Layers/Add Alpha Channel"), !fs && !aux && lp && !lm && !alpha);
menus_set_sensitive (_("<Image>/Image/RGB"), (base_type != RGB));
menus_set_sensitive (_("<Image>/Image/Grayscale"), (base_type != GRAY));
menus_set_sensitive (_("<Image>/Image/Indexed"), (base_type != INDEXED));
menus_set_sensitive (_("<Image>/Image/Colors/Threshold"), (base_type != INDEXED));
menus_set_sensitive (_("<Image>/Image/Colors/Posterize") , (base_type != INDEXED));
menus_set_sensitive (_("<Image>/Image/Colors/Equalize"), (base_type != INDEXED));
menus_set_sensitive (_("<Image>/Image/Colors/Invert"), (base_type != INDEXED));
menus_set_sensitive (_("<Image>/Image/Colors/Color Balance"), (base_type == RGB));
menus_set_sensitive (_("<Image>/Image/Colors/Brightness-Contrast"), (base_type != INDEXED));
menus_set_sensitive (_("<Image>/Image/Colors/Hue-Saturation"), (base_type == RGB));
menus_set_sensitive (_("<Image>/Image/Colors/Curves"), (base_type != INDEXED));
menus_set_sensitive (_("<Image>/Image/Colors/Levels"), (base_type != INDEXED));
menus_set_sensitive (_("<Image>/Image/Colors/Desaturate"), (base_type == RGB));
menus_set_sensitive (_("<Image>/Image/Alpha/Add Alpha Channel"), !fs && !aux && lp && !lm && !alpha);
menus_set_sensitive (_("<Image>/Select"), lp);
menus_set_sensitive (_("<Image>/Edit/Cut"), lp);
menus_set_sensitive (_("<Image>/Edit/Copy"), lp);
menus_set_sensitive (_("<Image>/Edit/Paste"), lp);
menus_set_sensitive (_("<Image>/Edit/Paste Into"), lp);
menus_set_sensitive (_("<Image>/Edit/Clear"), lp);
menus_set_sensitive (_("<Image>/Edit/Fill"), lp);
menus_set_sensitive (_("<Image>/Edit/Stroke"), lp);
menus_set_sensitive (_("<Image>/Edit/Cut Named"), lp);
menus_set_sensitive (_("<Image>/Edit/Copy Named"), lp);
menus_set_sensitive (_("<Image>/Edit/Paste Named"), lp);
menus_set_sensitive (_("<Image>/Image/Colors"), lp);
menus_set_sensitive (_("<Image>/Image/Channel Ops/Offset"), lp);
menus_set_sensitive (_("<Image>/Image/Histogram"), lp);
menus_set_sensitive (_("<Image>/Filters"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Layers/Stack/Previous Layer"), !fs && !aux && lp && lind > 0);
menus_set_sensitive_locale ("<Image>", N_("/Layers/Stack/Next Layer"), !fs && !aux && lp && lind < (lnum - 1));
menus_set_sensitive_locale ("<Image>", N_("/Layers/Stack/Raise Layer"), !fs && !aux && lp && alpha && lind > 0);
menus_set_sensitive_locale ("<Image>", N_("/Layers/Stack/Lower Layer"), !fs && !aux && lp && alpha && lind < (lnum - 1));
menus_set_sensitive_locale ("<Image>", N_("/Layers/Stack/Layer to Top"), !fs && !aux && lp && alpha && lind > 0);
menus_set_sensitive_locale ("<Image>", N_("/Layers/Stack/Layer to Bottom"), !fs && !aux && lp && alpha && lind < (lnum - 1));
menus_set_sensitive_locale ("<Image>", N_("/Layers/Anchor Layer"), fs && !aux && lp);
menus_set_sensitive_locale ("<Image>", N_("/Layers/Merge Visible Layers"), !fs && !aux && lp);
menus_set_sensitive_locale ("<Image>", N_("/Layers/Flatten Image"), !fs && !aux && lp);
menus_set_sensitive_locale ("<Image>", N_("/Layers/Alpha To Selection"), !aux && lp && alpha);
menus_set_sensitive_locale ("<Image>", N_("/Layers/Mask To Selection"), !aux && lm && lp);
menus_set_sensitive_locale ("<Image>", N_("/Layers/Add Alpha Channel"), !fs && !aux && lp && !lm && !alpha);
menus_set_sensitive_locale ("<Image>", N_("/Image/RGB"), (base_type != RGB));
menus_set_sensitive_locale ("<Image>", N_("/Image/Grayscale"), (base_type != GRAY));
menus_set_sensitive_locale ("<Image>", N_("/Image/Indexed"), (base_type != INDEXED));
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors/Threshold"), (base_type != INDEXED));
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors/Posterize") , (base_type != INDEXED));
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors/Equalize"), (base_type != INDEXED));
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors/Invert"), (base_type != INDEXED));
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors/Color Balance"), (base_type == RGB));
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors/Brightness-Contrast"), (base_type != INDEXED));
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors/Hue-Saturation"), (base_type == RGB));
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors/Curves"), (base_type != INDEXED));
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors/Levels"), (base_type != INDEXED));
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors/Desaturate"), (base_type == RGB));
menus_set_sensitive_locale ("<Image>", N_("/Image/Alpha/Add Alpha Channel"), !fs && !aux && lp && !lm && !alpha);
menus_set_sensitive_locale ("<Image>", N_("/Select"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Edit/Cut"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Edit/Copy"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Edit/Paste"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Edit/Paste Into"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Edit/Clear"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Edit/Fill"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Edit/Stroke"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Edit/Cut Named"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Edit/Copy Named"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Edit/Paste Named"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Image/Colors"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Image/Channel Ops/Offset"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Image/Histogram"), lp);
menus_set_sensitive_locale ("<Image>", N_("/Filters"), lp);
/* save selection to channel */
menus_set_sensitive (_("<Image>/Select/Save To Channel"), !fs);
menus_set_sensitive_locale ("<Image>", N_("/Select/Save To Channel"), !fs);
menus_set_state (_("<Image>/View/Toggle Rulers"), GTK_WIDGET_VISIBLE (gdisp->origin) ? 1 : 0);
menus_set_state (_("<Image>/View/Toggle Guides"), gdisp->draw_guides);
menus_set_state (_("<Image>/View/Snap To Guides"), gdisp->snap_to_guides);
menus_set_state (_("<Image>/View/Toggle Statusbar"), GTK_WIDGET_VISIBLE (gdisp->statusarea) ? 1 : 0);
menus_set_state (_("<Image>/View/Dot for dot"), gdisp->dot_for_dot);
menus_set_state_locale ("<Image>", N_("/View/Toggle Rulers"), GTK_WIDGET_VISIBLE (gdisp->origin) ? 1 : 0);
menus_set_state_locale ("<Image>", N_("/View/Toggle Guides"), gdisp->draw_guides);
menus_set_state_locale ("<Image>", N_("/View/Snap To Guides"), gdisp->snap_to_guides);
menus_set_state_locale ("<Image>", N_("/View/Toggle Statusbar"), GTK_WIDGET_VISIBLE (gdisp->statusarea) ? 1 : 0);
menus_set_state_locale ("<Image>", N_("/View/Dot for dot"), gdisp->dot_for_dot);
plug_in_set_menu_sensitivity (type);
}
......
......@@ -302,7 +302,7 @@ gdisplay_close_warning_callback (GtkWidget *w,
GDisplay *gdisp;
GtkWidget *mbox;
menus_set_sensitive (_("<Image>/File/Close"), TRUE);
menus_set_sensitive_locale ("<Image>", N_("/File/Close"), TRUE);
mbox = (GtkWidget *) client_data;
gdisp = (GDisplay *) gtk_object_get_user_data (GTK_OBJECT (mbox));
......@@ -321,7 +321,7 @@ gdisplay_cancel_warning_callback (GtkWidget *w,
{
GtkWidget *mbox;
menus_set_sensitive (_("<Image>/File/Close"), TRUE);
menus_set_sensitive_locale ("<Image>", N_("/File/Close"), TRUE);
mbox = (GtkWidget *) client_data;
gtk_widget_destroy (mbox);
}
......@@ -331,7 +331,7 @@ gdisplay_delete_warning_callback (GtkWidget *widget,
GdkEvent *event,
gpointer client_data)
{
menus_set_sensitive (_("<Image>/File/Close"), TRUE);
menus_set_sensitive_locale ("<Image>", N_("/File/Close"), TRUE);