when dropping multiple images to the empty image window, open them as

2008-11-04  Sven Neumann  <sven@gimp.org>

	* app/display/gimpdisplayshell-dnd.c
	(gimp_display_shell_drop_uri_list): when dropping multiple 
images
	to the empty image window, open them as seperate images.


svn path=/trunk/; revision=27554
This commit is contained in:
Sven Neumann 2008-11-04 22:32:15 +00:00 committed by Sven Neumann
parent 7d8b7f5534
commit a40525ac39
2 changed files with 34 additions and 11 deletions

View File

@ -1,3 +1,9 @@
2008-11-04 Sven Neumann <sven@gimp.org>
* app/display/gimpdisplayshell-dnd.c
(gimp_display_shell_drop_uri_list): when dropping multiple images
to the empty image window, open them as seperate images.
2008-11-04 Michael Natterer <mitch@gimp.org>
* app/core/gimpprojectable.[ch]: add vitrual function

View File

@ -462,9 +462,12 @@ gimp_display_shell_drop_uri_list (GtkWidget *widget,
GimpImage *image = shell->display->image;
GimpContext *context = gimp_get_user_context (shell->display->gimp);
GList *list;
gboolean open_as_layers;
GIMP_LOG (DND, NULL);
open_as_layers = (shell->display->image != NULL);
for (list = uri_list; list; list = g_list_next (list))
{
const gchar *uri = list->data;
@ -472,17 +475,7 @@ gimp_display_shell_drop_uri_list (GtkWidget *widget,
GError *error = NULL;
gboolean warn = FALSE;
if (! shell->display->image)
{
image = file_open_with_display (shell->display->gimp, context,
GIMP_PROGRESS (shell->display),
uri, FALSE,
&status, &error);
if (! image && status != GIMP_PDB_CANCEL)
warn = TRUE;
}
else
if (open_as_layers)
{
GList *new_layers;
@ -511,6 +504,30 @@ gimp_display_shell_drop_uri_list (GtkWidget *widget,
warn = TRUE;
}
}
else if (shell->display->image)
{
/* open any subsequent images in a new display */
GimpImage *new_image;
new_image = file_open_with_display (shell->display->gimp, context,
NULL,
uri, FALSE,
&status, &error);
if (! new_image && status != GIMP_PDB_CANCEL)
warn = TRUE;
}
else
{
/* open the first image in the empty display */
image = file_open_with_display (shell->display->gimp, context,
GIMP_PROGRESS (shell->display),
uri, FALSE,
&status, &error);
if (! image && status != GIMP_PDB_CANCEL)
warn = TRUE;
}
if (warn)
{