Commit dec69db1 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

removed the "locale_domain" and "help_path" parameters since the function

2003-08-25  Michael Natterer  <mitch@gimp.org>

	* app/plug-in/plug-ins.[ch] (plug_ins_temp_proc_def_add): removed
	the "locale_domain" and "help_path" parameters since the function
	can figure them by itself.

	* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
	changed accordingly.

	* app/plug-in/plug-in-proc.[ch] (plug_in_proc_def_get_help_id):
	new function which will soon be implemented correctly :-)

	* app/gui/file-open-menu.c (file_open_menu_setup)
	* app/gui/file-save-menu.c (file_save_menu_setup)
	* app/gui/plug-in-menus.c (plug_in_menus_create_entry): use it
	here instead of duplicating broken code.
parent bfb8068a
2003-08-25 Michael Natterer <mitch@gimp.org>
* app/plug-in/plug-ins.[ch] (plug_ins_temp_proc_def_add): removed
the "locale_domain" and "help_path" parameters since the function
can figure them by itself.
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
changed accordingly.
* app/plug-in/plug-in-proc.[ch] (plug_in_proc_def_get_help_id):
new function which will soon be implemented correctly :-)
* app/gui/file-open-menu.c (file_open_menu_setup)
* app/gui/file-save-menu.c (file_save_menu_setup)
* app/gui/plug-in-menus.c (plug_in_menus_create_entry): use it
here instead of duplicating broken code.
2003-08-25 Michael Natterer <mitch@gimp.org>
 
