[gimp] app, libgimp*: remove the config option to disable tooltips



commit b36205176e6a9bf48ee152572c3c1e7e46daa1a0
Author: Michael Natterer <mitch gimp org>
Date:   Wed Jun 6 19:20:32 2018 +0200

    app, libgimp*: remove the config option to disable tooltips
    
    Also remove all traces of it from the plug-in protocol and raise the
    protocol version to 0x0100 (we now allow features and therefore
    version bumps in stable, and the master protocol version should always
    be higher). Fix the code that aborts plug-in startup on protocol
    version mismatch, we can't use gimp_message() because we have no
    protocol.

 app/config/gimpguiconfig.c           | 15 ---------
 app/config/gimpguiconfig.h           |  1 -
 app/dialogs/preferences-dialog.c     |  3 --
 app/gui/gui.c                        | 21 ------------
 app/plug-in/gimppluginmanager-call.c |  1 -
 libgimp/gimp.c                       | 43 ++++++++----------------
 libgimp/gimp.def                     |  1 -
 libgimp/gimp.h                       |  1 -
 libgimp/gimpui.c                     |  3 --
 libgimpbase/gimpprotocol.c           |  7 ----
 libgimpbase/gimpprotocol.h           |  3 +-
 libgimpwidgets/gimphelpui.c          | 64 ++++--------------------------------
 libgimpwidgets/gimphelpui.h          |  3 --
 libgimpwidgets/gimpwidgets.def       |  2 --
 14 files changed, 20 insertions(+), 148 deletions(-)
---
diff --git a/app/config/gimpguiconfig.c b/app/config/gimpguiconfig.c
index 2916b8f17b..8653609ea5 100644
--- a/app/config/gimpguiconfig.c
+++ b/app/config/gimpguiconfig.c
@@ -57,7 +57,6 @@ enum
   PROP_RESTORE_SESSION,
   PROP_RESTORE_MONITOR,
   PROP_SAVE_TOOL_OPTIONS,
-  PROP_SHOW_TOOLTIPS,
   PROP_CAN_CHANGE_ACCELS,
   PROP_SAVE_ACCELS,
   PROP_RESTORE_ACCELS,
@@ -205,14 +204,6 @@ gimp_gui_config_class_init (GimpGuiConfigClass *klass)
                             TRUE,
                             GIMP_PARAM_STATIC_STRINGS);
 
