added "gboolean console_messages" to the Gimp struct and to gimp_new()

2003-09-09  Michael Natterer  <mitch@gimp.org>

	* app/core/gimp.[ch]: added "gboolean console_messages" to the
	Gimp struct and to gimp_new() since plug-in messages go directly
	through gimp_message() now and need to honor "console_messages"
	too.

	* app/app_procs.[ch]: added "gboolean console_messages" to
	app_init() and pass it to gimp_new().

	* app/appenv.h: removed global variable "console_messages".

	* app/main.c: added it to main()'s scope and pass it to app_init().

	* app/errors.c: changed accordingly.
This commit is contained in:
Michael Natterer 2003-09-09 10:54:20 +00:00 committed by Michael Natterer
parent 29cc429d95
commit 284b8f91d7
8 changed files with 45 additions and 19 deletions

View file

@ -1,3 +1,19 @@
2003-09-09 Michael Natterer <mitch@gimp.org>
* app/core/gimp.[ch]: added "gboolean console_messages" to the
Gimp struct and to gimp_new() since plug-in messages go directly
through gimp_message() now and need to honor "console_messages"
too.
* app/app_procs.[ch]: added "gboolean console_messages" to
app_init() and pass it to gimp_new().
* app/appenv.h: removed global variable "console_messages".
* app/main.c: added it to main()'s scope and pass it to app_init().
* app/errors.c: changed accordingly.
2003-09-08 Adam D. Moss <adam@gimp.org>
* plug-ins/common/animoptimize.c: Disable the (pdb interfaces

View file

@ -83,7 +83,6 @@ Gimp *the_gimp = NULL;
/* command-line options */
gboolean use_debug_handler = FALSE;
gboolean console_messages = FALSE;
GimpStackTraceMode stack_trace_mode = GIMP_STACK_TRACE_QUERY;
/* other global variables */
@ -112,6 +111,7 @@ app_init (gint gimp_argc,
gboolean be_verbose,
gboolean use_shm,
gboolean use_mmx,
gboolean console_messages,
gboolean restore_session)
{
GimpInitStatusFunc update_status_func;
@ -130,6 +130,7 @@ app_init (gint gimp_argc,
no_data,
no_interface,
use_shm,
console_messages,
stack_trace_mode);
gimp_object_set_name (GIMP_OBJECT (the_gimp), prog_name);

View file

@ -49,6 +49,7 @@ void app_init (gint gimp_argc,
gboolean be_verbose,
gboolean use_shm,
gboolean use_mmx,
gboolean console_messages,
gboolean restore_session);

View file

@ -26,7 +26,6 @@
/* command line options */
extern gboolean use_debug_handler;
extern gboolean console_messages;
extern GimpStackTraceMode stack_trace_mode;
/* other global variables */

View file

@ -536,16 +536,18 @@ gimp_new (gboolean be_verbose,
gboolean no_data,
gboolean no_interface,
gboolean use_shm,
gboolean console_messages,
GimpStackTraceMode stack_trace_mode)
{
Gimp *gimp;
gimp = g_object_new (GIMP_TYPE_GIMP, NULL);
gimp->be_verbose = be_verbose ? TRUE : FALSE;
gimp->no_data = no_data ? TRUE : FALSE;
gimp->no_interface = no_interface ? TRUE : FALSE;
gimp->use_shm = use_shm ? TRUE : FALSE;
gimp->be_verbose = be_verbose ? TRUE : FALSE;
gimp->no_data = no_data ? TRUE : FALSE;
gimp->no_interface = no_interface ? TRUE : FALSE;
gimp->use_shm = use_shm ? TRUE : FALSE;
gimp->console_messages = console_messages ? TRUE : FALSE;
gimp->stack_trace_mode = stack_trace_mode;
return gimp;
@ -909,19 +911,22 @@ gimp_message (Gimp *gimp,
{
g_return_if_fail (GIMP_IS_GIMP (gimp));
switch (gimp->message_handler)
if (! gimp->console_messages)
{
case GIMP_MESSAGE_BOX:
case GIMP_ERROR_CONSOLE:
if (gimp->gui_message_func)
switch (gimp->message_handler)
{
gimp->gui_message_func (gimp, domain, message);
return;
}
break;
case GIMP_MESSAGE_BOX:
case GIMP_ERROR_CONSOLE:
if (gimp->gui_message_func)
{
gimp->gui_message_func (gimp, domain, message);
return;
}
break;
default:
break;
default:
break;
}
}
g_printerr ("%s: %s\n", domain ? domain : GIMP_OBJECT (gimp)->name, message);

View file

@ -57,6 +57,7 @@ struct _Gimp
gboolean no_interface;
gboolean use_shm;
GimpMessageHandlerType message_handler;
gboolean console_messages;
GimpStackTraceMode stack_trace_mode;
GimpThreadEnterFunc gui_threads_enter_func;
@ -164,6 +165,7 @@ Gimp * gimp_new (gboolean be_verbose,
gboolean no_data,
gboolean no_interface,
gboolean use_shm,
gboolean console_messages,
GimpStackTraceMode stack_trace_mode);
void gimp_set_config (Gimp *gimp,

View file

@ -56,11 +56,11 @@ gimp_message_log_func (const gchar *log_domain,
const gchar *message,
gpointer data)
{
Gimp *gimp = *((Gimp **) data);
Gimp **gimp = (Gimp **) data;
if (! console_messages && GIMP_IS_GIMP (gimp))
if (gimp && GIMP_IS_GIMP (*gimp))
{
gimp_message (gimp, NULL, message);
gimp_message (*gimp, NULL, message);
return;
}

View file

@ -99,6 +99,7 @@ main (int argc,
gboolean be_verbose = FALSE;
gboolean use_shm = FALSE;
gboolean use_mmx = TRUE;
gboolean console_messages = FALSE;
gboolean restore_session = FALSE;
gint i, j;
@ -389,6 +390,7 @@ main (int argc,
be_verbose,
use_shm,
use_mmx,
console_messages,
restore_session);
return 0;