mirror of https://github.com/GNOME/gimp.git
Added message severities and make sure all messages are routed through a
2006-10-09 Michael Natterer <mitch@gimp.org> Added message severities and make sure all messages are routed through a central function, so redirecting to the error console or stderr work again: * app/core/core-enums.[ch]: added enum GimpMessageSeverity { INFO, WARNING, ERROR }. * app/core/gimp.[ch] (gimp_message) (gimp_message_valist): added severity parameter. Changed "GimpProgress *progress" parameter to "GObject *handler", where "handler" can be either a GimpProgress, a GtkWidget or NULL. * app/core/gimp-gui.[ch] (gimp_show_message): ditto. Honor --console-messages again. Always dispatch to the GUI message handler first if it exists. * app/gui/gui-message.[ch]: pass severity parameters around. (gui_message_error_dialog): if "handler" is a progress, dispatch the message to it first. If it is a widget (and *not* a progress), use a GtkMessageDialog on top of that widget's toplevel. Fall back to the usual GimpErrorDialog otherwise. * app/core/gimpprogress.[ch] (gimp_progress_message): added severity parameter. Also added boolean return value to the virtual function so it can decide to fail if it can't handle the message. * app/display/gimpdisplay.c: implement GimpProgress::message() and redirect the message to GimpDisplayShell. * app/display/gimpdisplayshell-progress.c: implement GimpProgress::message() and redirect the message to GimpStatusbar if it is not an error and if the status bar is visible. * app/display/gimpstatusbar.[ch]: implement GimpProgress::message(), but fail on messages that contain a newline. Show the right icons for the message severities (work in progress). * app/display/gimpdisplayshell.[ch]: removed gimp_display_shell_message() and its _valist() variant. * app/widgets/gimperrorconsole.[ch]: show the right icons for the message severities. * app/widgets/gimpthumbbox.c (gimp_thumb_box_progress_message): return TRUE to swallow all messages. * app/widgets/gimpwidgets-utils.[ch]: removed gimp_show_message_dialog(). Added gimp_get_message_stock_id(). * app/errors.c * app/actions/edit-commands.c * app/actions/error-console-commands.c * app/actions/file-commands.c * app/actions/select-commands.c * app/actions/text-editor-commands.c * app/actions/vectors-commands.c * app/core/gimpimage-convert.c * app/core/gimpimagefile.c * app/dialogs/convert-dialog.c * app/dialogs/file-open-dialog.c * app/dialogs/file-open-location-dialog.c * app/dialogs/file-save-dialog.c * app/dialogs/palette-import-dialog.c * app/dialogs/stroke-dialog.c * app/display/gimpdisplayshell-dnd.c * app/pdb/gimppdb.c * app/plug-in/gimpplugin.c * app/tools/gimpimagemaptool.c * app/tools/gimptool.c * app/tools/gimpvectortool.c * app/widgets/gimpactionview.c * app/widgets/gimpcontrollerlist.c * app/widgets/gimppdbdialog.c * app/widgets/gimpvectorstreeview.c * app/xcf/xcf-load.c * app/xcf/xcf-save.c * app/xcf/xcf.c * tools/pdbgen/pdb/brush.pdb * tools/pdbgen/pdb/gradient.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/message.pdb * tools/pdbgen/pdb/palette.pdb: added severity parameter to gimp_message() calls. Convert all calls to gimp_show_message_dialog() and gimp_display_shell_message() to gimp_message(). Also converted some more g_message() calls. * app/pdb/brush_cmds.c * app/pdb/gradient_cmds.c * app/pdb/image_cmds.c * app/pdb/message_cmds.c * app/pdb/palette_cmds.c: regenerated.
This commit is contained in:
parent
a8855ae632
commit
f5afb754a5
95
ChangeLog
95
ChangeLog
|
@ -1,3 +1,98 @@
|
||||||
|
2006-10-09 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
|
Added message severities and make sure all messages are routed
|
||||||
|
through a central function, so redirecting to the error console or
|
||||||
|
stderr work again:
|
||||||
|
|
||||||
|
* app/core/core-enums.[ch]: added enum GimpMessageSeverity { INFO,
|
||||||
|
WARNING, ERROR }.
|
||||||
|
|
||||||
|
* app/core/gimp.[ch] (gimp_message)
|
||||||
|
(gimp_message_valist): added severity parameter. Changed
|
||||||
|
"GimpProgress *progress" parameter to "GObject *handler", where
|
||||||
|
"handler" can be either a GimpProgress, a GtkWidget or NULL.
|
||||||
|
|
||||||
|
* app/core/gimp-gui.[ch] (gimp_show_message): ditto. Honor
|
||||||
|
--console-messages again. Always dispatch to the GUI message
|
||||||
|
handler first if it exists.
|
||||||
|
|
||||||
|
* app/gui/gui-message.[ch]: pass severity parameters around.
|
||||||
|
|
||||||
|
(gui_message_error_dialog): if "handler" is a progress, dispatch
|
||||||
|
the message to it first. If it is a widget (and *not* a progress),
|
||||||
|
use a GtkMessageDialog on top of that widget's toplevel. Fall
|
||||||
|
back to the usual GimpErrorDialog otherwise.
|
||||||
|
|
||||||
|
* app/core/gimpprogress.[ch] (gimp_progress_message): added
|
||||||
|
severity parameter. Also added boolean return value to the virtual
|
||||||
|
function so it can decide to fail if it can't handle the message.
|
||||||
|
|
||||||
|
* app/display/gimpdisplay.c: implement GimpProgress::message() and
|
||||||
|
redirect the message to GimpDisplayShell.
|
||||||
|
|
||||||
|
* app/display/gimpdisplayshell-progress.c: implement
|
||||||
|
GimpProgress::message() and redirect the message to GimpStatusbar
|
||||||
|
if it is not an error and if the status bar is visible.
|
||||||
|
|
||||||
|
* app/display/gimpstatusbar.[ch]: implement GimpProgress::message(),
|
||||||
|
but fail on messages that contain a newline. Show the right icons
|
||||||
|
for the message severities (work in progress).
|
||||||
|
|
||||||
|
* app/display/gimpdisplayshell.[ch]: removed
|
||||||
|
gimp_display_shell_message() and its _valist() variant.
|
||||||
|
|
||||||
|
* app/widgets/gimperrorconsole.[ch]: show the right icons for the
|
||||||
|
message severities.
|
||||||
|
|
||||||
|
* app/widgets/gimpthumbbox.c (gimp_thumb_box_progress_message):
|
||||||
|
return TRUE to swallow all messages.
|
||||||
|
|
||||||
|
* app/widgets/gimpwidgets-utils.[ch]: removed
|
||||||
|
gimp_show_message_dialog(). Added gimp_get_message_stock_id().
|
||||||
|
|
||||||
|
* app/errors.c
|
||||||
|
* app/actions/edit-commands.c
|
||||||
|
* app/actions/error-console-commands.c
|
||||||
|
* app/actions/file-commands.c
|
||||||
|
* app/actions/select-commands.c
|
||||||
|
* app/actions/text-editor-commands.c
|
||||||
|
* app/actions/vectors-commands.c
|
||||||
|
* app/core/gimpimage-convert.c
|
||||||
|
* app/core/gimpimagefile.c
|
||||||
|
* app/dialogs/convert-dialog.c
|
||||||
|
* app/dialogs/file-open-dialog.c
|
||||||
|
* app/dialogs/file-open-location-dialog.c
|
||||||
|
* app/dialogs/file-save-dialog.c
|
||||||
|
* app/dialogs/palette-import-dialog.c
|
||||||
|
* app/dialogs/stroke-dialog.c
|
||||||
|
* app/display/gimpdisplayshell-dnd.c
|
||||||
|
* app/pdb/gimppdb.c
|
||||||
|
* app/plug-in/gimpplugin.c
|
||||||
|
* app/tools/gimpimagemaptool.c
|
||||||
|
* app/tools/gimptool.c
|
||||||
|
* app/tools/gimpvectortool.c
|
||||||
|
* app/widgets/gimpactionview.c
|
||||||
|
* app/widgets/gimpcontrollerlist.c
|
||||||
|
* app/widgets/gimppdbdialog.c
|
||||||
|
* app/widgets/gimpvectorstreeview.c
|
||||||
|
* app/xcf/xcf-load.c
|
||||||
|
* app/xcf/xcf-save.c
|
||||||
|
* app/xcf/xcf.c
|
||||||
|
* tools/pdbgen/pdb/brush.pdb
|
||||||
|
* tools/pdbgen/pdb/gradient.pdb
|
||||||
|
* tools/pdbgen/pdb/image.pdb
|
||||||
|
* tools/pdbgen/pdb/message.pdb
|
||||||
|
* tools/pdbgen/pdb/palette.pdb: added severity parameter to
|
||||||
|
gimp_message() calls. Convert all calls to
|
||||||
|
gimp_show_message_dialog() and gimp_display_shell_message() to
|
||||||
|
gimp_message(). Also converted some more g_message() calls.
|
||||||
|
|
||||||
|
* app/pdb/brush_cmds.c
|
||||||
|
* app/pdb/gradient_cmds.c
|
||||||
|
* app/pdb/image_cmds.c
|
||||||
|
* app/pdb/message_cmds.c
|
||||||
|
* app/pdb/palette_cmds.c: regenerated.
|
||||||
|
|
||||||
2006-10-07 Manish Singh <yosh@gimp.org>
|
2006-10-07 Manish Singh <yosh@gimp.org>
|
||||||
|
|
||||||
* plug-ins/pygimp/gimpfu.py: Don't use Python 2.4 specific functions,
|
* plug-ins/pygimp/gimpfu.py: Don't use Python 2.4 specific functions,
|
||||||
|
|
|
@ -265,7 +265,8 @@ edit_paste_as_new_cmd_callback (GtkAction *action,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g_message (_("There is no image data in the clipboard to paste."));
|
gimp_message (gimp, NULL, GIMP_MESSAGE_WARNING,
|
||||||
|
_("There is no image data in the clipboard to paste."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -418,9 +419,9 @@ edit_paste (GimpDisplay *display,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gimp_display_shell_message (GIMP_DISPLAY_SHELL (display->shell),
|
gimp_message (display->image->gimp, G_OBJECT (display),
|
||||||
_("There is no image data in "
|
GIMP_MESSAGE_WARNING,
|
||||||
"the clipboard to paste."));
|
_("There is no image data in the clipboard to paste."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -437,7 +438,8 @@ cut_named_buffer_callback (GtkWidget *widget,
|
||||||
|
|
||||||
if (! drawable)
|
if (! drawable)
|
||||||
{
|
{
|
||||||
g_message (_("There is no active layer or channel to cut from."));
|
gimp_message (image->gimp, NULL, GIMP_MESSAGE_WARNING,
|
||||||
|
_("There is no active layer or channel to cut from."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -463,7 +465,8 @@ copy_named_buffer_callback (GtkWidget *widget,
|
||||||
|
|
||||||
if (! drawable)
|
if (! drawable)
|
||||||
{
|
{
|
||||||
g_message (_("There is no active layer or channel to copy from."));
|
gimp_message (image->gimp, NULL, GIMP_MESSAGE_WARNING,
|
||||||
|
_("There is no active layer or channel to copy from."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,8 @@
|
||||||
|
|
||||||
#include "actions-types.h"
|
#include "actions-types.h"
|
||||||
|
|
||||||
|
#include "core/gimp.h"
|
||||||
|
|
||||||
#include "widgets/gimperrorconsole.h"
|
#include "widgets/gimperrorconsole.h"
|
||||||
#include "widgets/gimphelp-ids.h"
|
#include "widgets/gimphelp-ids.h"
|
||||||
#include "widgets/gimpwidgets-utils.h"
|
#include "widgets/gimpwidgets-utils.h"
|
||||||
|
@ -78,8 +80,8 @@ error_console_save_cmd_callback (GtkAction *action,
|
||||||
if (value && ! gtk_text_buffer_get_selection_bounds (console->text_buffer,
|
if (value && ! gtk_text_buffer_get_selection_bounds (console->text_buffer,
|
||||||
NULL, NULL))
|
NULL, NULL))
|
||||||
{
|
{
|
||||||
gimp_show_message_dialog (GTK_WIDGET (console), GTK_MESSAGE_WARNING,
|
gimp_message (console->gimp, G_OBJECT (console), GIMP_MESSAGE_WARNING,
|
||||||
_("Cannot save. Nothing is selected."));
|
_("Cannot save. Nothing is selected."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,10 +149,10 @@ error_console_save_response (GtkWidget *dialog,
|
||||||
if (! gimp_text_buffer_save (console->text_buffer, filename,
|
if (! gimp_text_buffer_save (console->text_buffer, filename,
|
||||||
console->save_selection, &error))
|
console->save_selection, &error))
|
||||||
{
|
{
|
||||||
gimp_show_message_dialog (dialog, GTK_MESSAGE_ERROR,
|
gimp_message (console->gimp, G_OBJECT (dialog), GIMP_MESSAGE_ERROR,
|
||||||
_("Error writing file '%s':\n%s"),
|
_("Error writing file '%s':\n%s"),
|
||||||
gimp_filename_to_utf8 (filename),
|
gimp_filename_to_utf8 (filename),
|
||||||
error->message);
|
error->message);
|
||||||
g_clear_error (&error);
|
g_clear_error (&error);
|
||||||
g_free (filename);
|
g_free (filename);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -173,8 +173,9 @@ file_last_opened_cmd_callback (GtkAction *action,
|
||||||
gchar *filename =
|
gchar *filename =
|
||||||
file_utils_uri_display_name (GIMP_OBJECT (imagefile)->name);
|
file_utils_uri_display_name (GIMP_OBJECT (imagefile)->name);
|
||||||
|
|
||||||
g_message (_("Opening '%s' failed:\n\n%s"),
|
gimp_message (gimp, NULL, GIMP_MESSAGE_ERROR,
|
||||||
filename, error->message);
|
_("Opening '%s' failed:\n\n%s"),
|
||||||
|
filename, error->message);
|
||||||
g_clear_error (&error);
|
g_clear_error (&error);
|
||||||
|
|
||||||
g_free (filename);
|
g_free (filename);
|
||||||
|
@ -219,6 +220,7 @@ file_save_cmd_callback (GtkAction *action,
|
||||||
GimpPDBStatusType status;
|
GimpPDBStatusType status;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
GList *list;
|
GList *list;
|
||||||
|
gchar *filename;
|
||||||
|
|
||||||
for (list = gimp_action_groups_from_name ("file");
|
for (list = gimp_action_groups_from_name ("file");
|
||||||
list;
|
list;
|
||||||
|
@ -233,19 +235,31 @@ file_save_cmd_callback (GtkAction *action,
|
||||||
uri, save_proc,
|
uri, save_proc,
|
||||||
GIMP_RUN_WITH_LAST_VALS, FALSE, &error);
|
GIMP_RUN_WITH_LAST_VALS, FALSE, &error);
|
||||||
|
|
||||||
if (status != GIMP_PDB_SUCCESS &&
|
filename = file_utils_uri_display_name (uri);
|
||||||
status != GIMP_PDB_CANCEL)
|
|
||||||
{
|
|
||||||
gchar *filename = file_utils_uri_display_name (uri);
|
|
||||||
|
|
||||||
gimp_message (image->gimp, GIMP_PROGRESS (display),
|
switch (status)
|
||||||
|
{
|
||||||
|
case GIMP_PDB_SUCCESS:
|
||||||
|
gimp_message (image->gimp, G_OBJECT (display), GIMP_MESSAGE_INFO,
|
||||||
|
_("Image saved to '%s'"),
|
||||||
|
filename);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case GIMP_PDB_CANCEL:
|
||||||
|
gimp_message (image->gimp, G_OBJECT (display), GIMP_MESSAGE_INFO,
|
||||||
|
_("Saving canceled"));
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
gimp_message (image->gimp, G_OBJECT (display), GIMP_MESSAGE_ERROR,
|
||||||
_("Saving '%s' failed:\n\n%s"),
|
_("Saving '%s' failed:\n\n%s"),
|
||||||
filename, error->message);
|
filename, error->message);
|
||||||
g_clear_error (&error);
|
g_clear_error (&error);
|
||||||
|
break;
|
||||||
g_free (filename);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_free (filename);
|
||||||
|
|
||||||
for (list = gimp_action_groups_from_name ("file");
|
for (list = gimp_action_groups_from_name ("file");
|
||||||
list;
|
list;
|
||||||
list = g_list_next (list))
|
list = g_list_next (list))
|
||||||
|
@ -326,7 +340,7 @@ file_revert_cmd_callback (GtkAction *action,
|
||||||
|
|
||||||
if (! uri)
|
if (! uri)
|
||||||
{
|
{
|
||||||
gimp_message (image->gimp, GIMP_PROGRESS (display),
|
gimp_message (image->gimp, G_OBJECT (display), GIMP_MESSAGE_ERROR,
|
||||||
_("Revert failed. "
|
_("Revert failed. "
|
||||||
"No file name associated with this image."));
|
"No file name associated with this image."));
|
||||||
}
|
}
|
||||||
|
@ -567,7 +581,7 @@ file_revert_confirm_response (GtkWidget *dialog,
|
||||||
{
|
{
|
||||||
gchar *filename = file_utils_uri_display_name (uri);
|
gchar *filename = file_utils_uri_display_name (uri);
|
||||||
|
|
||||||
gimp_message (gimp, GIMP_PROGRESS (display),
|
gimp_message (gimp, G_OBJECT (display), GIMP_MESSAGE_ERROR,
|
||||||
_("Reverting to '%s' failed:\n\n%s"),
|
_("Reverting to '%s' failed:\n\n%s"),
|
||||||
filename, error->message);
|
filename, error->message);
|
||||||
g_clear_error (&error);
|
g_clear_error (&error);
|
||||||
|
|
|
@ -286,7 +286,8 @@ select_stroke_cmd_callback (GtkAction *action,
|
||||||
|
|
||||||
if (! drawable)
|
if (! drawable)
|
||||||
{
|
{
|
||||||
g_message (_("There is no active layer or channel to stroke to."));
|
gimp_message (image->gimp, NULL, GIMP_MESSAGE_WARNING,
|
||||||
|
_("There is no active layer or channel to stroke to."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -314,7 +315,8 @@ select_stroke_last_vals_cmd_callback (GtkAction *action,
|
||||||
|
|
||||||
if (! drawable)
|
if (! drawable)
|
||||||
{
|
{
|
||||||
g_message (_("There is no active layer or channel to stroke to."));
|
gimp_message (image->gimp, NULL, GIMP_MESSAGE_WARNING,
|
||||||
|
_("There is no active layer or channel to stroke to."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,11 @@
|
||||||
|
|
||||||
#include "actions-types.h"
|
#include "actions-types.h"
|
||||||
|
|
||||||
|
#include "core/gimp.h"
|
||||||
|
|
||||||
#include "widgets/gimptexteditor.h"
|
#include "widgets/gimptexteditor.h"
|
||||||
#include "widgets/gimphelp-ids.h"
|
#include "widgets/gimphelp-ids.h"
|
||||||
|
#include "widgets/gimpuimanager.h"
|
||||||
#include "widgets/gimpwidgets-utils.h"
|
#include "widgets/gimpwidgets-utils.h"
|
||||||
|
|
||||||
#include "text-editor-commands.h"
|
#include "text-editor-commands.h"
|
||||||
|
@ -134,10 +137,11 @@ text_editor_load_response (GtkWidget *dialog,
|
||||||
|
|
||||||
if (! gimp_text_buffer_load (buffer, filename, &error))
|
if (! gimp_text_buffer_load (buffer, filename, &error))
|
||||||
{
|
{
|
||||||
gimp_show_message_dialog (dialog, GTK_MESSAGE_ERROR,
|
gimp_message (editor->ui_manager->gimp, G_OBJECT (dialog),
|
||||||
_("Could not open '%s' for reading: %s"),
|
GIMP_MESSAGE_ERROR,
|
||||||
gimp_filename_to_utf8 (filename),
|
_("Could not open '%s' for reading: %s"),
|
||||||
error->message);
|
gimp_filename_to_utf8 (filename),
|
||||||
|
error->message);
|
||||||
g_clear_error (&error);
|
g_clear_error (&error);
|
||||||
g_free (filename);
|
g_free (filename);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -356,7 +356,8 @@ vectors_stroke_cmd_callback (GtkAction *action,
|
||||||
|
|
||||||
if (! drawable)
|
if (! drawable)
|
||||||
{
|
{
|
||||||
g_message (_("There is no active layer or channel to stroke to."));
|
gimp_message (image->gimp, NULL, GIMP_MESSAGE_WARNING,
|
||||||
|
_("There is no active layer or channel to stroke to."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -385,7 +386,8 @@ vectors_stroke_last_vals_cmd_callback (GtkAction *action,
|
||||||
|
|
||||||
if (! drawable)
|
if (! drawable)
|
||||||
{
|
{
|
||||||
g_message (_("There is no active layer or channel to stroke to."));
|
gimp_message (image->gimp, NULL, GIMP_MESSAGE_WARNING,
|
||||||
|
_("There is no active layer or channel to stroke to."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -440,7 +442,8 @@ vectors_paste_cmd_callback (GtkAction *action,
|
||||||
if (! gimp_vectors_import_buffer (image, svg, svg_size,
|
if (! gimp_vectors_import_buffer (image, svg, svg_size,
|
||||||
TRUE, TRUE, -1, &error))
|
TRUE, TRUE, -1, &error))
|
||||||
{
|
{
|
||||||
g_message (error->message);
|
gimp_message (image->gimp, NULL, GIMP_MESSAGE_ERROR,
|
||||||
|
error->message);
|
||||||
g_clear_error (&error);
|
g_clear_error (&error);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -621,7 +624,8 @@ vectors_import_response (GtkWidget *widget,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g_message (error->message);
|
gimp_message (dialog->image->gimp, NULL, GIMP_MESSAGE_ERROR,
|
||||||
|
error->message);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -651,7 +655,8 @@ vectors_export_response (GtkWidget *widget,
|
||||||
|
|
||||||
if (! gimp_vectors_export_file (dialog->image, vectors, filename, &error))
|
if (! gimp_vectors_export_file (dialog->image, vectors, filename, &error))
|
||||||
{
|
{
|
||||||
g_message (error->message);
|
gimp_message (dialog->image->gimp, NULL, GIMP_MESSAGE_ERROR,
|
||||||
|
error->message);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1210,6 +1210,36 @@ gimp_select_criterion_get_type (void)
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GType
|
||||||
|
gimp_message_severity_get_type (void)
|
||||||
|
{
|
||||||
|
static const GEnumValue values[] =
|
||||||
|
{
|
||||||
|
{ GIMP_MESSAGE_INFO, "GIMP_MESSAGE_INFO", "info" },
|
||||||
|
{ GIMP_MESSAGE_WARNING, "GIMP_MESSAGE_WARNING", "warning" },
|
||||||
|
{ GIMP_MESSAGE_ERROR, "GIMP_MESSAGE_ERROR", "error" },
|
||||||
|
{ 0, NULL, NULL }
|
||||||
|
};
|
||||||
|
|
||||||
|
static const GimpEnumDesc descs[] =
|
||||||
|
{
|
||||||
|
{ GIMP_MESSAGE_INFO, N_("Message"), NULL },
|
||||||
|
{ GIMP_MESSAGE_WARNING, N_("Warning"), NULL },
|
||||||
|
{ GIMP_MESSAGE_ERROR, N_("Error"), NULL },
|
||||||
|
{ 0, NULL, NULL }
|
||||||
|
};
|
||||||
|
|
||||||
|
static GType type = 0;
|
||||||
|
|
||||||
|
if (! type)
|
||||||
|
{
|
||||||
|
type = g_enum_register_static ("GimpMessageSeverity", values);
|
||||||
|
gimp_enum_set_value_descriptions (type, descs);
|
||||||
|
}
|
||||||
|
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Generated data ends here */
|
/* Generated data ends here */
|
||||||
|
|
||||||
|
|
|
@ -549,7 +549,7 @@ typedef enum
|
||||||
|
|
||||||
GType gimp_select_criterion_get_type (void) G_GNUC_CONST;
|
GType gimp_select_criterion_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
GIMP_SELECT_CRITERION_COMPOSITE, /*< desc="Composite" >*/
|
GIMP_SELECT_CRITERION_COMPOSITE, /*< desc="Composite" >*/
|
||||||
GIMP_SELECT_CRITERION_R, /*< desc="Red" >*/
|
GIMP_SELECT_CRITERION_R, /*< desc="Red" >*/
|
||||||
|
@ -561,6 +561,18 @@ typedef enum
|
||||||
} GimpSelectCriterion;
|
} GimpSelectCriterion;
|
||||||
|
|
||||||
|
|
||||||
|
#define GIMP_TYPE_MESSAGE_SEVERITY (gimp_message_severity_get_type ())
|
||||||
|
|
||||||
|
GType gimp_message_severity_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
|
typedef enum /*< pdb-skip >*/
|
||||||
|
{
|
||||||
|
GIMP_MESSAGE_INFO, /*< desc="Message" >*/
|
||||||
|
GIMP_MESSAGE_WARNING, /*< desc="Warning" >*/
|
||||||
|
GIMP_MESSAGE_ERROR /*< desc="Error" >*/
|
||||||
|
} GimpMessageSeverity;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* non-registered enums; register them if needed
|
* non-registered enums; register them if needed
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -149,31 +149,41 @@ gimp_unset_busy (Gimp *gimp)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_show_message (Gimp *gimp,
|
gimp_show_message (Gimp *gimp,
|
||||||
GimpProgress *progress,
|
GObject *handler,
|
||||||
const gchar *domain,
|
GimpMessageSeverity severity,
|
||||||
const gchar *message)
|
const gchar *domain,
|
||||||
|
const gchar *message)
|
||||||
{
|
{
|
||||||
|
const gchar *desc = "Message";
|
||||||
|
|
||||||
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
||||||
g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
|
g_return_if_fail (handler == NULL || G_IS_OBJECT (handler));
|
||||||
g_return_if_fail (message != NULL);
|
g_return_if_fail (message != NULL);
|
||||||
|
|
||||||
if (! domain)
|
if (! domain)
|
||||||
domain = GIMP_ACRONYM;
|
domain = GIMP_ACRONYM;
|
||||||
|
|
||||||
if (progress &&
|
if (! gimp->console_messages)
|
||||||
gimp_progress_message (progress, gimp, domain, message))
|
|
||||||
{
|
{
|
||||||
/* message has already been handled by GimpProgress */
|
if (gimp->gui.show_message)
|
||||||
}
|
{
|
||||||
else if (gimp->gui.show_message && ! gimp->console_messages)
|
gimp->gui.show_message (gimp, handler,
|
||||||
{
|
severity, domain, message);
|
||||||
gimp->gui.show_message (gimp, progress, domain, message);
|
return;
|
||||||
}
|
}
|
||||||
else
|
else if (GIMP_IS_PROGRESS (handler) &&
|
||||||
{
|
gimp_progress_message (GIMP_PROGRESS (handler), gimp,
|
||||||
g_printerr ("%s: %s\n\n", domain, message);
|
severity, domain, message))
|
||||||
|
{
|
||||||
|
/* message has been handled by GimpProgress */
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gimp_enum_get_value (GIMP_TYPE_MESSAGE_SEVERITY, severity,
|
||||||
|
NULL, NULL, &desc, NULL);
|
||||||
|
g_printerr ("%s-%s: %s\n\n", domain, desc, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -33,7 +33,8 @@ struct _GimpGui
|
||||||
void (* unset_busy) (Gimp *gimp);
|
void (* unset_busy) (Gimp *gimp);
|
||||||
|
|
||||||
void (* show_message) (Gimp *gimp,
|
void (* show_message) (Gimp *gimp,
|
||||||
GimpProgress *progress,
|
GObject *handler,
|
||||||
|
GimpMessageSeverity severity,
|
||||||
const gchar *domain,
|
const gchar *domain,
|
||||||
const gchar *message);
|
const gchar *message);
|
||||||
void (* help) (Gimp *gimp,
|
void (* help) (Gimp *gimp,
|
||||||
|
@ -110,7 +111,8 @@ void gimp_set_busy_until_idle (Gimp *gimp);
|
||||||
void gimp_unset_busy (Gimp *gimp);
|
void gimp_unset_busy (Gimp *gimp);
|
||||||
|
|
||||||
void gimp_show_message (Gimp *gimp,
|
void gimp_show_message (Gimp *gimp,
|
||||||
GimpProgress *progress,
|
GObject *handler,
|
||||||
|
GimpMessageSeverity severity,
|
||||||
const gchar *domain,
|
const gchar *domain,
|
||||||
const gchar *message);
|
const gchar *message);
|
||||||
void gimp_help (Gimp *gimp,
|
void gimp_help (Gimp *gimp,
|
||||||
|
|
|
@ -994,34 +994,37 @@ gimp_get_tool_info (Gimp *gimp,
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_message (Gimp *gimp,
|
gimp_message (Gimp *gimp,
|
||||||
GimpProgress *progress,
|
GObject *handler,
|
||||||
const gchar *format,
|
GimpMessageSeverity severity,
|
||||||
|
const gchar *format,
|
||||||
...)
|
...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
va_start (args, format);
|
va_start (args, format);
|
||||||
|
|
||||||
gimp_message_valist (gimp, progress, format, args);
|
gimp_message_valist (gimp, handler, severity, format, args);
|
||||||
|
|
||||||
va_end (args);
|
va_end (args);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_message_valist (Gimp *gimp,
|
gimp_message_valist (Gimp *gimp,
|
||||||
GimpProgress *progress,
|
GObject *handler,
|
||||||
const gchar *format,
|
GimpMessageSeverity severity,
|
||||||
va_list args)
|
const gchar *format,
|
||||||
|
va_list args)
|
||||||
{
|
{
|
||||||
gchar *message;
|
gchar *message;
|
||||||
|
|
||||||
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
||||||
g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
|
g_return_if_fail (handler == NULL || G_IS_OBJECT (handler));
|
||||||
|
g_return_if_fail (format != NULL);
|
||||||
|
|
||||||
message = g_strdup_vprintf (format, args);
|
message = g_strdup_vprintf (format, args);
|
||||||
|
|
||||||
gimp_show_message (gimp, progress, NULL, message);
|
gimp_show_message (gimp, handler, severity, NULL, message);
|
||||||
|
|
||||||
g_free (message);
|
g_free (message);
|
||||||
}
|
}
|
||||||
|
|
|
@ -175,11 +175,13 @@ GimpToolInfo * gimp_get_tool_info (Gimp *gimp,
|
||||||
const gchar *tool_name);
|
const gchar *tool_name);
|
||||||
|
|
||||||
void gimp_message (Gimp *gimp,
|
void gimp_message (Gimp *gimp,
|
||||||
GimpProgress *progress,
|
GObject *handler,
|
||||||
|
GimpMessageSeverity severity,
|
||||||
const gchar *format,
|
const gchar *format,
|
||||||
...) G_GNUC_PRINTF(3,4);
|
...) G_GNUC_PRINTF(4,5);
|
||||||
void gimp_message_valist (Gimp *gimp,
|
void gimp_message_valist (Gimp *gimp,
|
||||||
GimpProgress *progress,
|
GObject *handler,
|
||||||
|
GimpMessageSeverity severity,
|
||||||
const gchar *format,
|
const gchar *format,
|
||||||
va_list args);
|
va_list args);
|
||||||
|
|
||||||
|
|
|
@ -789,7 +789,7 @@ gimp_image_convert (GimpImage *image,
|
||||||
|
|
||||||
if (custom_palette->n_colors < 1)
|
if (custom_palette->n_colors < 1)
|
||||||
{
|
{
|
||||||
gimp_message (image->gimp, progress,
|
gimp_message (image->gimp, G_OBJECT (progress), GIMP_MESSAGE_ERROR,
|
||||||
_("Cannot convert image: palette is empty."));
|
_("Cannot convert image: palette is empty."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -290,7 +290,8 @@ gimp_imagefile_create_thumbnail (GimpImagefile *imagefile,
|
||||||
|
|
||||||
if (! success)
|
if (! success)
|
||||||
{
|
{
|
||||||
gimp_message (imagefile->gimp, progress, error->message);
|
gimp_message (imagefile->gimp, G_OBJECT (progress),
|
||||||
|
GIMP_MESSAGE_ERROR, error->message);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -219,23 +219,23 @@ gimp_progress_get_window (GimpProgress *progress)
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
gimp_progress_message (GimpProgress *progress,
|
gimp_progress_message (GimpProgress *progress,
|
||||||
Gimp *gimp,
|
Gimp *gimp,
|
||||||
const gchar *domain,
|
GimpMessageSeverity severity,
|
||||||
const gchar *message)
|
const gchar *domain,
|
||||||
|
const gchar *message)
|
||||||
{
|
{
|
||||||
GimpProgressInterface *progress_iface;
|
GimpProgressInterface *progress_iface;
|
||||||
|
|
||||||
g_return_val_if_fail (GIMP_IS_PROGRESS (progress), FALSE);
|
g_return_val_if_fail (GIMP_IS_PROGRESS (progress), FALSE);
|
||||||
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE);
|
||||||
|
g_return_val_if_fail (domain != NULL, FALSE);
|
||||||
|
g_return_val_if_fail (message != NULL, FALSE);
|
||||||
|
|
||||||
progress_iface = GIMP_PROGRESS_GET_INTERFACE (progress);
|
progress_iface = GIMP_PROGRESS_GET_INTERFACE (progress);
|
||||||
|
|
||||||
if (progress_iface->message)
|
if (progress_iface->message)
|
||||||
{
|
return progress_iface->message (progress, gimp, severity, domain, message);
|
||||||
progress_iface->message (progress, gimp, domain, message);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,59 +36,61 @@ struct _GimpProgressInterface
|
||||||
GTypeInterface base_iface;
|
GTypeInterface base_iface;
|
||||||
|
|
||||||
/* virtual functions */
|
/* virtual functions */
|
||||||
GimpProgress * (* start) (GimpProgress *progress,
|
GimpProgress * (* start) (GimpProgress *progress,
|
||||||
const gchar *message,
|
const gchar *message,
|
||||||
gboolean cancelable);
|
gboolean cancelable);
|
||||||
void (* end) (GimpProgress *progress);
|
void (* end) (GimpProgress *progress);
|
||||||
gboolean (* is_active) (GimpProgress *progress);
|
gboolean (* is_active) (GimpProgress *progress);
|
||||||
|
|
||||||
void (* set_text) (GimpProgress *progress,
|
void (* set_text) (GimpProgress *progress,
|
||||||
const gchar *message);
|
const gchar *message);
|
||||||
void (* set_value) (GimpProgress *progress,
|
void (* set_value) (GimpProgress *progress,
|
||||||
gdouble percentage);
|
gdouble percentage);
|
||||||
gdouble (* get_value) (GimpProgress *progress);
|
gdouble (* get_value) (GimpProgress *progress);
|
||||||
void (* pulse) (GimpProgress *progress);
|
void (* pulse) (GimpProgress *progress);
|
||||||
|
|
||||||
guint32 (* get_window) (GimpProgress *progress);
|
guint32 (* get_window) (GimpProgress *progress);
|
||||||
|
|
||||||
void (* message) (GimpProgress *progress,
|
gboolean (* message) (GimpProgress *progress,
|
||||||
Gimp *gimp,
|
Gimp *gimp,
|
||||||
const gchar *domain,
|
GimpMessageSeverity severity,
|
||||||
const gchar *message);
|
const gchar *domain,
|
||||||
|
const gchar *message);
|
||||||
|
|
||||||
/* signals */
|
/* signals */
|
||||||
void (* cancel) (GimpProgress *progress);
|
void (* cancel) (GimpProgress *progress);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
GType gimp_progress_interface_get_type (void) G_GNUC_CONST;
|
GType gimp_progress_interface_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
GimpProgress * gimp_progress_start (GimpProgress *progress,
|
GimpProgress * gimp_progress_start (GimpProgress *progress,
|
||||||
const gchar *message,
|
const gchar *message,
|
||||||
gboolean cancelable);
|
gboolean cancelable);
|
||||||
void gimp_progress_end (GimpProgress *progress);
|
void gimp_progress_end (GimpProgress *progress);
|
||||||
gboolean gimp_progress_is_active (GimpProgress *progress);
|
gboolean gimp_progress_is_active (GimpProgress *progress);
|
||||||
|
|
||||||
void gimp_progress_set_text (GimpProgress *progress,
|
void gimp_progress_set_text (GimpProgress *progress,
|
||||||
const gchar *message);
|
const gchar *message);
|
||||||
void gimp_progress_set_value (GimpProgress *progress,
|
void gimp_progress_set_value (GimpProgress *progress,
|
||||||
gdouble percentage);
|
gdouble percentage);
|
||||||
gdouble gimp_progress_get_value (GimpProgress *progress);
|
gdouble gimp_progress_get_value (GimpProgress *progress);
|
||||||
void gimp_progress_pulse (GimpProgress *progress);
|
void gimp_progress_pulse (GimpProgress *progress);
|
||||||
|
|
||||||
guint32 gimp_progress_get_window (GimpProgress *progress);
|
guint32 gimp_progress_get_window (GimpProgress *progress);
|
||||||
|
|
||||||
gboolean gimp_progress_message (GimpProgress *progress,
|
gboolean gimp_progress_message (GimpProgress *progress,
|
||||||
Gimp *gimp,
|
Gimp *gimp,
|
||||||
const gchar *domain,
|
GimpMessageSeverity severity,
|
||||||
const gchar *message);
|
const gchar *domain,
|
||||||
|
const gchar *message);
|
||||||
|
|
||||||
void gimp_progress_cancel (GimpProgress *progress);
|
void gimp_progress_cancel (GimpProgress *progress);
|
||||||
|
|
||||||
void gimp_progress_update_and_flush (gint min,
|
void gimp_progress_update_and_flush (gint min,
|
||||||
gint max,
|
gint max,
|
||||||
gint current,
|
gint current,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
|
|
||||||
|
|
||||||
#endif /* __GIMP_PROGRESS_H__ */
|
#endif /* __GIMP_PROGRESS_H__ */
|
||||||
|
|
|
@ -394,9 +394,10 @@ convert_dialog_palette_changed (GimpContext *context,
|
||||||
|
|
||||||
if (palette->n_colors > 256)
|
if (palette->n_colors > 256)
|
||||||
{
|
{
|
||||||
gimp_show_message_dialog (dialog->dialog, GTK_MESSAGE_WARNING,
|
gimp_message (dialog->image->gimp, G_OBJECT (dialog->dialog),
|
||||||
_("Cannot convert to a palette "
|
GIMP_MESSAGE_WARNING,
|
||||||
"with more than 256 colors."));
|
_("Cannot convert to a palette "
|
||||||
|
"with more than 256 colors."));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -200,7 +200,7 @@ file_open_dialog_open_image (GtkWidget *open_dialog,
|
||||||
{
|
{
|
||||||
gchar *filename = file_utils_uri_display_name (uri);
|
gchar *filename = file_utils_uri_display_name (uri);
|
||||||
|
|
||||||
gimp_message (gimp, GIMP_PROGRESS (open_dialog),
|
gimp_message (gimp, G_OBJECT (open_dialog), GIMP_MESSAGE_ERROR,
|
||||||
_("Opening '%s' failed:\n\n%s"), filename, error->message);
|
_("Opening '%s' failed:\n\n%s"), filename, error->message);
|
||||||
g_clear_error (&error);
|
g_clear_error (&error);
|
||||||
|
|
||||||
|
@ -251,7 +251,7 @@ file_open_dialog_open_layer (GtkWidget *open_dialog,
|
||||||
{
|
{
|
||||||
gchar *filename = file_utils_uri_display_name (uri);
|
gchar *filename = file_utils_uri_display_name (uri);
|
||||||
|
|
||||||
gimp_message (image->gimp, GIMP_PROGRESS (open_dialog),
|
gimp_message (image->gimp, G_OBJECT (open_dialog), GIMP_MESSAGE_ERROR,
|
||||||
_("Opening '%s' failed:\n\n%s"), filename, error->message);
|
_("Opening '%s' failed:\n\n%s"), filename, error->message);
|
||||||
g_clear_error (&error);
|
g_clear_error (&error);
|
||||||
|
|
||||||
|
|
|
@ -212,7 +212,7 @@ file_open_location_response (GtkDialog *dialog,
|
||||||
{
|
{
|
||||||
gchar *filename = file_utils_uri_display_name (uri);
|
gchar *filename = file_utils_uri_display_name (uri);
|
||||||
|
|
||||||
gimp_message (gimp, GIMP_PROGRESS (box),
|
gimp_message (gimp, G_OBJECT (box), GIMP_MESSAGE_ERROR,
|
||||||
_("Opening '%s' failed:\n\n%s"),
|
_("Opening '%s' failed:\n\n%s"),
|
||||||
filename, error->message);
|
filename, error->message);
|
||||||
g_clear_error (&error);
|
g_clear_error (&error);
|
||||||
|
@ -224,7 +224,7 @@ file_open_location_response (GtkDialog *dialog,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gimp_message (gimp, GIMP_PROGRESS (box),
|
gimp_message (gimp, G_OBJECT (box), GIMP_MESSAGE_ERROR,
|
||||||
_("Opening '%s' failed:\n\n%s"),
|
_("Opening '%s' failed:\n\n%s"),
|
||||||
text, error->message);
|
text, error->message);
|
||||||
g_clear_error (&error);
|
g_clear_error (&error);
|
||||||
|
|
|
@ -282,7 +282,7 @@ file_save_dialog_check_uri (GtkWidget *save_dialog,
|
||||||
G_STRFUNC);
|
G_STRFUNC);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gimp_message (gimp, GIMP_PROGRESS (save_dialog),
|
gimp_message (gimp, G_OBJECT (save_dialog), GIMP_MESSAGE_WARNING,
|
||||||
_("The given filename does not have any known "
|
_("The given filename does not have any known "
|
||||||
"file extension. Please enter a known file "
|
"file extension. Please enter a known file "
|
||||||
"extension or select a file format from the "
|
"extension or select a file format from the "
|
||||||
|
@ -325,7 +325,7 @@ file_save_dialog_check_uri (GtkWidget *save_dialog,
|
||||||
G_STRFUNC);
|
G_STRFUNC);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gimp_message (gimp, GIMP_PROGRESS (save_dialog),
|
gimp_message (gimp, G_OBJECT (save_dialog), GIMP_MESSAGE_WARNING,
|
||||||
_("The given filename does not have any known "
|
_("The given filename does not have any known "
|
||||||
"file extension. Please enter a known file "
|
"file extension. Please enter a known file "
|
||||||
"extension or select a file format from the "
|
"extension or select a file format from the "
|
||||||
|
@ -367,7 +367,7 @@ file_save_dialog_check_uri (GtkWidget *save_dialog,
|
||||||
|
|
||||||
/* remote URI */
|
/* remote URI */
|
||||||
|
|
||||||
gimp_message (gimp, GIMP_PROGRESS (save_dialog),
|
gimp_message (gimp, G_OBJECT (save_dialog), GIMP_MESSAGE_WARNING,
|
||||||
_("Saving remote files needs to determine the "
|
_("Saving remote files needs to determine the "
|
||||||
"file format from the file extension. "
|
"file format from the file extension. "
|
||||||
"Please enter a file extension that matches "
|
"Please enter a file extension that matches "
|
||||||
|
@ -504,7 +504,7 @@ file_save_dialog_save_image (GtkWidget *save_dialog,
|
||||||
{
|
{
|
||||||
gchar *filename = file_utils_uri_display_name (uri);
|
gchar *filename = file_utils_uri_display_name (uri);
|
||||||
|
|
||||||
gimp_message (image->gimp, GIMP_PROGRESS (save_dialog),
|
gimp_message (image->gimp, G_OBJECT (save_dialog), GIMP_MESSAGE_ERROR,
|
||||||
_("Saving '%s' failed:\n\n%s"), filename, error->message);
|
_("Saving '%s' failed:\n\n%s"), filename, error->message);
|
||||||
g_clear_error (&error);
|
g_clear_error (&error);
|
||||||
|
|
||||||
|
|
|
@ -846,8 +846,9 @@ palette_import_make_palette (ImportDialog *dialog)
|
||||||
|
|
||||||
if (! palette)
|
if (! palette)
|
||||||
{
|
{
|
||||||
gimp_show_message_dialog (dialog->dialog, GTK_MESSAGE_ERROR,
|
gimp_message (dialog->context->gimp, G_OBJECT (dialog->dialog),
|
||||||
error->message);
|
GIMP_MESSAGE_ERROR,
|
||||||
|
error->message);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,6 @@
|
||||||
#include "widgets/gimpcontainerview.h"
|
#include "widgets/gimpcontainerview.h"
|
||||||
#include "widgets/gimpviewabledialog.h"
|
#include "widgets/gimpviewabledialog.h"
|
||||||
#include "widgets/gimpstrokeeditor.h"
|
#include "widgets/gimpstrokeeditor.h"
|
||||||
#include "widgets/gimpwidgets-utils.h"
|
|
||||||
|
|
||||||
#include "stroke-dialog.h"
|
#include "stroke-dialog.h"
|
||||||
|
|
||||||
|
@ -279,9 +278,10 @@ stroke_dialog_response (GtkWidget *widget,
|
||||||
|
|
||||||
if (! drawable)
|
if (! drawable)
|
||||||
{
|
{
|
||||||
gimp_show_message_dialog (widget, GTK_MESSAGE_WARNING,
|
gimp_message (context->gimp, G_OBJECT (widget),
|
||||||
_("There is no active layer or channel "
|
GIMP_MESSAGE_WARNING,
|
||||||
"to stroke to."));
|
_("There is no active layer or channel "
|
||||||
|
"to stroke to."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,38 +54,43 @@ enum
|
||||||
|
|
||||||
static void gimp_display_progress_iface_init (GimpProgressInterface *iface);
|
static void gimp_display_progress_iface_init (GimpProgressInterface *iface);
|
||||||
|
|
||||||
static void gimp_display_set_property (GObject *object,
|
static void gimp_display_set_property (GObject *object,
|
||||||
guint property_id,
|
guint property_id,
|
||||||
const GValue *value,
|
const GValue *value,
|
||||||
GParamSpec *pspec);
|
GParamSpec *pspec);
|
||||||
static void gimp_display_get_property (GObject *object,
|
static void gimp_display_get_property (GObject *object,
|
||||||
guint property_id,
|
guint property_id,
|
||||||
GValue *value,
|
GValue *value,
|
||||||
GParamSpec *pspec);
|
GParamSpec *pspec);
|
||||||
|
|
||||||
static GimpProgress *
|
static GimpProgress *
|
||||||
gimp_display_progress_start (GimpProgress *progress,
|
gimp_display_progress_start (GimpProgress *progress,
|
||||||
const gchar *message,
|
const gchar *message,
|
||||||
gboolean cancelable);
|
gboolean cancelable);
|
||||||
static void gimp_display_progress_end (GimpProgress *progress);
|
static void gimp_display_progress_end (GimpProgress *progress);
|
||||||
static gboolean gimp_display_progress_is_active (GimpProgress *progress);
|
static gboolean gimp_display_progress_is_active (GimpProgress *progress);
|
||||||
static void gimp_display_progress_set_text (GimpProgress *progress,
|
static void gimp_display_progress_set_text (GimpProgress *progress,
|
||||||
const gchar *message);
|
const gchar *message);
|
||||||
static void gimp_display_progress_set_value (GimpProgress *progress,
|
static void gimp_display_progress_set_value (GimpProgress *progress,
|
||||||
gdouble percentage);
|
gdouble percentage);
|
||||||
static gdouble gimp_display_progress_get_value (GimpProgress *progress);
|
static gdouble gimp_display_progress_get_value (GimpProgress *progress);
|
||||||
static void gimp_display_progress_pulse (GimpProgress *progress);
|
static void gimp_display_progress_pulse (GimpProgress *progress);
|
||||||
static guint32 gimp_display_progress_get_window (GimpProgress *progress);
|
static guint32 gimp_display_progress_get_window (GimpProgress *progress);
|
||||||
static void gimp_display_progress_canceled (GimpProgress *progress,
|
static gboolean gimp_display_progress_message (GimpProgress *progress,
|
||||||
GimpDisplay *display);
|
Gimp *gimp,
|
||||||
|
GimpMessageSeverity severity,
|
||||||
|
const gchar *domain,
|
||||||
|
const gchar *message);
|
||||||
|
static void gimp_display_progress_canceled (GimpProgress *progress,
|
||||||
|
GimpDisplay *display);
|
||||||
|
|
||||||
static void gimp_display_flush_whenever (GimpDisplay *display,
|
static void gimp_display_flush_whenever (GimpDisplay *display,
|
||||||
gboolean now);
|
gboolean now);
|
||||||
static void gimp_display_paint_area (GimpDisplay *display,
|
static void gimp_display_paint_area (GimpDisplay *display,
|
||||||
gint x,
|
gint x,
|
||||||
gint y,
|
gint y,
|
||||||
gint w,
|
gint w,
|
||||||
gint h);
|
gint h);
|
||||||
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (GimpDisplay, gimp_display, GIMP_TYPE_OBJECT,
|
G_DEFINE_TYPE_WITH_CODE (GimpDisplay, gimp_display, GIMP_TYPE_OBJECT,
|
||||||
|
@ -147,6 +152,7 @@ gimp_display_progress_iface_init (GimpProgressInterface *iface)
|
||||||
iface->get_value = gimp_display_progress_get_value;
|
iface->get_value = gimp_display_progress_get_value;
|
||||||
iface->pulse = gimp_display_progress_pulse;
|
iface->pulse = gimp_display_progress_pulse;
|
||||||
iface->get_window = gimp_display_progress_get_window;
|
iface->get_window = gimp_display_progress_get_window;
|
||||||
|
iface->message = gimp_display_progress_message;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -204,11 +210,11 @@ gimp_display_progress_start (GimpProgress *progress,
|
||||||
{
|
{
|
||||||
GimpDisplay *display = GIMP_DISPLAY (progress);
|
GimpDisplay *display = GIMP_DISPLAY (progress);
|
||||||
|
|
||||||
if (! display->shell)
|
if (display->shell)
|
||||||
return NULL;
|
return gimp_progress_start (GIMP_PROGRESS (display->shell),
|
||||||
|
message, cancelable);
|
||||||
|
|
||||||
return gimp_progress_start (GIMP_PROGRESS (display->shell),
|
return NULL;
|
||||||
message, cancelable);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -225,10 +231,10 @@ gimp_display_progress_is_active (GimpProgress *progress)
|
||||||
{
|
{
|
||||||
GimpDisplay *display = GIMP_DISPLAY (progress);
|
GimpDisplay *display = GIMP_DISPLAY (progress);
|
||||||
|
|
||||||
if (! display->shell)
|
if (display->shell)
|
||||||
return FALSE;
|
return gimp_progress_is_active (GIMP_PROGRESS (display->shell));
|
||||||
|
|
||||||
return gimp_progress_is_active (GIMP_PROGRESS (display->shell));
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -256,10 +262,10 @@ gimp_display_progress_get_value (GimpProgress *progress)
|
||||||
{
|
{
|
||||||
GimpDisplay *display = GIMP_DISPLAY (progress);
|
GimpDisplay *display = GIMP_DISPLAY (progress);
|
||||||
|
|
||||||
if (! display->shell)
|
if (display->shell)
|
||||||
return 0.0;
|
return gimp_progress_get_value (GIMP_PROGRESS (display->shell));
|
||||||
|
|
||||||
return gimp_progress_get_value (GIMP_PROGRESS (display->shell));
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -276,10 +282,26 @@ gimp_display_progress_get_window (GimpProgress *progress)
|
||||||
{
|
{
|
||||||
GimpDisplay *display = GIMP_DISPLAY (progress);
|
GimpDisplay *display = GIMP_DISPLAY (progress);
|
||||||
|
|
||||||
if (! display->shell)
|
if (display->shell)
|
||||||
return 0;
|
return gimp_progress_get_window (GIMP_PROGRESS (display->shell));
|
||||||
|
|
||||||
return gimp_progress_get_window (GIMP_PROGRESS (display->shell));
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
gimp_display_progress_message (GimpProgress *progress,
|
||||||
|
Gimp *gimp,
|
||||||
|
GimpMessageSeverity severity,
|
||||||
|
const gchar *domain,
|
||||||
|
const gchar *message)
|
||||||
|
{
|
||||||
|
GimpDisplay *display = GIMP_DISPLAY (progress);
|
||||||
|
|
||||||
|
if (display->shell)
|
||||||
|
return gimp_progress_message (GIMP_PROGRESS (display->shell), gimp,
|
||||||
|
severity, domain, message);
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -277,7 +277,7 @@ gimp_display_shell_drop_svg (GtkWidget *widget,
|
||||||
(const gchar *) svg_data, svg_data_len,
|
(const gchar *) svg_data, svg_data_len,
|
||||||
TRUE, TRUE, -1, &error))
|
TRUE, TRUE, -1, &error))
|
||||||
{
|
{
|
||||||
gimp_message (image->gimp, GIMP_PROGRESS (shell->display),
|
gimp_message (image->gimp, G_OBJECT (shell->display), GIMP_MESSAGE_ERROR,
|
||||||
error->message);
|
error->message);
|
||||||
g_clear_error (&error);
|
g_clear_error (&error);
|
||||||
}
|
}
|
||||||
|
@ -448,7 +448,8 @@ gimp_display_shell_drop_uri_list (GtkWidget *widget,
|
||||||
{
|
{
|
||||||
gchar *filename = file_utils_uri_display_name (uri);
|
gchar *filename = file_utils_uri_display_name (uri);
|
||||||
|
|
||||||
gimp_message (image->gimp, GIMP_PROGRESS (shell->display),
|
gimp_message (image->gimp, G_OBJECT (shell->display),
|
||||||
|
GIMP_MESSAGE_ERROR,
|
||||||
_("Opening '%s' failed:\n\n%s"),
|
_("Opening '%s' failed:\n\n%s"),
|
||||||
filename, error->message);
|
filename, error->message);
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
|
|
||||||
#include "gimpdisplayshell.h"
|
#include "gimpdisplayshell.h"
|
||||||
#include "gimpdisplayshell-progress.h"
|
#include "gimpdisplayshell-progress.h"
|
||||||
|
#include "gimpstatusbar.h"
|
||||||
|
|
||||||
|
|
||||||
static GimpProgress *
|
static GimpProgress *
|
||||||
|
@ -99,6 +100,22 @@ gimp_display_shell_progress_get_window (GimpProgress *progress)
|
||||||
return (guint32) gimp_window_get_native (GTK_WINDOW (shell));
|
return (guint32) gimp_window_get_native (GTK_WINDOW (shell));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
gimp_display_shell_progress_message (GimpProgress *progress,
|
||||||
|
Gimp *gimp,
|
||||||
|
GimpMessageSeverity severity,
|
||||||
|
const gchar *domain,
|
||||||
|
const gchar *message)
|
||||||
|
{
|
||||||
|
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress);
|
||||||
|
|
||||||
|
if (severity != GIMP_MESSAGE_ERROR && GTK_WIDGET_VISIBLE (shell->statusbar))
|
||||||
|
return gimp_progress_message (GIMP_PROGRESS (shell->statusbar), gimp,
|
||||||
|
severity, domain, message);
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_display_shell_progress_iface_init (GimpProgressInterface *iface)
|
gimp_display_shell_progress_iface_init (GimpProgressInterface *iface)
|
||||||
{
|
{
|
||||||
|
@ -110,4 +127,5 @@ gimp_display_shell_progress_iface_init (GimpProgressInterface *iface)
|
||||||
iface->get_value = gimp_display_shell_progress_get_value;
|
iface->get_value = gimp_display_shell_progress_get_value;
|
||||||
iface->pulse = gimp_display_shell_progress_pulse;
|
iface->pulse = gimp_display_shell_progress_pulse;
|
||||||
iface->get_window = gimp_display_shell_progress_get_window;
|
iface->get_window = gimp_display_shell_progress_get_window;
|
||||||
|
iface->message = gimp_display_shell_progress_message;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1636,56 +1636,3 @@ gimp_display_shell_set_mask (GimpDisplayShell *shell,
|
||||||
|
|
||||||
gimp_display_shell_expose_full (shell);
|
gimp_display_shell_expose_full (shell);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* gimp_display_shell_message:
|
|
||||||
* @shell: the #GimpDisplayShell
|
|
||||||
* @format: printf-like format string
|
|
||||||
* @...: arguments
|
|
||||||
*
|
|
||||||
* Display a message in the display shell. If the statusbar is
|
|
||||||
* visible, the message will appear there, otherwise a dialog window
|
|
||||||
* is opened.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
gimp_display_shell_message (GimpDisplayShell *shell,
|
|
||||||
const gchar *format,
|
|
||||||
...)
|
|
||||||
{
|
|
||||||
va_list args;
|
|
||||||
|
|
||||||
va_start (args, format);
|
|
||||||
|
|
||||||
gimp_display_shell_message_valist (shell, format, args);
|
|
||||||
|
|
||||||
va_end (args);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gimp_display_shell_message_valist:
|
|
||||||
* @shell: the #GimpDisplayShell
|
|
||||||
* @format: printf-like format string
|
|
||||||
* @args: arguments
|
|
||||||
*
|
|
||||||
* Display a message in the display shell. See gimp_display_shell_message()
|
|
||||||
* for details.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
gimp_display_shell_message_valist (GimpDisplayShell *shell,
|
|
||||||
const gchar *format,
|
|
||||||
va_list args)
|
|
||||||
{
|
|
||||||
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
|
|
||||||
g_return_if_fail (format != NULL);
|
|
||||||
|
|
||||||
if (GTK_WIDGET_VISIBLE (shell->statusbar))
|
|
||||||
{
|
|
||||||
gimp_statusbar_push_temp_valist (GIMP_STATUSBAR (shell->statusbar),
|
|
||||||
format, args);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
gimp_message_valist (shell->display->image->gimp, GIMP_PROGRESS (shell),
|
|
||||||
format, args);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -243,12 +243,5 @@ void gimp_display_shell_set_mask (GimpDisplayShell *shell,
|
||||||
GimpDrawable *mask,
|
GimpDrawable *mask,
|
||||||
GimpChannelType color);
|
GimpChannelType color);
|
||||||
|
|
||||||
void gimp_display_shell_message (GimpDisplayShell *shell,
|
|
||||||
const gchar *format,
|
|
||||||
...) G_GNUC_PRINTF(2,3);
|
|
||||||
void gimp_display_shell_message_valist (GimpDisplayShell *shell,
|
|
||||||
const gchar *format,
|
|
||||||
va_list args);
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* __GIMP_DISPLAY_SHELL_H__ */
|
#endif /* __GIMP_DISPLAY_SHELL_H__ */
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include "widgets/gimpuimanager.h"
|
#include "widgets/gimpuimanager.h"
|
||||||
#include "widgets/gimpunitstore.h"
|
#include "widgets/gimpunitstore.h"
|
||||||
#include "widgets/gimpunitcombobox.h"
|
#include "widgets/gimpunitcombobox.h"
|
||||||
|
#include "widgets/gimpwidgets-utils.h"
|
||||||
|
|
||||||
#include "gimpdisplay.h"
|
#include "gimpdisplay.h"
|
||||||
#include "gimpdisplayshell.h"
|
#include "gimpdisplayshell.h"
|
||||||
|
@ -48,6 +49,7 @@ typedef struct _GimpStatusbarMsg GimpStatusbarMsg;
|
||||||
struct _GimpStatusbarMsg
|
struct _GimpStatusbarMsg
|
||||||
{
|
{
|
||||||
guint context_id;
|
guint context_id;
|
||||||
|
gchar *stock_id;
|
||||||
gchar *text;
|
gchar *text;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -75,6 +77,11 @@ static void gimp_statusbar_progress_set_value (GimpProgress *progress,
|
||||||
gdouble percentage);
|
gdouble percentage);
|
||||||
static gdouble gimp_statusbar_progress_get_value (GimpProgress *progress);
|
static gdouble gimp_statusbar_progress_get_value (GimpProgress *progress);
|
||||||
static void gimp_statusbar_progress_pulse (GimpProgress *progress);
|
static void gimp_statusbar_progress_pulse (GimpProgress *progress);
|
||||||
|
static gboolean gimp_statusbar_progress_message (GimpProgress *progress,
|
||||||
|
Gimp *gimp,
|
||||||
|
GimpMessageSeverity severity,
|
||||||
|
const gchar *domain,
|
||||||
|
const gchar *message);
|
||||||
static void gimp_statusbar_progress_canceled (GtkWidget *button,
|
static void gimp_statusbar_progress_canceled (GtkWidget *button,
|
||||||
GimpStatusbar *statusbar);
|
GimpStatusbar *statusbar);
|
||||||
|
|
||||||
|
@ -96,6 +103,8 @@ static guint gimp_statusbar_get_context_id (GimpStatusbar *statusbar,
|
||||||
const gchar *context);
|
const gchar *context);
|
||||||
static gboolean gimp_statusbar_temp_timeout (GimpStatusbar *statusbar);
|
static gboolean gimp_statusbar_temp_timeout (GimpStatusbar *statusbar);
|
||||||
|
|
||||||
|
static void gimp_statusbar_msg_free (GimpStatusbarMsg *msg);
|
||||||
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (GimpStatusbar, gimp_statusbar, GTK_TYPE_HBOX,
|
G_DEFINE_TYPE_WITH_CODE (GimpStatusbar, gimp_statusbar, GTK_TYPE_HBOX,
|
||||||
G_IMPLEMENT_INTERFACE (GIMP_TYPE_PROGRESS,
|
G_IMPLEMENT_INTERFACE (GIMP_TYPE_PROGRESS,
|
||||||
|
@ -134,6 +143,7 @@ gimp_statusbar_progress_iface_init (GimpProgressInterface *iface)
|
||||||
iface->set_value = gimp_statusbar_progress_set_value;
|
iface->set_value = gimp_statusbar_progress_set_value;
|
||||||
iface->get_value = gimp_statusbar_progress_get_value;
|
iface->get_value = gimp_statusbar_progress_get_value;
|
||||||
iface->pulse = gimp_statusbar_progress_pulse;
|
iface->pulse = gimp_statusbar_progress_pulse;
|
||||||
|
iface->message = gimp_statusbar_progress_message;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -252,16 +262,8 @@ static void
|
||||||
gimp_statusbar_finalize (GObject *object)
|
gimp_statusbar_finalize (GObject *object)
|
||||||
{
|
{
|
||||||
GimpStatusbar *statusbar = GIMP_STATUSBAR (object);
|
GimpStatusbar *statusbar = GIMP_STATUSBAR (object);
|
||||||
GSList *list;
|
|
||||||
|
|
||||||
for (list = statusbar->messages; list; list = list->next)
|
|
||||||
{
|
|
||||||
GimpStatusbarMsg *msg = list->data;
|
|
||||||
|
|
||||||
g_free (msg->text);
|
|
||||||
g_free (msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
g_slist_foreach (statusbar->messages, (GFunc) gimp_statusbar_msg_free, NULL);
|
||||||
g_slist_free (statusbar->messages);
|
g_slist_free (statusbar->messages);
|
||||||
statusbar->messages = NULL;
|
statusbar->messages = NULL;
|
||||||
|
|
||||||
|
@ -404,6 +406,25 @@ gimp_statusbar_progress_pulse (GimpProgress *progress)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
gimp_statusbar_progress_message (GimpProgress *progress,
|
||||||
|
Gimp *gimp,
|
||||||
|
GimpMessageSeverity severity,
|
||||||
|
const gchar *domain,
|
||||||
|
const gchar *message)
|
||||||
|
{
|
||||||
|
GimpStatusbar *statusbar = GIMP_STATUSBAR (progress);
|
||||||
|
|
||||||
|
/* we can handle only one-liners */
|
||||||
|
if (strchr (message, '\n'))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
gimp_statusbar_push_temp (statusbar,
|
||||||
|
gimp_get_message_stock_id (severity), message);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_statusbar_progress_canceled (GtkWidget *button,
|
gimp_statusbar_progress_canceled (GtkWidget *button,
|
||||||
GimpStatusbar *statusbar)
|
GimpStatusbar *statusbar)
|
||||||
|
@ -524,8 +545,7 @@ gimp_statusbar_push_valist (GimpStatusbar *statusbar,
|
||||||
if (msg->context_id == context_id)
|
if (msg->context_id == context_id)
|
||||||
{
|
{
|
||||||
statusbar->messages = g_slist_remove (statusbar->messages, msg);
|
statusbar->messages = g_slist_remove (statusbar->messages, msg);
|
||||||
g_free (msg->text);
|
gimp_statusbar_msg_free (msg);
|
||||||
g_free (msg);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -718,8 +738,7 @@ gimp_statusbar_pop (GimpStatusbar *statusbar,
|
||||||
if (msg->context_id == context_id)
|
if (msg->context_id == context_id)
|
||||||
{
|
{
|
||||||
statusbar->messages = g_slist_remove (statusbar->messages, msg);
|
statusbar->messages = g_slist_remove (statusbar->messages, msg);
|
||||||
g_free (msg->text);
|
gimp_statusbar_msg_free (msg);
|
||||||
g_free (msg);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -730,6 +749,7 @@ gimp_statusbar_pop (GimpStatusbar *statusbar,
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_statusbar_push_temp (GimpStatusbar *statusbar,
|
gimp_statusbar_push_temp (GimpStatusbar *statusbar,
|
||||||
|
const gchar *stock_id,
|
||||||
const gchar *format,
|
const gchar *format,
|
||||||
...)
|
...)
|
||||||
{
|
{
|
||||||
|
@ -739,12 +759,13 @@ gimp_statusbar_push_temp (GimpStatusbar *statusbar,
|
||||||
g_return_if_fail (format != NULL);
|
g_return_if_fail (format != NULL);
|
||||||
|
|
||||||
va_start (args, format);
|
va_start (args, format);
|
||||||
gimp_statusbar_push_temp_valist (statusbar, format, args);
|
gimp_statusbar_push_temp_valist (statusbar, stock_id, format, args);
|
||||||
va_end (args);
|
va_end (args);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_statusbar_push_temp_valist (GimpStatusbar *statusbar,
|
gimp_statusbar_push_temp_valist (GimpStatusbar *statusbar,
|
||||||
|
const gchar *stock_id,
|
||||||
const gchar *format,
|
const gchar *format,
|
||||||
va_list args)
|
va_list args)
|
||||||
{
|
{
|
||||||
|
@ -774,6 +795,9 @@ gimp_statusbar_push_temp_valist (GimpStatusbar *statusbar,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_free (msg->stock_id);
|
||||||
|
msg->stock_id = g_strdup (stock_id);
|
||||||
|
|
||||||
g_free (msg->text);
|
g_free (msg->text);
|
||||||
msg->text = message;
|
msg->text = message;
|
||||||
|
|
||||||
|
@ -785,6 +809,7 @@ gimp_statusbar_push_temp_valist (GimpStatusbar *statusbar,
|
||||||
msg = g_new0 (GimpStatusbarMsg, 1);
|
msg = g_new0 (GimpStatusbarMsg, 1);
|
||||||
|
|
||||||
msg->context_id = statusbar->temp_context_id;
|
msg->context_id = statusbar->temp_context_id;
|
||||||
|
msg->stock_id = g_strdup (stock_id);
|
||||||
msg->text = message;
|
msg->text = message;
|
||||||
|
|
||||||
statusbar->messages = g_slist_prepend (statusbar->messages, msg);
|
statusbar->messages = g_slist_prepend (statusbar->messages, msg);
|
||||||
|
@ -810,8 +835,7 @@ gimp_statusbar_pop_temp (GimpStatusbar *statusbar)
|
||||||
if (msg->context_id == statusbar->temp_context_id)
|
if (msg->context_id == statusbar->temp_context_id)
|
||||||
{
|
{
|
||||||
statusbar->messages = g_slist_remove (statusbar->messages, msg);
|
statusbar->messages = g_slist_remove (statusbar->messages, msg);
|
||||||
g_free (msg->text);
|
gimp_statusbar_msg_free (msg);
|
||||||
g_free (msg);
|
|
||||||
|
|
||||||
gimp_statusbar_update (statusbar);
|
gimp_statusbar_update (statusbar);
|
||||||
}
|
}
|
||||||
|
@ -916,15 +940,23 @@ gimp_statusbar_progress_expose (GtkWidget *widget,
|
||||||
GdkEventExpose *event,
|
GdkEventExpose *event,
|
||||||
GimpStatusbar *statusbar)
|
GimpStatusbar *statusbar)
|
||||||
{
|
{
|
||||||
GdkPixbuf *pixbuf;
|
GdkPixbuf *pixbuf;
|
||||||
gint text_xalign;
|
const gchar *stock_id = NULL;
|
||||||
gint text_yalign;
|
gint text_xalign;
|
||||||
gint x, y;
|
gint text_yalign;
|
||||||
|
gint x, y;
|
||||||
|
|
||||||
if (! statusbar->temp_timeout_id)
|
if (statusbar->messages)
|
||||||
|
{
|
||||||
|
GimpStatusbarMsg *msg = statusbar->messages->data;
|
||||||
|
|
||||||
|
stock_id = msg->stock_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! stock_id)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
pixbuf = gtk_widget_render_icon (widget, GIMP_STOCK_WARNING,
|
pixbuf = gtk_widget_render_icon (widget, stock_id,
|
||||||
GTK_ICON_SIZE_MENU, NULL);
|
GTK_ICON_SIZE_MENU, NULL);
|
||||||
|
|
||||||
g_object_get (widget,
|
g_object_get (widget,
|
||||||
|
@ -1074,3 +1106,11 @@ gimp_statusbar_temp_timeout (GimpStatusbar *statusbar)
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gimp_statusbar_msg_free (GimpStatusbarMsg *msg)
|
||||||
|
{
|
||||||
|
g_free (msg->stock_id);
|
||||||
|
g_free (msg->text);
|
||||||
|
g_free (msg);
|
||||||
|
}
|
||||||
|
|
|
@ -103,9 +103,11 @@ void gimp_statusbar_pop (GimpStatusbar *statusbar,
|
||||||
const gchar *context);
|
const gchar *context);
|
||||||
|
|
||||||
void gimp_statusbar_push_temp (GimpStatusbar *statusbar,
|
void gimp_statusbar_push_temp (GimpStatusbar *statusbar,
|
||||||
|
const gchar *stock_id,
|
||||||
const gchar *format,
|
const gchar *format,
|
||||||
...) G_GNUC_PRINTF(2,3);
|
...) G_GNUC_PRINTF(3,4);
|
||||||
void gimp_statusbar_push_temp_valist (GimpStatusbar *statusbar,
|
void gimp_statusbar_push_temp_valist (GimpStatusbar *statusbar,
|
||||||
|
const gchar *stock_id,
|
||||||
const gchar *format,
|
const gchar *format,
|
||||||
va_list args);
|
va_list args);
|
||||||
void gimp_statusbar_pop_temp (GimpStatusbar *statusbar);
|
void gimp_statusbar_pop_temp (GimpStatusbar *statusbar);
|
||||||
|
|
|
@ -169,7 +169,7 @@ gimp_message_log_func (const gchar *log_domain,
|
||||||
|
|
||||||
if (gimp)
|
if (gimp)
|
||||||
{
|
{
|
||||||
gimp_show_message (gimp, NULL, NULL, message);
|
gimp_show_message (gimp, NULL, GIMP_MESSAGE_WARNING, NULL, message);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
#include "libgimpbase/gimpbase.h"
|
||||||
#include "libgimpwidgets/gimpwidgets.h"
|
#include "libgimpwidgets/gimpwidgets.h"
|
||||||
|
|
||||||
#include "gui-types.h"
|
#include "gui-types.h"
|
||||||
|
@ -42,49 +43,57 @@
|
||||||
|
|
||||||
#include "dialogs/dialogs.h"
|
#include "dialogs/dialogs.h"
|
||||||
|
|
||||||
|
#include "gui-message.h"
|
||||||
|
|
||||||
#include "gimp-intl.h"
|
#include "gimp-intl.h"
|
||||||
|
|
||||||
|
|
||||||
static gboolean gui_message_error_console (const gchar *domain,
|
static gboolean gui_message_error_console (GimpMessageSeverity severity,
|
||||||
const gchar *message);
|
const gchar *domain,
|
||||||
static gboolean gui_message_error_dialog (GimpProgress *progress,
|
const gchar *message);
|
||||||
const gchar *domain,
|
static gboolean gui_message_error_dialog (Gimp *gimp,
|
||||||
const gchar *message);
|
GObject *handler,
|
||||||
static void gui_message_console (const gchar *domain,
|
GimpMessageSeverity severity,
|
||||||
const gchar *message);
|
const gchar *domain,
|
||||||
|
const gchar *message);
|
||||||
|
static void gui_message_console (GimpMessageSeverity severity,
|
||||||
|
const gchar *domain,
|
||||||
|
const gchar *message);
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
gui_message (Gimp *gimp,
|
gui_message (Gimp *gimp,
|
||||||
GimpProgress *progress,
|
GObject *handler,
|
||||||
const gchar *domain,
|
GimpMessageSeverity severity,
|
||||||
const gchar *message)
|
const gchar *domain,
|
||||||
|
const gchar *message)
|
||||||
{
|
{
|
||||||
switch (gimp->message_handler)
|
switch (gimp->message_handler)
|
||||||
{
|
{
|
||||||
case GIMP_ERROR_CONSOLE:
|
case GIMP_ERROR_CONSOLE:
|
||||||
if (gui_message_error_console (domain, message))
|
if (gui_message_error_console (severity, domain, message))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gimp->message_handler = GIMP_MESSAGE_BOX;
|
gimp->message_handler = GIMP_MESSAGE_BOX;
|
||||||
/* fallthru */
|
/* fallthru */
|
||||||
|
|
||||||
case GIMP_MESSAGE_BOX:
|
case GIMP_MESSAGE_BOX:
|
||||||
if (gui_message_error_dialog (progress, domain, message))
|
if (gui_message_error_dialog (gimp, handler, severity, domain, message))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gimp->message_handler = GIMP_CONSOLE;
|
gimp->message_handler = GIMP_CONSOLE;
|
||||||
/* fallthru */
|
/* fallthru */
|
||||||
|
|
||||||
case GIMP_CONSOLE:
|
case GIMP_CONSOLE:
|
||||||
gui_message_console (domain, message);
|
gui_message_console (severity, domain, message);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gui_message_error_console (const gchar *domain,
|
gui_message_error_console (GimpMessageSeverity severity,
|
||||||
const gchar *message)
|
const gchar *domain,
|
||||||
|
const gchar *message)
|
||||||
{
|
{
|
||||||
GtkWidget *dockable;
|
GtkWidget *dockable;
|
||||||
|
|
||||||
|
@ -95,7 +104,7 @@ gui_message_error_console (const gchar *domain,
|
||||||
if (dockable)
|
if (dockable)
|
||||||
{
|
{
|
||||||
gimp_error_console_add (GIMP_ERROR_CONSOLE (GTK_BIN (dockable)->child),
|
gimp_error_console_add (GIMP_ERROR_CONSOLE (GTK_BIN (dockable)->child),
|
||||||
GIMP_STOCK_WARNING, domain, message);
|
severity, domain, message);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -158,21 +167,59 @@ global_error_dialog (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gui_message_error_dialog (GimpProgress *progress,
|
gui_message_error_dialog (Gimp *gimp,
|
||||||
const gchar *domain,
|
GObject *handler,
|
||||||
const gchar *message)
|
GimpMessageSeverity severity,
|
||||||
|
const gchar *domain,
|
||||||
|
const gchar *message)
|
||||||
{
|
{
|
||||||
GtkWidget *dialog;
|
GtkWidget *dialog;
|
||||||
|
|
||||||
if (progress && ! GIMP_IS_PROGRESS_DIALOG (progress))
|
if (GIMP_IS_PROGRESS (handler))
|
||||||
dialog = progress_error_dialog (progress);
|
{
|
||||||
|
if (gimp_progress_message (GIMP_PROGRESS (handler), gimp,
|
||||||
|
severity, domain, message))
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (GTK_IS_WIDGET (handler))
|
||||||
|
{
|
||||||
|
GtkWidget *parent = GTK_WIDGET (handler);
|
||||||
|
GtkMessageType type = GTK_MESSAGE_ERROR;
|
||||||
|
|
||||||
|
switch (severity)
|
||||||
|
{
|
||||||
|
case GIMP_MESSAGE_INFO: type = GTK_MESSAGE_INFO; break;
|
||||||
|
case GIMP_MESSAGE_WARNING: type = GTK_MESSAGE_WARNING; break;
|
||||||
|
case GIMP_MESSAGE_ERROR: type = GTK_MESSAGE_ERROR; break;
|
||||||
|
}
|
||||||
|
|
||||||
|
dialog =
|
||||||
|
gtk_message_dialog_new (GTK_WINDOW (gtk_widget_get_toplevel (parent)),
|
||||||
|
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||||
|
type, GTK_BUTTONS_OK,
|
||||||
|
message);
|
||||||
|
|
||||||
|
g_signal_connect (dialog, "response",
|
||||||
|
G_CALLBACK (gtk_widget_destroy),
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
gtk_widget_show (dialog);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GIMP_IS_PROGRESS (handler) && ! GIMP_IS_PROGRESS_DIALOG (handler))
|
||||||
|
dialog = progress_error_dialog (GIMP_PROGRESS (handler));
|
||||||
else
|
else
|
||||||
dialog = global_error_dialog ();
|
dialog = global_error_dialog ();
|
||||||
|
|
||||||
if (dialog)
|
if (dialog)
|
||||||
{
|
{
|
||||||
gimp_error_dialog_add (GIMP_ERROR_DIALOG (dialog),
|
gimp_error_dialog_add (GIMP_ERROR_DIALOG (dialog),
|
||||||
GIMP_STOCK_WARNING, domain, message);
|
gimp_get_message_stock_id (severity),
|
||||||
|
domain, message);
|
||||||
gtk_window_present (GTK_WINDOW (dialog));
|
gtk_window_present (GTK_WINDOW (dialog));
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -182,8 +229,13 @@ gui_message_error_dialog (GimpProgress *progress,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gui_message_console (const gchar *domain,
|
gui_message_console (GimpMessageSeverity severity,
|
||||||
const gchar *message)
|
const gchar *domain,
|
||||||
|
const gchar *message)
|
||||||
{
|
{
|
||||||
g_printerr ("%s: %s\n\n", domain, message);
|
const gchar *desc = "Message";
|
||||||
|
|
||||||
|
gimp_enum_get_value (GIMP_TYPE_MESSAGE_SEVERITY, severity,
|
||||||
|
NULL, NULL, &desc, NULL);
|
||||||
|
g_printerr ("%s-%s: %s\n\n", domain, desc, message);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,10 +20,11 @@
|
||||||
#define __GUI_MESSAGE_H__
|
#define __GUI_MESSAGE_H__
|
||||||
|
|
||||||
|
|
||||||
void gui_message (Gimp *gimp,
|
void gui_message (Gimp *gimp,
|
||||||
GimpProgress *progress,
|
GObject *handler,
|
||||||
const gchar *domain,
|
GimpMessageSeverity severity,
|
||||||
const gchar *message);
|
const gchar *domain,
|
||||||
|
const gchar *message);
|
||||||
|
|
||||||
|
|
||||||
#endif /* __GUI_VTABLE_H__ */
|
#endif /* __GUI_VTABLE_H__ */
|
||||||
|
|
|
@ -215,7 +215,8 @@ brush_delete_invoker (GimpProcedure *procedure,
|
||||||
|
|
||||||
if (! success)
|
if (! success)
|
||||||
{
|
{
|
||||||
gimp_message (gimp, progress, error->message);
|
gimp_message (gimp, G_OBJECT (progress), GIMP_MESSAGE_ERROR,
|
||||||
|
error->message);
|
||||||
g_clear_error (&error);
|
g_clear_error (&error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -299,9 +299,9 @@ gimp_pdb_execute_procedure_by_name_args (GimpPDB *pdb,
|
||||||
|
|
||||||
if (list == NULL)
|
if (list == NULL)
|
||||||
{
|
{
|
||||||
gimp_message (pdb->gimp, progress,
|
gimp_message (pdb->gimp, progress, GIMP_MESSAGE_ERROR,
|
||||||
_("PDB calling error:\n"
|
_("PDB calling error:\n"
|
||||||
"Procedure '%s' not found"), name);
|
"Procedure '%s' not found"), name);
|
||||||
|
|
||||||
return_vals = gimp_procedure_get_return_values (NULL, FALSE);
|
return_vals = gimp_procedure_get_return_values (NULL, FALSE);
|
||||||
g_value_set_enum (return_vals->values, GIMP_PDB_CALLING_ERROR);
|
g_value_set_enum (return_vals->values, GIMP_PDB_CALLING_ERROR);
|
||||||
|
@ -364,7 +364,7 @@ gimp_pdb_execute_procedure_by_name (GimpPDB *pdb,
|
||||||
|
|
||||||
if (procedure == NULL)
|
if (procedure == NULL)
|
||||||
{
|
{
|
||||||
gimp_message (pdb->gimp, progress,
|
gimp_message (pdb->gimp, progress, GIMP_MESSAGE_ERROR,
|
||||||
_("PDB calling error:\n"
|
_("PDB calling error:\n"
|
||||||
"Procedure '%s' not found"), name);
|
"Procedure '%s' not found"), name);
|
||||||
|
|
||||||
|
@ -398,7 +398,7 @@ gimp_pdb_execute_procedure_by_name (GimpPDB *pdb,
|
||||||
|
|
||||||
g_value_array_free (args);
|
g_value_array_free (args);
|
||||||
|
|
||||||
gimp_message (pdb->gimp, progress,
|
gimp_message (pdb->gimp, progress, GIMP_MESSAGE_ERROR,
|
||||||
_("PDB calling error for procedure '%s':\n"
|
_("PDB calling error for procedure '%s':\n"
|
||||||
"Argument #%d type mismatch (expected %s, got %s)"),
|
"Argument #%d type mismatch (expected %s, got %s)"),
|
||||||
gimp_object_get_name (GIMP_OBJECT (procedure)),
|
gimp_object_get_name (GIMP_OBJECT (procedure)),
|
||||||
|
|
|
@ -264,7 +264,8 @@ gradient_delete_invoker (GimpProcedure *procedure,
|
||||||
|
|
||||||
if (! success)
|
if (! success)
|
||||||
{
|
{
|
||||||
gimp_message (gimp, progress, error->message);
|
gimp_message (gimp, G_OBJECT (progress), GIMP_MESSAGE_ERROR,
|
||||||
|
error->message);
|
||||||
g_clear_error (&error);
|
g_clear_error (&error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1942,7 +1942,7 @@ image_set_resolution_invoker (GimpProcedure *procedure,
|
||||||
! FINITE (yresolution) ||
|
! FINITE (yresolution) ||
|
||||||
yresolution < GIMP_MIN_RESOLUTION || yresolution > GIMP_MAX_RESOLUTION)
|
yresolution < GIMP_MIN_RESOLUTION || yresolution > GIMP_MAX_RESOLUTION)
|
||||||
{
|
{
|
||||||
gimp_message (gimp, progress,
|
gimp_message (gimp, G_OBJECT (progress), GIMP_MESSAGE_WARNING,
|
||||||
_("Image resolution is out of bounds, "
|
_("Image resolution is out of bounds, "
|
||||||
"using the default resolution instead."));
|
"using the default resolution instead."));
|
||||||
success = FALSE;
|
success = FALSE;
|
||||||
|
|
|
@ -53,7 +53,8 @@ message_invoker (GimpProcedure *procedure,
|
||||||
|
|
||||||
if (gimp->plug_in_manager->current_plug_in)
|
if (gimp->plug_in_manager->current_plug_in)
|
||||||
domain = gimp_plug_in_get_undo_desc (gimp->plug_in_manager->current_plug_in);
|
domain = gimp_plug_in_get_undo_desc (gimp->plug_in_manager->current_plug_in);
|
||||||
gimp_show_message (gimp, progress, domain, message);
|
gimp_show_message (gimp, G_OBJECT (progress), GIMP_MESSAGE_WARNING,
|
||||||
|
domain, message);
|
||||||
|
|
||||||
g_free (domain);
|
g_free (domain);
|
||||||
}
|
}
|
||||||
|
|
|
@ -182,7 +182,8 @@ palette_delete_invoker (GimpProcedure *procedure,
|
||||||
|
|
||||||
if (! success)
|
if (! success)
|
||||||
{
|
{
|
||||||
gimp_message (gimp, progress, error->message);
|
gimp_message (gimp, G_OBJECT (progress), GIMP_MESSAGE_ERROR,
|
||||||
|
error->message);
|
||||||
g_clear_error (&error);
|
g_clear_error (&error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -607,7 +607,8 @@ gimp_plug_in_recv_message (GIOChannel *channel,
|
||||||
GimpPlugInProcFrame *frame = gimp_plug_in_get_proc_frame (plug_in);
|
GimpPlugInProcFrame *frame = gimp_plug_in_get_proc_frame (plug_in);
|
||||||
GimpProgress *progress = frame ? frame->progress : NULL;
|
GimpProgress *progress = frame ? frame->progress : NULL;
|
||||||
|
|
||||||
gimp_message (plug_in->manager->gimp, progress,
|
gimp_message (plug_in->manager->gimp, G_OBJECT (progress),
|
||||||
|
GIMP_MESSAGE_ERROR,
|
||||||
_("Plug-in crashed: \"%s\"\n(%s)\n\n"
|
_("Plug-in crashed: \"%s\"\n(%s)\n\n"
|
||||||
"The dying plug-in may have messed up GIMP's internal "
|
"The dying plug-in may have messed up GIMP's internal "
|
||||||
"state. You may want to save your images and restart "
|
"state. You may want to save your images and restart "
|
||||||
|
|
|
@ -584,10 +584,11 @@ gimp_image_map_tool_load_save (GimpImageMapTool *tool,
|
||||||
_("Could not open '%s' for writing: %s") :
|
_("Could not open '%s' for writing: %s") :
|
||||||
_("Could not open '%s' for reading: %s");
|
_("Could not open '%s' for reading: %s");
|
||||||
|
|
||||||
gimp_show_message_dialog (tool->shell, GTK_MESSAGE_ERROR,
|
gimp_message (GIMP_TOOL (tool)->tool_info->gimp, G_OBJECT (tool->shell),
|
||||||
format,
|
GIMP_MESSAGE_ERROR,
|
||||||
gimp_filename_to_utf8 (filename),
|
format,
|
||||||
g_strerror (errno));
|
gimp_filename_to_utf8 (filename),
|
||||||
|
g_strerror (errno));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -601,10 +602,11 @@ gimp_image_map_tool_load_save (GimpImageMapTool *tool,
|
||||||
}
|
}
|
||||||
else if (! gimp_image_map_tool_settings_load (tool, file, &error))
|
else if (! gimp_image_map_tool_settings_load (tool, file, &error))
|
||||||
{
|
{
|
||||||
gimp_show_message_dialog (tool->shell, GTK_MESSAGE_ERROR,
|
gimp_message (GIMP_TOOL (tool)->tool_info->gimp, G_OBJECT (tool->shell),
|
||||||
_("Error reading '%s': %s"),
|
GIMP_MESSAGE_ERROR,
|
||||||
gimp_filename_to_utf8 (filename),
|
_("Error reading '%s': %s"),
|
||||||
error->message);
|
gimp_filename_to_utf8 (filename),
|
||||||
|
error->message);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
|
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
#include "core/gimpimage.h"
|
#include "core/gimpimage.h"
|
||||||
#include "core/gimpprogress.h"
|
|
||||||
#include "core/gimptoolinfo.h"
|
#include "core/gimptoolinfo.h"
|
||||||
|
|
||||||
#include "display/gimpdisplay.h"
|
#include "display/gimpdisplay.h"
|
||||||
|
@ -727,9 +726,11 @@ gimp_tool_push_status (GimpTool *tool,
|
||||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||||
|
|
||||||
va_start (args, format);
|
va_start (args, format);
|
||||||
|
|
||||||
gimp_statusbar_push_valist (GIMP_STATUSBAR (shell->statusbar),
|
gimp_statusbar_push_valist (GIMP_STATUSBAR (shell->statusbar),
|
||||||
G_OBJECT_TYPE_NAME (tool),
|
G_OBJECT_TYPE_NAME (tool),
|
||||||
format, args);
|
format, args);
|
||||||
|
|
||||||
va_end (args);
|
va_end (args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -788,9 +789,11 @@ gimp_tool_replace_status (GimpTool *tool,
|
||||||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||||
|
|
||||||
va_start (args, format);
|
va_start (args, format);
|
||||||
|
|
||||||
gimp_statusbar_replace_valist (GIMP_STATUSBAR (shell->statusbar),
|
gimp_statusbar_replace_valist (GIMP_STATUSBAR (shell->statusbar),
|
||||||
G_OBJECT_TYPE_NAME (tool),
|
G_OBJECT_TYPE_NAME (tool),
|
||||||
format, args);
|
format, args);
|
||||||
|
|
||||||
va_end (args);
|
va_end (args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -819,11 +822,12 @@ gimp_tool_message (GimpTool *tool,
|
||||||
|
|
||||||
g_return_if_fail (GIMP_IS_TOOL (tool));
|
g_return_if_fail (GIMP_IS_TOOL (tool));
|
||||||
g_return_if_fail (GIMP_IS_DISPLAY (display));
|
g_return_if_fail (GIMP_IS_DISPLAY (display));
|
||||||
|
g_return_if_fail (format != NULL);
|
||||||
|
|
||||||
va_start (args, format);
|
va_start (args, format);
|
||||||
|
|
||||||
gimp_display_shell_message_valist (GIMP_DISPLAY_SHELL (display->shell),
|
gimp_message_valist (display->image->gimp, G_OBJECT (display),
|
||||||
format, args);
|
GIMP_MESSAGE_WARNING, format, args);
|
||||||
|
|
||||||
va_end (args);
|
va_end (args);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1880,9 +1880,9 @@ gimp_vector_tool_stroke_vectors (GimpVectorTool *vector_tool,
|
||||||
|
|
||||||
if (! active_drawable)
|
if (! active_drawable)
|
||||||
{
|
{
|
||||||
gimp_message (image->gimp,
|
gimp_tool_message (GIMP_TOOL (vector_tool),
|
||||||
GIMP_PROGRESS (GIMP_TOOL (vector_tool)->display),
|
GIMP_TOOL (vector_tool)->display,
|
||||||
_("There is no active layer or channel to stroke to"));
|
_("There is no active layer or channel to stroke to"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,8 @@
|
||||||
|
|
||||||
#include "widgets-types.h"
|
#include "widgets-types.h"
|
||||||
|
|
||||||
|
#include "core/gimp.h"
|
||||||
|
|
||||||
#include "gimpaction.h"
|
#include "gimpaction.h"
|
||||||
#include "gimpactiongroup.h"
|
#include "gimpactiongroup.h"
|
||||||
#include "gimpactionview.h"
|
#include "gimpactionview.h"
|
||||||
|
@ -462,6 +464,7 @@ gimp_action_view_accel_changed (GtkAccelGroup *accel_group,
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
GimpUIManager *manager;
|
||||||
gchar *accel_path;
|
gchar *accel_path;
|
||||||
guint accel_key;
|
guint accel_key;
|
||||||
GdkModifierType accel_mask;
|
GdkModifierType accel_mask;
|
||||||
|
@ -481,8 +484,9 @@ gimp_action_view_conflict_response (GtkWidget *dialog,
|
||||||
confirm_data->accel_mask,
|
confirm_data->accel_mask,
|
||||||
TRUE))
|
TRUE))
|
||||||
{
|
{
|
||||||
gimp_show_message_dialog (dialog, GTK_MESSAGE_ERROR,
|
gimp_message (confirm_data->manager->gimp, G_OBJECT (dialog),
|
||||||
_("Changing shortcut failed."));
|
GIMP_MESSAGE_ERROR,
|
||||||
|
_("Changing shortcut failed."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -517,6 +521,7 @@ gimp_action_view_conflict_confirm (GimpActionView *view,
|
||||||
|
|
||||||
confirm_data = g_new0 (ConfirmData, 1);
|
confirm_data = g_new0 (ConfirmData, 1);
|
||||||
|
|
||||||
|
confirm_data->manager = view->manager;
|
||||||
confirm_data->accel_path = g_strdup (accel_path);
|
confirm_data->accel_path = g_strdup (accel_path);
|
||||||
confirm_data->accel_key = accel_key;
|
confirm_data->accel_key = accel_key;
|
||||||
confirm_data->accel_mask = accel_mask;
|
confirm_data->accel_mask = accel_mask;
|
||||||
|
@ -600,14 +605,16 @@ gimp_action_view_accel_edited (GimpCellRendererAccel *accel,
|
||||||
{
|
{
|
||||||
if (! gtk_accel_map_change_entry (accel_path, 0, 0, FALSE))
|
if (! gtk_accel_map_change_entry (accel_path, 0, 0, FALSE))
|
||||||
{
|
{
|
||||||
gimp_show_message_dialog (GTK_WIDGET (view), GTK_MESSAGE_ERROR,
|
gimp_message (view->manager->gimp, G_OBJECT (view),
|
||||||
_("Removing shortcut failed."));
|
GIMP_MESSAGE_ERROR,
|
||||||
|
_("Removing shortcut failed."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (! accel_key)
|
else if (! accel_key)
|
||||||
{
|
{
|
||||||
gimp_show_message_dialog (GTK_WIDGET (view), GTK_MESSAGE_ERROR,
|
gimp_message (view->manager->gimp, G_OBJECT (view),
|
||||||
_("Invalid shortcut."));
|
GIMP_MESSAGE_ERROR,
|
||||||
|
_("Invalid shortcut."));
|
||||||
}
|
}
|
||||||
else if (! gtk_accel_map_change_entry (accel_path,
|
else if (! gtk_accel_map_change_entry (accel_path,
|
||||||
accel_key, accel_mask, FALSE))
|
accel_key, accel_mask, FALSE))
|
||||||
|
@ -666,9 +673,9 @@ gimp_action_view_accel_edited (GimpCellRendererAccel *accel,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gimp_show_message_dialog (GTK_WIDGET (view),
|
gimp_message (view->manager->gimp, G_OBJECT (view),
|
||||||
GTK_MESSAGE_ERROR,
|
GIMP_MESSAGE_ERROR,
|
||||||
_("Changing shortcut failed."));
|
_("Changing shortcut failed."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -509,21 +509,21 @@ gimp_controller_list_add_clicked (GtkWidget *button,
|
||||||
if (list->src_gtype == GIMP_TYPE_CONTROLLER_KEYBOARD &&
|
if (list->src_gtype == GIMP_TYPE_CONTROLLER_KEYBOARD &&
|
||||||
gimp_controllers_get_keyboard (list->gimp) != NULL)
|
gimp_controllers_get_keyboard (list->gimp) != NULL)
|
||||||
{
|
{
|
||||||
gimp_show_message_dialog (button, GTK_MESSAGE_WARNING,
|
gimp_message (list->gimp, G_OBJECT (button), GIMP_MESSAGE_WARNING,
|
||||||
_("There can only be one active keyboard "
|
_("There can only be one active keyboard "
|
||||||
"controller.\n\n"
|
"controller.\n\n"
|
||||||
"You already have a keyboard controller in "
|
"You already have a keyboard controller in "
|
||||||
"your list of active controllers."));
|
"your list of active controllers."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (list->src_gtype == GIMP_TYPE_CONTROLLER_WHEEL &&
|
else if (list->src_gtype == GIMP_TYPE_CONTROLLER_WHEEL &&
|
||||||
gimp_controllers_get_wheel (list->gimp) != NULL)
|
gimp_controllers_get_wheel (list->gimp) != NULL)
|
||||||
{
|
{
|
||||||
gimp_show_message_dialog (button, GTK_MESSAGE_WARNING,
|
gimp_message (list->gimp, G_OBJECT (button), GIMP_MESSAGE_WARNING,
|
||||||
_("There can only be one active wheel "
|
_("There can only be one active wheel "
|
||||||
"controller.\n\n"
|
"controller.\n\n"
|
||||||
"You already have a wheel controller in "
|
"You already have a wheel controller in "
|
||||||
"your list of active controllers."));
|
"your list of active controllers."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
#include "libgimpbase/gimpbase.h"
|
||||||
#include "libgimpwidgets/gimpwidgets.h"
|
#include "libgimpwidgets/gimpwidgets.h"
|
||||||
|
|
||||||
#include "widgets-types.h"
|
#include "widgets-types.h"
|
||||||
|
@ -34,6 +35,7 @@
|
||||||
|
|
||||||
#include "gimperrorconsole.h"
|
#include "gimperrorconsole.h"
|
||||||
#include "gimpmenufactory.h"
|
#include "gimpmenufactory.h"
|
||||||
|
#include "gimpwidgets-utils.h"
|
||||||
|
|
||||||
#include "gimp-intl.h"
|
#include "gimp-intl.h"
|
||||||
|
|
||||||
|
@ -177,31 +179,35 @@ gimp_error_console_new (Gimp *gimp,
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_error_console_add (GimpErrorConsole *console,
|
gimp_error_console_add (GimpErrorConsole *console,
|
||||||
const gchar *stock_id,
|
GimpMessageSeverity severity,
|
||||||
const gchar *domain,
|
const gchar *domain,
|
||||||
const gchar *message)
|
const gchar *message)
|
||||||
{
|
{
|
||||||
|
const gchar *desc;
|
||||||
GtkTextIter end;
|
GtkTextIter end;
|
||||||
GtkTextMark *end_mark;
|
GtkTextMark *end_mark;
|
||||||
GdkPixbuf *pixbuf;
|
GdkPixbuf *pixbuf;
|
||||||
gchar *str;
|
gchar *str;
|
||||||
|
|
||||||
g_return_if_fail (GIMP_IS_ERROR_CONSOLE (console));
|
g_return_if_fail (GIMP_IS_ERROR_CONSOLE (console));
|
||||||
g_return_if_fail (stock_id != NULL);
|
|
||||||
g_return_if_fail (domain != NULL);
|
g_return_if_fail (domain != NULL);
|
||||||
g_return_if_fail (message != NULL);
|
g_return_if_fail (message != NULL);
|
||||||
|
|
||||||
|
gimp_enum_get_value (GIMP_TYPE_MESSAGE_SEVERITY, severity,
|
||||||
|
NULL, NULL, &desc, NULL);
|
||||||
|
|
||||||
gtk_text_buffer_get_end_iter (console->text_buffer, &end);
|
gtk_text_buffer_get_end_iter (console->text_buffer, &end);
|
||||||
|
|
||||||
pixbuf = gtk_widget_render_icon (console->text_view, stock_id,
|
pixbuf = gtk_widget_render_icon (console->text_view,
|
||||||
|
gimp_get_message_stock_id (severity),
|
||||||
GTK_ICON_SIZE_MENU, NULL);
|
GTK_ICON_SIZE_MENU, NULL);
|
||||||
gtk_text_buffer_insert_pixbuf (console->text_buffer, &end, pixbuf);
|
gtk_text_buffer_insert_pixbuf (console->text_buffer, &end, pixbuf);
|
||||||
g_object_unref (pixbuf);
|
g_object_unref (pixbuf);
|
||||||
|
|
||||||
gtk_text_buffer_insert (console->text_buffer, &end, " ", -1);
|
gtk_text_buffer_insert (console->text_buffer, &end, " ", -1);
|
||||||
|
|
||||||
str = g_strdup_printf (_("%s Message"), domain);
|
str = g_strdup_printf ("%s %s", domain, desc);
|
||||||
gtk_text_buffer_insert_with_tags_by_name (console->text_buffer, &end,
|
gtk_text_buffer_insert_with_tags_by_name (console->text_buffer, &end,
|
||||||
str, -1,
|
str, -1,
|
||||||
"title",
|
"title",
|
||||||
|
|
|
@ -60,13 +60,13 @@ struct _GimpErrorConsoleClass
|
||||||
|
|
||||||
GType gimp_error_console_get_type (void) G_GNUC_CONST;
|
GType gimp_error_console_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
GtkWidget * gimp_error_console_new (Gimp *gimp,
|
GtkWidget * gimp_error_console_new (Gimp *gimp,
|
||||||
GimpMenuFactory *menu_factory);
|
GimpMenuFactory *menu_factory);
|
||||||
|
|
||||||
void gimp_error_console_add (GimpErrorConsole *console,
|
void gimp_error_console_add (GimpErrorConsole *console,
|
||||||
const gchar *stock_id,
|
GimpMessageSeverity severity,
|
||||||
const gchar *domain,
|
const gchar *domain,
|
||||||
const gchar *message);
|
const gchar *message);
|
||||||
|
|
||||||
|
|
||||||
#endif /* __GIMP_ERROR_CONSOLE_H__ */
|
#endif /* __GIMP_ERROR_CONSOLE_H__ */
|
||||||
|
|
|
@ -340,12 +340,12 @@ gimp_pdb_dialog_run_callback (GimpPdbDialog *dialog,
|
||||||
|
|
||||||
if (g_value_get_enum (&return_vals->values[0]) != GIMP_PDB_SUCCESS)
|
if (g_value_get_enum (&return_vals->values[0]) != GIMP_PDB_SUCCESS)
|
||||||
{
|
{
|
||||||
gimp_show_message_dialog (GTK_WIDGET (dialog),
|
gimp_message (dialog->context->gimp, G_OBJECT (dialog),
|
||||||
GTK_MESSAGE_ERROR,
|
GIMP_MESSAGE_ERROR,
|
||||||
_("Unable to run %s callback. "
|
_("Unable to run %s callback. "
|
||||||
"The corresponding plug-in may have "
|
"The corresponding plug-in may have "
|
||||||
"crashed."),
|
"crashed."),
|
||||||
g_type_name (G_TYPE_FROM_INSTANCE (dialog)));
|
g_type_name (G_TYPE_FROM_INSTANCE (dialog)));
|
||||||
}
|
}
|
||||||
|
|
||||||
g_value_array_free (return_vals);
|
g_value_array_free (return_vals);
|
||||||
|
|
|
@ -69,8 +69,9 @@ static void gimp_thumb_box_progress_set_value (GimpProgress *progress,
|
||||||
static gdouble gimp_thumb_box_progress_get_value (GimpProgress *progress);
|
static gdouble gimp_thumb_box_progress_get_value (GimpProgress *progress);
|
||||||
static void gimp_thumb_box_progress_pulse (GimpProgress *progress);
|
static void gimp_thumb_box_progress_pulse (GimpProgress *progress);
|
||||||
|
|
||||||
static void gimp_thumb_box_progress_message (GimpProgress *progress,
|
static gboolean gimp_thumb_box_progress_message (GimpProgress *progress,
|
||||||
Gimp *gimp,
|
Gimp *gimp,
|
||||||
|
GimpMessageSeverity severity,
|
||||||
const gchar *domain,
|
const gchar *domain,
|
||||||
const gchar *message);
|
const gchar *message);
|
||||||
|
|
||||||
|
@ -271,13 +272,16 @@ gimp_thumb_box_progress_pulse (GimpProgress *progress)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static gboolean
|
||||||
gimp_thumb_box_progress_message (GimpProgress *progress,
|
gimp_thumb_box_progress_message (GimpProgress *progress,
|
||||||
Gimp *gimp,
|
Gimp *gimp,
|
||||||
const gchar *domain,
|
GimpMessageSeverity severity,
|
||||||
const gchar *message)
|
const gchar *domain,
|
||||||
|
const gchar *message)
|
||||||
{
|
{
|
||||||
/* GimpThumbBox never shows any messages */
|
/* GimpThumbBox never shows any messages */
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -235,8 +235,8 @@ gimp_vectors_tree_view_drop_svg (GimpContainerTreeView *tree_view,
|
||||||
if (! gimp_vectors_import_buffer (image, svg_data, svg_data_len,
|
if (! gimp_vectors_import_buffer (image, svg_data, svg_data_len,
|
||||||
TRUE, TRUE, index, &error))
|
TRUE, TRUE, index, &error))
|
||||||
{
|
{
|
||||||
gimp_show_message_dialog (GTK_WIDGET (tree_view), GTK_MESSAGE_ERROR,
|
gimp_message (image->gimp, G_OBJECT (tree_view), GIMP_MESSAGE_ERROR,
|
||||||
error->message);
|
error->message);
|
||||||
g_clear_error (&error);
|
g_clear_error (&error);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -1131,33 +1131,20 @@ gimp_widget_set_accel_help (GtkWidget *widget,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
const gchar *
|
||||||
gimp_show_message_dialog (GtkWidget *parent,
|
gimp_get_message_stock_id (GimpMessageSeverity severity)
|
||||||
GtkMessageType type,
|
|
||||||
const gchar *format,
|
|
||||||
...)
|
|
||||||
{
|
{
|
||||||
GtkWidget *dialog;
|
switch (severity)
|
||||||
gchar *message;
|
{
|
||||||
va_list args;
|
case GIMP_MESSAGE_INFO:
|
||||||
|
return GIMP_STOCK_INFO;
|
||||||
|
|
||||||
g_return_if_fail (GTK_IS_WIDGET (parent));
|
case GIMP_MESSAGE_WARNING:
|
||||||
g_return_if_fail (format != NULL);
|
return GIMP_STOCK_WARNING;
|
||||||
|
|
||||||
va_start (args, format);
|
case GIMP_MESSAGE_ERROR:
|
||||||
message = g_strdup_vprintf (format, args);
|
return GIMP_STOCK_ERROR;
|
||||||
va_end (args);
|
}
|
||||||
|
|
||||||
dialog =
|
g_return_val_if_reached (GIMP_STOCK_WARNING);
|
||||||
gtk_message_dialog_new (GTK_WINDOW (gtk_widget_get_toplevel (parent)),
|
|
||||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
|
||||||
type, GTK_BUTTONS_OK,
|
|
||||||
message);
|
|
||||||
g_free (message);
|
|
||||||
|
|
||||||
g_signal_connect (dialog, "response",
|
|
||||||
G_CALLBACK (gtk_widget_destroy),
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
gtk_widget_show (dialog);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,10 +93,7 @@ void gimp_toggle_button_set_visible (GtkToggleButton *toggle,
|
||||||
void gimp_widget_set_accel_help (GtkWidget *widget,
|
void gimp_widget_set_accel_help (GtkWidget *widget,
|
||||||
GtkAction *action);
|
GtkAction *action);
|
||||||
|
|
||||||
void gimp_show_message_dialog (GtkWidget *parent,
|
const gchar * gimp_get_message_stock_id (GimpMessageSeverity severity);
|
||||||
GtkMessageType type,
|
|
||||||
const gchar *format,
|
|
||||||
...) G_GNUC_PRINTF(3,4);
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* __GIMP_WIDGETS_UTILS_H__ */
|
#endif /* __GIMP_WIDGETS_UTILS_H__ */
|
||||||
|
|
|
@ -276,7 +276,7 @@ xcf_load_image (Gimp *gimp,
|
||||||
if (num_successful_elements == 0)
|
if (num_successful_elements == 0)
|
||||||
goto hard_error;
|
goto hard_error;
|
||||||
|
|
||||||
gimp_message (gimp, info->progress,
|
gimp_message (gimp, G_OBJECT (info->progress), GIMP_MESSAGE_WARNING,
|
||||||
"XCF: This file is corrupt! I have loaded as much\n"
|
"XCF: This file is corrupt! I have loaded as much\n"
|
||||||
"of it as I can, but it is incomplete.");
|
"of it as I can, but it is incomplete.");
|
||||||
|
|
||||||
|
@ -285,7 +285,7 @@ xcf_load_image (Gimp *gimp,
|
||||||
return image;
|
return image;
|
||||||
|
|
||||||
hard_error:
|
hard_error:
|
||||||
gimp_message (gimp, info->progress,
|
gimp_message (gimp, G_OBJECT (info->progress), GIMP_MESSAGE_ERROR,
|
||||||
"XCF: This file is corrupt! I could not even\n"
|
"XCF: This file is corrupt! I could not even\n"
|
||||||
"salvage any partial image data from it.");
|
"salvage any partial image data from it.");
|
||||||
|
|
||||||
|
@ -316,7 +316,8 @@ xcf_load_image_props (XcfInfo *info,
|
||||||
{
|
{
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
gimp_message (info->gimp, info->progress,
|
gimp_message (info->gimp, G_OBJECT (info->progress),
|
||||||
|
GIMP_MESSAGE_WARNING,
|
||||||
_("XCF warning: version 0 of XCF file format\n"
|
_("XCF warning: version 0 of XCF file format\n"
|
||||||
"did not save indexed colormaps correctly.\n"
|
"did not save indexed colormaps correctly.\n"
|
||||||
"Substituting grayscale map."));
|
"Substituting grayscale map."));
|
||||||
|
@ -366,7 +367,8 @@ xcf_load_image_props (XcfInfo *info,
|
||||||
(compression != COMPRESS_ZLIB) &&
|
(compression != COMPRESS_ZLIB) &&
|
||||||
(compression != COMPRESS_FRACTAL))
|
(compression != COMPRESS_FRACTAL))
|
||||||
{
|
{
|
||||||
gimp_message (info->gimp, info->progress,
|
gimp_message (info->gimp, G_OBJECT (info->progress),
|
||||||
|
GIMP_MESSAGE_ERROR,
|
||||||
"unknown compression type: %d",
|
"unknown compression type: %d",
|
||||||
(int) compression);
|
(int) compression);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -403,7 +405,8 @@ xcf_load_image_props (XcfInfo *info,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
gimp_message (info->gimp, info->progress,
|
gimp_message (info->gimp, G_OBJECT (info->progress),
|
||||||
|
GIMP_MESSAGE_WARNING,
|
||||||
"guide orientation out of range in XCF file");
|
"guide orientation out of range in XCF file");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -442,7 +445,8 @@ xcf_load_image_props (XcfInfo *info,
|
||||||
if (xres < GIMP_MIN_RESOLUTION || xres > GIMP_MAX_RESOLUTION ||
|
if (xres < GIMP_MIN_RESOLUTION || xres > GIMP_MAX_RESOLUTION ||
|
||||||
yres < GIMP_MIN_RESOLUTION || yres > GIMP_MAX_RESOLUTION)
|
yres < GIMP_MIN_RESOLUTION || yres > GIMP_MAX_RESOLUTION)
|
||||||
{
|
{
|
||||||
gimp_message (info->gimp, info->progress,
|
gimp_message (info->gimp, G_OBJECT (info->progress),
|
||||||
|
GIMP_MESSAGE_WARNING,
|
||||||
"Warning, resolution out of range in XCF file");
|
"Warning, resolution out of range in XCF file");
|
||||||
xres = image->gimp->config->default_image->xresolution;
|
xres = image->gimp->config->default_image->xresolution;
|
||||||
yres = image->gimp->config->default_image->yresolution;
|
yres = image->gimp->config->default_image->yresolution;
|
||||||
|
@ -470,7 +474,8 @@ xcf_load_image_props (XcfInfo *info,
|
||||||
gimp_parasite_free (p);
|
gimp_parasite_free (p);
|
||||||
}
|
}
|
||||||
if (info->cp - base != prop_size)
|
if (info->cp - base != prop_size)
|
||||||
gimp_message (info->gimp, info->progress,
|
gimp_message (info->gimp, G_OBJECT (info->progress),
|
||||||
|
GIMP_MESSAGE_WARNING,
|
||||||
"Error while loading an image's parasites");
|
"Error while loading an image's parasites");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -484,7 +489,8 @@ xcf_load_image_props (XcfInfo *info,
|
||||||
if ((unit <= GIMP_UNIT_PIXEL) ||
|
if ((unit <= GIMP_UNIT_PIXEL) ||
|
||||||
(unit >= _gimp_unit_get_number_of_built_in_units (image->gimp)))
|
(unit >= _gimp_unit_get_number_of_built_in_units (image->gimp)))
|
||||||
{
|
{
|
||||||
gimp_message (info->gimp, info->progress,
|
gimp_message (info->gimp, G_OBJECT (info->progress),
|
||||||
|
GIMP_MESSAGE_WARNING,
|
||||||
"Warning, unit out of range in XCF file, "
|
"Warning, unit out of range in XCF file, "
|
||||||
"falling back to inches");
|
"falling back to inches");
|
||||||
unit = GIMP_UNIT_INCH;
|
unit = GIMP_UNIT_INCH;
|
||||||
|
@ -714,7 +720,8 @@ xcf_load_layer_props (XcfInfo *info,
|
||||||
gimp_parasite_free (p);
|
gimp_parasite_free (p);
|
||||||
}
|
}
|
||||||
if (info->cp - base != prop_size)
|
if (info->cp - base != prop_size)
|
||||||
gimp_message (info->gimp, info->progress,
|
gimp_message (info->gimp, G_OBJECT (info->progress),
|
||||||
|
GIMP_MESSAGE_WARNING,
|
||||||
"Error while loading a layer's parasites");
|
"Error while loading a layer's parasites");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -856,7 +863,8 @@ xcf_load_channel_props (XcfInfo *info,
|
||||||
gimp_parasite_free (p);
|
gimp_parasite_free (p);
|
||||||
}
|
}
|
||||||
if (info->cp - base != prop_size)
|
if (info->cp - base != prop_size)
|
||||||
gimp_message (info->gimp, info->progress,
|
gimp_message (info->gimp, G_OBJECT (info->progress),
|
||||||
|
GIMP_MESSAGE_WARNING,
|
||||||
"Error while loading a channel's parasites");
|
"Error while loading a channel's parasites");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1218,7 +1226,8 @@ xcf_load_level (XcfInfo *info,
|
||||||
|
|
||||||
if (offset == 0)
|
if (offset == 0)
|
||||||
{
|
{
|
||||||
gimp_message (info->gimp, info->progress,
|
gimp_message (info->gimp, G_OBJECT (info->progress),
|
||||||
|
GIMP_MESSAGE_ERROR,
|
||||||
"not enough tiles found in level");
|
"not enough tiles found in level");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -1305,7 +1314,7 @@ xcf_load_level (XcfInfo *info,
|
||||||
|
|
||||||
if (offset != 0)
|
if (offset != 0)
|
||||||
{
|
{
|
||||||
gimp_message (info->gimp, info->progress,
|
gimp_message (info->gimp, G_OBJECT (info->progress), GIMP_MESSAGE_ERROR,
|
||||||
"encountered garbage after reading level: %d", offset);
|
"encountered garbage after reading level: %d", offset);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -1616,7 +1625,8 @@ xcf_load_vectors (XcfInfo *info,
|
||||||
|
|
||||||
if (version != 1)
|
if (version != 1)
|
||||||
{
|
{
|
||||||
gimp_message (info->gimp, info->progress,
|
gimp_message (info->gimp, G_OBJECT (info->progress),
|
||||||
|
GIMP_MESSAGE_WARNING,
|
||||||
"Unknown vectors version: %d (skipping)", version);
|
"Unknown vectors version: %d (skipping)", version);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,7 +158,8 @@ static gboolean xcf_save_vectors (XcfInfo *info,
|
||||||
info->cp += xcf_write_int32 (info->fp, data, count, &error); \
|
info->cp += xcf_write_int32 (info->fp, data, count, &error); \
|
||||||
if (error) \
|
if (error) \
|
||||||
{ \
|
{ \
|
||||||
gimp_message (info->gimp, info->progress, \
|
gimp_message (info->gimp, G_OBJECT (info->progress), \
|
||||||
|
GIMP_MESSAGE_ERROR, \
|
||||||
_("Error saving XCF file: %s"), \
|
_("Error saving XCF file: %s"), \
|
||||||
error->message); \
|
error->message); \
|
||||||
return FALSE; \
|
return FALSE; \
|
||||||
|
@ -169,7 +170,8 @@ static gboolean xcf_save_vectors (XcfInfo *info,
|
||||||
info->cp += xcf_write_int8 (info->fp, data, count, &error); \
|
info->cp += xcf_write_int8 (info->fp, data, count, &error); \
|
||||||
if (error) \
|
if (error) \
|
||||||
{ \
|
{ \
|
||||||
gimp_message (info->gimp, info->progress, \
|
gimp_message (info->gimp, G_OBJECT (info->progress), \
|
||||||
|
GIMP_MESSAGE_ERROR, \
|
||||||
_("Error saving XCF file: %s"), \
|
_("Error saving XCF file: %s"), \
|
||||||
error->message); \
|
error->message); \
|
||||||
return FALSE; \
|
return FALSE; \
|
||||||
|
@ -180,7 +182,8 @@ static gboolean xcf_save_vectors (XcfInfo *info,
|
||||||
info->cp += xcf_write_float (info->fp, data, count, &error); \
|
info->cp += xcf_write_float (info->fp, data, count, &error); \
|
||||||
if (error) \
|
if (error) \
|
||||||
{ \
|
{ \
|
||||||
gimp_message (info->gimp, info->progress, \
|
gimp_message (info->gimp, G_OBJECT (info->progress), \
|
||||||
|
GIMP_MESSAGE_ERROR, \
|
||||||
_("Error saving XCF file: %s"), \
|
_("Error saving XCF file: %s"), \
|
||||||
error->message); \
|
error->message); \
|
||||||
return FALSE; \
|
return FALSE; \
|
||||||
|
@ -191,7 +194,8 @@ static gboolean xcf_save_vectors (XcfInfo *info,
|
||||||
info->cp += xcf_write_string (info->fp, data, count, &error); \
|
info->cp += xcf_write_string (info->fp, data, count, &error); \
|
||||||
if (error) \
|
if (error) \
|
||||||
{ \
|
{ \
|
||||||
gimp_message (info->gimp, info->progress, \
|
gimp_message (info->gimp, G_OBJECT (info->progress), \
|
||||||
|
GIMP_MESSAGE_ERROR, \
|
||||||
_("Error saving XCF file: %s"), \
|
_("Error saving XCF file: %s"), \
|
||||||
error->message); \
|
error->message); \
|
||||||
return FALSE; \
|
return FALSE; \
|
||||||
|
@ -216,7 +220,8 @@ static gboolean xcf_save_vectors (XcfInfo *info,
|
||||||
#define xcf_print_error(info, x) G_STMT_START { \
|
#define xcf_print_error(info, x) G_STMT_START { \
|
||||||
if (! (x)) \
|
if (! (x)) \
|
||||||
{ \
|
{ \
|
||||||
gimp_message (info->gimp, info->progress, \
|
gimp_message (info->gimp, G_OBJECT (info->progress), \
|
||||||
|
GIMP_MESSAGE_ERROR, \
|
||||||
_("Error saving XCF file: %s"), \
|
_("Error saving XCF file: %s"), \
|
||||||
error->message); \
|
error->message); \
|
||||||
return FALSE; \
|
return FALSE; \
|
||||||
|
|
|
@ -301,7 +301,7 @@ xcf_load_invoker (GimpProcedure *procedure,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gimp_message (gimp, progress,
|
gimp_message (gimp, G_OBJECT (progress), GIMP_MESSAGE_ERROR,
|
||||||
_("XCF error: unsupported XCF file version %d "
|
_("XCF error: unsupported XCF file version %d "
|
||||||
"encountered"), info.file_version);
|
"encountered"), info.file_version);
|
||||||
success = FALSE;
|
success = FALSE;
|
||||||
|
@ -315,7 +315,7 @@ xcf_load_invoker (GimpProcedure *procedure,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gimp_message (gimp, progress,
|
gimp_message (gimp, G_OBJECT (progress), GIMP_MESSAGE_ERROR,
|
||||||
_("Could not open '%s' for reading: %s"),
|
_("Could not open '%s' for reading: %s"),
|
||||||
gimp_filename_to_utf8 (filename), g_strerror (errno));
|
gimp_filename_to_utf8 (filename), g_strerror (errno));
|
||||||
}
|
}
|
||||||
|
@ -382,7 +382,7 @@ xcf_save_invoker (GimpProcedure *procedure,
|
||||||
|
|
||||||
if (fclose (info.fp) == EOF)
|
if (fclose (info.fp) == EOF)
|
||||||
{
|
{
|
||||||
gimp_message (gimp, progress,
|
gimp_message (gimp, G_OBJECT (progress), GIMP_MESSAGE_ERROR,
|
||||||
_("Error saving XCF file: %s"), g_strerror (errno));
|
_("Error saving XCF file: %s"), g_strerror (errno));
|
||||||
|
|
||||||
success = FALSE;
|
success = FALSE;
|
||||||
|
@ -393,7 +393,7 @@ xcf_save_invoker (GimpProcedure *procedure,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gimp_message (gimp, progress,
|
gimp_message (gimp, G_OBJECT (progress), GIMP_MESSAGE_ERROR,
|
||||||
_("Could not open '%s' for writing: %s"),
|
_("Could not open '%s' for writing: %s"),
|
||||||
gimp_filename_to_utf8 (filename), g_strerror (errno));
|
gimp_filename_to_utf8 (filename), g_strerror (errno));
|
||||||
}
|
}
|
||||||
|
|
|
@ -217,7 +217,8 @@ sub brush_delete {
|
||||||
|
|
||||||
if (! success)
|
if (! success)
|
||||||
{
|
{
|
||||||
gimp_message (gimp, progress, error->message);
|
gimp_message (gimp, G_OBJECT (progress), GIMP_MESSAGE_ERROR,
|
||||||
|
error->message);
|
||||||
g_clear_error (&error);
|
g_clear_error (&error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -184,7 +184,8 @@ sub gradient_delete {
|
||||||
|
|
||||||
if (! success)
|
if (! success)
|
||||||
{
|
{
|
||||||
gimp_message (gimp, progress, error->message);
|
gimp_message (gimp, G_OBJECT (progress), GIMP_MESSAGE_ERROR,
|
||||||
|
error->message);
|
||||||
g_clear_error (&error);
|
g_clear_error (&error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2094,7 +2094,7 @@ HELP
|
||||||
! FINITE (yresolution) ||
|
! FINITE (yresolution) ||
|
||||||
yresolution < GIMP_MIN_RESOLUTION || yresolution > GIMP_MAX_RESOLUTION)
|
yresolution < GIMP_MIN_RESOLUTION || yresolution > GIMP_MAX_RESOLUTION)
|
||||||
{
|
{
|
||||||
gimp_message (gimp, progress,
|
gimp_message (gimp, G_OBJECT (progress), GIMP_MESSAGE_WARNING,
|
||||||
_("Image resolution is out of bounds, "
|
_("Image resolution is out of bounds, "
|
||||||
"using the default resolution instead."));
|
"using the default resolution instead."));
|
||||||
success = FALSE;
|
success = FALSE;
|
||||||
|
|
|
@ -39,7 +39,8 @@ HELP
|
||||||
|
|
||||||
if (gimp->plug_in_manager->current_plug_in)
|
if (gimp->plug_in_manager->current_plug_in)
|
||||||
domain = gimp_plug_in_get_undo_desc (gimp->plug_in_manager->current_plug_in);
|
domain = gimp_plug_in_get_undo_desc (gimp->plug_in_manager->current_plug_in);
|
||||||
gimp_show_message (gimp, progress, domain, message);
|
gimp_show_message (gimp, G_OBJECT (progress), GIMP_MESSAGE_WARNING,
|
||||||
|
domain, message);
|
||||||
|
|
||||||
g_free (domain);
|
g_free (domain);
|
||||||
}
|
}
|
||||||
|
|
|
@ -186,7 +186,8 @@ sub palette_delete {
|
||||||
|
|
||||||
if (! success)
|
if (! success)
|
||||||
{
|
{
|
||||||
gimp_message (gimp, progress, error->message);
|
gimp_message (gimp, G_OBJECT (progress), GIMP_MESSAGE_ERROR,
|
||||||
|
error->message);
|
||||||
g_clear_error (&error);
|
g_clear_error (&error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue