From bbda88d670eedf28a3170ebfcfd9d38a44e87e53 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Fri, 26 Nov 1999 10:17:19 +0000 Subject: [PATCH] accidentially replaced "Gradient:" with "Blend:" in my last checkin to 1999-11-26 Michael Natterer * app/blend.c: accidentially replaced "Gradient:" with "Blend:" in my last checkin to this file. Put the right string back. * app/menus.c: fixed the plugin translation problem (YES!!! :-) Mysteriously, using g_strdup() et al. instead of composing the string to translate in a statically allocated array fixed the problem. * plug-ins/gap/gap_main.c: fixed a menu path. --- ChangeLog | 12 ++++ app/blend.c | 20 +++--- app/core/gimpdrawable-blend.c | 20 +++--- app/gui/menus.c | 116 ++++++++++++++++++++++++---------- app/menus.c | 116 ++++++++++++++++++++++++---------- app/menus/menus.c | 116 ++++++++++++++++++++++++---------- app/tools/blend.c | 20 +++--- app/tools/gimpblendtool.c | 20 +++--- app/widgets/gimpitemfactory.c | 116 ++++++++++++++++++++++++---------- plug-ins/gap/gap_main.c | 2 +- 10 files changed, 377 insertions(+), 181 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5f4d71fd4b..d7992d805a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +1999-11-26 Michael Natterer + + * app/blend.c: accidentially replaced "Gradient:" with "Blend:" in + my last checkin to this file. Put the right string back. + + * app/menus.c: fixed the plugin translation problem (YES!!! :-) + Mysteriously, using g_strdup() et al. instead of composing the + string to translate in a statically allocated array fixed the + problem. + + * plug-ins/gap/gap_main.c: fixed a menu path. + Fri Nov 26 01:33:04 MET 1999 Sven Neumann * app/histogram_tool.c: purely cosmetic change diff --git a/app/blend.c b/app/blend.c index a2cc0c0e1c..8424da179c 100644 --- a/app/blend.c +++ b/app/blend.c @@ -331,12 +331,12 @@ blend_options_new () scale = gtk_hscale_new (GTK_ADJUSTMENT (options->offset_w)); gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP); gtk_range_set_update_policy (GTK_RANGE (scale), GTK_UPDATE_DELAYED); - gtk_signal_connect (GTK_OBJECT (options->offset_w), "value_changed", - (GtkSignalFunc) tool_options_double_adjustment_update, - &options->offset); gimp_table_attach_aligned (GTK_TABLE (table), 0, _("Offset:"), 1.0, 1.0, scale, FALSE); + gtk_signal_connect (GTK_OBJECT (options->offset_w), "value_changed", + (GtkSignalFunc) tool_options_double_adjustment_update, + &options->offset); /* the blend mode menu */ options->blend_mode_w = gtk_option_menu_new (); @@ -351,7 +351,7 @@ blend_options_new () menu = build_menu (gradient_option_items, NULL); gtk_option_menu_set_menu (GTK_OPTION_MENU (options->gradient_type_w), menu); gimp_table_attach_aligned (GTK_TABLE (table), 2, - _("Blend:"), 1.0, 0.5, + _("Gradient:"), 1.0, 0.5, options->gradient_type_w, TRUE); /* the repeat option */ @@ -405,12 +405,12 @@ blend_options_new () scale = gtk_hscale_new (GTK_ADJUSTMENT (options->max_depth_w)); gtk_scale_set_digits (GTK_SCALE (scale), 0); gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP); - gtk_signal_connect (GTK_OBJECT(options->max_depth_w), "value_changed", - (GtkSignalFunc) tool_options_int_adjustment_update, - &options->max_depth); gimp_table_attach_aligned (GTK_TABLE (table), 0, _("Max Depth:"), 1.0, 1.0, scale, FALSE); + gtk_signal_connect (GTK_OBJECT(options->max_depth_w), "value_changed", + (GtkSignalFunc) tool_options_int_adjustment_update, + &options->max_depth); /* threshold scale */ options->threshold_w = @@ -418,12 +418,12 @@ blend_options_new () scale = gtk_hscale_new (GTK_ADJUSTMENT (options->threshold_w)); gtk_scale_set_digits (GTK_SCALE (scale), 2); gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP); - gtk_signal_connect (GTK_OBJECT(options->threshold_w), "value_changed", - (GtkSignalFunc) tool_options_double_adjustment_update, - &options->threshold); gimp_table_attach_aligned (GTK_TABLE (table), 1, _("Threshold:"), 1.0, 1.0, scale, FALSE); + gtk_signal_connect (GTK_OBJECT(options->threshold_w), "value_changed", + (GtkSignalFunc) tool_options_double_adjustment_update, + &options->threshold); /* show the table */ gtk_widget_show (table); diff --git a/app/core/gimpdrawable-blend.c b/app/core/gimpdrawable-blend.c index a2cc0c0e1c..8424da179c 100644 --- a/app/core/gimpdrawable-blend.c +++ b/app/core/gimpdrawable-blend.c @@ -331,12 +331,12 @@ blend_options_new () scale = gtk_hscale_new (GTK_ADJUSTMENT (options->offset_w)); gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP); gtk_range_set_update_policy (GTK_RANGE (scale), GTK_UPDATE_DELAYED); - gtk_signal_connect (GTK_OBJECT (options->offset_w), "value_changed", - (GtkSignalFunc) tool_options_double_adjustment_update, - &options->offset); gimp_table_attach_aligned (GTK_TABLE (table), 0, _("Offset:"), 1.0, 1.0, scale, FALSE); + gtk_signal_connect (GTK_OBJECT (options->offset_w), "value_changed", + (GtkSignalFunc) tool_options_double_adjustment_update, + &options->offset); /* the blend mode menu */ options->blend_mode_w = gtk_option_menu_new (); @@ -351,7 +351,7 @@ blend_options_new () menu = build_menu (gradient_option_items, NULL); gtk_option_menu_set_menu (GTK_OPTION_MENU (options->gradient_type_w), menu); gimp_table_attach_aligned (GTK_TABLE (table), 2, - _("Blend:"), 1.0, 0.5, + _("Gradient:"), 1.0, 0.5, options->gradient_type_w, TRUE); /* the repeat option */ @@ -405,12 +405,12 @@ blend_options_new () scale = gtk_hscale_new (GTK_ADJUSTMENT (options->max_depth_w)); gtk_scale_set_digits (GTK_SCALE (scale), 0); gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP); - gtk_signal_connect (GTK_OBJECT(options->max_depth_w), "value_changed", - (GtkSignalFunc) tool_options_int_adjustment_update, - &options->max_depth); gimp_table_attach_aligned (GTK_TABLE (table), 0, _("Max Depth:"), 1.0, 1.0, scale, FALSE); + gtk_signal_connect (GTK_OBJECT(options->max_depth_w), "value_changed", + (GtkSignalFunc) tool_options_int_adjustment_update, + &options->max_depth); /* threshold scale */ options->threshold_w = @@ -418,12 +418,12 @@ blend_options_new () scale = gtk_hscale_new (GTK_ADJUSTMENT (options->threshold_w)); gtk_scale_set_digits (GTK_SCALE (scale), 2); gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP); - gtk_signal_connect (GTK_OBJECT(options->threshold_w), "value_changed", - (GtkSignalFunc) tool_options_double_adjustment_update, - &options->threshold); gimp_table_attach_aligned (GTK_TABLE (table), 1, _("Threshold:"), 1.0, 1.0, scale, FALSE); + gtk_signal_connect (GTK_OBJECT(options->threshold_w), "value_changed", + (GtkSignalFunc) tool_options_double_adjustment_update, + &options->threshold); /* show the table */ gtk_widget_show (table); diff --git a/app/gui/menus.c b/app/gui/menus.c index 403b667050..7970f99b2a 100644 --- a/app/gui/menus.c +++ b/app/gui/menus.c @@ -66,11 +66,43 @@ static void help_debug_cmd_callback (GtkWidget *widget, static gchar G_GNUC_UNUSED *dummy_entries[] = { + /* */ + N_("/Xtns/Animation"), + N_("/Xtns/Perl-Fu"), + N_("/Xtns/Perl-Fu/Logos"), + N_("/Xtns/Perl"), + N_("/Xtns/Render"), + N_("/Xtns/Render/Logos"), + N_("/Xtns/Render/Povray"), + N_("/Xtns/Script-Fu"), + N_("/Xtns/Script-Fu/Logos"), + N_("/Xtns/Script-Fu/Patterns"), + N_("/Xtns/Script-Fu/Web page themes"), + N_("/Xtns/Script-Fu/Utils"), + N_("/Xtns/Script-Fu/Buttons"), + N_("/Xtns/Script-Fu/Make Brush"), + N_("/Xtns/Script-Fu/Misc"), + N_("/Xtns/Script-Fu/Test"), + N_("/Xtns/Web Browser"), + + /* */ + N_("/Filters/Colors/Map"), N_("/Filters/Render/Clouds"), N_("/Filters/Render/Nature"), N_("/Filters/Render/Pattern"), - N_("/Filters/Colors/Map"), - N_("/Filters/Misc") + N_("/Filters/Misc"), + N_("/Script-Fu/Decor"), + N_("/Script-Fu/Modify"), + N_("/Script-Fu/Utils"), + N_("/Script-Fu/Animators"), + N_("/Script-Fu/Stencil Ops"), + N_("/Script-Fu/Alchemy"), + N_("/Script-Fu/Selection"), + N_("/Script-Fu/Shadow"), + N_("/Script-Fu/Render"), + N_("/Guides"), + N_("Video"), + N_("Video/Encode") }; static GSList *last_opened_raw_filenames = NULL; @@ -993,8 +1025,18 @@ menus_reorder_plugins (void) static gint n_image_file_entries = (sizeof (image_file_entries) / sizeof (image_file_entries[0])); - GtkWidget *menu; + static gchar *reorder_submenus[] = { "/Video" }; + static gint n_reorder_submenus = (sizeof (reorder_submenus) / + sizeof (reorder_submenus[0])); + + static gchar *reorder_sub_submenus[] = { "/Filters", + "/Xtns" }; + static gint n_reorder_sub_submenus = (sizeof (reorder_sub_submenus) / + sizeof (reorder_sub_submenus[0])); + + GtkItemFactory *item_factory; GtkWidget *menu_item; + GtkWidget *menu; GList *list; gchar *path; gint i, pos; @@ -1060,36 +1102,38 @@ menus_reorder_plugins (void) gtk_menu_reorder_child (GTK_MENU (menu_item->parent), menu_item, -1); } - /* Find the /Filters menu... */ - menu_item = gtk_item_factory_get_widget (image_factory, - "/Filters/Repeat last"); - if (!menu_item || !menu_item->parent) - return; - menu = menu_item->parent; - - /* ...and reorder all submenus of it's submenus */ - for (list = GTK_MENU_SHELL (menu)->children; list; list = g_list_next (list)) + /* Reorder menus where plugins registered submenus */ + for (i = 0; i < n_reorder_submenus; i++) { - GtkMenuItem *menu_item = GTK_MENU_ITEM (list->data); + item_factory = gtk_item_factory_from_path (reorder_submenus[i]); + menu = gtk_item_factory_get_widget (item_factory, + reorder_submenus[i]); - if (menu_item->submenu) - menus_filters_subdirs_to_top (GTK_MENU (menu_item->submenu)); + if (menu && GTK_IS_MENU (menu)) + { + menus_filters_subdirs_to_top (GTK_MENU (menu)); + } } - /* Find the /Xtns menu... */ - menu_item = gtk_item_factory_get_widget (toolbox_factory, - "/Xtns/Module Browser..."); - if (!menu_item || !menu_item->parent) - return; - menu = menu_item->parent; - - /* ...and reorder all submenus of it's submenus */ - for (list = GTK_MENU_SHELL (menu)->children; list; list = g_list_next (list)) + for (i = 0; i < n_reorder_sub_submenus; i++) { - GtkMenuItem *menu_item = GTK_MENU_ITEM (list->data); + item_factory = gtk_item_factory_from_path (reorder_sub_submenus[i]); + menu = gtk_item_factory_get_widget (item_factory, + reorder_sub_submenus[i]); - if (menu_item->submenu) - menus_filters_subdirs_to_top (GTK_MENU (menu_item->submenu)); + if (menu && GTK_IS_MENU (menu)) + { + for (list = GTK_MENU_SHELL (menu)->children; list; + list = g_list_next (list)) + { + GtkMenuItem *menu_item; + + menu_item = GTK_MENU_ITEM (list->data); + + if (menu_item->submenu) + menus_filters_subdirs_to_top (GTK_MENU (menu_item->submenu)); + } + } } } @@ -1618,32 +1662,34 @@ menus_init (void) } } -#define MENUPATH_SIZE 384 - static gchar * menu_translate (const gchar *path, gpointer data) { - static gchar menupath[MENUPATH_SIZE]; + static gchar *menupath = NULL; + gchar *retval; gchar *factory; factory = (gchar *) data; - menupath[MENUPATH_SIZE - 1] = '\0'; - strncpy (menupath, path, MENUPATH_SIZE -1); + if (menupath) + g_free (menupath); + + menupath = g_strdup (path); if ((strstr (path, "/tearoff1") != NULL) || (strstr (path, "/---") != NULL) || (strstr (path, "/MRU") != NULL)) return menupath; - retval = gettext (path); + retval = gettext (menupath); if (!strcmp (path, retval) && factory) { - strcpy (menupath, factory); - strncat (menupath, path, MENUPATH_SIZE - 1 - strlen (factory)); + g_free (menupath); + + menupath = g_strconcat (factory, path, NULL); retval = dgettext ("gimp-std-plugins", menupath) + strlen (factory); } diff --git a/app/menus.c b/app/menus.c index 403b667050..7970f99b2a 100644 --- a/app/menus.c +++ b/app/menus.c @@ -66,11 +66,43 @@ static void help_debug_cmd_callback (GtkWidget *widget, static gchar G_GNUC_UNUSED *dummy_entries[] = { + /* */ + N_("/Xtns/Animation"), + N_("/Xtns/Perl-Fu"), + N_("/Xtns/Perl-Fu/Logos"), + N_("/Xtns/Perl"), + N_("/Xtns/Render"), + N_("/Xtns/Render/Logos"), + N_("/Xtns/Render/Povray"), + N_("/Xtns/Script-Fu"), + N_("/Xtns/Script-Fu/Logos"), + N_("/Xtns/Script-Fu/Patterns"), + N_("/Xtns/Script-Fu/Web page themes"), + N_("/Xtns/Script-Fu/Utils"), + N_("/Xtns/Script-Fu/Buttons"), + N_("/Xtns/Script-Fu/Make Brush"), + N_("/Xtns/Script-Fu/Misc"), + N_("/Xtns/Script-Fu/Test"), + N_("/Xtns/Web Browser"), + + /* */ + N_("/Filters/Colors/Map"), N_("/Filters/Render/Clouds"), N_("/Filters/Render/Nature"), N_("/Filters/Render/Pattern"), - N_("/Filters/Colors/Map"), - N_("/Filters/Misc") + N_("/Filters/Misc"), + N_("/Script-Fu/Decor"), + N_("/Script-Fu/Modify"), + N_("/Script-Fu/Utils"), + N_("/Script-Fu/Animators"), + N_("/Script-Fu/Stencil Ops"), + N_("/Script-Fu/Alchemy"), + N_("/Script-Fu/Selection"), + N_("/Script-Fu/Shadow"), + N_("/Script-Fu/Render"), + N_("/Guides"), + N_("Video"), + N_("Video/Encode") }; static GSList *last_opened_raw_filenames = NULL; @@ -993,8 +1025,18 @@ menus_reorder_plugins (void) static gint n_image_file_entries = (sizeof (image_file_entries) / sizeof (image_file_entries[0])); - GtkWidget *menu; + static gchar *reorder_submenus[] = { "/Video" }; + static gint n_reorder_submenus = (sizeof (reorder_submenus) / + sizeof (reorder_submenus[0])); + + static gchar *reorder_sub_submenus[] = { "/Filters", + "/Xtns" }; + static gint n_reorder_sub_submenus = (sizeof (reorder_sub_submenus) / + sizeof (reorder_sub_submenus[0])); + + GtkItemFactory *item_factory; GtkWidget *menu_item; + GtkWidget *menu; GList *list; gchar *path; gint i, pos; @@ -1060,36 +1102,38 @@ menus_reorder_plugins (void) gtk_menu_reorder_child (GTK_MENU (menu_item->parent), menu_item, -1); } - /* Find the /Filters menu... */ - menu_item = gtk_item_factory_get_widget (image_factory, - "/Filters/Repeat last"); - if (!menu_item || !menu_item->parent) - return; - menu = menu_item->parent; - - /* ...and reorder all submenus of it's submenus */ - for (list = GTK_MENU_SHELL (menu)->children; list; list = g_list_next (list)) + /* Reorder menus where plugins registered submenus */ + for (i = 0; i < n_reorder_submenus; i++) { - GtkMenuItem *menu_item = GTK_MENU_ITEM (list->data); + item_factory = gtk_item_factory_from_path (reorder_submenus[i]); + menu = gtk_item_factory_get_widget (item_factory, + reorder_submenus[i]); - if (menu_item->submenu) - menus_filters_subdirs_to_top (GTK_MENU (menu_item->submenu)); + if (menu && GTK_IS_MENU (menu)) + { + menus_filters_subdirs_to_top (GTK_MENU (menu)); + } } - /* Find the /Xtns menu... */ - menu_item = gtk_item_factory_get_widget (toolbox_factory, - "/Xtns/Module Browser..."); - if (!menu_item || !menu_item->parent) - return; - menu = menu_item->parent; - - /* ...and reorder all submenus of it's submenus */ - for (list = GTK_MENU_SHELL (menu)->children; list; list = g_list_next (list)) + for (i = 0; i < n_reorder_sub_submenus; i++) { - GtkMenuItem *menu_item = GTK_MENU_ITEM (list->data); + item_factory = gtk_item_factory_from_path (reorder_sub_submenus[i]); + menu = gtk_item_factory_get_widget (item_factory, + reorder_sub_submenus[i]); - if (menu_item->submenu) - menus_filters_subdirs_to_top (GTK_MENU (menu_item->submenu)); + if (menu && GTK_IS_MENU (menu)) + { + for (list = GTK_MENU_SHELL (menu)->children; list; + list = g_list_next (list)) + { + GtkMenuItem *menu_item; + + menu_item = GTK_MENU_ITEM (list->data); + + if (menu_item->submenu) + menus_filters_subdirs_to_top (GTK_MENU (menu_item->submenu)); + } + } } } @@ -1618,32 +1662,34 @@ menus_init (void) } } -#define MENUPATH_SIZE 384 - static gchar * menu_translate (const gchar *path, gpointer data) { - static gchar menupath[MENUPATH_SIZE]; + static gchar *menupath = NULL; + gchar *retval; gchar *factory; factory = (gchar *) data; - menupath[MENUPATH_SIZE - 1] = '\0'; - strncpy (menupath, path, MENUPATH_SIZE -1); + if (menupath) + g_free (menupath); + + menupath = g_strdup (path); if ((strstr (path, "/tearoff1") != NULL) || (strstr (path, "/---") != NULL) || (strstr (path, "/MRU") != NULL)) return menupath; - retval = gettext (path); + retval = gettext (menupath); if (!strcmp (path, retval) && factory) { - strcpy (menupath, factory); - strncat (menupath, path, MENUPATH_SIZE - 1 - strlen (factory)); + g_free (menupath); + + menupath = g_strconcat (factory, path, NULL); retval = dgettext ("gimp-std-plugins", menupath) + strlen (factory); } diff --git a/app/menus/menus.c b/app/menus/menus.c index 403b667050..7970f99b2a 100644 --- a/app/menus/menus.c +++ b/app/menus/menus.c @@ -66,11 +66,43 @@ static void help_debug_cmd_callback (GtkWidget *widget, static gchar G_GNUC_UNUSED *dummy_entries[] = { + /* */ + N_("/Xtns/Animation"), + N_("/Xtns/Perl-Fu"), + N_("/Xtns/Perl-Fu/Logos"), + N_("/Xtns/Perl"), + N_("/Xtns/Render"), + N_("/Xtns/Render/Logos"), + N_("/Xtns/Render/Povray"), + N_("/Xtns/Script-Fu"), + N_("/Xtns/Script-Fu/Logos"), + N_("/Xtns/Script-Fu/Patterns"), + N_("/Xtns/Script-Fu/Web page themes"), + N_("/Xtns/Script-Fu/Utils"), + N_("/Xtns/Script-Fu/Buttons"), + N_("/Xtns/Script-Fu/Make Brush"), + N_("/Xtns/Script-Fu/Misc"), + N_("/Xtns/Script-Fu/Test"), + N_("/Xtns/Web Browser"), + + /* */ + N_("/Filters/Colors/Map"), N_("/Filters/Render/Clouds"), N_("/Filters/Render/Nature"), N_("/Filters/Render/Pattern"), - N_("/Filters/Colors/Map"), - N_("/Filters/Misc") + N_("/Filters/Misc"), + N_("/Script-Fu/Decor"), + N_("/Script-Fu/Modify"), + N_("/Script-Fu/Utils"), + N_("/Script-Fu/Animators"), + N_("/Script-Fu/Stencil Ops"), + N_("/Script-Fu/Alchemy"), + N_("/Script-Fu/Selection"), + N_("/Script-Fu/Shadow"), + N_("/Script-Fu/Render"), + N_("/Guides"), + N_("Video"), + N_("Video/Encode") }; static GSList *last_opened_raw_filenames = NULL; @@ -993,8 +1025,18 @@ menus_reorder_plugins (void) static gint n_image_file_entries = (sizeof (image_file_entries) / sizeof (image_file_entries[0])); - GtkWidget *menu; + static gchar *reorder_submenus[] = { "/Video" }; + static gint n_reorder_submenus = (sizeof (reorder_submenus) / + sizeof (reorder_submenus[0])); + + static gchar *reorder_sub_submenus[] = { "/Filters", + "/Xtns" }; + static gint n_reorder_sub_submenus = (sizeof (reorder_sub_submenus) / + sizeof (reorder_sub_submenus[0])); + + GtkItemFactory *item_factory; GtkWidget *menu_item; + GtkWidget *menu; GList *list; gchar *path; gint i, pos; @@ -1060,36 +1102,38 @@ menus_reorder_plugins (void) gtk_menu_reorder_child (GTK_MENU (menu_item->parent), menu_item, -1); } - /* Find the /Filters menu... */ - menu_item = gtk_item_factory_get_widget (image_factory, - "/Filters/Repeat last"); - if (!menu_item || !menu_item->parent) - return; - menu = menu_item->parent; - - /* ...and reorder all submenus of it's submenus */ - for (list = GTK_MENU_SHELL (menu)->children; list; list = g_list_next (list)) + /* Reorder menus where plugins registered submenus */ + for (i = 0; i < n_reorder_submenus; i++) { - GtkMenuItem *menu_item = GTK_MENU_ITEM (list->data); + item_factory = gtk_item_factory_from_path (reorder_submenus[i]); + menu = gtk_item_factory_get_widget (item_factory, + reorder_submenus[i]); - if (menu_item->submenu) - menus_filters_subdirs_to_top (GTK_MENU (menu_item->submenu)); + if (menu && GTK_IS_MENU (menu)) + { + menus_filters_subdirs_to_top (GTK_MENU (menu)); + } } - /* Find the /Xtns menu... */ - menu_item = gtk_item_factory_get_widget (toolbox_factory, - "/Xtns/Module Browser..."); - if (!menu_item || !menu_item->parent) - return; - menu = menu_item->parent; - - /* ...and reorder all submenus of it's submenus */ - for (list = GTK_MENU_SHELL (menu)->children; list; list = g_list_next (list)) + for (i = 0; i < n_reorder_sub_submenus; i++) { - GtkMenuItem *menu_item = GTK_MENU_ITEM (list->data); + item_factory = gtk_item_factory_from_path (reorder_sub_submenus[i]); + menu = gtk_item_factory_get_widget (item_factory, + reorder_sub_submenus[i]); - if (menu_item->submenu) - menus_filters_subdirs_to_top (GTK_MENU (menu_item->submenu)); + if (menu && GTK_IS_MENU (menu)) + { + for (list = GTK_MENU_SHELL (menu)->children; list; + list = g_list_next (list)) + { + GtkMenuItem *menu_item; + + menu_item = GTK_MENU_ITEM (list->data); + + if (menu_item->submenu) + menus_filters_subdirs_to_top (GTK_MENU (menu_item->submenu)); + } + } } } @@ -1618,32 +1662,34 @@ menus_init (void) } } -#define MENUPATH_SIZE 384 - static gchar * menu_translate (const gchar *path, gpointer data) { - static gchar menupath[MENUPATH_SIZE]; + static gchar *menupath = NULL; + gchar *retval; gchar *factory; factory = (gchar *) data; - menupath[MENUPATH_SIZE - 1] = '\0'; - strncpy (menupath, path, MENUPATH_SIZE -1); + if (menupath) + g_free (menupath); + + menupath = g_strdup (path); if ((strstr (path, "/tearoff1") != NULL) || (strstr (path, "/---") != NULL) || (strstr (path, "/MRU") != NULL)) return menupath; - retval = gettext (path); + retval = gettext (menupath); if (!strcmp (path, retval) && factory) { - strcpy (menupath, factory); - strncat (menupath, path, MENUPATH_SIZE - 1 - strlen (factory)); + g_free (menupath); + + menupath = g_strconcat (factory, path, NULL); retval = dgettext ("gimp-std-plugins", menupath) + strlen (factory); } diff --git a/app/tools/blend.c b/app/tools/blend.c index a2cc0c0e1c..8424da179c 100644 --- a/app/tools/blend.c +++ b/app/tools/blend.c @@ -331,12 +331,12 @@ blend_options_new () scale = gtk_hscale_new (GTK_ADJUSTMENT (options->offset_w)); gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP); gtk_range_set_update_policy (GTK_RANGE (scale), GTK_UPDATE_DELAYED); - gtk_signal_connect (GTK_OBJECT (options->offset_w), "value_changed", - (GtkSignalFunc) tool_options_double_adjustment_update, - &options->offset); gimp_table_attach_aligned (GTK_TABLE (table), 0, _("Offset:"), 1.0, 1.0, scale, FALSE); + gtk_signal_connect (GTK_OBJECT (options->offset_w), "value_changed", + (GtkSignalFunc) tool_options_double_adjustment_update, + &options->offset); /* the blend mode menu */ options->blend_mode_w = gtk_option_menu_new (); @@ -351,7 +351,7 @@ blend_options_new () menu = build_menu (gradient_option_items, NULL); gtk_option_menu_set_menu (GTK_OPTION_MENU (options->gradient_type_w), menu); gimp_table_attach_aligned (GTK_TABLE (table), 2, - _("Blend:"), 1.0, 0.5, + _("Gradient:"), 1.0, 0.5, options->gradient_type_w, TRUE); /* the repeat option */ @@ -405,12 +405,12 @@ blend_options_new () scale = gtk_hscale_new (GTK_ADJUSTMENT (options->max_depth_w)); gtk_scale_set_digits (GTK_SCALE (scale), 0); gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP); - gtk_signal_connect (GTK_OBJECT(options->max_depth_w), "value_changed", - (GtkSignalFunc) tool_options_int_adjustment_update, - &options->max_depth); gimp_table_attach_aligned (GTK_TABLE (table), 0, _("Max Depth:"), 1.0, 1.0, scale, FALSE); + gtk_signal_connect (GTK_OBJECT(options->max_depth_w), "value_changed", + (GtkSignalFunc) tool_options_int_adjustment_update, + &options->max_depth); /* threshold scale */ options->threshold_w = @@ -418,12 +418,12 @@ blend_options_new () scale = gtk_hscale_new (GTK_ADJUSTMENT (options->threshold_w)); gtk_scale_set_digits (GTK_SCALE (scale), 2); gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP); - gtk_signal_connect (GTK_OBJECT(options->threshold_w), "value_changed", - (GtkSignalFunc) tool_options_double_adjustment_update, - &options->threshold); gimp_table_attach_aligned (GTK_TABLE (table), 1, _("Threshold:"), 1.0, 1.0, scale, FALSE); + gtk_signal_connect (GTK_OBJECT(options->threshold_w), "value_changed", + (GtkSignalFunc) tool_options_double_adjustment_update, + &options->threshold); /* show the table */ gtk_widget_show (table); diff --git a/app/tools/gimpblendtool.c b/app/tools/gimpblendtool.c index a2cc0c0e1c..8424da179c 100644 --- a/app/tools/gimpblendtool.c +++ b/app/tools/gimpblendtool.c @@ -331,12 +331,12 @@ blend_options_new () scale = gtk_hscale_new (GTK_ADJUSTMENT (options->offset_w)); gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP); gtk_range_set_update_policy (GTK_RANGE (scale), GTK_UPDATE_DELAYED); - gtk_signal_connect (GTK_OBJECT (options->offset_w), "value_changed", - (GtkSignalFunc) tool_options_double_adjustment_update, - &options->offset); gimp_table_attach_aligned (GTK_TABLE (table), 0, _("Offset:"), 1.0, 1.0, scale, FALSE); + gtk_signal_connect (GTK_OBJECT (options->offset_w), "value_changed", + (GtkSignalFunc) tool_options_double_adjustment_update, + &options->offset); /* the blend mode menu */ options->blend_mode_w = gtk_option_menu_new (); @@ -351,7 +351,7 @@ blend_options_new () menu = build_menu (gradient_option_items, NULL); gtk_option_menu_set_menu (GTK_OPTION_MENU (options->gradient_type_w), menu); gimp_table_attach_aligned (GTK_TABLE (table), 2, - _("Blend:"), 1.0, 0.5, + _("Gradient:"), 1.0, 0.5, options->gradient_type_w, TRUE); /* the repeat option */ @@ -405,12 +405,12 @@ blend_options_new () scale = gtk_hscale_new (GTK_ADJUSTMENT (options->max_depth_w)); gtk_scale_set_digits (GTK_SCALE (scale), 0); gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP); - gtk_signal_connect (GTK_OBJECT(options->max_depth_w), "value_changed", - (GtkSignalFunc) tool_options_int_adjustment_update, - &options->max_depth); gimp_table_attach_aligned (GTK_TABLE (table), 0, _("Max Depth:"), 1.0, 1.0, scale, FALSE); + gtk_signal_connect (GTK_OBJECT(options->max_depth_w), "value_changed", + (GtkSignalFunc) tool_options_int_adjustment_update, + &options->max_depth); /* threshold scale */ options->threshold_w = @@ -418,12 +418,12 @@ blend_options_new () scale = gtk_hscale_new (GTK_ADJUSTMENT (options->threshold_w)); gtk_scale_set_digits (GTK_SCALE (scale), 2); gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP); - gtk_signal_connect (GTK_OBJECT(options->threshold_w), "value_changed", - (GtkSignalFunc) tool_options_double_adjustment_update, - &options->threshold); gimp_table_attach_aligned (GTK_TABLE (table), 1, _("Threshold:"), 1.0, 1.0, scale, FALSE); + gtk_signal_connect (GTK_OBJECT(options->threshold_w), "value_changed", + (GtkSignalFunc) tool_options_double_adjustment_update, + &options->threshold); /* show the table */ gtk_widget_show (table); diff --git a/app/widgets/gimpitemfactory.c b/app/widgets/gimpitemfactory.c index 403b667050..7970f99b2a 100644 --- a/app/widgets/gimpitemfactory.c +++ b/app/widgets/gimpitemfactory.c @@ -66,11 +66,43 @@ static void help_debug_cmd_callback (GtkWidget *widget, static gchar G_GNUC_UNUSED *dummy_entries[] = { + /* */ + N_("/Xtns/Animation"), + N_("/Xtns/Perl-Fu"), + N_("/Xtns/Perl-Fu/Logos"), + N_("/Xtns/Perl"), + N_("/Xtns/Render"), + N_("/Xtns/Render/Logos"), + N_("/Xtns/Render/Povray"), + N_("/Xtns/Script-Fu"), + N_("/Xtns/Script-Fu/Logos"), + N_("/Xtns/Script-Fu/Patterns"), + N_("/Xtns/Script-Fu/Web page themes"), + N_("/Xtns/Script-Fu/Utils"), + N_("/Xtns/Script-Fu/Buttons"), + N_("/Xtns/Script-Fu/Make Brush"), + N_("/Xtns/Script-Fu/Misc"), + N_("/Xtns/Script-Fu/Test"), + N_("/Xtns/Web Browser"), + + /* */ + N_("/Filters/Colors/Map"), N_("/Filters/Render/Clouds"), N_("/Filters/Render/Nature"), N_("/Filters/Render/Pattern"), - N_("/Filters/Colors/Map"), - N_("/Filters/Misc") + N_("/Filters/Misc"), + N_("/Script-Fu/Decor"), + N_("/Script-Fu/Modify"), + N_("/Script-Fu/Utils"), + N_("/Script-Fu/Animators"), + N_("/Script-Fu/Stencil Ops"), + N_("/Script-Fu/Alchemy"), + N_("/Script-Fu/Selection"), + N_("/Script-Fu/Shadow"), + N_("/Script-Fu/Render"), + N_("/Guides"), + N_("Video"), + N_("Video/Encode") }; static GSList *last_opened_raw_filenames = NULL; @@ -993,8 +1025,18 @@ menus_reorder_plugins (void) static gint n_image_file_entries = (sizeof (image_file_entries) / sizeof (image_file_entries[0])); - GtkWidget *menu; + static gchar *reorder_submenus[] = { "/Video" }; + static gint n_reorder_submenus = (sizeof (reorder_submenus) / + sizeof (reorder_submenus[0])); + + static gchar *reorder_sub_submenus[] = { "/Filters", + "/Xtns" }; + static gint n_reorder_sub_submenus = (sizeof (reorder_sub_submenus) / + sizeof (reorder_sub_submenus[0])); + + GtkItemFactory *item_factory; GtkWidget *menu_item; + GtkWidget *menu; GList *list; gchar *path; gint i, pos; @@ -1060,36 +1102,38 @@ menus_reorder_plugins (void) gtk_menu_reorder_child (GTK_MENU (menu_item->parent), menu_item, -1); } - /* Find the /Filters menu... */ - menu_item = gtk_item_factory_get_widget (image_factory, - "/Filters/Repeat last"); - if (!menu_item || !menu_item->parent) - return; - menu = menu_item->parent; - - /* ...and reorder all submenus of it's submenus */ - for (list = GTK_MENU_SHELL (menu)->children; list; list = g_list_next (list)) + /* Reorder menus where plugins registered submenus */ + for (i = 0; i < n_reorder_submenus; i++) { - GtkMenuItem *menu_item = GTK_MENU_ITEM (list->data); + item_factory = gtk_item_factory_from_path (reorder_submenus[i]); + menu = gtk_item_factory_get_widget (item_factory, + reorder_submenus[i]); - if (menu_item->submenu) - menus_filters_subdirs_to_top (GTK_MENU (menu_item->submenu)); + if (menu && GTK_IS_MENU (menu)) + { + menus_filters_subdirs_to_top (GTK_MENU (menu)); + } } - /* Find the /Xtns menu... */ - menu_item = gtk_item_factory_get_widget (toolbox_factory, - "/Xtns/Module Browser..."); - if (!menu_item || !menu_item->parent) - return; - menu = menu_item->parent; - - /* ...and reorder all submenus of it's submenus */ - for (list = GTK_MENU_SHELL (menu)->children; list; list = g_list_next (list)) + for (i = 0; i < n_reorder_sub_submenus; i++) { - GtkMenuItem *menu_item = GTK_MENU_ITEM (list->data); + item_factory = gtk_item_factory_from_path (reorder_sub_submenus[i]); + menu = gtk_item_factory_get_widget (item_factory, + reorder_sub_submenus[i]); - if (menu_item->submenu) - menus_filters_subdirs_to_top (GTK_MENU (menu_item->submenu)); + if (menu && GTK_IS_MENU (menu)) + { + for (list = GTK_MENU_SHELL (menu)->children; list; + list = g_list_next (list)) + { + GtkMenuItem *menu_item; + + menu_item = GTK_MENU_ITEM (list->data); + + if (menu_item->submenu) + menus_filters_subdirs_to_top (GTK_MENU (menu_item->submenu)); + } + } } } @@ -1618,32 +1662,34 @@ menus_init (void) } } -#define MENUPATH_SIZE 384 - static gchar * menu_translate (const gchar *path, gpointer data) { - static gchar menupath[MENUPATH_SIZE]; + static gchar *menupath = NULL; + gchar *retval; gchar *factory; factory = (gchar *) data; - menupath[MENUPATH_SIZE - 1] = '\0'; - strncpy (menupath, path, MENUPATH_SIZE -1); + if (menupath) + g_free (menupath); + + menupath = g_strdup (path); if ((strstr (path, "/tearoff1") != NULL) || (strstr (path, "/---") != NULL) || (strstr (path, "/MRU") != NULL)) return menupath; - retval = gettext (path); + retval = gettext (menupath); if (!strcmp (path, retval) && factory) { - strcpy (menupath, factory); - strncat (menupath, path, MENUPATH_SIZE - 1 - strlen (factory)); + g_free (menupath); + + menupath = g_strconcat (factory, path, NULL); retval = dgettext ("gimp-std-plugins", menupath) + strlen (factory); } diff --git a/plug-ins/gap/gap_main.c b/plug-ins/gap/gap_main.c index 1d3e1c980d..8a13f8cf04 100644 --- a/plug-ins/gap/gap_main.c +++ b/plug-ins/gap/gap_main.c @@ -576,7 +576,7 @@ query () "Wolfgang Hofer (hof@hotbot.com)", "Wolfgang Hofer", gap_main_version, - N_("/Video/Encode/MPEG2 mpeg2encode...)"), + N_("/Video/Encode/MPEG2..."), "RGB*, INDEXED*, GRAY*", PROC_PLUG_IN, nargs_mpege, nreturn_vals,