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.
This commit is contained in:
Michael Natterer 2018-06-06 19:20:32 +02:00
parent 95a74d68c0
commit b36205176e
14 changed files with 20 additions and 148 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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));

View File

@ -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,

View File

@ -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);

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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))

View File

@ -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;

View File

@ -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);
}

View File

@ -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,

View File

@ -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