[gimp/osx-build: 29/31] Hide the help browser selection listbox if no help browser is installed



commit 7098c81dc484f8e9d384bc6fc0a99ba01a92e4c8
Author: Sven Claussner <sclaussner src gnome org>
Date:   Sun May 25 12:43:21 2014 +0200

    Hide the help browser selection listbox if no help browser is installed
    
    If we have the internal help browser not installed (e.g. because of
    missing WebKit) it makes no sense to offer it as an ever-failing option
    to the user. Thus hide it and use the external web browser by default
    then.
    
    Based on a patch by Simone Karin Lehmann.

 app/dialogs/preferences-dialog.c    |   26 ++++++++++++++++++++------
 app/pdb/gimppdb.c                   |   10 ++++++++++
 build/osx/custom/gimprc             |   13 -------------
 build/osx/gimp-2.8-python.bundle    |   22 ++++++++++++++++------
 build/osx/gimp-master-python.bundle |   22 ++++++++++++++++------
 5 files changed, 62 insertions(+), 31 deletions(-)
---
diff --git a/app/dialogs/preferences-dialog.c b/app/dialogs/preferences-dialog.c
index 259a5ee..d409709 100644
--- a/app/dialogs/preferences-dialog.c
+++ b/app/dialogs/preferences-dialog.c
@@ -34,6 +34,8 @@
 #include "core/gimplist.h"
 #include "core/gimptemplate.h"
 
+#include "pdb/gimppdb.h"
+
 #include "widgets/gimpcolorpanel.h"
 #include "widgets/gimpcontainercombobox.h"
 #include "widgets/gimpcontainerview.h"
@@ -1347,6 +1349,15 @@ prefs_message (GtkMessageType  type,
   gtk_widget_show (dialog);
 }
 
+/**
+ * prefs_dialog_new:
+ * @gimp:  the GIMP instance
+ * @config: the configuration model
+ *
+ * build the Preferences dialog
+ *
+ * TODO: split into smaller, easy maintainable pieces
+ */
 static GtkWidget *
 prefs_dialog_new (Gimp       *gimp,
                   GimpConfig *config)
@@ -1828,12 +1839,15 @@ prefs_dialog_new (Gimp       *gimp,
   }
 
   /*  Help Browser  */
-  vbox2 = prefs_frame_new (_("Help Browser"), GTK_CONTAINER (vbox), FALSE);
-  table = prefs_table_new (1, GTK_CONTAINER (vbox2));
-
-  prefs_enum_combo_box_add (object, "help-browser", 0, 0,
-                            _("H_elp browser to use:"),
-                            GTK_TABLE (table), 0, size_group);
+  if (gimp_pdb_lookup_procedure (gimp->pdb,
+                                 "extension-gimp-help-browser")) {
+    vbox2 = prefs_frame_new (_("Help Browser"), GTK_CONTAINER (vbox), FALSE);
+    table = prefs_table_new (1, GTK_CONTAINER (vbox2));
+
+    prefs_enum_combo_box_add (object, "help-browser", 0, 0,
+                              _("H_elp browser to use:"),
+                              GTK_TABLE (table), 0, size_group);
+  }
 
   g_object_unref (size_group);
   size_group = NULL;
diff --git a/app/pdb/gimppdb.c b/app/pdb/gimppdb.c
index db00c22..25fa909 100644
--- a/app/pdb/gimppdb.c
+++ b/app/pdb/gimppdb.c
@@ -238,6 +238,16 @@ gimp_pdb_unregister_procedure (GimpPDB       *pdb,
                  procedure);
 }
 
+/**
+ * gimp_pdb_lookup_procedure:
+ * @pdb    the Plug-in Database to query
+ * @name name of the requested procedure
+ *
+ * Returns: a pointer to the struct with procedure data
+ *
+ * Look up the plug-in database for a procedure with
+ * the given name.
+ */
 GimpProcedure *
 gimp_pdb_lookup_procedure (GimpPDB     *pdb,
                            const gchar *name)
diff --git a/build/osx/custom/gimprc b/build/osx/custom/gimprc
index a25f3df..112eafe 100644
--- a/build/osx/custom/gimprc
+++ b/build/osx/custom/gimprc
@@ -1,16 +1,3 @@
-(dock-window-hint normal)
-
-# Sets the browser used by the help system.  
-# Because the OS X build doesn't ship with WebKit, we use the system's
-# web browser by default:
-(help-browser web-browser)
-
-# Because the user manual is not shipped with GIMP by default, we first try to
-# access the online help.
-(user-manual-online yes)
-
-# The location of the online user manual. 
-(user-manual-online-uri "http://docs.gimp.org/2.8";)
 # This is the system-wide gimprc file.  Any change made in this file will
 # affect all users of this system, provided that they are not overriding the
 # default values in their personal gimprc file.
