Commit a42075f6 authored by Andreas J. Guelzow 's avatar Andreas J. Guelzow

Add preference settings whether to show function name and/or argument tooltips.

2010-07-22  Andreas J. Guelzow <aguelzow@pyrshep.ca>

	* gnumeric-expr-entry.c (gee_set_tooltip): don't remove the completion
	(gee_set_tooltip_completion): return whether the tool tip was shown,
	  check the preference setting.
	(gee_check_tooltip): check the preference setting and watch the return
	  value of gee_set_tooltip_completion

2010-07-22  Andreas J. Guelzow <aguelzow@pyrshep.ca>

	* schemas/gnumeric-general.schemas.in: add tooltip preferences
	* src/gnumeric-gconf.h
	(gnm_conf_*et_core_gui_editing_function_argument_tooltips*): new
	* src/gnumeric-gconf.c
	(gnm_conf_*et_core_gui_editing_function_name_tooltips*): new

2010-07-22  Andreas J. Guelzow <aguelzow@pyrshep.ca>

	* dialog-function-select.c (pref_tool_page_initializer): add checkboxes
	  for tooltip preferences
parent b331371c
2010-07-22 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* schemas/gnumeric-general.schemas.in: add tooltip preferences
* src/gnumeric-gconf.h
(gnm_conf_*et_core_gui_editing_function_argument_tooltips*): new
* src/gnumeric-gconf.c
(gnm_conf_*et_core_gui_editing_function_name_tooltips*): new
2010-07-21 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* src/func.h (GNM_FUNC_RECALC_ONLOAD): not used
......
......@@ -41,8 +41,10 @@ Andreas:
* Make the font style buttons override the character attributes.
[#163410]
* Provide name completion (F4) when entering functions. [#587084]
* Implement access to the function selector to paste function names
while editing cells (Shift-F4).
* Implement access to the function selector to paste function
names while editing cells (Shift-F4).
* Add preference settings whether to show function name and/or
argument tooltips.
Jean:
* Fix strong/weak cursor display. [#623241]
......
......@@ -266,6 +266,28 @@
<long>This variable determines whether autocompletion is set on.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gnumeric/core/gui/editing/function-name-tooltips</key>
<applyto>/apps/gnumeric/core/gui/editing/function-name-tooltips</applyto>
<owner>Gnumeric</owner>
<type>bool</type>
<default>TRUE</default>
<locale name="C">
<short>Show Function Name Tooltips</short>
<long>This variable determines whether to show function name tooltips.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gnumeric/core/gui/editing/function-argument-tooltips</key>
<applyto>/apps/gnumeric/core/gui/editing/function-argument-tooltips</applyto>
<owner>Gnumeric</owner>
<type>bool</type>
<default>TRUE</default>
<locale name="C">
<short>Show Function Argument Tooltips</short>
<long>This variable determines whether to show function argument tooltips.</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/gnumeric/core/gui/editing/enter_moves_dir</key>
<applyto>/apps/gnumeric/core/gui/editing/enter_moves_dir</applyto>
......
2010-07-22 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* dialog-function-select.c (pref_tool_page_initializer): add checkboxes
for tooltip preferences
2010-07-21 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* dialog-function-select.c (dialog_function_select_load_tree): dont load
......
......@@ -1027,6 +1027,16 @@ pref_tool_page_initializer (PrefState *state,
gnm_conf_set_core_gui_editing_autocomplete,
gnm_conf_get_core_gui_editing_autocomplete,
_("Autocomplete"));
bool_pref_create_widget (gnm_conf_get_core_gui_editing_function_name_tooltips_node (),
page, row++,
gnm_conf_set_core_gui_editing_function_name_tooltips,
gnm_conf_get_core_gui_editing_function_name_tooltips,
_("Show Function Name Tooltips"));
bool_pref_create_widget (gnm_conf_get_core_gui_editing_function_argument_tooltips_node (),
page, row++,
gnm_conf_set_core_gui_editing_function_argument_tooltips,
gnm_conf_get_core_gui_editing_function_argument_tooltips,
_("Show Function Argument Tooltips"));
bool_pref_create_widget (gnm_conf_get_dialogs_rs_unfocused_node (),
page, row++,
gnm_conf_set_dialogs_rs_unfocused,
......
......@@ -1128,6 +1128,58 @@ gnm_conf_get_core_gui_editing_enter_moves_dir_node (void)
return get_node (watch_core_gui_editing_enter_moves_dir.key);
}
static struct cb_watch_bool watch_core_gui_editing_function_argument_tooltips = {
0, "core/gui/editing/function-argument-tooltips", TRUE,
};
gboolean
gnm_conf_get_core_gui_editing_function_argument_tooltips (void)
{
if (!watch_core_gui_editing_function_argument_tooltips.handler)
watch_bool (&watch_core_gui_editing_function_argument_tooltips);
return watch_core_gui_editing_function_argument_tooltips.var;
}
void
gnm_conf_set_core_gui_editing_function_argument_tooltips (gboolean x)
{
if (!watch_core_gui_editing_function_argument_tooltips.handler)
watch_bool (&watch_core_gui_editing_function_argument_tooltips);
set_bool (&watch_core_gui_editing_function_argument_tooltips, x);
}
GOConfNode *
gnm_conf_get_core_gui_editing_function_argument_tooltips_node (void)
{
return get_node (watch_core_gui_editing_function_argument_tooltips.key);
}
static struct cb_watch_bool watch_core_gui_editing_function_name_tooltips = {
0, "core/gui/editing/function-name-tooltips", TRUE,
};
gboolean
gnm_conf_get_core_gui_editing_function_name_tooltips (void)
{
if (!watch_core_gui_editing_function_name_tooltips.handler)
watch_bool (&watch_core_gui_editing_function_name_tooltips);
return watch_core_gui_editing_function_name_tooltips.var;
}
void
gnm_conf_set_core_gui_editing_function_name_tooltips (gboolean x)
{
if (!watch_core_gui_editing_function_name_tooltips.handler)
watch_bool (&watch_core_gui_editing_function_name_tooltips);
set_bool (&watch_core_gui_editing_function_name_tooltips, x);
}
GOConfNode *
gnm_conf_get_core_gui_editing_function_name_tooltips_node (void)
{
return get_node (watch_core_gui_editing_function_name_tooltips.key);
}
static struct cb_watch_bool watch_core_gui_editing_livescrolling = {
0, "core/gui/editing/livescrolling", TRUE,
};
......
......@@ -105,6 +105,14 @@ GOConfNode *gnm_conf_get_core_gui_editing_enter_moves_dir_node (void);
GODirection gnm_conf_get_core_gui_editing_enter_moves_dir (void);
void gnm_conf_set_core_gui_editing_enter_moves_dir (GODirection);
GOConfNode *gnm_conf_get_core_gui_editing_function_argument_tooltips_node (void);
gboolean gnm_conf_get_core_gui_editing_function_argument_tooltips (void);
void gnm_conf_set_core_gui_editing_function_argument_tooltips (gboolean);
GOConfNode *gnm_conf_get_core_gui_editing_function_name_tooltips_node (void);
gboolean gnm_conf_get_core_gui_editing_function_name_tooltips (void);
void gnm_conf_set_core_gui_editing_function_name_tooltips (gboolean);
GOConfNode *gnm_conf_get_core_gui_editing_livescrolling_node (void);
gboolean gnm_conf_get_core_gui_editing_livescrolling (void);
void gnm_conf_set_core_gui_editing_livescrolling (gboolean);
......
2010-07-22 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* gnumeric-expr-entry.c (gee_set_tooltip): don't remove the completion
(gee_set_tooltip_completion): return whether the tool tip was shown,
check the preference setting.
(gee_check_tooltip): check the preference setting and watch the return
value of gee_set_tooltip_completion
2010-07-21 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* gnumeric-expr-entry.c (gee_check_tooltip): zero teh correct token
* gnumeric-expr-entry.c (gee_check_tooltip): zero the correct token
2010-07-21 Andreas J. Guelzow <aguelzow@pyrshep.ca>
......
......@@ -722,7 +722,7 @@ gee_set_tooltip (GnmExprEntry *gee, GnmFunc *fd, gint args, gboolean had_stuff)
&& (gee->tooltip.fd == fd && gee->tooltip.args == args
&& gee->tooltip.had_stuff == (max == 0 && args == 0 && had_stuff)))
return;
gee_delete_tooltip (gee, TRUE);
gee_delete_tooltip (gee, FALSE);
gee->tooltip.fd = fd;
gnm_func_ref (gee->tooltip.fd);
......@@ -782,7 +782,7 @@ gee_set_tooltip (GnmExprEntry *gee, GnmFunc *fd, gint args, gboolean had_stuff)
g_string_free (str, TRUE);
}
static void
static gboolean
gee_set_tooltip_completion (GnmExprEntry *gee, GSList *list, guint start, guint end)
{
GString *str;
......@@ -791,6 +791,7 @@ gee_set_tooltip_completion (GnmExprEntry *gee, GSList *list, guint start, guint
gint max = 10;
GSList *list_c = list;
gchar const *name;
gboolean show_tool_tip;
gee_delete_tooltip (gee, TRUE);
......@@ -816,7 +817,6 @@ gee_set_tooltip_completion (GnmExprEntry *gee, GSList *list, guint start, guint
if (i == max)
g_string_append (str_marked, UNICODE_ELLIPSIS_VERT "\n");
if (i == 1) {
g_free (gee->tooltip.completion);
gee->tooltip.completion
= g_strdup (name);
/*xgettext: short form for: "type F4-key to complete the name"*/
......@@ -829,11 +829,14 @@ gee_set_tooltip_completion (GnmExprEntry *gee, GSList *list, guint start, guint
gee->tooltip.completion_start = start;
gee->tooltip.completion_end = end;
gee->tooltip.completion_se_valid = TRUE;
gee->tooltip.tooltip = gee_create_tooltip
(gee, str->str, str_marked->str, TRUE);
show_tool_tip = gnm_conf_get_core_gui_editing_function_name_tooltips ();
if (show_tool_tip)
gee->tooltip.tooltip = gee_create_tooltip
(gee, str->str, str_marked->str, TRUE);
g_string_free (str, TRUE);
g_string_free (str_marked, TRUE);
go_slist_free_custom (list, (GFreeFunc) gnm_func_unref);
go_slist_free_custom (list, (GFreeFunc) gnm_func_unref);
return show_tool_tip;
}
static void
......@@ -861,7 +864,7 @@ gee_check_tooltip (GnmExprEntry *gee)
gint end, args = 0;
guint end_t;
char *str;
gboolean stuff = FALSE;
gboolean stuff = FALSE, completion_se_set = FALSE;
GnmLexerItem *gli, *gli_c;
if (!gee->tooltip.enabled || gee->is_cell_renderer ||
......@@ -923,16 +926,29 @@ gee_check_tooltip (GnmExprEntry *gee)
list = g_slist_sort
(list,
(GCompareFunc)func_def_cmp);
gee_set_tooltip_completion (gee, list, start_t, end_t);
g_free (str);
g_free (gli_c);
return;
if (gee_set_tooltip_completion
(gee, list, start_t, end_t)) {
g_free (str);
g_free (gli_c);
return;
}
} else {
g_free (gee->tooltip.completion);
gee->tooltip.completion = NULL;
gee->tooltip.completion_start = start_t;
gee->tooltip.completion_end = end_t;
gee->tooltip.completion_se_valid = TRUE;
}
completion_se_set = TRUE;
} else {
g_free (gee->tooltip.completion);
gee->tooltip.completion = NULL;
gee->tooltip.completion_se_valid = FALSE;
}
if (!gnm_conf_get_core_gui_editing_function_argument_tooltips ())
goto not_found;
if (gnm_debug_flag ("functooltip"))
g_print ("last token consider is %d from %d to %d\n",
......@@ -1017,7 +1033,7 @@ gee_check_tooltip (GnmExprEntry *gee)
not_found:
g_free (str);
g_free (gli_c);
gee_delete_tooltip (gee, TRUE);
gee_delete_tooltip (gee, !completion_se_set);
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment