documentation.

2007-05-21  Sven Neumann  <sven@gimp.org>

	* app/core/gimp.c (gimp_message): documentation.

	* app/actions/documents-commands.c
	* app/widgets/gimplayertreeview.c
	* app/widgets/gimptoolbox-dnd.c: pass parent widgets to gimp_message().

svn path=/trunk/; revision=22552
This commit is contained in:
Sven Neumann 2007-05-21 16:32:52 +00:00 committed by Sven Neumann
parent 618f648c21
commit 9b369d8f6b
5 changed files with 47 additions and 21 deletions

View file

@ -1,3 +1,11 @@
2007-05-21 Sven Neumann <sven@gimp.org>
* app/core/gimp.c (gimp_message): documentation.
* app/actions/documents-commands.c
* app/widgets/gimplayertreeview.c
* app/widgets/gimptoolbox-dnd.c: pass parent widgets to gimp_message().
2007-05-21 Sven Neumann <sven@gimp.org>
* app/pdb/gimpprocedure.c (gimp_procedure_validate_args): pass the

View file

@ -53,21 +53,21 @@
#include "gimp-intl.h"
typedef struct _RaiseClosure RaiseClosure;
struct _RaiseClosure
typedef struct
{
const gchar *name;
gboolean found;
};
} RaiseClosure;
/* local function prototypes */
static void documents_open_image (GimpContext *context,
static void documents_open_image (GtkWidget *editor,
GimpContext *context,
GimpImagefile *imagefile);
static void documents_raise_display (gpointer data,
gpointer user_data);
static void documents_raise_display (GimpDisplay *display,
RaiseClosure *closure);
/* public functions */
@ -88,7 +88,7 @@ documents_open_cmd_callback (GtkAction *action,
if (imagefile && gimp_container_have (container, GIMP_OBJECT (imagefile)))
{
documents_open_image (context, imagefile);
documents_open_image (GTK_WIDGET (editor), context, imagefile);
}
else
{
@ -118,11 +118,11 @@ documents_raise_or_open_cmd_callback (GtkAction *action,
closure.found = FALSE;
gimp_container_foreach (context->gimp->displays,
documents_raise_display,
(GFunc) documents_raise_display,
&closure);
if (! closure.found)
documents_open_image (context, imagefile);
documents_open_image (GTK_WIDGET (editor), context, imagefile);
}
}
@ -299,7 +299,8 @@ documents_remove_dangling_cmd_callback (GtkAction *action,
/* private functions */
static void
documents_open_image (GimpContext *context,
documents_open_image (GtkWidget *editor,
GimpContext *context,
GimpImagefile *imagefile)
{
const gchar *uri;
@ -316,7 +317,7 @@ documents_open_image (GimpContext *context,
{
gchar *filename = file_utils_uri_display_name (uri);
gimp_message (context->gimp, NULL, GIMP_MESSAGE_ERROR,
gimp_message (context->gimp, G_OBJECT (editor), GIMP_MESSAGE_ERROR,
_("Opening '%s' failed:\n\n%s"),
filename, error->message);
g_clear_error (&error);
@ -326,14 +327,10 @@ documents_open_image (GimpContext *context,
}
static void
documents_raise_display (gpointer data,
gpointer user_data)
documents_raise_display (GimpDisplay *display,
RaiseClosure *closure)
{
GimpDisplay *display = data;
RaiseClosure *closure = user_data;
const gchar *uri;
uri = gimp_object_get_name (GIMP_OBJECT (display->image));
const gchar *uri = gimp_object_get_name (GIMP_OBJECT (display->image));
if (uri && ! strcmp (closure->name, uri))
{

View file

@ -994,6 +994,17 @@ gimp_get_tool_info (Gimp *gimp,
return (GimpToolInfo *) info;
}
/**
* gimp_message:
* @gimp: a pointer to the %Gimp object
* @handler: either a %GimpProgress or a %GtkWidget pointer
* @severity: severity of the message
* @format: printf-like format string
* @...: arguments to use with @format
*
* Present a message to the user. How exactly the message is displayed
* depends on the @severity, the @handler object and user preferences.
**/
void
gimp_message (Gimp *gimp,
GObject *handler,
@ -1010,6 +1021,16 @@ gimp_message (Gimp *gimp,
va_end (args);
}
/**
* gimp_message_valist:
* @gimp: a pointer to the %Gimp object
* @handler: either a %GimpProgress or a %GtkWidget pointer
* @severity: severity of the message
* @format: printf-like format string
* @args: arguments to use with @format
*
* See documentation for gimp_message().
**/
void
gimp_message_valist (Gimp *gimp,
GObject *handler,

View file

@ -759,7 +759,7 @@ gimp_layer_tree_view_drop_uri_list (GimpContainerTreeView *view,
{
gchar *filename = file_utils_uri_display_name (uri);
gimp_message (image->gimp, NULL, GIMP_MESSAGE_ERROR,
gimp_message (image->gimp, G_OBJECT (view), GIMP_MESSAGE_ERROR,
_("Opening '%s' failed:\n\n%s"),
filename, error->message);

View file

@ -154,7 +154,7 @@ gimp_toolbox_drop_uri_list (GtkWidget *widget,
{
gchar *filename = file_utils_uri_display_name (uri);
gimp_message (context->gimp, NULL, GIMP_MESSAGE_ERROR,
gimp_message (context->gimp, G_OBJECT (widget), GIMP_MESSAGE_ERROR,
_("Opening '%s' failed:\n\n%s"),
filename, error->message);