[gimp: 13/27] app: Implement 'File -> Export to'



commit 7a771a09d312a6ac96bad5b01c10b2472a4fce61
Author: Martin Nordholts <martinn src gnome org>
Date:   Sun Apr 26 17:44:10 2009 +0200

    app: Implement 'File -> Export to'
    
    Handle 'Export to' by finding a file proc based on the import URI and
    then save back to that location using the proc.
---
 app/actions/file-commands.c |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/app/actions/file-commands.c b/app/actions/file-commands.c
index b2c5839..0e2770d 100644
--- a/app/actions/file-commands.c
+++ b/app/actions/file-commands.c
@@ -283,7 +283,28 @@ file_save_cmd_callback (GtkAction *action,
       break;
 
     case GIMP_SAVE_MODE_EXPORT_TO:
-      /* TODO */
+      {
+        const gchar         *uri;
+        GimpPlugInProcedure *export_proc;
+
+        uri = g_object_get_data (G_OBJECT (image),
+                                       GIMP_FILE_EXPORT_TO_URI_KEY);
+        if (uri)
+          {
+            export_proc =
+              file_procedure_find (image->gimp->plug_in_manager->export_procs,
+                                   uri, NULL);
+          }
+
+        if (uri && export_proc)
+          {
+            saved = file_save_dialog_save_image (GIMP_PROGRESS (display),
+                                                 gimp, image, uri,
+                                                 export_proc,
+                                                 GIMP_RUN_WITH_LAST_VALS,
+                                                 FALSE, TRUE);
+          }
+      }
       break;
     }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]