[gnumeric] Add preference setting determining the minimum number of chars for autocompletion. [#663671]
- From: Andreas J. Guelzow <guelzow src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Add preference setting determining the minimum number of chars for autocompletion. [#663671]
- Date: Thu, 10 Nov 2011 07:25:01 +0000 (UTC)
commit 3b31a5f3977883fbe89cb897327588c441478c3d
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date: Thu Nov 10 00:22:11 2011 -0700
Add preference setting determining the minimum number of chars for autocompletion. [#663671]
2011-11-10 Andreas J. Guelzow <aguelzow pyrshep ca>
* dialog-preferences.c (pref_tool_page_initializer): add
gnm_conf_get_core_gui_editing_autocomplete_min_chars_node item
2011-11-10 Andreas J. Guelzow <aguelzow pyrshep ca>
* handle-conf-options (extra_attributes): add attributes for
/apps/gnumeric/core/gui/editing/autocomplete-min-chars
2011-11-10 Andreas J. Guelzow <aguelzow pyrshep ca>
* schemas/org.gnome.gnumeric.gschema.xml.in.in
(autocomplete-min-chars): new item
* src/complete-sheet.c (complete_sheet_search_iteration): use
gnm_conf_get_core_gui_editing_autocomplete_min_chars
* src/gnumeric-conf.h
(gnm_conf_get_core_gui_editing_autocomplete_min_chars_node): new
(gnm_conf_get_core_gui_editing_autocomplete_min_chars): new
(gnm_conf_set_core_gui_editing_autocomplete_min_chars): new
* src/gnumeric-conf.c
(gnm_conf_get_core_gui_editing_autocomplete_min_chars_node): new
(gnm_conf_get_core_gui_editing_autocomplete_min_chars): new
(gnm_conf_set_core_gui_editing_autocomplete_min_chars): new
(watch_core_gui_editing_autocomplete_min_chars): new
ChangeLog | 16 ++++++++++++++++
NEWS | 2 ++
schemas/org.gnome.gnumeric.gschema.xml.in.in | 5 +++++
src/complete-sheet.c | 5 ++---
src/dialogs/ChangeLog | 5 +++++
src/dialogs/dialog-preferences.c | 5 +++++
src/gnumeric-conf.c | 26 ++++++++++++++++++++++++++
src/gnumeric-conf.h | 4 ++++
tools/ChangeLog | 5 +++++
tools/handle-conf-options | 5 +++++
10 files changed, 75 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 3ce2ee9..8d6457b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2011-11-10 Andreas J. Guelzow <aguelzow pyrshep ca>
+
+ * schemas/org.gnome.gnumeric.gschema.xml.in.in
+ (autocomplete-min-chars): new item
+ * src/complete-sheet.c (complete_sheet_search_iteration): use
+ gnm_conf_get_core_gui_editing_autocomplete_min_chars
+ * src/gnumeric-conf.h
+ (gnm_conf_get_core_gui_editing_autocomplete_min_chars_node): new
+ (gnm_conf_get_core_gui_editing_autocomplete_min_chars): new
+ (gnm_conf_set_core_gui_editing_autocomplete_min_chars): new
+ * src/gnumeric-conf.c
+ (gnm_conf_get_core_gui_editing_autocomplete_min_chars_node): new
+ (gnm_conf_get_core_gui_editing_autocomplete_min_chars): new
+ (gnm_conf_set_core_gui_editing_autocomplete_min_chars): new
+ (watch_core_gui_editing_autocomplete_min_chars): new
+
2011-11-09 Morten Welinder <terra gnome org>
* src/wbc-gtk.c (wbc_gtk_close): Avoid FMR.
diff --git a/NEWS b/NEWS
index f58940f..5831c85 100644
--- a/NEWS
+++ b/NEWS
@@ -67,6 +67,8 @@ Jean:
* Add support for SVG images using librsvg.
* Fixed SVG images size. [#628472]
* Fix crash in graphs using markups. [#663216]
+ * Add preference setting determining the minimum number of chars for
+ autocompletion. [#663671]
Marek ÄernockÃ:
* Add some translation contexts to improve translations.
diff --git a/schemas/org.gnome.gnumeric.gschema.xml.in.in b/schemas/org.gnome.gnumeric.gschema.xml.in.in
index ae885f6..13cca27 100644
--- a/schemas/org.gnome.gnumeric.gschema.xml.in.in
+++ b/schemas/org.gnome.gnumeric.gschema.xml.in.in
@@ -162,6 +162,11 @@
<_summary>Autocomplete</_summary>
<_description>This variable determines whether autocompletion is set on.</_description>
</key>
+ <key name="autocomplete-min-chars" type="i">
+ <default>3</default>
+ <_summary>Minimum Number of Characters for Autocompletion</_summary>
+ <_description>This variable determines theminimum number of characters required for autocompletion.</_description>
+ </key>
<key name="function-name-tooltips" type="b">
<default>true</default>
<_summary>Show Function Name Tooltips</_summary>
diff --git a/src/complete-sheet.c b/src/complete-sheet.c
index 7e07bea..8a8197e 100644
--- a/src/complete-sheet.c
+++ b/src/complete-sheet.c
@@ -85,9 +85,8 @@ complete_sheet_search_iteration (Complete *complete)
CompleteSheet *cs = COMPLETE_SHEET (complete);
int i;
- /* http://bugzilla.gnome.org/show_bug.cgi?id=55026
- * only kick in after 3 characters */
- if (strlen (complete->text) < 3)
+ if (strlen (complete->text) <
+ gnm_conf_get_core_gui_editing_autocomplete_min_chars ())
return FALSE;
if (strncmp (cs->current_text, complete->text, strlen (cs->current_text)) != 0)
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index bcb7c3d..fd32243 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -1,3 +1,8 @@
+2011-11-10 Andreas J. Guelzow <aguelzow pyrshep ca>
+
+ * dialog-preferences.c (pref_tool_page_initializer): add
+ gnm_conf_get_core_gui_editing_autocomplete_min_chars_node item
+
2011-11-06 Marek Äernockà <marek manet cz>
* anova-one.ui: add context to _Columns and _Rows
diff --git a/src/dialogs/dialog-preferences.c b/src/dialogs/dialog-preferences.c
index b3372b1..020acf1 100644
--- a/src/dialogs/dialog-preferences.c
+++ b/src/dialogs/dialog-preferences.c
@@ -1039,6 +1039,11 @@ pref_tool_page_initializer (PrefState *state,
gnm_conf_set_core_gui_editing_autocomplete,
gnm_conf_get_core_gui_editing_autocomplete,
_("Autocomplete"));
+ int_pref_create_widget (gnm_conf_get_core_gui_editing_autocomplete_min_chars_node (),
+ page, row++, 3, 1, 10, 1,
+ gnm_conf_set_core_gui_editing_autocomplete_min_chars,
+ gnm_conf_get_core_gui_editing_autocomplete_min_chars,
+ _("Minimum Number of Characters for Autocompletion"));
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,
diff --git a/src/gnumeric-conf.c b/src/gnumeric-conf.c
index 5f28f23..1958d2e 100644
--- a/src/gnumeric-conf.c
+++ b/src/gnumeric-conf.c
@@ -1134,6 +1134,32 @@ gnm_conf_get_core_gui_editing_autocomplete_node (void)
return get_node (watch_core_gui_editing_autocomplete.key);
}
+static struct cb_watch_int watch_core_gui_editing_autocomplete_min_chars = {
+ 0, "core/gui/editing/autocomplete-min-chars", 1, 10, 3,
+};
+
+int
+gnm_conf_get_core_gui_editing_autocomplete_min_chars (void)
+{
+ if (!watch_core_gui_editing_autocomplete_min_chars.handler)
+ watch_int (&watch_core_gui_editing_autocomplete_min_chars);
+ return watch_core_gui_editing_autocomplete_min_chars.var;
+}
+
+void
+gnm_conf_set_core_gui_editing_autocomplete_min_chars (int x)
+{
+ if (!watch_core_gui_editing_autocomplete_min_chars.handler)
+ watch_int (&watch_core_gui_editing_autocomplete_min_chars);
+ set_int (&watch_core_gui_editing_autocomplete_min_chars, x);
+}
+
+GOConfNode *
+gnm_conf_get_core_gui_editing_autocomplete_min_chars_node (void)
+{
+ return get_node (watch_core_gui_editing_autocomplete_min_chars.key);
+}
+
static struct cb_watch_enum watch_core_gui_editing_enter_moves_dir = {
0, "core/gui/editing/enter-moves-dir", GO_DIRECTION_DOWN,
};
diff --git a/src/gnumeric-conf.h b/src/gnumeric-conf.h
index e550cc2..82d44c6 100644
--- a/src/gnumeric-conf.h
+++ b/src/gnumeric-conf.h
@@ -106,6 +106,10 @@ GOConfNode *gnm_conf_get_core_gui_editing_autocomplete_node (void);
gboolean gnm_conf_get_core_gui_editing_autocomplete (void);
void gnm_conf_set_core_gui_editing_autocomplete (gboolean);
+GOConfNode *gnm_conf_get_core_gui_editing_autocomplete_min_chars_node (void);
+int gnm_conf_get_core_gui_editing_autocomplete_min_chars (void);
+void gnm_conf_set_core_gui_editing_autocomplete_min_chars (int);
+
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);
diff --git a/tools/ChangeLog b/tools/ChangeLog
index fab506a..304b5d5 100644
--- a/tools/ChangeLog
+++ b/tools/ChangeLog
@@ -1,3 +1,8 @@
+2011-11-10 Andreas J. Guelzow <aguelzow pyrshep ca>
+
+ * handle-conf-options (extra_attributes): add attributes for
+ /apps/gnumeric/core/gui/editing/autocomplete-min-chars
+
2011-10-26 Morten Welinder <terra gnome org>
* handle-conf-options: Parse gsettings schemas as well.
diff --git a/tools/handle-conf-options b/tools/handle-conf-options
index 3383ca3..e59fad0 100644
--- a/tools/handle-conf-options
+++ b/tools/handle-conf-options
@@ -181,6 +181,11 @@ my %extra_attributes =
'max' => 5000
},
+ '/apps/gnumeric/core/gui/editing/autocomplete-min-chars' => {
+ 'min' => 1,
+ 'max' => 10
+ },
+
'/apps/gnumeric/core/gui/toolbars/format-position' => {
'gtype' => 'GTK_TYPE_POSITION',
'min' => 0,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]