use plug_in_get_undo_desc() instead of duplicating its code.

2003-06-20  Michael Natterer  <mitch@gimp.org>

	* tools/pdbgen/pdb/message.pdb (message): use
	plug_in_get_undo_desc() instead of duplicating its code.

	* app/pdb/message_cmds.c: regenerated.
This commit is contained in:
Michael Natterer 2003-06-20 14:13:15 +00:00 committed by Michael Natterer
parent 6684bb8aa8
commit 119356a692
3 changed files with 10 additions and 80 deletions

View File

@ -1,3 +1,10 @@
2003-06-20 Michael Natterer <mitch@gimp.org>
* tools/pdbgen/pdb/message.pdb (message): use
plug_in_get_undo_desc() instead of duplicating its code.
* app/pdb/message_cmds.c: regenerated.
2003-06-20 Michael Natterer <mitch@gimp.org>
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): pass the

View File

@ -31,9 +31,7 @@
#include "core/gimp.h"
#include "gimp-intl.h"
#include "plug-in/plug-in-proc.h"
#include "plug-in/plug-in.h"
#include "plug-in/plug-ins.h"
static ProcRecord message_proc;
static ProcRecord message_get_handler_proc;
@ -70,44 +68,7 @@ message_invoker (Gimp *gimp,
gchar *domain = NULL;
if (gimp->current_plug_in)
{
GSList *list;
for (list = gimp->plug_in_proc_defs; list; list = g_slist_next (list))
{
PlugInProcDef *proc_def = list->data;
if (&proc_def->db_info == gimp->current_plug_in->proc_rec)
{
const gchar *progname;
progname = plug_in_proc_def_get_progname (proc_def);
if (proc_def->menu_path)
{
const gchar *path;
gchar *ellipses;
path = dgettext (plug_ins_locale_domain (gimp, progname,
NULL),
proc_def->menu_path);
domain = g_path_get_basename (path);
ellipses = strstr (domain, "...");
if (ellipses && ellipses == (domain + strlen (domain) - 3))
*ellipses = '\0';
}
else
{
domain = g_path_get_basename (progname);
}
break;
}
}
}
domain = plug_in_get_undo_desc (gimp->current_plug_in);
gimp_message (gimp, domain, message);

View File

@ -49,44 +49,7 @@ HELP
gchar *domain = NULL;
if (gimp->current_plug_in)
{
GSList *list;
for (list = gimp->plug_in_proc_defs; list; list = g_slist_next (list))
{
PlugInProcDef *proc_def = list->data;
if (&proc_def->db_info == gimp->current_plug_in->proc_rec)
{
const gchar *progname;
progname = plug_in_proc_def_get_progname (proc_def);
if (proc_def->menu_path)
{
const gchar *path;
gchar *ellipses;
path = dgettext (plug_ins_locale_domain (gimp, progname,
NULL),
proc_def->menu_path);
domain = g_path_get_basename (path);
ellipses = strstr (domain, "...");
if (ellipses && ellipses == (domain + strlen (domain) - 3))
*ellipses = '\\0';
}
else
{
domain = g_path_get_basename (progname);
}
break;
}
}
}
domain = plug_in_get_undo_desc (gimp->current_plug_in);
gimp_message (gimp, domain, message);
@ -134,8 +97,7 @@ HELP
%invoke = ( code => 'gimp->message_handler = handler;' );
}
@headers = qw(<string.h> "core/gimp.h" "plug-in/plug-in.h" "plug-in/plug-ins.h"
"plug-in/plug-in-proc.h" "gimp-intl.h");
@headers = qw(<string.h> "core/gimp.h" "plug-in/plug-in.h" "gimp-intl.h");
@procs = qw(message message_get_handler message_set_handler);
%exports = (app => [@procs], lib => [@procs]);