2013-10-03 Disable Gimp Save&Export

Материал из YourcmcWiki
Перейти к: навигация, поиск

My post about gimp Save and Export to http://www.gimpusers.com/forums/gimp-user/14339-hate-the-new-save-vs-export-behavior#message74677

I want to say two things:

  1. The new behaviour is a TOTAL PIECE OF SHIT. And the authors are just MORONS because they argue that if you dislike it, you are an idiot, "misuse" gimp and should only use MSPAINT because of a low IQ. Just like it was with the single-window mode, yeah.
  2. But - Good news, everyone! That bevaviour really fucked me up and I got to the code and patched it. And the patch to DISABLE that piece of shit is very simple - you just need to comment out two if()'s in app/plug-in/gimppluginmanager-file.c (see below or get it from http://svn.yourcmc.ru/viewvc.py/vitalif/trunk/scripts/patch-gimp-unite-save_export.diff?view=co).

After patching, Gimp still suggests you to save the opened *.png or anything in XCF on Ctrl-S, but it does so only the FIRST time, and ALLOWS to actually select any other format.

Patch source:

Gimp authors are MORONS!

Shame on you all for splitting "Save" and "Export" features and
for arguing that everyone who dislikes the new behaviour is an
idiot and should use MSPAINT instead of their super-duper GIMP!

First part -- enable all formats in both save and export:

--- gimp-2.8.6.orig/app/plug-in/gimppluginmanager-file.c
+++ gimp-2.8.6/app/plug-in/gimppluginmanager-file.c
@@ -136,13 +136,13 @@ gimp_plug_in_manager_register_save_handl
   gimp_plug_in_procedure_set_file_proc (file_proc,
                                         extensions, prefixes, NULL);
 
-  if (file_procedure_in_group (file_proc, FILE_PROCEDURE_GROUP_SAVE))
+  //if (file_procedure_in_group (file_proc, FILE_PROCEDURE_GROUP_SAVE))
     {
       if (! g_slist_find (manager->save_procs, file_proc))
         manager->save_procs = g_slist_prepend (manager->save_procs, file_proc);
     }
 
-  if (file_procedure_in_group (file_proc, FILE_PROCEDURE_GROUP_EXPORT))
+  //if (file_procedure_in_group (file_proc, FILE_PROCEDURE_GROUP_EXPORT))
     {
       if (! g_slist_find (manager->export_procs, file_proc))
         manager->export_procs = g_slist_prepend (manager->export_procs, file_proc);

Second part -- do not suggest saving a non-xcf image into xcf format,
even on the first save click.

--- gimp-2.8.6.orig/app/actions/file-commands.c
+++ gimp-2.8.6/app/actions/file-commands.c
@@ -228,6 +228,9 @@ file_save_cmd_callback (GtkAction *actio
     return;
 
   uri = gimp_image_get_uri (image);
+  if (! uri)
+    uri = gimp_image_get_imported_uri (image);
+  uri = g_strdup (uri);
 
   switch (save_mode)
     {
@@ -348,6 +351,8 @@ file_save_cmd_callback (GtkAction *actio
     {
       gimp_display_close (display);
     }
+
+  g_free (uri);
 }
 
 void

Third part - suggest the same type as import/export by default.

--- gimp-2.8.6.orig/app/widgets/gimpfiledialog.c	2012-12-06 03:41:06.000000000 +0400
+++ gimp-2.8.6.orig/app/widgets/gimpfiledialog.c	2013-11-08 22:53:03.095326498 +0400
@@ -571,11 +571,19 @@ gimp_file_dialog_set_save_image (GimpFil
       /* Priority of default type/extension for Save:
        *
        *   1. Type of last Save
-       *   2. .xcf (which we don't explicitly append)
+       *   2. Type of last Export
+       *   3. Type of import source
+       *   4. .xcf (which we don't explicitly append)
        */
       ext_uri = gimp_image_get_uri (image);
 
       if (! ext_uri)
+        ext_uri = gimp_image_get_exported_uri (image);
+
+      if (! ext_uri)
+        ext_uri = gimp_image_get_imported_uri (image);
+
+      if (! ext_uri)
         ext_uri = "file:///we/only/care/about/extension.xcf";
     }
   else /* if (export) */

[ Хронологический вид ]Комментарии

(нет элементов)

Войдите, чтобы комментировать.