2008-08-19 Sven Neumann <sven@gimp.org>
Complements the fix for bug #344818:
* libgimpbase/gimpbaseenums.[ch]: added new enum
GimpPDBErrorHandler.
* tools/pdbgen/enums.pl: regenerated.
* app/plug-in/gimpplugin.[ch]: added error_handler to
GimpPlugIn.
* app/plug-in/gimpplugin-message.c
(gimp_plug_in_handle_proc_run):
only display an error message for a failed procedure call if the
plug-in's error-handler is set to
GIMP_PDB_ERROR_HANDLER_INTERNAL.
* tools/pdbgen/pdb/plug_in.pdb: added PDB getter and setter for
the plug-in's error-handler.
* app/pdb/plug-in-cmds.c
* app/pdb/internal-procs.c
* libgimp/gimpenums.c.tail
* libgimp/gimpplugin_pdb.[ch]: regenerated.
* plug-ins/common/file-compressor.c
* plug-ins/file-uri/uri.c: set the error-handler to
GIMP_PDB_ERROR_HANDLER_PLUGIN as these plug-ins are forwarding
the
error with their return values.
svn path=/trunk/; revision=26656
2008-08-18 Sven Neumann <sven@gimp.org>
* plug-ins/file-uri/uri.c: pass error messages with the return
values instead of calling g_message().
* plug-ins/file-uri/uri-backend-libcurl.c
* plug-ins/file-uri/uri-backend-gnomevfs.c
* plug-ins/file-uri/uri-backend-gvfs.c
* plug-ins/file-uri/uri-backend-wget.c: set errors in the
G_FILE_ERROR domain and other minor cleanups.
svn path=/trunk/; revision=26655
2008-08-18 Sven Neumann <sven@gimp.org>
* plug-ins/common/file-compressor.c: open the temporary file
before forking. This allows us to return an error message if the
file can't be opened. Also changed the code to not use
g_message()
from the child process.
svn path=/trunk/; revision=26653
2008-08-18 Sven Neumann <sven@gimp.org>
* plug-ins/common/file-compressor.c: pass some error message
with
the return values instead of calling g_message().
svn path=/trunk/; revision=26652
2008-08-18 Sven Neumann <sven@gimp.org>
* plug-ins/common/file-gbr.c
* plug-ins/common/file-gih.c
* plug-ins/common/file-pat.c
* plug-ins/common/file-pix.c
* plug-ins/common/file-sunras.c: for the most common errors,
pass
the error message with the return values instead of calling
g_message().
svn path=/trunk/; revision=26650
2008-08-18 Sven Neumann <sven@gimp.org>
* plug-ins/common/file-xbm.c
* plug-ins/common/file-xpm.c
* plug-ins/common/file-xwd.c: for the most common errors, pass
the
error message with the return values instead of calling
g_message().
svn path=/trunk/; revision=26646
2008-08-18 Sven Neumann <sven@gimp.org>
* plug-ins/common/file-wmf.c: pass error message with the return
values instead of calling g_message().
svn path=/trunk/; revision=26642
2008-08-18 Sven Neumann <sven@gimp.org>
* plug-ins/common/file-pnm.c
* plug-ins/common/file-ps.c
* plug-ins/common/file-psp.c: for the most common errors, pass
the
error message with the return values instead of calling
gimp_message().
svn path=/trunk/; revision=26639
2008-08-18 Sven Neumann <sven@gimp.org>
* plug-ins/common/file-mng.c
* plug-ins/common/file-pcx.c: for the most common errors,
pass the error message with the return values instead of calling
gimp_message().
* plug-ins/common/file-gif-save.c
* plug-ins/common/file-pdf.c
* plug-ins/common/file-png.c: minor cleanup.
svn path=/trunk/; revision=26638
2008-08-17 Sven Neumann <sven@gimp.org>
* plug-ins/common/file-pdf.c: in case of an error, pass the
error
message with the return values.
svn path=/trunk/; revision=26637
2008-08-17 Sven Neumann <sven@gimp.org>
* plug-ins/common/file-gif-load.c
* plug-ins/common/file-gif-save.c: for the most common errors,
pass the error message with the return values instead of calling
gimp_message().
* plug-ins/common/file-png.c: unmarked a string for translation.
This error condition can't possibly happen.
* plug-ins/common/file-svg.c: also return an error message when
the thumbnail can't be loaded.
svn path=/trunk/; revision=26636
2008-08-17 Sven Neumann <sven@gimp.org>
* plug-ins/common/file-dicom.c: for the most common errors, pass
the error message with the return values instead of calling
gimp_message().
svn path=/trunk/; revision=26634
2008-08-17 Sven Neumann <sven@gimp.org>
* plug-ins/common/file-csource.c (save_image): in case of an
error, pass the error message with the return values.
svn path=/trunk/; revision=26633
2008-08-17 Sven Neumann <sven@gimp.org>
* plug-ins/common/file-desktop-link.c
* plug-ins/common/file-svg.c: changed to pass error messages
with
the return values instead of calling g_message().
svn path=/trunk/; revision=26626
2008-08-17 Sven Neumann <sven@gimp.org>
* plug-ins/script-fu/scripts/glowing-logo.scm
* plug-ins/script-fu/scripts/neon-logo.scm: changed the "Alpha
to
Logo" parts of these scripts so that the user can specify the
effect size directly instead of as some multiple of the size.
svn path=/trunk/; revision=26623
2008-08-17 Sven Neumann <sven@gimp.org>
* plug-ins/script-fu/scripts/starscape-logo.scm: dropped the
"Alpha to Logo" part of the "Starscape logo script. It had a
similar problem as the Starburst script (see bug #486779).
svn path=/trunk/; revision=26622
2008-08-17 Sven Neumann <sven@gimp.org>
Next step towards fixing bug #344818:
* app/pdb/gimpprocedure.c (gimp_procedure_execute): if the error
has not already been set, construct one from the error message
that is optionally passed with the return values.
* plug-ins/common/file-png.c: changed to pass an error message
with the return values instead of calling g_message() in case of
an error.
svn path=/trunk/; revision=26620
2008-08-17 Sven Neumann <sven@gimp.org>
* plug-ins/file-psd/psd-util.c (psd_set_error): changed to use
g_error_new_literal().
svn path=/trunk/; revision=26617
2008-08-17 Sven Neumann <sven@gimp.org>
* app/plug-in/gimpplugin-progress.c
(gimp_plug_in_progress_cancel_callback): introduced a utility
function to reduce code duplication.
* app/pdb/gimppdb.c (gimp_pdb_execute_procedure_by_name):
changed
to use g_error_new_literal().
svn path=/trunk/; revision=26616
2008-08-17 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell-callbacks.c
(gimp_display_shell_canvas_size_allocate): If the image ends up
below or to the right of the viewport top and left edges, and the
image is not centered on a given axis, align the top left image
edge with the top left viewport edge. This is basically the best
we can do without an API for start and end of a window resize
cycle using the mouse.
svn path=/trunk/; revision=26613
2008-08-17 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell.[ch]
(gimp_display_shell_configure_event): When applying the centering
logic we need to know the size of the new canvas, so instead of
having it here, only make sure that this logic is run on the next
canvas size-allocate.
* app/display/gimpdisplayshell-callbacks.c
(gimp_display_shell_canvas_size_allocate): If the size-allocate
comes from a top level window resize, apply centering logic.
svn path=/trunk/; revision=26611
2008-08-16 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell-scroll.c
(gimp_display_shell_scroll_center_image_on_next_size_allocate):
Explain that this function needs to be used with care since it is
risky.
* app/display/gimpdisplayshell.c
(gimp_display_shell_new)
(gimp_display_shell_fill): Clarify that it is safe to use the
risky function.
(gimp_display_shell_configure_event): Make proper comparisions (<=
not =) and explain that usage of the risky function is safe.
(gimp_display_shell_shrink_wrap): Always call
gimp_display_shell_scroll_center_image() and let size-requests be
handled by GimpDisplayShell::configure_event().
* app/actions/view-commands.c (view_shrink_wrap_cmd_callback): No
need to center anything explicitly any longer.
svn path=/trunk/; revision=26607
2008-08-16 Sven Neumann <sven@gimp.org>
Next step towards fixing bug #344818:
* libgimp/gimp.[ch]: keep the last error status and error
message
in libgimp. Added new functon gimp_pdb_get_error() that allows
to
retrieve it.
* libgimp/gimp.def: updated.
* plug-ins/pygimp/gimpmodule.c (pygimp_vectors_import_from_file)
(pygimp_vectors_import_from_string): use the new function to get
a more useful error message.
svn path=/trunk/; revision=26602
2008-08-16 Sven Neumann <sven@gimp.org>
* app/plug-in/gimpplugin-message.c
(gimp_plug_in_handle_proc_run):
removed the term 'PDB' from the user-visible error messages.
svn path=/trunk/; revision=26601
2008-08-16 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell-callbacks.c
(gimp_display_shell_canvas_size_allocate): Remove the centering
logic because we do not always want to run it when the canvas size
changes. For example, the canvas size changes if rulers are
toggled on/off.
* app/display/gimpdisplayshell.c
(gimp_display_shell_configure_event): Implement
GtkWidget::configure_event() for the display shell and put the
image centering logic here instead, since this class function is
run when the top level window size changes. Run it only if the
size (not position) of the window changes.
svn path=/trunk/; revision=26599
2008-08-16 Sven Neumann <sven@gimp.org>
* app/pdb/gimppdb.c (gimp_pdb_execute_procedure_by_name):
changed
error message to be similar to the message thrown from
gimp_procedure_validate_args().
svn path=/trunk/; revision=26594
2008-08-16 Sven Neumann <sven@gimp.org>
If a procedure call fails, pass a string describing the error as
the second return value. First step towars fixing bug #344818.
* app/pdb/gimpprocedure.[ch] (gimp_procedure_get_return_values):
added a GError parameter. If it is set, pass the error message
to
the return values.
* app/pdb/gimppdberror.h: added some more error codes.
* app/pdb/gimppdb.c
* app/xcf/xcf.c: pass errors to
gimp_procedure_get_return_values().
* app/plug-in/gimpplugin-message.c
(gimp_plug_in_handle_proc_run):
show a different error message for execution vs. calling errors.
* app/plug-in/gimpplugin-progress.c
(gimp_plug_in_progress_cancel_callback): pass the error
GIMP_PDB_CANCELLED to gimp_procedure_get_return_values().
* app/plug-in/gimppluginmanager-call.[ch]
(gimp_plug_in_manager_call_run): removed the
'destroy_return_vals'
parameter.
* app/plug-in/gimppluginprocedure.c: destroy the return values
here.
* app/plug-in/gimppluginprocframe.c: pass an error to
gimp_procedure_get_return_values().
* tools/pdbgen/app.pl
* tools/pdbgen/pdb/fileops.pdb: generate code that passes the
error to gimp_procedure_get_return_values().
* app/pdb/*-cmds.c: regenerated.
* plug-ins/pygimp/pygimp-pdb.c: extract the error message from
the
return values and pass it to the exception that is thrown.
svn path=/trunk/; revision=26593
2008-08-16 Martin Nordholts <martinn@svn.gnome.org>
* app/actions/view-commands.c (view_shrink_wrap_cmd_callback):
Also handle the case when only the offset is wrong. Not pretty but
simple.
svn path=/trunk/; revision=26592
2008-08-16 Martin Nordholts <martinn@svn.gnome.org>
* app/display/gimpdisplayshell-scale.c
(gimp_display_shell_scale_viewport_coord_almost_centered): New
function.
(gimp_display_shell_scale): Center the image on zoom also if it is
almost centered. This makes the image centered all the way when
zooming out far away.
svn path=/trunk/; revision=26589