* app/widgets/gimphelp-ids.h: added GIMP_HELP_TEXT_EDITOR_DIALOG.
......@@ -73,25 +73,10 @@ file_open_menu_setup (GimpItemFactory *factory)
progname = plug_in_proc_def_get_progname (file_proc);
locale_domain = plug_ins_locale_domain (factory->gimp,
progname, NULL);
help_path = plug_ins_help_path (factory->gimp,
progname);
locale_domain = plug_ins_locale_domain (factory->gimp, progname, NULL);
help_path = plug_ins_help_path (factory->gimp, progname);
#ifdef __GNUC__
#warning FIXME: fix plug-in menu item help
#endif
{
gchar *basename;
gchar *lowercase_basename;
basename = g_path_get_basename (file_proc->prog);
lowercase_basename = g_ascii_strdown (basename, -1);
help_id = g_strconcat (lowercase_basename, ".html", NULL);
g_free (lowercase_basename);
}
help_id = plug_in_proc_def_get_help_id (file_proc);
if (help_path)
help_page = g_strconcat (help_path, ":", help_id, NULL);
......
......@@ -74,25 +74,10 @@ file_save_menu_setup (GimpItemFactory *factory)
progname = plug_in_proc_def_get_progname (file_proc);
locale_domain = plug_ins_locale_domain (factory->gimp,
progname, NULL);
help_path = plug_ins_help_path (factory->gimp,
progname);
locale_domain = plug_ins_locale_domain (factory->gimp, progname, NULL);
help_path = plug_ins_help_path (factory->gimp, progname);
#ifdef __GNUC__
#warning FIXME: fix plug-in menu item help
#endif
{
gchar *basename;
gchar *lowercase_basename;
basename = g_path_get_basename (file_proc->prog);
lowercase_basename = g_ascii_strdown (basename, -1);
help_id = g_strconcat (lowercase_basename, ".html", NULL);
g_free (lowercase_basename);
}
help_id = plug_in_proc_def_get_help_id (file_proc);
if (help_path)
help_page = g_strconcat (help_path, ":", help_id, NULL);
......
......@@ -94,10 +94,8 @@ plug_in_menus_init (Gimp *gimp,
&locale_path);
for (list = domains; list; list = list->next)
{
if (! strcmp (locale_domain, (gchar *) list->data))
break;
}
if (! strcmp (locale_domain, (gchar *) list->data))
break;
if (! list)
{
......@@ -115,9 +113,8 @@ void
plug_in_menus_create (GimpItemFactory *item_factory,
GSList *proc_defs)
{
PlugInProcDef *proc_def;
GSList *procs;
GTree *menu_entries;
GSList *procs;
GTree *menu_entries;
g_return_if_fail (GIMP_IS_ITEM_FACTORY (item_factory));
g_return_if_fail (proc_defs != NULL);
......@@ -127,7 +124,7 @@ plug_in_menus_create (GimpItemFactory *item_factory,
for (procs = proc_defs; procs; procs = procs->next)
{
proc_def = procs->data;
PlugInProcDef *proc_def = procs->data;
if (proc_def->prog &&
proc_def->menu_path &&
......@@ -177,21 +174,9 @@ plug_in_menus_create_entry (GimpItemFactory *item_factory,
g_return_if_fail (item_factory == NULL ||
GIMP_IS_ITEM_FACTORY (item_factory));
g_return_if_fail (proc_def != NULL);
#ifdef __GNUC__
#warning FIXME: fix plug-in menu item help
#endif
{
gchar *basename;
gchar *lowercase_basename;
basename = g_path_get_basename (proc_def->prog);
lowercase_basename = g_ascii_strdown (basename, -1);
help_id = g_strconcat (lowercase_basename, ".html", NULL);
g_free (lowercase_basename);
}
help_id = plug_in_proc_def_get_help_id (proc_def);
if (help_path)
help_page = g_strconcat (help_path, ":", help_id, NULL);
......
......@@ -73,25 +73,10 @@ file_open_menu_setup (GimpItemFactory *factory)
progname = plug_in_proc_def_get_progname (file_proc);
locale_domain = plug_ins_locale_domain (factory->gimp,
progname, NULL);
help_path = plug_ins_help_path (factory->gimp,
progname);
locale_domain = plug_ins_locale_domain (factory->gimp, progname, NULL);
help_path = plug_ins_help_path (factory->gimp, progname);
#ifdef __GNUC__
#warning FIXME: fix plug-in menu item help
#endif
{
gchar *basename;
gchar *lowercase_basename;
basename = g_path_get_basename (file_proc->prog);
lowercase_basename = g_ascii_strdown (basename, -1);
help_id = g_strconcat (lowercase_basename, ".html", NULL);
g_free (lowercase_basename);
}
help_id = plug_in_proc_def_get_help_id (file_proc);
if (help_path)
help_page = g_strconcat (help_path, ":", help_id, NULL);
......
......@@ -74,25 +74,10 @@ file_save_menu_setup (GimpItemFactory *factory)
progname = plug_in_proc_def_get_progname (file_proc);
locale_domain = plug_ins_locale_domain (factory->gimp,
progname, NULL);
help_path = plug_ins_help_path (factory->gimp,
progname);
locale_domain = plug_ins_locale_domain (factory->gimp, progname, NULL);
help_path = plug_ins_help_path (factory->gimp, progname);
#ifdef __GNUC__
#warning FIXME: fix plug-in menu item help
#endif
{
gchar *basename;
gchar *lowercase_basename;
basename = g_path_get_basename (file_proc->prog);
lowercase_basename = g_ascii_strdown (basename, -1);
help_id = g_strconcat (lowercase_basename, ".html", NULL);
g_free (lowercase_basename);
}
help_id = plug_in_proc_def_get_help_id (file_proc);
if (help_path)
help_page = g_strconcat (help_path, ":", help_id, NULL);
......
......@@ -94,10 +94,8 @@ plug_in_menus_init (Gimp *gimp,
&locale_path);
for (list = domains; list; list = list->next)
{
if (! strcmp (locale_domain, (gchar *) list->data))
break;
}
if (! strcmp (locale_domain, (gchar *) list->data))
break;
if (! list)
{
......@@ -115,9 +113,8 @@ void
plug_in_menus_create (GimpItemFactory *item_factory,
GSList *proc_defs)
{
PlugInProcDef *proc_def;
GSList *procs;
GTree *menu_entries;
GSList *procs;
GTree *menu_entries;
g_return_if_fail (GIMP_IS_ITEM_FACTORY (item_factory));
g_return_if_fail (proc_defs != NULL);
......@@ -127,7 +124,7 @@ plug_in_menus_create (GimpItemFactory *item_factory,
for (procs = proc_defs; procs; procs = procs->next)
{
proc_def = procs->data;
PlugInProcDef *proc_def = procs->data;
if (proc_def->prog &&
proc_def->menu_path &&
......@@ -177,21 +174,9 @@ plug_in_menus_create_entry (GimpItemFactory *item_factory,
g_return_if_fail (item_factory == NULL ||
GIMP_IS_ITEM_FACTORY (item_factory));
g_return_if_fail (proc_def != NULL);
#ifdef __GNUC__
#warning FIXME: fix plug-in menu item help
#endif
{
gchar *basename;
gchar *lowercase_basename;
basename = g_path_get_basename (proc_def->prog);
lowercase_basename = g_ascii_strdown (basename, -1);
help_id = g_strconcat (lowercase_basename, ".html", NULL);
g_free (lowercase_basename);
}
help_id = plug_in_proc_def_get_help_id (proc_def);
if (help_path)
help_page = g_strconcat (help_path, ":", help_id, NULL);
......
......@@ -104,3 +104,29 @@ plug_in_proc_def_get_progname (PlugInProcDef *proc_def)
return NULL;
}
gchar *
plug_in_proc_def_get_help_id (PlugInProcDef *proc_def)
{
const gchar *progname;
gchar *basename;
gchar *lowercase_basename;
gchar *help_id;
g_return_val_if_fail (proc_def != NULL, NULL);
progname = plug_in_proc_def_get_progname (proc_def);
basename = g_path_get_basename (progname);
lowercase_basename = g_ascii_strdown (basename, -1);
g_free (basename);
#ifdef __GNUC__
#warning FIXME: fix plug-in menu item help
#endif
help_id = g_strconcat (lowercase_basename, ".html", NULL);
g_free (lowercase_basename);
return help_id;
}
......@@ -47,6 +47,7 @@ void plug_in_proc_def_free (PlugInProcDef *proc_def);
ProcRecord * plug_in_proc_def_get_proc (PlugInProcDef *proc_def);
const gchar * plug_in_proc_def_get_progname (PlugInProcDef *proc_def);
gchar * plug_in_proc_def_get_help_id (PlugInProcDef *proc_def);
#endif /* __PLUG_IN_PROC_H__ */
......@@ -745,12 +745,7 @@ plug_in_handle_proc_install (PlugIn *plug_in,
proc->exec_method.temporary.plug_in = plug_in;
plug_ins_temp_proc_def_add (plug_in->gimp, proc_def,
plug_ins_locale_domain (plug_in->gimp,
plug_in->prog,
NULL),
plug_ins_help_path (plug_in->gimp,
plug_in->prog));
plug_ins_temp_proc_def_add (plug_in->gimp, proc_def);
break;
}
}
......
......@@ -552,9 +552,7 @@ plug_ins_def_add_from_rc (Gimp *gimp,
void
plug_ins_temp_proc_def_add (Gimp *gimp,
PlugInProcDef *proc_def,
const gchar *locale_domain,
const gchar *help_path)
PlugInProcDef *proc_def)
{
g_return_if_fail (GIMP_IS_GIMP (gimp));
g_return_if_fail (proc_def != NULL);
......@@ -563,10 +561,17 @@ plug_ins_temp_proc_def_add (Gimp *gimp,
{
if (proc_def->menu_path)
{
if (! locale_domain)
locale_domain = STD_PLUGINS_DOMAIN;
const gchar *progname;
const gchar *locale_domain;
const gchar *help_path;
plug_in_menus_create_entry (NULL, proc_def, locale_domain, help_path);
progname = plug_in_proc_def_get_progname (proc_def);
locale_domain = plug_ins_locale_domain (gimp, progname, NULL);
help_path = plug_ins_help_path (gimp, progname);
plug_in_menus_create_entry (NULL, proc_def,
locale_domain, help_path);
}
}
......
......@@ -44,9 +44,7 @@ void plug_ins_def_add_from_rc (Gimp *gimp,
/* Add/Remove temporary procedures. */
void plug_ins_temp_proc_def_add (Gimp *gimp,
PlugInProcDef *proc_def,
const gchar *locale_domain,
const gchar *help_path);
PlugInProcDef *proc_def);
void plug_ins_temp_proc_def_remove (Gimp *gimp,
PlugInProcDef *proc_def);
......
......@@ -104,3 +104,29 @@ plug_in_proc_def_get_progname (PlugInProcDef *proc_def)
return NULL;
}
gchar *
plug_in_proc_def_get_help_id (PlugInProcDef *proc_def)
{
const gchar *progname;
gchar *basename;
gchar *lowercase_basename;
gchar *help_id;
g_return_val_if_fail (proc_def != NULL, NULL);
progname = plug_in_proc_def_get_progname (proc_def);
basename = g_path_get_basename (progname);
lowercase_basename = g_ascii_strdown (basename, -1);
g_free (basename);
#ifdef __GNUC__
#warning FIXME: fix plug-in menu item help
#endif
help_id = g_strconcat (lowercase_basename, ".html", NULL);
g_free (lowercase_basename);
return help_id;
}
......@@ -47,6 +47,7 @@ void plug_in_proc_def_free (PlugInProcDef *proc_def);
ProcRecord * plug_in_proc_def_get_proc (PlugInProcDef *proc_def);
const gchar * plug_in_proc_def_get_progname (PlugInProcDef *proc_def);
gchar * plug_in_proc_def_get_help_id (PlugInProcDef *proc_def);
#endif /* __PLUG_IN_PROC_H__ */
......@@ -745,12 +745,7 @@ plug_in_handle_proc_install (PlugIn *plug_in,
proc->exec_method.temporary.plug_in = plug_in;
plug_ins_temp_proc_def_add (plug_in->gimp, proc_def,
plug_ins_locale_domain (plug_in->gimp,
plug_in->prog,
NULL),
plug_ins_help_path (plug_in->gimp,
plug_in->prog));
plug_ins_temp_proc_def_add (plug_in->gimp, proc_def);
break;
}
}
......
......@@ -104,3 +104,29 @@ plug_in_proc_def_get_progname (PlugInProcDef *proc_def)
return NULL;
}
gchar *
plug_in_proc_def_get_help_id (PlugInProcDef *proc_def)
{
const gchar *progname;
gchar *basename;
gchar *lowercase_basename;
gchar *help_id;
g_return_val_if_fail (proc_def != NULL, NULL);
progname = plug_in_proc_def_get_progname (proc_def);
basename = g_path_get_basename (progname);
lowercase_basename = g_ascii_strdown (basename, -1);
g_free (basename);
#ifdef __GNUC__
#warning FIXME: fix plug-in menu item help
#endif
help_id = g_strconcat (lowercase_basename, ".html", NULL);
g_free (lowercase_basename);
return help_id;
}
......@@ -47,6 +47,7 @@ void plug_in_proc_def_free (PlugInProcDef *proc_def);
ProcRecord * plug_in_proc_def_get_proc (PlugInProcDef *proc_def);
const gchar * plug_in_proc_def_get_progname (PlugInProcDef *proc_def);
gchar * plug_in_proc_def_get_help_id (PlugInProcDef *proc_def);
#endif /* __PLUG_IN_PROC_H__ */
......@@ -104,3 +104,29 @@ plug_in_proc_def_get_progname (PlugInProcDef *proc_def)
return NULL;
}
gchar *
plug_in_proc_def_get_help_id (PlugInProcDef *proc_def)
{
const gchar *progname;
gchar *basename;
gchar *lowercase_basename;
gchar *help_id;
g_return_val_if_fail (proc_def != NULL, NULL);
progname = plug_in_proc_def_get_progname (proc_def);
basename = g_path_get_basename (progname);
lowercase_basename = g_ascii_strdown (basename, -1);
g_free (basename);
#ifdef __GNUC__
#warning FIXME: fix plug-in menu item help
#endif
help_id = g_strconcat (lowercase_basename, ".html", NULL);
g_free (lowercase_basename);
return help_id;
}
......@@ -47,6 +47,7 @@ void plug_in_proc_def_free (PlugInProcDef *proc_def);
ProcRecord * plug_in_proc_def_get_proc (PlugInProcDef *proc_def);
const gchar * plug_in_proc_def_get_progname (PlugInProcDef *proc_def);
gchar * plug_in_proc_def_get_help_id (PlugInProcDef *proc_def);
#endif /* __PLUG_IN_PROC_H__ */
......@@ -552,9 +552,7 @@ plug_ins_def_add_from_rc (Gimp *gimp,
void
plug_ins_temp_proc_def_add (Gimp *gimp,
PlugInProcDef *proc_def,
const gchar *locale_domain,
const gchar *help_path)
PlugInProcDef *proc_def)
{
g_return_if_fail (GIMP_IS_GIMP (gimp));
g_return_if_fail (proc_def != NULL);
......@@ -563,10 +561,17 @@ plug_ins_temp_proc_def_add (Gimp *gimp,
{
if (proc_def->menu_path)
{
if (! locale_domain)
locale_domain = STD_PLUGINS_DOMAIN;
const gchar *progname;
const gchar *locale_domain;
const gchar *help_path;
plug_in_menus_create_entry (NULL, proc_def, locale_domain, help_path);
progname = plug_in_proc_def_get_progname (proc_def);
locale_domain = plug_ins_locale_domain (gimp, progname, NULL);
help_path = plug_ins_help_path (gimp, progname);
plug_in_menus_create_entry (NULL, proc_def,
locale_domain, help_path);
}
}
......
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