app/core/gimpimage-duplicate.c (gimp_image_duplicate) a somewhat hackish
2006-08-29 Sven Neumann <sven@gimp.org> * app/core/gimpimage-duplicate.c (gimp_image_duplicate) * app/widgets/gimpfiledialog.c (gimp_file_dialog_set_image): a somewhat hackish implementation of what's suggested in bug #353246. Let the save dialog default to the folder of the duplicated image.
This commit is contained in:
committed by
Sven Neumann
parent
0e07e8a92b
commit
e6350b15dd
@ -1,3 +1,10 @@
|
||||
2006-08-29 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/core/gimpimage-duplicate.c (gimp_image_duplicate)
|
||||
* app/widgets/gimpfiledialog.c (gimp_file_dialog_set_image): a
|
||||
somewhat hackish implementation of what's suggested in bug #353246.
|
||||
Let the save dialog default to the folder of the duplicated image.
|
||||
|
||||
2006-08-29 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/display/gimpnavigationeditor.c: some adjustments to the fix
|
||||
|
||||
@ -54,6 +54,7 @@ gimp_image_duplicate (GimpImage *image)
|
||||
GimpVectors *active_vectors = NULL;
|
||||
GimpDrawable *new_floating_sel_drawable = NULL;
|
||||
GimpDrawable *floating_sel_drawable = NULL;
|
||||
gchar *filename;
|
||||
gint count;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
||||
@ -62,11 +63,21 @@ gimp_image_duplicate (GimpImage *image)
|
||||
|
||||
/* Create a new image */
|
||||
new_image = gimp_create_image (image->gimp,
|
||||
image->width, image->height,
|
||||
image->base_type,
|
||||
FALSE);
|
||||
image->width, image->height,
|
||||
image->base_type,
|
||||
FALSE);
|
||||
gimp_image_undo_disable (new_image);
|
||||
|
||||
/* Store the folder to be used by the save dialog */
|
||||
filename = gimp_image_get_filename (image);
|
||||
if (filename)
|
||||
{
|
||||
g_object_set_data_full (G_OBJECT (new_image), "gimp-image-dirname",
|
||||
g_path_get_dirname (filename),
|
||||
(GDestroyNotify) g_free);
|
||||
g_free (filename);
|
||||
}
|
||||
|
||||
/* Copy the colormap if necessary */
|
||||
if (new_image->base_type == GIMP_INDEXED)
|
||||
gimp_image_set_colormap (new_image,
|
||||
|
||||
@ -395,8 +395,17 @@ gimp_file_dialog_set_image (GimpFileDialog *dialog,
|
||||
basename = file_utils_uri_display_basename (uri);
|
||||
|
||||
if (dirname && strlen (dirname) && strcmp (dirname, "."))
|
||||
gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (dialog),
|
||||
dirname);
|
||||
{
|
||||
gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (dialog),
|
||||
dirname);
|
||||
}
|
||||
else if (g_object_get_data (G_OBJECT (image), "gimp-image-dirname"))
|
||||
{
|
||||
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog),
|
||||
g_object_get_data (G_OBJECT (image),
|
||||
"gimp-image-dirname"));
|
||||
}
|
||||
|
||||
|
||||
gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), basename);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user