[gimp/gimp-2-10] app: show playground if any of the experimental feature is enabled.



commit a897b48921f41415c4bf1344b1716efecffaa85a
Author: Jehan <jehan girinstud io>
Date:   Fri Jul 17 13:21:43 2020 +0200

    app: show playground if any of the experimental feature is enabled.
    
    Basically if you enabled OpenCL or any of the experimental tools, it
    will show the Playground in Preferences. Otherwise, say you enabled some
    experimental feature months ago (e.g. with the CLI option) and you now
    experience crashes or whatnot. And you forgot how to change it, and only
    remembered that there was something in Preferences. It would make you
    crazy to not find the tab again to disable the option.
    
    This is even more important as OpenCL is moving from a normal option to
    a playground option. So you might not even have ever seen the Playground
    tab in Preferences and would not know how to disable OpenCL after you
    enabled it originally in "System Resources" tab.
    
    So now Playground is visible with any of these 3 conditions:
    * If you use an unstable version.
    * If you run GIMP with --show-playground option.
    * If you previously enabled one of the playground options.
    
    (cherry picked from commit d3ef6cfb1841f5215a64e184abec5ca2dc21f888)

 app/core/gimp.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
---
diff --git a/app/core/gimp.c b/app/core/gimp.c
index c17eea52b3..ede44fedee 100644
--- a/app/core/gimp.c
+++ b/app/core/gimp.c
@@ -762,6 +762,34 @@ gimp_load_config (Gimp  *gimp,
   g_signal_connect_object (gimp->edit_config, "notify",
                            G_CALLBACK (gimp_edit_config_notify),
                            gimp->config, 0);
+
+  if (! gimp->show_playground)
+    {
+      gboolean    use_opencl;
+      gboolean    use_npd_tool;
+      gboolean    use_seamless_clone_tool;
+
+      /* Playground preferences is shown by default for unstable
+       * versions and if the associated CLI option was set. Additionally
+       * we want to show it if any of the playground options had been
+       * enabled. Otherwise you might end up getting blocked with a
+       * playground feature and forget where you can even disable it.
+       *
+       * Also we check this once at start when loading config, and not
+       * inside preferences-dialog.c because we don't want to end up
+       * with inconsistent behavior where you open once the Preferences,
+       * deactivate features, then back to preferences and the tab is
+       * gone.
+       */
+
+      g_object_get (gimp->edit_config,
+                    "use-opencl",                     &use_opencl,
+                    "playground-npd-tool",            &use_npd_tool,
+                    "playground-seamless-clone-tool", &use_seamless_clone_tool,
+                    NULL);
+      if (use_opencl || use_npd_tool || use_seamless_clone_tool)
+        gimp->show_playground = TRUE;
+    }
 }
 
 void


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