2006-12-09 21:33:38 +00:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
2001-06-26 12:09:43 +00:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2009-01-17 22:28:01 +00:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
2001-06-26 12:09:43 +00:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-17 22:28:01 +00:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2001-06-26 12:09:43 +00:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2009-01-17 22:28:01 +00:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2001-06-26 12:09:43 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2003-04-03 17:50:56 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
2008-10-09 20:24:04 +00:00
|
|
|
#include <gegl.h>
|
2001-06-26 12:09:43 +00:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2001-07-09 17:58:56 +00:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
2004-04-20 13:25:55 +00:00
|
|
|
#include "actions-types.h"
|
2001-06-26 12:09:43 +00:00
|
|
|
|
2002-11-18 20:50:31 +00:00
|
|
|
#include "config/gimpguiconfig.h"
|
|
|
|
|
2001-10-17 11:33:43 +00:00
|
|
|
#include "core/gimp.h"
|
2001-10-23 16:23:32 +00:00
|
|
|
#include "core/gimpcontainer.h"
|
2001-07-09 17:58:56 +00:00
|
|
|
#include "core/gimpimage.h"
|
2004-08-10 18:47:21 +00:00
|
|
|
#include "core/gimpprogress.h"
|
2003-04-03 17:50:56 +00:00
|
|
|
#include "core/gimptemplate.h"
|
2001-07-09 17:58:56 +00:00
|
|
|
|
2006-04-28 22:26:51 +00:00
|
|
|
#include "plug-in/gimppluginmanager.h"
|
|
|
|
|
2001-10-25 13:30:01 +00:00
|
|
|
#include "file/file-open.h"
|
2007-05-11 18:50:35 +00:00
|
|
|
#include "file/file-procedure.h"
|
2001-10-25 13:30:01 +00:00
|
|
|
#include "file/file-save.h"
|
2002-04-19 14:09:53 +00:00
|
|
|
#include "file/file-utils.h"
|
2009-05-01 09:03:13 +02:00
|
|
|
#include "file/gimp-file.h"
|
2001-10-25 13:30:01 +00:00
|
|
|
|
2005-10-29 01:43:14 +00:00
|
|
|
#include "widgets/gimpactiongroup.h"
|
2004-09-09 09:47:33 +00:00
|
|
|
#include "widgets/gimpdialogfactory.h"
|
2004-09-13 16:01:52 +00:00
|
|
|
#include "widgets/gimpfiledialog.h"
|
2003-08-21 15:54:47 +00:00
|
|
|
#include "widgets/gimphelp-ids.h"
|
2004-10-13 15:27:00 +00:00
|
|
|
#include "widgets/gimpmessagebox.h"
|
|
|
|
#include "widgets/gimpmessagedialog.h"
|
2003-05-02 18:43:15 +00:00
|
|
|
|
2001-09-25 23:23:09 +00:00
|
|
|
#include "display/gimpdisplay.h"
|
2001-10-13 12:52:30 +00:00
|
|
|
#include "display/gimpdisplay-foreach.h"
|
2001-09-25 23:23:09 +00:00
|
|
|
|
2009-05-02 15:58:32 +02:00
|
|
|
#include "dialogs/file-save-dialog.h"
|
2004-04-20 13:25:55 +00:00
|
|
|
|
2004-05-03 14:03:51 +00:00
|
|
|
#include "actions.h"
|
2001-06-26 12:09:43 +00:00
|
|
|
#include "file-commands.h"
|
|
|
|
|
2003-03-25 16:38:19 +00:00
|
|
|
#include "gimp-intl.h"
|
2001-06-26 12:09:43 +00:00
|
|
|
|
|
|
|
|
2001-07-09 17:58:56 +00:00
|
|
|
#define REVERT_DATA_KEY "revert-confirm-dialog"
|
|
|
|
|
2002-12-10 16:38:16 +00:00
|
|
|
|
2001-07-09 17:58:56 +00:00
|
|
|
/* local function prototypes */
|
|
|
|
|
2009-04-26 17:22:56 +02:00
|
|
|
static void file_open_dialog_show (Gimp *gimp,
|
|
|
|
GtkWidget *parent,
|
|
|
|
const gchar *title,
|
|
|
|
GimpImage *image,
|
|
|
|
const gchar *uri,
|
|
|
|
gboolean open_as_layers);
|
2009-05-01 12:22:41 +02:00
|
|
|
static void file_save_dialog_show (Gimp *gimp,
|
|
|
|
GimpImage *image,
|
2009-04-26 17:22:56 +02:00
|
|
|
GtkWidget *parent,
|
|
|
|
const gchar *title,
|
|
|
|
gboolean save_a_copy,
|
2012-11-25 23:13:35 +09:00
|
|
|
gboolean close_after_saving,
|
|
|
|
GimpDisplay *display);
|
2009-04-25 10:54:56 +02:00
|
|
|
static void file_export_dialog_show (Gimp *gimp,
|
|
|
|
GimpImage *image,
|
|
|
|
GtkWidget *parent);
|
2009-04-26 17:22:56 +02:00
|
|
|
static void file_save_dialog_destroyed (GtkWidget *dialog,
|
|
|
|
GimpImage *image);
|
2009-04-25 10:54:56 +02:00
|
|
|
static void file_export_dialog_destroyed (GtkWidget *dialog,
|
|
|
|
GimpImage *image);
|
2009-04-26 17:22:56 +02:00
|
|
|
static void file_new_template_callback (GtkWidget *widget,
|
|
|
|
const gchar *name,
|
|
|
|
gpointer data);
|
|
|
|
static void file_revert_confirm_response (GtkWidget *dialog,
|
|
|
|
gint response_id,
|
|
|
|
GimpDisplay *display);
|
|
|
|
|
2001-07-09 17:58:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* public functions */
|
|
|
|
|
2007-01-15 19:48:36 +00:00
|
|
|
|
2001-06-26 12:09:43 +00:00
|
|
|
void
|
2004-05-25 12:02:54 +00:00
|
|
|
file_open_cmd_callback (GtkAction *action,
|
2004-06-30 16:01:05 +00:00
|
|
|
gpointer data)
|
2001-06-26 12:09:43 +00:00
|
|
|
{
|
2008-07-30 14:53:09 +00:00
|
|
|
Gimp *gimp;
|
2005-01-13 17:41:48 +00:00
|
|
|
GtkWidget *widget;
|
2008-10-05 15:21:02 +00:00
|
|
|
GimpImage *image;
|
2008-07-30 14:53:09 +00:00
|
|
|
return_if_no_gimp (gimp, data);
|
2004-04-29 12:52:29 +00:00
|
|
|
return_if_no_widget (widget, data);
|
2002-11-01 16:20:13 +00:00
|
|
|
|
2005-01-13 17:41:48 +00:00
|
|
|
image = action_data_get_image (data);
|
|
|
|
|
2008-10-05 15:21:02 +00:00
|
|
|
file_open_dialog_show (gimp, widget,
|
|
|
|
_("Open Image"),
|
|
|
|
image, NULL, FALSE);
|
2004-09-21 12:08:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2006-11-05 11:35:57 +00:00
|
|
|
file_open_as_layers_cmd_callback (GtkAction *action,
|
|
|
|
gpointer data)
|
2004-09-21 12:08:30 +00:00
|
|
|
{
|
2008-07-30 14:53:09 +00:00
|
|
|
Gimp *gimp;
|
2004-09-21 12:08:30 +00:00
|
|
|
GtkWidget *widget;
|
2008-10-05 15:21:02 +00:00
|
|
|
GimpDisplay *display;
|
|
|
|
GimpImage *image = NULL;
|
2008-07-30 14:53:09 +00:00
|
|
|
return_if_no_gimp (gimp, data);
|
2004-09-21 12:08:30 +00:00
|
|
|
return_if_no_widget (widget, data);
|
|
|
|
|
2008-10-05 15:21:02 +00:00
|
|
|
display = action_data_get_display (data);
|
|
|
|
|
|
|
|
if (display)
|
2009-10-06 19:20:44 +02:00
|
|
|
image = gimp_display_get_image (display);
|
2005-02-24 17:18:11 +00:00
|
|
|
|
2008-10-05 15:21:02 +00:00
|
|
|
file_open_dialog_show (gimp, widget,
|
|
|
|
_("Open Image as Layers"),
|
|
|
|
image, NULL, TRUE);
|
2001-06-26 12:09:43 +00:00
|
|
|
}
|
|
|
|
|
2004-05-31 14:40:10 +00:00
|
|
|
void
|
|
|
|
file_open_location_cmd_callback (GtkAction *action,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
GtkWidget *widget;
|
|
|
|
return_if_no_widget (widget, data);
|
|
|
|
|
2010-02-28 23:20:57 +01:00
|
|
|
gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
|
2004-09-09 09:47:33 +00:00
|
|
|
gtk_widget_get_screen (widget),
|
2010-05-16 12:19:18 +02:00
|
|
|
NULL /*ui_manager*/,
|
2004-09-09 09:47:33 +00:00
|
|
|
"gimp-file-open-location-dialog", -1, TRUE);
|
2004-05-31 14:40:10 +00:00
|
|
|
}
|
|
|
|
|
2001-06-29 19:25:03 +00:00
|
|
|
void
|
2008-03-25 09:33:28 +00:00
|
|
|
file_open_recent_cmd_callback (GtkAction *action,
|
2004-04-29 12:52:29 +00:00
|
|
|
gint value,
|
2004-06-30 16:01:05 +00:00
|
|
|
gpointer data)
|
2001-06-29 19:25:03 +00:00
|
|
|
{
|
2001-10-29 11:47:11 +00:00
|
|
|
Gimp *gimp;
|
2001-10-23 16:23:32 +00:00
|
|
|
GimpImagefile *imagefile;
|
2004-04-29 12:52:29 +00:00
|
|
|
gint num_entries;
|
2002-12-10 16:38:16 +00:00
|
|
|
return_if_no_gimp (gimp, data);
|
2001-10-29 11:47:11 +00:00
|
|
|
|
2008-11-20 22:45:19 +00:00
|
|
|
num_entries = gimp_container_get_n_children (gimp->documents);
|
2001-06-29 19:25:03 +00:00
|
|
|
|
2004-04-29 12:52:29 +00:00
|
|
|
if (value >= num_entries)
|
2001-06-29 19:25:03 +00:00
|
|
|
return;
|
|
|
|
|
2001-10-23 16:23:32 +00:00
|
|
|
imagefile = (GimpImagefile *)
|
2004-04-29 12:52:29 +00:00
|
|
|
gimp_container_get_child_by_index (gimp->documents, value);
|
2001-06-29 19:25:03 +00:00
|
|
|
|
2001-10-23 16:23:32 +00:00
|
|
|
if (imagefile)
|
2001-06-29 19:25:03 +00:00
|
|
|
{
|
2008-03-25 09:33:28 +00:00
|
|
|
GimpDisplay *display;
|
|
|
|
GimpProgress *progress;
|
2006-03-28 17:08:36 +00:00
|
|
|
GimpImage *image;
|
2003-03-05 11:25:59 +00:00
|
|
|
GimpPDBStatusType status;
|
|
|
|
GError *error = NULL;
|
2008-03-25 09:33:28 +00:00
|
|
|
return_if_no_display (display, data);
|
|
|
|
|
2008-10-21 07:51:08 +00:00
|
|
|
g_object_ref (display);
|
|
|
|
g_object_ref (imagefile);
|
|
|
|
|
2009-10-06 19:20:44 +02:00
|
|
|
progress = gimp_display_get_image (display) ?
|
|
|
|
NULL : GIMP_PROGRESS (display);
|
2003-03-05 11:25:59 +00:00
|
|
|
|
2006-03-28 17:08:36 +00:00
|
|
|
image = file_open_with_display (gimp, action_data_get_context (data),
|
2008-03-25 09:33:28 +00:00
|
|
|
progress,
|
2009-08-29 12:40:40 +02:00
|
|
|
gimp_object_get_name (imagefile), FALSE,
|
2006-07-12 06:10:52 +00:00
|
|
|
&status, &error);
|
2003-03-05 11:25:59 +00:00
|
|
|
|
2006-03-28 17:08:36 +00:00
|
|
|
if (! image && status != GIMP_PDB_CANCEL)
|
2003-03-05 11:25:59 +00:00
|
|
|
{
|
2005-10-01 22:43:22 +00:00
|
|
|
gchar *filename =
|
2009-08-29 12:40:40 +02:00
|
|
|
file_utils_uri_display_name (gimp_object_get_name (imagefile));
|
2003-03-05 11:25:59 +00:00
|
|
|
|
2008-03-25 09:33:28 +00:00
|
|
|
gimp_message (gimp, G_OBJECT (display), GIMP_MESSAGE_ERROR,
|
2006-10-09 08:17:22 +00:00
|
|
|
_("Opening '%s' failed:\n\n%s"),
|
|
|
|
filename, error->message);
|
2003-03-05 11:25:59 +00:00
|
|
|
g_clear_error (&error);
|
|
|
|
|
|
|
|
g_free (filename);
|
|
|
|
}
|
2008-10-21 07:51:08 +00:00
|
|
|
|
|
|
|
g_object_unref (imagefile);
|
|
|
|
g_object_unref (display);
|
2001-06-29 19:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-06-26 12:09:43 +00:00
|
|
|
void
|
2004-04-29 12:52:29 +00:00
|
|
|
file_save_cmd_callback (GtkAction *action,
|
2007-01-20 19:38:09 +00:00
|
|
|
gint value,
|
2004-06-30 16:01:05 +00:00
|
|
|
gpointer data)
|
2001-06-26 12:09:43 +00:00
|
|
|
{
|
2009-05-01 12:22:41 +02:00
|
|
|
Gimp *gimp;
|
2007-01-20 19:38:09 +00:00
|
|
|
GimpDisplay *display;
|
|
|
|
GimpImage *image;
|
|
|
|
GtkWidget *widget;
|
|
|
|
GimpSaveMode save_mode;
|
2008-08-15 07:38:32 +00:00
|
|
|
const gchar *uri;
|
2007-01-20 19:38:09 +00:00
|
|
|
gboolean saved = FALSE;
|
2009-05-01 12:22:41 +02:00
|
|
|
return_if_no_gimp (gimp, data);
|
2006-03-28 17:55:52 +00:00
|
|
|
return_if_no_display (display, data);
|
2007-01-20 19:38:09 +00:00
|
|
|
return_if_no_widget (widget, data);
|
2001-07-09 17:58:56 +00:00
|
|
|
|
2009-10-06 19:20:44 +02:00
|
|
|
image = gimp_display_get_image (display);
|
2005-02-13 18:05:43 +00:00
|
|
|
|
2007-01-20 19:38:09 +00:00
|
|
|
save_mode = (GimpSaveMode) value;
|
|
|
|
|
2007-07-19 14:59:51 +00:00
|
|
|
if (! gimp_image_get_active_drawable (image))
|
2004-10-23 19:13:17 +00:00
|
|
|
return;
|
2001-07-09 17:58:56 +00:00
|
|
|
|
2011-01-26 08:19:39 +01:00
|
|
|
uri = gimp_image_get_uri (image);
|
2008-08-15 07:38:32 +00:00
|
|
|
|
2007-01-20 19:38:09 +00:00
|
|
|
switch (save_mode)
|
2001-07-09 17:58:56 +00:00
|
|
|
{
|
2007-01-20 19:38:09 +00:00
|
|
|
case GIMP_SAVE_MODE_SAVE:
|
|
|
|
case GIMP_SAVE_MODE_SAVE_AND_CLOSE:
|
2008-08-15 07:38:32 +00:00
|
|
|
/* Only save if the image has been modified, or if it is new. */
|
2009-07-03 21:11:21 +02:00
|
|
|
if ((gimp_image_is_dirty (image) ||
|
2008-08-15 07:38:32 +00:00
|
|
|
! GIMP_GUI_CONFIG (image->gimp->config)->trust_dirty_flag) ||
|
|
|
|
uri == NULL)
|
2004-06-30 16:01:05 +00:00
|
|
|
{
|
2008-08-15 07:38:32 +00:00
|
|
|
GimpPlugInProcedure *save_proc = gimp_image_get_save_proc (image);
|
2001-07-09 17:58:56 +00:00
|
|
|
|
2007-01-20 19:38:09 +00:00
|
|
|
if (uri && ! save_proc)
|
2008-08-15 07:38:32 +00:00
|
|
|
{
|
|
|
|
save_proc =
|
|
|
|
file_procedure_find (image->gimp->plug_in_manager->save_procs,
|
|
|
|
uri, NULL);
|
|
|
|
}
|
2001-07-09 17:58:56 +00:00
|
|
|
|
2007-01-20 19:38:09 +00:00
|
|
|
if (uri && save_proc)
|
2006-10-09 08:17:22 +00:00
|
|
|
{
|
2009-05-02 15:58:32 +02:00
|
|
|
saved = file_save_dialog_save_image (GIMP_PROGRESS (display),
|
|
|
|
gimp, image, uri,
|
|
|
|
save_proc,
|
|
|
|
GIMP_RUN_WITH_LAST_VALS,
|
2012-05-18 18:48:51 +02:00
|
|
|
TRUE, FALSE, FALSE, TRUE);
|
2006-10-09 08:17:22 +00:00
|
|
|
break;
|
2004-06-30 16:01:05 +00:00
|
|
|
}
|
2005-10-29 01:43:14 +00:00
|
|
|
|
2007-01-20 19:38:09 +00:00
|
|
|
/* fall thru */
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-11-04 12:33:09 +00:00
|
|
|
gimp_message_literal (image->gimp,
|
|
|
|
G_OBJECT (display), GIMP_MESSAGE_INFO,
|
|
|
|
_("No changes need to be saved"));
|
2007-01-20 19:38:09 +00:00
|
|
|
saved = TRUE;
|
|
|
|
break;
|
2004-06-30 16:01:05 +00:00
|
|
|
}
|
2006-12-11 20:33:01 +00:00
|
|
|
|
2007-01-20 19:38:09 +00:00
|
|
|
case GIMP_SAVE_MODE_SAVE_AS:
|
2009-10-06 19:20:44 +02:00
|
|
|
file_save_dialog_show (gimp, image, widget,
|
2007-01-20 19:38:09 +00:00
|
|
|
_("Save Image"), FALSE,
|
2012-11-25 23:13:35 +09:00
|
|
|
save_mode == GIMP_SAVE_MODE_SAVE_AND_CLOSE, display);
|
2007-01-20 19:38:09 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_SAVE_MODE_SAVE_A_COPY:
|
2009-10-06 19:20:44 +02:00
|
|
|
file_save_dialog_show (gimp, image, widget,
|
2007-01-20 19:38:09 +00:00
|
|
|
_("Save a Copy of the Image"), TRUE,
|
2012-11-25 23:13:35 +09:00
|
|
|
FALSE, display);
|
2007-01-20 19:38:09 +00:00
|
|
|
break;
|
2009-04-23 18:59:40 +02:00
|
|
|
|
|
|
|
case GIMP_SAVE_MODE_EXPORT:
|
2009-10-06 19:20:44 +02:00
|
|
|
file_export_dialog_show (gimp, image, widget);
|
2009-04-25 10:54:56 +02:00
|
|
|
break;
|
|
|
|
|
2009-04-23 18:59:40 +02:00
|
|
|
case GIMP_SAVE_MODE_EXPORT_TO:
|
2011-06-30 23:44:50 +02:00
|
|
|
case GIMP_SAVE_MODE_OVERWRITE:
|
2009-04-26 17:44:10 +02:00
|
|
|
{
|
2011-07-05 17:39:41 +02:00
|
|
|
const gchar *uri = NULL;
|
2009-04-26 17:44:10 +02:00
|
|
|
GimpPlugInProcedure *export_proc;
|
2012-05-18 18:48:51 +02:00
|
|
|
gboolean overwrite;
|
2009-04-26 17:44:10 +02:00
|
|
|
|
2012-05-18 18:48:51 +02:00
|
|
|
if (save_mode == GIMP_SAVE_MODE_EXPORT_TO)
|
2011-06-30 23:44:50 +02:00
|
|
|
{
|
|
|
|
uri = gimp_image_get_exported_uri (image);
|
|
|
|
|
|
|
|
if (! uri)
|
|
|
|
{
|
|
|
|
/* Behave as if Export... was invoked */
|
|
|
|
file_export_dialog_show (gimp, image, widget);
|
|
|
|
break;
|
|
|
|
}
|
2012-05-18 18:48:51 +02:00
|
|
|
|
|
|
|
overwrite = FALSE;
|
2011-06-30 23:44:50 +02:00
|
|
|
}
|
|
|
|
else if (save_mode == GIMP_SAVE_MODE_OVERWRITE)
|
|
|
|
{
|
|
|
|
uri = gimp_image_get_imported_uri (image);
|
2012-05-18 18:48:51 +02:00
|
|
|
|
|
|
|
overwrite = TRUE;
|
2011-06-30 23:44:50 +02:00
|
|
|
}
|
2009-07-05 09:09:12 +02:00
|
|
|
|
2009-04-26 17:44:10 +02:00
|
|
|
if (uri)
|
|
|
|
{
|
|
|
|
export_proc =
|
|
|
|
file_procedure_find (image->gimp->plug_in_manager->export_procs,
|
|
|
|
uri, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (uri && export_proc)
|
|
|
|
{
|
2011-05-07 05:51:30 +05:30
|
|
|
char *uri_copy;
|
|
|
|
|
|
|
|
/* The memory that 'uri' points to can be freed by
|
|
|
|
file_save_dialog_save_image(), when it eventually calls
|
|
|
|
gimp_image_set_imported_uri() to reset the imported uri,
|
|
|
|
resulting in garbage. So make a duplicate of it here. */
|
|
|
|
|
|
|
|
uri_copy = g_strdup (uri);
|
|
|
|
|
2009-04-26 17:44:10 +02:00
|
|
|
saved = file_save_dialog_save_image (GIMP_PROGRESS (display),
|
2011-05-07 05:51:30 +05:30
|
|
|
gimp, image, uri_copy,
|
2009-04-26 17:44:10 +02:00
|
|
|
export_proc,
|
|
|
|
GIMP_RUN_WITH_LAST_VALS,
|
2012-05-18 18:48:51 +02:00
|
|
|
FALSE,
|
|
|
|
overwrite, ! overwrite,
|
|
|
|
TRUE);
|
2011-05-07 05:51:30 +05:30
|
|
|
g_free (uri_copy);
|
2009-04-26 17:44:10 +02:00
|
|
|
}
|
|
|
|
}
|
2009-04-23 18:59:40 +02:00
|
|
|
break;
|
2007-01-20 19:38:09 +00:00
|
|
|
}
|
2006-12-11 20:33:01 +00:00
|
|
|
|
2007-01-20 19:38:09 +00:00
|
|
|
if (save_mode == GIMP_SAVE_MODE_SAVE_AND_CLOSE &&
|
2009-07-03 21:11:21 +02:00
|
|
|
saved &&
|
2009-10-06 19:20:44 +02:00
|
|
|
! gimp_image_is_dirty (image))
|
2007-01-20 19:38:09 +00:00
|
|
|
{
|
2008-04-05 20:32:24 +00:00
|
|
|
gimp_display_close (display);
|
2007-01-20 19:38:09 +00:00
|
|
|
}
|
2006-12-11 20:33:01 +00:00
|
|
|
}
|
|
|
|
|
2003-04-03 17:50:56 +00:00
|
|
|
void
|
2009-04-26 08:24:02 +02:00
|
|
|
file_create_template_cmd_callback (GtkAction *action,
|
|
|
|
gpointer data)
|
2003-04-03 17:50:56 +00:00
|
|
|
{
|
2006-03-28 17:55:52 +00:00
|
|
|
GimpDisplay *display;
|
2009-10-06 19:20:44 +02:00
|
|
|
GimpImage *image;
|
2004-10-19 14:08:44 +00:00
|
|
|
GtkWidget *dialog;
|
2006-03-28 17:55:52 +00:00
|
|
|
return_if_no_display (display, data);
|
2003-04-03 17:50:56 +00:00
|
|
|
|
2009-10-06 19:20:44 +02:00
|
|
|
image = gimp_display_get_image (display);
|
|
|
|
|
2004-10-19 14:08:44 +00:00
|
|
|
dialog = gimp_query_string_box (_("Create New Template"),
|
2009-10-05 19:58:03 +02:00
|
|
|
GTK_WIDGET (gimp_display_get_shell (display)),
|
2004-10-19 14:08:44 +00:00
|
|
|
gimp_standard_help_func,
|
2009-04-26 08:24:02 +02:00
|
|
|
GIMP_HELP_FILE_CREATE_TEMPLATE,
|
2004-10-19 14:08:44 +00:00
|
|
|
_("Enter a name for this template"),
|
|
|
|
NULL,
|
2009-10-06 19:20:44 +02:00
|
|
|
G_OBJECT (image), "disconnect",
|
|
|
|
file_new_template_callback, image);
|
2004-10-19 14:08:44 +00:00
|
|
|
gtk_widget_show (dialog);
|
2003-04-03 17:50:56 +00:00
|
|
|
}
|
|
|
|
|
2001-06-26 12:09:43 +00:00
|
|
|
void
|
2004-04-29 12:52:29 +00:00
|
|
|
file_revert_cmd_callback (GtkAction *action,
|
2004-06-30 16:01:05 +00:00
|
|
|
gpointer data)
|
2001-06-26 12:09:43 +00:00
|
|
|
{
|
2006-03-28 17:55:52 +00:00
|
|
|
GimpDisplay *display;
|
2006-08-08 21:06:36 +00:00
|
|
|
GimpImage *image;
|
2004-10-13 15:27:00 +00:00
|
|
|
GtkWidget *dialog;
|
2012-07-14 00:11:17 +02:00
|
|
|
const gchar *uri;
|
2006-03-28 17:55:52 +00:00
|
|
|
return_if_no_display (display, data);
|
2001-07-09 17:58:56 +00:00
|
|
|
|
2009-10-06 19:20:44 +02:00
|
|
|
image = gimp_display_get_image (display);
|
2001-07-09 17:58:56 +00:00
|
|
|
|
2011-01-26 08:19:39 +01:00
|
|
|
uri = gimp_image_get_uri (image);
|
2006-08-08 21:06:36 +00:00
|
|
|
|
2009-04-26 13:00:25 +02:00
|
|
|
if (! uri)
|
2012-07-14 00:11:17 +02:00
|
|
|
uri = gimp_image_get_imported_uri (image);
|
2009-04-26 13:00:25 +02:00
|
|
|
|
2006-08-08 21:06:36 +00:00
|
|
|
dialog = g_object_get_data (G_OBJECT (image), REVERT_DATA_KEY);
|
2001-07-09 17:58:56 +00:00
|
|
|
|
2012-07-14 00:11:17 +02:00
|
|
|
if (! uri)
|
2001-07-09 17:58:56 +00:00
|
|
|
{
|
2008-11-04 12:33:09 +00:00
|
|
|
gimp_message_literal (image->gimp,
|
|
|
|
G_OBJECT (display), GIMP_MESSAGE_ERROR,
|
|
|
|
_("Revert failed. "
|
|
|
|
"No file name associated with this image."));
|
2001-07-09 17:58:56 +00:00
|
|
|
}
|
2004-10-13 15:27:00 +00:00
|
|
|
else if (dialog)
|
2001-07-09 17:58:56 +00:00
|
|
|
{
|
2004-10-13 15:27:00 +00:00
|
|
|
gtk_window_present (GTK_WINDOW (dialog));
|
2001-07-09 17:58:56 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-10-13 23:03:12 +00:00
|
|
|
gchar *filename;
|
2001-07-09 17:58:56 +00:00
|
|
|
|
2004-10-13 15:27:00 +00:00
|
|
|
dialog =
|
2007-09-25 14:03:33 +00:00
|
|
|
gimp_message_dialog_new (_("Revert Image"), GTK_STOCK_REVERT_TO_SAVED,
|
2009-10-05 19:58:03 +02:00
|
|
|
GTK_WIDGET (gimp_display_get_shell (display)),
|
|
|
|
0,
|
2004-10-13 15:27:00 +00:00
|
|
|
gimp_standard_help_func, GIMP_HELP_FILE_REVERT,
|
2001-08-29 17:48:28 +00:00
|
|
|
|
2004-10-13 15:27:00 +00:00
|
|
|
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
|
|
|
GTK_STOCK_REVERT_TO_SAVED, GTK_RESPONSE_OK,
|
2001-08-29 17:48:28 +00:00
|
|
|
|
2004-10-13 15:27:00 +00:00
|
|
|
NULL);
|
2001-07-09 17:58:56 +00:00
|
|
|
|
2005-09-27 18:51:44 +00:00
|
|
|
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
|
|
|
|
GTK_RESPONSE_OK,
|
|
|
|
GTK_RESPONSE_CANCEL,
|
|
|
|
-1);
|
2005-02-10 11:00:46 +00:00
|
|
|
|
2006-03-28 17:55:52 +00:00
|
|
|
g_signal_connect_object (display, "disconnect",
|
2004-10-13 15:27:00 +00:00
|
|
|
G_CALLBACK (gtk_widget_destroy),
|
|
|
|
dialog, G_CONNECT_SWAPPED);
|
2004-07-16 21:24:39 +00:00
|
|
|
|
2004-10-13 15:27:00 +00:00
|
|
|
g_signal_connect (dialog, "response",
|
|
|
|
G_CALLBACK (file_revert_confirm_response),
|
2006-03-28 17:55:52 +00:00
|
|
|
display);
|
2004-06-30 16:01:05 +00:00
|
|
|
|
2005-10-01 22:43:22 +00:00
|
|
|
filename = file_utils_uri_display_name (uri);
|
2004-10-13 23:03:12 +00:00
|
|
|
|
2004-10-13 15:27:00 +00:00
|
|
|
gimp_message_box_set_primary_text (GIMP_MESSAGE_DIALOG (dialog)->box,
|
|
|
|
_("Revert '%s' to '%s'?"),
|
2012-07-17 22:52:49 +02:00
|
|
|
gimp_image_get_display_name (image),
|
|
|
|
filename);
|
2004-10-13 23:03:12 +00:00
|
|
|
g_free (filename);
|
2004-10-13 15:27:00 +00:00
|
|
|
|
|
|
|
gimp_message_box_set_text (GIMP_MESSAGE_DIALOG (dialog)->box,
|
|
|
|
_("By reverting the image to the state saved "
|
|
|
|
"on disk, you will lose all changes, "
|
|
|
|
"including all undo information."));
|
2004-07-16 21:24:39 +00:00
|
|
|
|
2006-08-08 21:06:36 +00:00
|
|
|
g_object_set_data (G_OBJECT (image), REVERT_DATA_KEY, dialog);
|
2004-07-16 21:24:39 +00:00
|
|
|
|
2004-10-13 15:27:00 +00:00
|
|
|
gtk_widget_show (dialog);
|
2001-07-09 17:58:56 +00:00
|
|
|
}
|
2001-06-26 12:09:43 +00:00
|
|
|
}
|
|
|
|
|
2005-09-24 19:30:08 +00:00
|
|
|
void
|
|
|
|
file_close_all_cmd_callback (GtkAction *action,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
Gimp *gimp;
|
|
|
|
return_if_no_gimp (gimp, data);
|
|
|
|
|
|
|
|
if (! gimp_displays_dirty (gimp))
|
|
|
|
{
|
2008-04-05 20:32:24 +00:00
|
|
|
gimp_displays_close (gimp);
|
2005-09-24 19:30:08 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
GtkWidget *widget;
|
|
|
|
return_if_no_widget (widget, data);
|
|
|
|
|
2010-02-28 23:20:57 +01:00
|
|
|
gimp_dialog_factory_dialog_raise (gimp_dialog_factory_get_singleton (),
|
2005-09-24 19:30:08 +00:00
|
|
|
gtk_widget_get_screen (widget),
|
|
|
|
"gimp-close-all-dialog", -1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-06-26 12:09:43 +00:00
|
|
|
void
|
2004-04-29 12:52:29 +00:00
|
|
|
file_quit_cmd_callback (GtkAction *action,
|
2004-06-30 16:01:05 +00:00
|
|
|
gpointer data)
|
2001-06-26 12:09:43 +00:00
|
|
|
{
|
2002-12-10 16:38:16 +00:00
|
|
|
Gimp *gimp;
|
|
|
|
return_if_no_gimp (gimp, data);
|
|
|
|
|
|
|
|
gimp_exit (gimp, FALSE);
|
2001-06-26 12:09:43 +00:00
|
|
|
}
|
2001-07-09 17:58:56 +00:00
|
|
|
|
2003-01-10 17:55:53 +00:00
|
|
|
void
|
|
|
|
file_file_open_dialog (Gimp *gimp,
|
2003-11-09 22:05:37 +00:00
|
|
|
const gchar *uri,
|
|
|
|
GtkWidget *parent)
|
2004-09-13 19:33:07 +00:00
|
|
|
{
|
2008-10-05 15:21:02 +00:00
|
|
|
file_open_dialog_show (gimp, parent,
|
|
|
|
_("Open Image"),
|
|
|
|
NULL, uri, FALSE);
|
2004-09-13 19:33:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* private functions */
|
|
|
|
|
|
|
|
static void
|
2008-10-05 15:21:02 +00:00
|
|
|
file_open_dialog_show (Gimp *gimp,
|
|
|
|
GtkWidget *parent,
|
|
|
|
const gchar *title,
|
2006-03-28 17:08:36 +00:00
|
|
|
GimpImage *image,
|
2004-09-21 12:08:30 +00:00
|
|
|
const gchar *uri,
|
2006-11-05 11:35:57 +00:00
|
|
|
gboolean open_as_layers)
|
2003-01-10 17:55:53 +00:00
|
|
|
{
|
2004-09-13 16:01:52 +00:00
|
|
|
GtkWidget *dialog;
|
|
|
|
|
2010-02-28 23:20:57 +01:00
|
|
|
dialog = gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
|
2004-09-13 16:01:52 +00:00
|
|
|
gtk_widget_get_screen (parent),
|
2010-05-16 12:19:18 +02:00
|
|
|
NULL /*ui_manager*/,
|
2004-09-13 16:01:52 +00:00
|
|
|
"gimp-file-open-dialog", -1, FALSE);
|
|
|
|
|
|
|
|
if (dialog)
|
|
|
|
{
|
2008-10-05 15:21:02 +00:00
|
|
|
if (! uri && image)
|
2011-01-26 08:19:39 +01:00
|
|
|
uri = gimp_image_get_uri (image);
|
2008-10-05 15:21:02 +00:00
|
|
|
|
2008-07-30 14:53:09 +00:00
|
|
|
if (! uri)
|
2009-04-30 19:53:19 +02:00
|
|
|
uri = g_object_get_data (G_OBJECT (gimp), GIMP_FILE_OPEN_LAST_URI_KEY);
|
2008-07-30 14:53:09 +00:00
|
|
|
|
2005-01-13 17:41:48 +00:00
|
|
|
if (uri)
|
|
|
|
gtk_file_chooser_set_uri (GTK_FILE_CHOOSER (dialog), uri);
|
2012-12-15 00:34:15 +01:00
|
|
|
else if (gimp->default_folder)
|
|
|
|
gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (dialog),
|
|
|
|
gimp->default_folder);
|
2004-09-13 16:01:52 +00:00
|
|
|
|
2008-10-05 15:21:02 +00:00
|
|
|
gimp_file_dialog_set_open_image (GIMP_FILE_DIALOG (dialog),
|
|
|
|
image, open_as_layers);
|
2004-09-21 12:08:30 +00:00
|
|
|
|
2012-11-14 16:43:06 +01:00
|
|
|
gtk_window_set_transient_for (GTK_WINDOW (dialog),
|
|
|
|
GTK_WINDOW (gtk_widget_get_toplevel (parent)));
|
2005-05-18 21:01:51 +00:00
|
|
|
|
2004-09-13 16:01:52 +00:00
|
|
|
gtk_window_present (GTK_WINDOW (dialog));
|
|
|
|
}
|
2003-01-10 17:55:53 +00:00
|
|
|
}
|
2001-07-09 17:58:56 +00:00
|
|
|
|
2004-09-13 19:33:07 +00:00
|
|
|
static void
|
2009-05-01 12:22:41 +02:00
|
|
|
file_save_dialog_show (Gimp *gimp,
|
|
|
|
GimpImage *image,
|
2004-09-13 19:33:07 +00:00
|
|
|
GtkWidget *parent,
|
|
|
|
const gchar *title,
|
2007-01-20 19:38:09 +00:00
|
|
|
gboolean save_a_copy,
|
2012-11-25 23:13:35 +09:00
|
|
|
gboolean close_after_saving,
|
|
|
|
GimpDisplay *display)
|
2004-09-13 19:33:07 +00:00
|
|
|
{
|
|
|
|
GtkWidget *dialog;
|
2003-04-03 17:50:56 +00:00
|
|
|
|
2006-03-28 17:08:36 +00:00
|
|
|
dialog = g_object_get_data (G_OBJECT (image), "gimp-file-save-dialog");
|
2004-09-13 19:33:07 +00:00
|
|
|
|
|
|
|
if (! dialog)
|
|
|
|
{
|
2010-02-28 23:20:57 +01:00
|
|
|
dialog = gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
|
2004-09-13 19:33:07 +00:00
|
|
|
gtk_widget_get_screen (parent),
|
2010-05-16 12:19:18 +02:00
|
|
|
NULL /*ui_manager*/,
|
2004-09-13 19:33:07 +00:00
|
|
|
"gimp-file-save-dialog",
|
|
|
|
-1, FALSE);
|
|
|
|
|
|
|
|
if (dialog)
|
|
|
|
{
|
2005-05-18 21:01:51 +00:00
|
|
|
gtk_window_set_transient_for (GTK_WINDOW (dialog),
|
2012-11-14 16:42:05 +01:00
|
|
|
GTK_WINDOW (gtk_widget_get_toplevel (parent)));
|
2005-05-18 21:01:51 +00:00
|
|
|
|
2006-03-28 17:08:36 +00:00
|
|
|
g_object_set_data_full (G_OBJECT (image),
|
2004-09-13 19:33:07 +00:00
|
|
|
"gimp-file-save-dialog", dialog,
|
|
|
|
(GDestroyNotify) gtk_widget_destroy);
|
|
|
|
g_signal_connect (dialog, "destroy",
|
|
|
|
G_CALLBACK (file_save_dialog_destroyed),
|
2006-03-28 17:08:36 +00:00
|
|
|
image);
|
2004-09-13 19:33:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dialog)
|
|
|
|
{
|
|
|
|
gtk_window_set_title (GTK_WINDOW (dialog), title);
|
|
|
|
|
2008-10-05 15:21:02 +00:00
|
|
|
gimp_file_dialog_set_save_image (GIMP_FILE_DIALOG (dialog),
|
2009-04-25 10:51:07 +02:00
|
|
|
gimp, image, save_a_copy, FALSE,
|
2012-11-25 23:13:35 +09:00
|
|
|
close_after_saving, GIMP_OBJECT (display));
|
2004-09-13 19:33:07 +00:00
|
|
|
|
|
|
|
gtk_window_present (GTK_WINDOW (dialog));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
file_save_dialog_destroyed (GtkWidget *dialog,
|
2006-03-28 17:08:36 +00:00
|
|
|
GimpImage *image)
|
2004-09-13 19:33:07 +00:00
|
|
|
{
|
2006-03-28 17:08:36 +00:00
|
|
|
if (GIMP_FILE_DIALOG (dialog)->image == image)
|
|
|
|
g_object_set_data (G_OBJECT (image), "gimp-file-save-dialog", NULL);
|
2004-09-13 19:33:07 +00:00
|
|
|
}
|
2001-07-09 17:58:56 +00:00
|
|
|
|
2009-04-25 10:54:56 +02:00
|
|
|
static void
|
|
|
|
file_export_dialog_show (Gimp *gimp,
|
|
|
|
GimpImage *image,
|
|
|
|
GtkWidget *parent)
|
|
|
|
{
|
|
|
|
GtkWidget *dialog;
|
|
|
|
|
|
|
|
dialog = g_object_get_data (G_OBJECT (image), "gimp-file-export-dialog");
|
|
|
|
|
|
|
|
if (! dialog)
|
|
|
|
{
|
2010-02-28 23:20:57 +01:00
|
|
|
dialog = gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
|
2009-04-25 10:54:56 +02:00
|
|
|
gtk_widget_get_screen (parent),
|
2010-05-16 12:19:18 +02:00
|
|
|
NULL /*ui_manager*/,
|
2009-04-25 10:54:56 +02:00
|
|
|
"gimp-file-export-dialog",
|
|
|
|
-1, FALSE);
|
|
|
|
|
|
|
|
if (dialog)
|
|
|
|
{
|
|
|
|
gtk_window_set_transient_for (GTK_WINDOW (dialog),
|
2012-11-14 16:42:05 +01:00
|
|
|
GTK_WINDOW (gtk_widget_get_toplevel (parent)));
|
2009-04-25 10:54:56 +02:00
|
|
|
|
|
|
|
g_object_set_data_full (G_OBJECT (image),
|
|
|
|
"gimp-file-export-dialog", dialog,
|
|
|
|
(GDestroyNotify) gtk_widget_destroy);
|
|
|
|
g_signal_connect (dialog, "destroy",
|
|
|
|
G_CALLBACK (file_export_dialog_destroyed),
|
|
|
|
image);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dialog)
|
|
|
|
{
|
|
|
|
gimp_file_dialog_set_save_image (GIMP_FILE_DIALOG (dialog),
|
|
|
|
gimp,
|
|
|
|
image,
|
|
|
|
FALSE,
|
|
|
|
TRUE,
|
2012-11-25 23:13:35 +09:00
|
|
|
FALSE,
|
|
|
|
NULL);
|
2009-04-25 10:54:56 +02:00
|
|
|
|
|
|
|
gtk_window_present (GTK_WINDOW (dialog));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
file_export_dialog_destroyed (GtkWidget *dialog,
|
|
|
|
GimpImage *image)
|
|
|
|
{
|
|
|
|
if (GIMP_FILE_DIALOG (dialog)->image == image)
|
|
|
|
g_object_set_data (G_OBJECT (image), "gimp-file-export-dialog", NULL);
|
|
|
|
}
|
|
|
|
|
2003-04-03 17:50:56 +00:00
|
|
|
static void
|
2003-09-05 01:40:29 +00:00
|
|
|
file_new_template_callback (GtkWidget *widget,
|
|
|
|
const gchar *name,
|
|
|
|
gpointer data)
|
2003-04-03 17:50:56 +00:00
|
|
|
{
|
|
|
|
GimpTemplate *template;
|
2006-03-28 17:08:36 +00:00
|
|
|
GimpImage *image;
|
2003-04-03 17:50:56 +00:00
|
|
|
|
2006-03-28 17:08:36 +00:00
|
|
|
image = (GimpImage *) data;
|
2003-04-03 17:50:56 +00:00
|
|
|
|
|
|
|
if (! (name && strlen (name)))
|
|
|
|
name = _("(Unnamed Template)");
|
|
|
|
|
|
|
|
template = gimp_template_new (name);
|
2006-03-28 17:08:36 +00:00
|
|
|
gimp_template_set_from_image (template, image);
|
|
|
|
gimp_container_add (image->gimp->templates, GIMP_OBJECT (template));
|
2003-04-03 17:50:56 +00:00
|
|
|
g_object_unref (template);
|
|
|
|
}
|
|
|
|
|
2001-07-09 17:58:56 +00:00
|
|
|
static void
|
2004-10-13 15:27:00 +00:00
|
|
|
file_revert_confirm_response (GtkWidget *dialog,
|
|
|
|
gint response_id,
|
2006-03-28 17:55:52 +00:00
|
|
|
GimpDisplay *display)
|
2001-07-09 17:58:56 +00:00
|
|
|
{
|
2009-10-06 19:20:44 +02:00
|
|
|
GimpImage *old_image = gimp_display_get_image (display);
|
2004-10-13 15:27:00 +00:00
|
|
|
|
|
|
|
gtk_widget_destroy (dialog);
|
2001-07-09 17:58:56 +00:00
|
|
|
|
2006-03-28 17:08:36 +00:00
|
|
|
g_object_set_data (G_OBJECT (old_image), REVERT_DATA_KEY, NULL);
|
2001-07-09 17:58:56 +00:00
|
|
|
|
2004-10-13 15:27:00 +00:00
|
|
|
if (response_id == GTK_RESPONSE_OK)
|
2001-07-09 17:58:56 +00:00
|
|
|
{
|
2006-03-28 17:08:36 +00:00
|
|
|
Gimp *gimp = old_image->gimp;
|
|
|
|
GimpImage *new_image;
|
2002-04-14 14:38:55 +00:00
|
|
|
const gchar *uri;
|
2001-10-29 11:47:11 +00:00
|
|
|
GimpPDBStatusType status;
|
2002-04-19 14:09:53 +00:00
|
|
|
GError *error = NULL;
|
2001-07-09 17:58:56 +00:00
|
|
|
|
2011-01-26 08:19:39 +01:00
|
|
|
uri = gimp_image_get_uri (old_image);
|
2001-07-09 17:58:56 +00:00
|
|
|
|
2009-04-26 13:00:25 +02:00
|
|
|
if (! uri)
|
2011-01-26 20:45:32 +01:00
|
|
|
uri = gimp_image_get_imported_uri (old_image);
|
2009-04-26 13:00:25 +02:00
|
|
|
|
2006-03-28 17:08:36 +00:00
|
|
|
new_image = file_open_image (gimp, gimp_get_user_context (gimp),
|
2006-07-12 06:10:52 +00:00
|
|
|
GIMP_PROGRESS (display),
|
2007-04-17 15:54:01 +00:00
|
|
|
uri, uri, FALSE, NULL,
|
2006-07-12 06:10:52 +00:00
|
|
|
GIMP_RUN_INTERACTIVE,
|
|
|
|
&status, NULL, &error);
|
2001-07-09 17:58:56 +00:00
|
|
|
|
2006-03-28 17:08:36 +00:00
|
|
|
if (new_image)
|
2004-06-30 16:01:05 +00:00
|
|
|
{
|
2006-03-28 17:08:36 +00:00
|
|
|
gimp_displays_reconnect (gimp, old_image, new_image);
|
|
|
|
gimp_image_flush (new_image);
|
2003-05-17 16:34:30 +00:00
|
|
|
|
|
|
|
/* the displays own the image now */
|
2006-03-28 17:08:36 +00:00
|
|
|
g_object_unref (new_image);
|
2004-06-30 16:01:05 +00:00
|
|
|
}
|
2001-07-09 17:58:56 +00:00
|
|
|
else if (status != GIMP_PDB_CANCEL)
|
2004-06-30 16:01:05 +00:00
|
|
|
{
|
2006-03-06 17:35:40 +00:00
|
|
|
gchar *filename = file_utils_uri_display_name (uri);
|
2002-04-19 14:09:53 +00:00
|
|
|
|
2006-10-09 08:17:22 +00:00
|
|
|
gimp_message (gimp, G_OBJECT (display), GIMP_MESSAGE_ERROR,
|
2006-08-08 21:06:36 +00:00
|
|
|
_("Reverting to '%s' failed:\n\n%s"),
|
|
|
|
filename, error->message);
|
2003-03-05 11:25:59 +00:00
|
|
|
g_clear_error (&error);
|
2002-04-19 14:09:53 +00:00
|
|
|
|
|
|
|
g_free (filename);
|
2004-06-30 16:01:05 +00:00
|
|
|
}
|
2001-07-09 17:58:56 +00:00
|
|
|
}
|
|
|
|
}
|