-  GIMP_CONFIG_PROP_BOOLEAN (object_class, PROP_SHOW_TOOLTIPS,
-                            "show-tooltips",
-                            "Show tooltips",
-                            SHOW_TOOLTIPS_BLURB,
-                            TRUE,
-                            GIMP_PARAM_STATIC_STRINGS |
-                            GIMP_CONFIG_PARAM_RESTART);
-
   GIMP_CONFIG_PROP_BOOLEAN (object_class, PROP_CAN_CHANGE_ACCELS,
                             "can-change-accels",
                             "Can change accelerators",
@@ -575,9 +566,6 @@ gimp_gui_config_set_property (GObject      *object,
     case PROP_SAVE_TOOL_OPTIONS:
       gui_config->save_tool_options = g_value_get_boolean (value);
       break;
-    case PROP_SHOW_TOOLTIPS:
-      gui_config->show_tooltips = g_value_get_boolean (value);
-      break;
     case PROP_CAN_CHANGE_ACCELS:
       gui_config->can_change_accels = g_value_get_boolean (value);
       break;
@@ -738,9 +726,6 @@ gimp_gui_config_get_property (GObject    *object,
     case PROP_SAVE_TOOL_OPTIONS:
       g_value_set_boolean (value, gui_config->save_tool_options);
       break;
-    case PROP_SHOW_TOOLTIPS:
-      g_value_set_boolean (value, gui_config->show_tooltips);
-      break;
     case PROP_CAN_CHANGE_ACCELS:
       g_value_set_boolean (value, gui_config->can_change_accels);
       break;
diff --git a/app/config/gimpguiconfig.h b/app/config/gimpguiconfig.h
index a22c923bd8..3dcb2f01b5 100644
--- a/app/config/gimpguiconfig.h
+++ b/app/config/gimpguiconfig.h
@@ -52,7 +52,6 @@ struct _GimpGuiConfig
   gboolean             restore_session;
   gboolean             restore_monitor;
   gboolean             save_tool_options;
-  gboolean             show_tooltips;
   gboolean             can_change_accels;
   gboolean             save_accels;
   gboolean             restore_accels;
diff --git a/app/dialogs/preferences-dialog.c b/app/dialogs/preferences-dialog.c
index dfe8d1fa10..2670ee4da6 100644
--- a/app/dialogs/preferences-dialog.c
+++ b/app/dialogs/preferences-dialog.c
@@ -2392,9 +2392,6 @@ prefs_dialog_new (Gimp       *gimp,
   /*  General  */
   vbox2 = prefs_frame_new (_("General"), GTK_CONTAINER (vbox), FALSE);
 
-  prefs_check_button_add (object, "show-tooltips",
-                          _("Show _tooltips"),
-                          GTK_BOX (vbox2));
   prefs_check_button_add (object, "show-help-button",
                           _("Show help _buttons"),
                           GTK_BOX (vbox2));
diff --git a/app/gui/gui.c b/app/gui/gui.c
index 5dbc6ea9e5..ff8f661edd 100644
--- a/app/gui/gui.c
+++ b/app/gui/gui.c
@@ -465,13 +465,6 @@ gui_restore_callback (Gimp               *gimp,
 
   gui_vtable_init (gimp);
 
-  if (! gui_config->show_tooltips)
-    gimp_help_disable_tooltips ();
-
-  g_signal_connect (gui_config, "notify::show-tooltips",
-                    G_CALLBACK (gui_show_tooltips_notify),
-                    gimp);
-
   gimp_dialogs_show_help_button (gui_config->use_help &&
                                  gui_config->show_help_button);
 
@@ -772,9 +765,6 @@ gui_exit_after_callback (Gimp     *gimp,
   g_signal_handlers_disconnect_by_func (gimp->config,
                                         gui_user_manual_notify,
                                         gimp);
-  g_signal_handlers_disconnect_by_func (gimp->config,
-                                        gui_show_tooltips_notify,
-                                        gimp);
 
   gimp_action_history_exit (gimp);
 
@@ -807,17 +797,6 @@ gui_exit_after_callback (Gimp     *gimp,
   return FALSE; /* continue exiting */
 }
 
-static void
-gui_show_tooltips_notify (GimpGuiConfig *gui_config,
-                          GParamSpec    *param_spec,
-                          Gimp          *gimp)
-{
-  if (gui_config->show_tooltips)
-    gimp_help_enable_tooltips ();
-  else
-    gimp_help_disable_tooltips ();
-}
-
 static void
 gui_show_help_button_notify (GimpGuiConfig *gui_config,
                              GParamSpec    *param_spec,
diff --git a/app/plug-in/gimppluginmanager-call.c b/app/plug-in/gimppluginmanager-call.c
index ad848e8012..09e92749d3 100644
--- a/app/plug-in/gimppluginmanager-call.c
+++ b/app/plug-in/gimppluginmanager-call.c
@@ -210,7 +210,6 @@ gimp_plug_in_manager_call_run (GimpPlugInManager   *manager,
       config.export_exif      = core_config->export_metadata_exif;
       config.export_xmp       = core_config->export_metadata_xmp;
       config.export_iptc      = core_config->export_metadata_iptc;
-      config.show_tooltips    = gui_config->show_tooltips;
       config.gdisp_ID         = display_ID;
       config.app_name         = (gchar *) g_get_application_name ();
       config.wm_class         = (gchar *) gimp_get_program_class (manager->gimp);
diff --git a/libgimp/gimp.c b/libgimp/gimp.c
index 7289d19d2f..144b46d27c 100644
--- a/libgimp/gimp.c
+++ b/libgimp/gimp.c
@@ -214,7 +214,6 @@ static gint           _tile_height       = -1;
 static gint           _shm_ID            = -1;
 static guchar        *_shm_addr          = NULL;
 static const gdouble  _gamma_val         = 2.2;
-static gboolean       _show_tool_tips    = TRUE;
 static gboolean       _show_help_button  = TRUE;
 static gboolean       _export_exif       = FALSE;
 static gboolean       _export_xmp        = FALSE;
@@ -445,7 +444,7 @@ gimp_main (const GimpPlugInInfo *info,
     {
       g_printerr ("%s is a GIMP plug-in and must be run by GIMP to be used\n",
                   argv[ARG_PROGNAME]);
-      return 1;
+      return EXIT_FAILURE;
     }
 
   gimp_env_init (TRUE);
@@ -460,21 +459,21 @@ gimp_main (const GimpPlugInInfo *info,
 
   if (protocol_version < GIMP_PROTOCOL_VERSION)
     {
-      gimp_message (g_strdup_printf ("Could not execute plug-in \"%s\"\n(%s)\n"
-                                     "because GIMP is using an older version of the "
-                                     "plug-in protocol.",
-                                     gimp_filename_to_utf8 (g_get_prgname ()),
-                                     gimp_filename_to_utf8 (progname)));
-      return 1;
+      g_printerr ("Could not execute plug-in \"%s\"\n(%s)\n"
+                  "because GIMP is using an older version of the "
+                  "plug-in protocol.\n",
+                  gimp_filename_to_utf8 (g_get_prgname ()),
+                  gimp_filename_to_utf8 (progname));
+      return EXIT_FAILURE;
     }
   else if (protocol_version > GIMP_PROTOCOL_VERSION)
     {
-      gimp_message (g_strdup_printf ("Could not execute plug-in \"%s\"\n(%s)\n"
-                                     "because it uses an obsolete version of the "
-                                     "plug-in protocol.",
-                                     gimp_filename_to_utf8 (g_get_prgname ()),
-                                     gimp_filename_to_utf8 (progname)));
-      return 1;
+      g_printerr ("Could not execute plug-in \"%s\"\n(%s)\n"
+                  "because it uses an obsolete version of the "
+                  "plug-in protocol.\n",
+                  gimp_filename_to_utf8 (g_get_prgname ()),
+                  gimp_filename_to_utf8 (progname));
+      return EXIT_FAILURE;
     }
 
   env_string = g_getenv ("GIMP_PLUGIN_DEBUG");
@@ -1399,21 +1398,6 @@ gimp_gamma (void)
   return _gamma_val;
 }
 
-/**
- * gimp_show_tool_tips:
- *
- * Returns whether or not the plug-in should show tool-tips.
- *
- * This is a constant value given at plug-in configuration time.
- *
- * Return value: the show_tool_tips boolean
- **/
-gboolean
-gimp_show_tool_tips (void)
-{
-  return _show_tool_tips;
-}
-
 /**
  * gimp_show_help_button:
  *
@@ -2170,7 +2154,6 @@ gimp_config (GPConfig *config)
   _shm_ID           = config->shm_ID;
   _check_size       = config->check_size;
   _check_type       = config->check_type;
-  _show_tool_tips   = config->show_tooltips    ? TRUE : FALSE;
   _show_help_button = config->show_help_button ? TRUE : FALSE;
   _export_exif      = config->export_exif      ? TRUE : FALSE;
   _export_xmp       = config->export_xmp       ? TRUE : FALSE;
diff --git a/libgimp/gimp.def b/libgimp/gimp.def
index 7df60e8069..e0ae87943b 100644
--- a/libgimp/gimp.def
+++ b/libgimp/gimp.def
@@ -673,7 +673,6 @@ EXPORTS
        gimp_shm_ID
        gimp_shm_addr
        gimp_show_help_button
-       gimp_show_tool_tips
        gimp_smudge
        gimp_smudge_default
        gimp_temp_name
diff --git a/libgimp/gimp.h b/libgimp/gimp.h
index 47d16026c1..eb31ef8a5a 100644
--- a/libgimp/gimp.h
+++ b/libgimp/gimp.h
@@ -319,7 +319,6 @@ guint          gimp_tile_height         (void) G_GNUC_CONST;
 gint           gimp_shm_ID              (void) G_GNUC_CONST;
 guchar       * gimp_shm_addr            (void) G_GNUC_CONST;
 gdouble        gimp_gamma               (void) G_GNUC_CONST;
-gboolean       gimp_show_tool_tips      (void) G_GNUC_CONST;
 gboolean       gimp_show_help_button    (void) G_GNUC_CONST;
 gboolean       gimp_export_exif         (void) G_GNUC_CONST;
 gboolean       gimp_export_xmp          (void) G_GNUC_CONST;
diff --git a/libgimp/gimpui.c b/libgimp/gimpui.c
index e123dce56b..a588f76531 100644
--- a/libgimp/gimpui.c
+++ b/libgimp/gimpui.c
@@ -174,9 +174,6 @@ gimp_ui_init (const gchar *prog_name,
                      gimp_context_get_background,
                      gimp_ensure_modules);
 
-  if (! gimp_show_tool_tips ())
-    gimp_help_disable_tooltips ();
-
   gimp_dialogs_show_help_button (gimp_show_help_button ());
 
 #ifdef GDK_WINDOWING_QUARTZ
diff --git a/libgimpbase/gimpprotocol.c b/libgimpbase/gimpprotocol.c
index 35eec85320..96b3184053 100644
--- a/libgimpbase/gimpprotocol.c
+++ b/libgimpbase/gimpprotocol.c
@@ -512,9 +512,6 @@ _gp_config_read (GIOChannel      *channel,
                               (guint8 *) &config->export_iptc, 1,
                               user_data))
     goto cleanup;
-  if (! _gimp_wire_read_int8 (channel,
-                              (guint8 *) &config->show_tooltips, 1, user_data))
-    goto cleanup;
   if (! _gimp_wire_read_int32 (channel,
                                (guint32 *) &config->gdisp_ID, 1, user_data))
     goto cleanup;
@@ -599,10 +596,6 @@ _gp_config_write (GIOChannel      *channel,
                                (const guint8 *) &config->export_iptc, 1,
                                user_data))
     return;
-  if (! _gimp_wire_write_int8 (channel,
-                               (const guint8 *) &config->show_tooltips, 1,
-                               user_data))
-    return;
   if (! _gimp_wire_write_int32 (channel,
                                 (const guint32 *) &config->gdisp_ID, 1,
                                 user_data))
diff --git a/libgimpbase/gimpprotocol.h b/libgimpbase/gimpprotocol.h
index e2312795ca..a1667d281f 100644
--- a/libgimpbase/gimpprotocol.h
+++ b/libgimpbase/gimpprotocol.h
@@ -26,7 +26,7 @@ G_BEGIN_DECLS
 
 /* Increment every time the protocol changes
  */
-#define GIMP_PROTOCOL_VERSION  0x0017
+#define GIMP_PROTOCOL_VERSION  0x0100
 
 
 enum
@@ -72,7 +72,6 @@ struct _GPConfig
   gint8    export_exif;
   gint8    export_xmp;
   gint8    export_iptc;
-  gint8    show_tooltips;
   gint32   gdisp_ID;
   gchar   *app_name;
   gchar   *wm_class;
diff --git a/libgimpwidgets/gimphelpui.c b/libgimpwidgets/gimphelpui.c
index a06a01c2b6..c13f752984 100644
--- a/libgimpwidgets/gimphelpui.c
+++ b/libgimpwidgets/gimphelpui.c
@@ -50,12 +50,6 @@ typedef enum
 } GimpWidgetHelpType;
 
 
-/*  local variables  */
-
-static gboolean tooltips_enabled       = TRUE;
-static gboolean tooltips_enable_called = FALSE;
-
-
 /*  local function prototypes  */
 
 static const gchar * gimp_help_get_help_data        (GtkWidget      *widget,
@@ -85,46 +79,6 @@ static gboolean   gimp_context_help_idle_show_help  (gpointer        data);
 
 /*  public functions  */
 
-/**
- * gimp_help_enable_tooltips:
- *
- * Enable tooltips to be shown in the GIMP user interface.
- *
- * As a plug-in author, you don't need to care about this as this
- * function is called for you from gimp_ui_init(). This ensures that
- * the user setting from the GIMP preferences dialog is respected in
- * all plug-in dialogs.
- **/
-void
-gimp_help_enable_tooltips (void)
-{
-  if (! tooltips_enable_called)
-    {
-      tooltips_enable_called = TRUE;
-      tooltips_enabled       = TRUE;
-    }
-}
-
-/**
- * gimp_help_disable_tooltips:
- *
- * Disable tooltips to be shown in the GIMP user interface.
- *
- * As a plug-in author, you don't need to care about this as this
- * function is called for you from gimp_ui_init(). This ensures that
- * the user setting from the GIMP preferences dialog is respected in
- * all plug-in dialogs.
- **/
-void
-gimp_help_disable_tooltips (void)
-{
-  if (! tooltips_enable_called)
-    {
-      tooltips_enable_called = TRUE;
-      tooltips_enabled       = FALSE;
-    }
-}
-
 /**
  * gimp_standard_help_func:
  * @help_id:   A unique help identifier.
@@ -223,13 +177,10 @@ gimp_help_set_help_data (GtkWidget   *widget,
 {
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
-  if (tooltips_enabled)
-    {
-      gtk_widget_set_tooltip_text (widget, tooltip);
+  gtk_widget_set_tooltip_text (widget, tooltip);
 
-      if (GTK_IS_MENU_ITEM (widget))
-        gimp_help_menu_item_set_tooltip (widget, tooltip, help_id);
-    }
+  if (GTK_IS_MENU_ITEM (widget))
+    gimp_help_menu_item_set_tooltip (widget, tooltip, help_id);
 
   g_object_set_qdata (G_OBJECT (widget), GIMP_HELP_ID, (gpointer) help_id);
 }
@@ -253,13 +204,10 @@ gimp_help_set_help_data_with_markup (GtkWidget   *widget,
 {
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
-  if (tooltips_enabled)
-    {
-      gtk_widget_set_tooltip_markup (widget, tooltip);
+  gtk_widget_set_tooltip_markup (widget, tooltip);
 
-      if (GTK_IS_MENU_ITEM (widget))
-        gimp_help_menu_item_set_tooltip (widget, tooltip, help_id);
-    }
+  if (GTK_IS_MENU_ITEM (widget))
+    gimp_help_menu_item_set_tooltip (widget, tooltip, help_id);
 
   g_object_set_qdata (G_OBJECT (widget), GIMP_HELP_ID, (gpointer) help_id);
 }
diff --git a/libgimpwidgets/gimphelpui.h b/libgimpwidgets/gimphelpui.h
index 04d405f211..de57e0a480 100644
--- a/libgimpwidgets/gimphelpui.h
+++ b/libgimpwidgets/gimphelpui.h
@@ -31,9 +31,6 @@ G_BEGIN_DECLS
 /* For information look into the C source or the html documentation */
 
 
-void   gimp_help_enable_tooltips           (void);
-void   gimp_help_disable_tooltips          (void);
-
 /*  the standard gimp help function
  */
 void   gimp_standard_help_func             (const gchar  *help_id,
diff --git a/libgimpwidgets/gimpwidgets.def b/libgimpwidgets/gimpwidgets.def
index aee102e009..65d962e24a 100644
--- a/libgimpwidgets/gimpwidgets.def
+++ b/libgimpwidgets/gimpwidgets.def
@@ -187,8 +187,6 @@ EXPORTS
        gimp_get_monitor_at_pointer
        gimp_grid_attach_aligned
        gimp_help_connect
-       gimp_help_disable_tooltips
-       gimp_help_enable_tooltips
        gimp_help_id_quark
        gimp_help_set_help_data
        gimp_help_set_help_data_with_markup


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