diff --git a/build/osx/gimp-2.8-python.bundle b/build/osx/gimp-2.8-python.bundle
index 37617a4..bbcdbd5 100644
--- a/build/osx/gimp-2.8-python.bundle
+++ b/build/osx/gimp-2.8-python.bundle
@@ -197,8 +197,22 @@
        <data>${prefix}/etc/fonts/fonts.conf</data>
 
        <!-- GIMP data -->
-       <data>${prefix}/etc/gimp/2.0/*</data>
-       <data dest="${bundle}/Contents/Resources/share/gimp">${prefix}/share/gimp</data>
+       <data dest="${bundle}/Contents/Resources/share/gimp">
+               ${prefix}/share/gimp
+       </data>
+       <!-- We have to copy the files from gimp/2.0 one by one, otherwise gtk-mac-bundler 
+               overwrites the platform specific custom modifications with the unadapted 
+               files -->
+       <data>${prefix}/etc/gimp/2.0/controllerrc</data>
+       <data>${prefix}/etc/gimp/2.0/gtkrc</data>
+       <data>${prefix}/etc/gimp/2.0/menurc</data>
+       <data>${prefix}/etc/gimp/2.0/sessionrc</data>
+       <data>${prefix}/etc/gimp/2.0/templaterc</data>
+       <data>${prefix}/etc/gimp/2.0/unitrc</data>
+       <!-- take GIMP's own defaults platform specific adaptions -->
+       <data dest="${bundle}/Contents/Resources/etc/gimp/2.0/gimprc">
+               ${project}/custom/gimprc
+       </data>
 
        <!-- Copy in XML data -->
        <data>${prefix}/etc/xml/catalog</data>
@@ -214,10 +228,6 @@
                ${project}/custom/gtkrc
        </data>
 
-       <!-- Copy in better defaults -->
-       <data dest="${bundle}/Contents/Resources/etc/gimp/2.0/gimprc">
-               ${project}/custom/gimprc
-       </data>
 
        <!-- Copy in better FontConfig defaults -->
        <!--<data dest="${bundle}/Contents/Resources/etc/fonts/fonts.conf"> ${project}/custom/fonts.conf 
diff --git a/build/osx/gimp-master-python.bundle b/build/osx/gimp-master-python.bundle
index 2536c2c..796c33b 100755
--- a/build/osx/gimp-master-python.bundle
+++ b/build/osx/gimp-master-python.bundle
@@ -199,8 +199,22 @@
        <data>${prefix}/etc/fonts/fonts.conf</data>
 
        <!-- GIMP data -->
-       <data>${prefix}/etc/gimp/2.0/*</data>
-       <data dest="${bundle}/Contents/Resources/share/gimp">${prefix}/share/gimp</data>
+       <data dest="${bundle}/Contents/Resources/share/gimp">
+               ${prefix}/share/gimp
+       </data>
+       <!-- We have to copy the files from gimp/2.0 one by one, otherwise gtk-mac-bundler 
+               overwrites the platform specific custom modifications with the unadapted 
+               files -->
+       <data>${prefix}/etc/gimp/2.0/controllerrc</data>
+       <data>${prefix}/etc/gimp/2.0/gtkrc</data>
+       <data>${prefix}/etc/gimp/2.0/menurc</data>
+       <data>${prefix}/etc/gimp/2.0/sessionrc</data>
+       <data>${prefix}/etc/gimp/2.0/templaterc</data>
+       <data>${prefix}/etc/gimp/2.0/unitrc</data>
+       <!-- take GIMP's own defaults platform specific adaptions -->
+       <data dest="${bundle}/Contents/Resources/etc/gimp/2.0/gimprc">
+               ${project}/custom/gimprc
+       </data>
 
        <!-- Copy in XML data -->
        <data>${prefix}/etc/xml/catalog</data>
@@ -216,10 +230,6 @@
                ${project}/custom/gtkrc
        </data>
 
-       <!-- Copy in better defaults -->
-       <data dest="${bundle}/Contents/Resources/etc/gimp/2.0/gimprc">
-               ${project}/custom/gimprc
-       </data>
 
        <!-- Copy in better FontConfig defaults -->
        <!--<data dest="${bundle}/Contents/Resources/etc/fonts/fonts.conf"> ${project}/custom/fonts.conf 


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