[gnumeric] Save default search settings. [#105615]



commit 533885a1094cd3dbcaecccd0fc64c0dd1d7fabf3
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Wed Jun 30 02:32:10 2010 -0600

    Save default search settings. [#105615]
    
    2010-06-30  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* handle-conf-options: add max & min for
    	  /apps/gnumeric/searchreplace/scope,
    	  /apps/gnumeric/searchreplace/error-behaviour
    	  /apps/gnumeric/searchreplace/regex
    
    2010-06-30  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* schemas/gnumeric-dialogs.schemas.in: new preferences for
    	  search and replace dialog
    	* src/gnumeric-gconf.c: add the items generated from the above
    	  changes
    	* src/gnumeric-gconf.h: ditto
    
    2010-06-30  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* dialog-search-replace.c (dialog_search_replace_save_in_prefs): new
    	(apply_clicked): call dialog_search_replace_save_in_prefs if
    	  appropriate
    	(dialog_search_replace): set the current state according to the
    	  preferences
    	* search-replace.glade: add checkbox to save settings as default

 ChangeLog                           |    8 +
 NEWS                                |    1 +
 schemas/gnumeric-dialogs.schemas.in |  143 +++++++++++++++
 src/dialogs/ChangeLog               |    9 +
 src/dialogs/dialog-search-replace.c |   68 +++++++
 src/dialogs/search-replace.glade    |   69 +++++---
 src/gnumeric-gconf.c                |  339 +++++++++++++++++++++++++++++++++++
 src/gnumeric-gconf.h                |   54 ++++++
 tools/ChangeLog                     |    7 +
 tools/handle-conf-options           |   15 ++
 10 files changed, 690 insertions(+), 23 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 16da058..ee4f2e6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-06-30  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* schemas/gnumeric-dialogs.schemas.in: new preferences for
+	  search and replace dialog
+	* src/gnumeric-gconf.c: add the items generated from the above 
+	  changes 
+	* src/gnumeric-gconf.h: ditto
+	
 2010-06-28  Morten Welinder <terra gnome org>
 
 	* configure.in: Post-release bump.
diff --git a/NEWS b/NEWS
index bfd8f42..3ac994c 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ Gnumeric 1.10.8
 
 Andreas:
 	* Add new Excel and Openformula units ("pica" and "picapt") to CONVERT.
+	* Save default search settings. [#105615]
 
 --------------------------------------------------------------------------
 Gnumeric 1.10.7
diff --git a/schemas/gnumeric-dialogs.schemas.in b/schemas/gnumeric-dialogs.schemas.in
index 1db3055..db93cab 100644
--- a/schemas/gnumeric-dialogs.schemas.in
+++ b/schemas/gnumeric-dialogs.schemas.in
@@ -588,6 +588,149 @@
         <long>Please use the Text Export dialog to edit this value.</long>
         </locale>
       </schema>
+      <schema>
+        <key>/schemas/apps/gnumeric/searchreplace/ignore-case</key>
+        <applyto>/apps/gnumeric/searchreplace/ignore-case</applyto>
+        <owner>Gnumeric</owner>
+        <type>bool</type>
+	<default>TRUE</default>
+        <locale name="C">
+        <short>Search &amp; Replace Ignores Case</short>
+        <long>Search &amp; Replace ignores case as default</long>
+        </locale>
+      </schema>
+      <schema>
+        <key>/schemas/apps/gnumeric/searchreplace/preserve-case</key>
+        <applyto>/apps/gnumeric/searchreplace/preserve-case</applyto>
+        <owner>Gnumeric</owner>
+        <type>bool</type>
+	<default>FALSE</default>
+        <locale name="C">
+        <short>Search &amp; Replace Preserves Case</short>
+        <long>Search &amp; Replace preservess case as default</long>
+        </locale>
+      </schema>
+      <schema>
+        <key>/schemas/apps/gnumeric/searchreplace/query</key>
+        <applyto>/apps/gnumeric/searchreplace/query</applyto>
+        <owner>Gnumeric</owner>
+        <type>bool</type>
+	<default>FALSE</default>
+        <locale name="C">
+        <short>Search &amp; Replace Poses Query</short>
+        <long>Search &amp; Replace poses query before each change as default</long>
+        </locale>
+      </schema>
+      <schema>
+        <key>/schemas/apps/gnumeric/searchreplace/whole-words-only</key>
+        <applyto>/apps/gnumeric/searchreplace/whole-words-only</applyto>
+        <owner>Gnumeric</owner>
+        <type>bool</type>
+	<default>FALSE</default>
+        <locale name="C">
+        <short>Search &amp; Replace Whole Words Only</short>
+        <long>Search &amp; Replace replaces whole words only as default</long>
+        </locale>
+      </schema>
+      <schema>
+        <key>/schemas/apps/gnumeric/searchreplace/scope</key>
+        <applyto>/apps/gnumeric/searchreplace/scope</applyto>
+        <owner>Gnumeric</owner>
+        <type>int</type>
+	<default>0</default>
+        <locale name="C">
+        <short>Search &amp; Replace Scope</short>
+        <long>This is the default scope of Search &amp; Replace. 0: entire workbook; 1: current sheet; 2: range</long>
+        </locale>
+      </schema>
+      <schema>
+        <key>/schemas/apps/gnumeric/searchreplace/change-cell-strings</key>
+        <applyto>/apps/gnumeric/searchreplace/change-cell-strings</applyto>
+        <owner>Gnumeric</owner>
+        <type>bool</type>
+	<default>TRUE</default>
+        <locale name="C">
+        <short>Search &amp; Replace Changes Strings</short>
+        <long>Search &amp; Replace changes cells containing strings as default</long>
+        </locale>
+      </schema>
+      <schema>
+        <key>/schemas/apps/gnumeric/searchreplace/change-cell-expressions</key>
+        <applyto>/apps/gnumeric/searchreplace/change-cell-expressions</applyto>
+        <owner>Gnumeric</owner>
+        <type>bool</type>
+	<default>TRUE</default>
+        <locale name="C">
+        <short>Search &amp; Replace Changes Expressions</short>
+        <long>Search &amp; Replace changes cells containing expressions as default</long>
+        </locale>
+      </schema>
+      <schema>
+        <key>/schemas/apps/gnumeric/searchreplace/change-cell-other</key>
+        <applyto>/apps/gnumeric/searchreplace/change-cell-other</applyto>
+        <owner>Gnumeric</owner>
+        <type>bool</type>
+	<default>TRUE</default>
+        <locale name="C">
+        <short>Search &amp; Replace Changes Other Values</short>
+        <long>Search &amp; Replace changes cells containing other values as default</long>
+        </locale>
+      </schema>
+      <schema>
+        <key>/schemas/apps/gnumeric/searchreplace/change-comments</key>
+        <applyto>/apps/gnumeric/searchreplace/change-comments</applyto>
+        <owner>Gnumeric</owner>
+        <type>bool</type>
+	<default>FALSE</default>
+        <locale name="C">
+        <short>Search &amp; Replace Changes Comments</short>
+        <long>Search &amp; Replace changes comments as default</long>
+        </locale>
+      </schema>
+      <schema>
+        <key>/schemas/apps/gnumeric/searchreplace/keep-strings</key>
+        <applyto>/apps/gnumeric/searchreplace/keep-strings</applyto>
+        <owner>Gnumeric</owner>
+        <type>bool</type>
+	<default>TRUE</default>
+        <locale name="C">
+        <short>Search &amp; Replace Keeps Strings as Strings</short>
+        <long>Search &amp; Replace keeps strings as strings even if they look like numbers as default</long>
+        </locale>
+      </schema>
+      <schema>
+        <key>/schemas/apps/gnumeric/searchreplace/regex</key>
+        <applyto>/apps/gnumeric/searchreplace/regex</applyto>
+        <owner>Gnumeric</owner>
+        <type>int</type>
+	<default>0</default>
+        <locale name="C">
+        <short>Search &amp; Replace Search Type</short>
+        <long>This value determines the input type for Search &amp; Replace. 0: text; 1: regular expression; 2: number</long>
+        </locale>
+      </schema>
+      <schema>
+        <key>/schemas/apps/gnumeric/searchreplace/columnmajor</key>
+        <applyto>/apps/gnumeric/searchreplace/columnmajor</applyto>
+        <owner>Gnumeric</owner>
+        <type>bool</type>
+	<default>TRUE</default>
+        <locale name="C">
+        <short>Search &amp; Replace Column Major</short>
+        <long>Search &amp; Replace proceeds in column major order as default</long>
+        </locale>
+      </schema>
+      <schema>
+        <key>/schemas/apps/gnumeric/searchreplace/error-behaviour</key>
+        <applyto>/apps/gnumeric/searchreplace/error-behaviour</applyto>
+        <owner>Gnumeric</owner>
+        <type>int</type>
+	<default>0</default>
+        <locale name="C">
+        <short>Search &amp; Replace Error Behavior</short>
+        <long>This is the default error behavior of Search &amp; Replace indicated by an integer from 0 to 4.</long>
+        </locale>
+      </schema>
    </schemalist>
 </gconfschemafile>
   
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index 19302de..73899a9 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -1,3 +1,12 @@
+2010-06-30  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* dialog-search-replace.c (dialog_search_replace_save_in_prefs): new
+	(apply_clicked): call dialog_search_replace_save_in_prefs if 
+	  appropriate
+	(dialog_search_replace): set the current state according to the
+	  preferences
+	* search-replace.glade: add checkbox to save settings as default
+
 2010-06-28  Morten Welinder <terra gnome org>
 
 	* Release 1.10.7
diff --git a/src/dialogs/dialog-search-replace.c b/src/dialogs/dialog-search-replace.c
index a3711c7..f459a46 100644
--- a/src/dialogs/dialog-search-replace.c
+++ b/src/dialogs/dialog-search-replace.c
@@ -1,3 +1,5 @@
+/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
 /*
  * dialog-search-replace.c:
  *   Dialog for entering a search-and-replace query.
@@ -26,6 +28,7 @@
 #include "dialogs.h"
 #include "help.h"
 
+#include <gnumeric-gconf.h>
 #include <gui-util.h>
 #include <search.h>
 #include <widgets/gnumeric-expr-entry.h>
@@ -92,6 +95,32 @@ set_checked (GladeXML *gui, const char *name, gboolean checked)
 }
 
 static void
+dialog_search_replace_save_in_prefs (DialogState *dd)
+{
+	GladeXML *gui = dd->gui;
+
+#define SETW(w,f) f (is_checked (gui, w));
+	SETW("search_expr", gnm_conf_set_searchreplace_change_cell_expressions);
+	SETW("search_other", gnm_conf_set_searchreplace_change_cell_other);
+	SETW("search_string", gnm_conf_set_searchreplace_change_cell_strings);
+	SETW("search_comments", gnm_conf_set_searchreplace_change_comments);
+	SETW("ignore_case", gnm_conf_set_searchreplace_ignore_case);
+	SETW("keep_strings", gnm_conf_set_searchreplace_keep_strings);
+	SETW("preserve_case", gnm_conf_set_searchreplace_preserve_case);
+	SETW("query", gnm_conf_set_searchreplace_query);
+	SETW("match_words", gnm_conf_set_searchreplace_whole_words_only);
+	SETW("column_major", gnm_conf_set_searchreplace_columnmajor);
+#undef SETW
+
+	gnm_conf_set_searchreplace_regex 
+		(gnumeric_glade_group_value (gui, search_type_group));
+	gnm_conf_set_searchreplace_error_behaviour 
+		(gnumeric_glade_group_value (gui, error_group));
+	gnm_conf_set_searchreplace_scope 
+		(gnumeric_glade_group_value (gui, scope_group));	
+}
+
+static void
 apply_clicked (G_GNUC_UNUSED GtkWidget *widget, DialogState *dd)
 {
 	GladeXML *gui = dd->gui;
@@ -136,6 +165,10 @@ apply_clicked (G_GNUC_UNUSED GtkWidget *widget, DialogState *dd)
 	i = gnumeric_glade_group_value (gui, error_group);
 	sr->error_behaviour = (i == -1) ? GNM_SRE_FAIL : (GnmSearchReplaceError)i;
 
+	if  (is_checked (gui, "save-in-prefs"))
+		dialog_search_replace_save_in_prefs (dd);
+	
+
 	err = gnm_search_replace_verify (sr, TRUE);
 	if (err) {
 		go_gtk_notice_dialog (GTK_WINDOW (dialog), GTK_MESSAGE_ERROR,
@@ -268,6 +301,40 @@ dialog_search_replace (WBCGtk *wbcg,
 	g_free (selection_text);
 	gtk_widget_show (GTK_WIDGET (dd->rangetext));
 
+#define SETW(w,f) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, w)),  f())
+	SETW("search_expr", gnm_conf_get_searchreplace_change_cell_expressions);
+	SETW("search_other", gnm_conf_get_searchreplace_change_cell_other);
+	SETW("search_string", gnm_conf_get_searchreplace_change_cell_strings);
+	SETW("search_comments", gnm_conf_get_searchreplace_change_comments);
+	SETW("ignore_case", gnm_conf_get_searchreplace_ignore_case);
+	SETW("keep_strings", gnm_conf_get_searchreplace_keep_strings);
+	SETW("preserve_case", gnm_conf_get_searchreplace_preserve_case);
+	SETW("query", gnm_conf_get_searchreplace_query);
+	SETW("match_words", gnm_conf_get_searchreplace_whole_words_only);
+#undef SETW
+
+	gtk_toggle_button_set_active 
+	  (GTK_TOGGLE_BUTTON 
+	   (glade_xml_get_widget 
+	    (gui, 
+	     search_type_group[gnm_conf_get_searchreplace_regex () ? 1 : 0])), TRUE);
+	gtk_toggle_button_set_active 
+	  (GTK_TOGGLE_BUTTON 
+	   (glade_xml_get_widget 
+	    (gui, 
+	     direction_group[gnm_conf_get_searchreplace_columnmajor () ? 1 : 0])), TRUE);
+	gtk_toggle_button_set_active 
+	  (GTK_TOGGLE_BUTTON 
+	   (glade_xml_get_widget 
+	    (gui, 
+	     error_group[gnm_conf_get_searchreplace_error_behaviour ()])), TRUE);
+	gtk_toggle_button_set_active 
+	  (GTK_TOGGLE_BUTTON 
+	   (glade_xml_get_widget 
+	    (gui, 
+	     scope_group[gnm_conf_get_searchreplace_scope ()])), TRUE);
+
+
 	g_signal_connect (G_OBJECT (glade_xml_get_widget (gui, "ok_button")),
 		"clicked",
 		G_CALLBACK (ok_clicked), dd);
@@ -323,6 +390,7 @@ dialog_search_replace_query (WBCGtk *wbcg,
 			    old_text);
 	gtk_entry_set_text (GTK_ENTRY (glade_xml_get_widget (gui, "qd_new_text")),
 			    new_text);
+
 	set_checked (gui, "qd_query", sr->query);
 
 	wbcg_set_transient (wbcg, GTK_WINDOW (dialog));
diff --git a/src/dialogs/search-replace.glade b/src/dialogs/search-replace.glade
index 1fa9547..79666b7 100644
--- a/src/dialogs/search-replace.glade
+++ b/src/dialogs/search-replace.glade
@@ -275,7 +275,7 @@
                 <child>
                   <widget class="GtkTable" id="table2">
                     <property name="visible">True</property>
-                    <property name="n_rows">4</property>
+                    <property name="n_rows">3</property>
                     <property name="n_columns">3</property>
                     <property name="column_spacing">6</property>
                     <property name="row_spacing">6</property>
@@ -372,33 +372,13 @@
                       </packing>
                     </child>
                     <child>
-                      <widget class="GtkCheckButton" id="keep_strings">
-                        <property name="label" translatable="yes">_Keep strings as strings</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="tooltip" translatable="yes">When set, string values will remain as such after replacement, even if they look like numbers or expressions</property>
-                        <property name="use_underline">True</property>
-                        <property name="active">True</property>
-                        <property name="draw_indicator">True</property>
-                      </widget>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">3</property>
-                        <property name="top_attach">3</property>
-                        <property name="bottom_attach">4</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"></property>
-                      </packing>
-                    </child>
-                    <child>
                       <widget class="GtkLabel" id="label10">
                         <property name="visible">True</property>
                         <property name="xalign">0</property>
                       </widget>
                       <packing>
                         <property name="top_attach">1</property>
-                        <property name="bottom_attach">4</property>
+                        <property name="bottom_attach">3</property>
                         <property name="x_options"></property>
                         <property name="y_options"></property>
                       </packing>
@@ -492,7 +472,7 @@
                 <child>
                   <widget class="GtkTable" id="table5">
                     <property name="visible">True</property>
-                    <property name="n_rows">2</property>
+                    <property name="n_rows">4</property>
                     <property name="n_columns">3</property>
                     <property name="column_spacing">6</property>
                     <property name="row_spacing">6</property>
@@ -561,6 +541,49 @@
                         <property name="y_options"></property>
                       </packing>
                     </child>
+                    <child>
+                      <widget class="GtkCheckButton" id="keep_strings">
+                        <property name="label" translatable="yes">_Keep strings as strings</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="has_tooltip">True</property>
+                        <property name="tooltip" translatable="yes">When set, string values will remain as such after replacement, even if they look like numbers or expressions</property>
+                        <property name="use_underline">True</property>
+                        <property name="active">True</property>
+                        <property name="draw_indicator">True</property>
+                      </widget>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">3</property>
+                        <property name="top_attach">2</property>
+                        <property name="bottom_attach">3</property>
+                        <property name="x_options">GTK_FILL</property>
+                        <property name="y_options"></property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkCheckButton" id="save-in-prefs">
+                        <property name="label" translatable="yes">Save the current settings as default settings</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="tooltip" translatable="yes">When set, the current settings will be saved as the default settings for future invocations of this dialog.</property>
+                        <property name="draw_indicator">True</property>
+                      </widget>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">3</property>
+                        <property name="top_attach">3</property>
+                        <property name="bottom_attach">4</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <placeholder/>
+                    </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </widget>
                   <packing>
                     <property name="expand">False</property>
diff --git a/src/gnumeric-gconf.c b/src/gnumeric-gconf.c
index 5ec1a7b..587071f 100644
--- a/src/gnumeric-gconf.c
+++ b/src/gnumeric-gconf.c
@@ -2874,6 +2874,345 @@ gnm_conf_get_printsetup_scale_width_node (void)
 	return get_node (watch_printsetup_scale_width.key);
 }
 
+
+static struct cb_watch_bool watch_searchreplace_change_cell_expressions = {
+	0, "searchreplace/change-cell-expressions", TRUE,
+};
+
+GOConfNode *
+gnm_conf_get_searchreplace_change_cell_expressions_node (void)
+{
+	return get_node (watch_searchreplace_change_cell_expressions.key);
+}
+
+gboolean
+gnm_conf_get_searchreplace_change_cell_expressions (void)
+{
+	if (!watch_searchreplace_change_cell_expressions.handler)
+		watch_bool (&watch_searchreplace_change_cell_expressions);
+	return watch_searchreplace_change_cell_expressions.var;
+}
+
+void
+gnm_conf_set_searchreplace_change_cell_expressions (gboolean x)
+{
+	if (!watch_searchreplace_change_cell_expressions.handler)
+		watch_bool (&watch_searchreplace_change_cell_expressions);
+	set_bool (&watch_searchreplace_change_cell_expressions, x);
+}
+
+static struct cb_watch_bool watch_searchreplace_change_cell_other = {
+	0, "searchreplace/change-cell-other", TRUE,
+};
+
+GOConfNode *
+gnm_conf_get_searchreplace_change_cell_other_node (void)
+{
+	return get_node (watch_searchreplace_change_cell_other.key);
+}
+
+gboolean
+gnm_conf_get_searchreplace_change_cell_other (void)
+{
+	if (!watch_searchreplace_change_cell_other.handler)
+		watch_bool (&watch_searchreplace_change_cell_other);
+	return watch_searchreplace_change_cell_other.var;
+}
+
+void
+gnm_conf_set_searchreplace_change_cell_other (gboolean x)
+{
+	if (!watch_searchreplace_change_cell_other.handler)
+		watch_bool (&watch_searchreplace_change_cell_other);
+	set_bool (&watch_searchreplace_change_cell_other, x);
+}
+
+static struct cb_watch_bool watch_searchreplace_change_cell_strings = {
+	0, "searchreplace/change-cell-strings", TRUE,
+};
+
+GOConfNode *
+gnm_conf_get_searchreplace_change_cell_strings_node (void)
+{
+	return get_node (watch_searchreplace_change_cell_strings.key);
+}
+
+gboolean
+gnm_conf_get_searchreplace_change_cell_strings (void)
+{
+	if (!watch_searchreplace_change_cell_strings.handler)
+		watch_bool (&watch_searchreplace_change_cell_strings);
+	return watch_searchreplace_change_cell_strings.var;
+}
+
+void
+gnm_conf_set_searchreplace_change_cell_strings (gboolean x)
+{
+	if (!watch_searchreplace_change_cell_strings.handler)
+		watch_bool (&watch_searchreplace_change_cell_strings);
+	set_bool (&watch_searchreplace_change_cell_strings, x);
+}
+
+static struct cb_watch_bool watch_searchreplace_change_comments = {
+	0, "searchreplace/change-comments", FALSE,
+};
+
+GOConfNode *
+gnm_conf_get_searchreplace_change_comments_node (void)
+{
+	return get_node (watch_searchreplace_change_comments.key);
+}
+
+gboolean
+gnm_conf_get_searchreplace_change_comments (void)
+{
+	if (!watch_searchreplace_change_comments.handler)
+		watch_bool (&watch_searchreplace_change_comments);
+	return watch_searchreplace_change_comments.var;
+}
+
+void
+gnm_conf_set_searchreplace_change_comments (gboolean x)
+{
+	if (!watch_searchreplace_change_comments.handler)
+		watch_bool (&watch_searchreplace_change_comments);
+	set_bool (&watch_searchreplace_change_comments, x);
+}
+
+static struct cb_watch_bool watch_searchreplace_columnmajor = {
+	0, "searchreplace/columnmajor", TRUE,
+};
+
+GOConfNode *
+gnm_conf_get_searchreplace_columnmajor_node (void)
+{
+	return get_node (watch_searchreplace_columnmajor.key);
+}
+
+gboolean
+gnm_conf_get_searchreplace_columnmajor (void)
+{
+	if (!watch_searchreplace_columnmajor.handler)
+		watch_bool (&watch_searchreplace_columnmajor);
+	return watch_searchreplace_columnmajor.var;
+}
+
+void
+gnm_conf_set_searchreplace_columnmajor (gboolean x)
+{
+	if (!watch_searchreplace_columnmajor.handler)
+		watch_bool (&watch_searchreplace_columnmajor);
+	set_bool (&watch_searchreplace_columnmajor, x);
+}
+
+static struct cb_watch_int watch_searchreplace_error_behaviour = {
+	0, "searchreplace/error-behaviour", 0, 4, 0,
+};
+
+GOConfNode *
+gnm_conf_get_searchreplace_error_behaviour_node (void)
+{
+	return get_node (watch_searchreplace_error_behaviour.key);
+}
+
+int
+gnm_conf_get_searchreplace_error_behaviour (void)
+{
+	if (!watch_searchreplace_error_behaviour.handler)
+		watch_int (&watch_searchreplace_error_behaviour);
+	return watch_searchreplace_error_behaviour.var;
+}
+
+void
+gnm_conf_set_searchreplace_error_behaviour (int x)
+{
+	if (!watch_searchreplace_error_behaviour.handler)
+		watch_int (&watch_searchreplace_error_behaviour);
+	set_int (&watch_searchreplace_error_behaviour, x);
+}
+
+static struct cb_watch_bool watch_searchreplace_ignore_case = {
+	0, "searchreplace/ignore-case", TRUE,
+};
+
+GOConfNode *
+gnm_conf_get_searchreplace_ignore_case_node (void)
+{
+	return get_node (watch_searchreplace_ignore_case.key);
+}
+
+gboolean
+gnm_conf_get_searchreplace_ignore_case (void)
+{
+	if (!watch_searchreplace_ignore_case.handler)
+		watch_bool (&watch_searchreplace_ignore_case);
+	return watch_searchreplace_ignore_case.var;
+}
+
+void
+gnm_conf_set_searchreplace_ignore_case (gboolean x)
+{
+	if (!watch_searchreplace_ignore_case.handler)
+		watch_bool (&watch_searchreplace_ignore_case);
+	set_bool (&watch_searchreplace_ignore_case, x);
+}
+
+static struct cb_watch_bool watch_searchreplace_keep_strings = {
+	0, "searchreplace/keep-strings", TRUE,
+};
+
+GOConfNode *
+gnm_conf_get_searchreplace_keep_strings_node (void)
+{
+	return get_node (watch_searchreplace_keep_strings.key);
+}
+
+gboolean
+gnm_conf_get_searchreplace_keep_strings (void)
+{
+	if (!watch_searchreplace_keep_strings.handler)
+		watch_bool (&watch_searchreplace_keep_strings);
+	return watch_searchreplace_keep_strings.var;
+}
+
+void
+gnm_conf_set_searchreplace_keep_strings (gboolean x)
+{
+	if (!watch_searchreplace_keep_strings.handler)
+		watch_bool (&watch_searchreplace_keep_strings);
+	set_bool (&watch_searchreplace_keep_strings, x);
+}
+
+static struct cb_watch_bool watch_searchreplace_preserve_case = {
+	0, "searchreplace/preserve-case", FALSE,
+};
+
+GOConfNode *
+gnm_conf_get_searchreplace_preserve_case_node (void)
+{
+	return get_node (watch_searchreplace_preserve_case.key);
+}
+
+gboolean
+gnm_conf_get_searchreplace_preserve_case (void)
+{
+	if (!watch_searchreplace_preserve_case.handler)
+		watch_bool (&watch_searchreplace_preserve_case);
+	return watch_searchreplace_preserve_case.var;
+}
+
+void
+gnm_conf_set_searchreplace_preserve_case (gboolean x)
+{
+	if (!watch_searchreplace_preserve_case.handler)
+		watch_bool (&watch_searchreplace_preserve_case);
+	set_bool (&watch_searchreplace_preserve_case, x);
+}
+
+static struct cb_watch_bool watch_searchreplace_query = {
+	0, "searchreplace/query", FALSE,
+};
+
+GOConfNode *
+gnm_conf_get_searchreplace_query_node (void)
+{
+	return get_node (watch_searchreplace_query.key);
+}
+
+gboolean
+gnm_conf_get_searchreplace_query (void)
+{
+	if (!watch_searchreplace_query.handler)
+		watch_bool (&watch_searchreplace_query);
+	return watch_searchreplace_query.var;
+}
+
+void
+gnm_conf_set_searchreplace_query (gboolean x)
+{
+	if (!watch_searchreplace_query.handler)
+		watch_bool (&watch_searchreplace_query);
+	set_bool (&watch_searchreplace_query, x);
+}
+
+static struct cb_watch_int watch_searchreplace_regex = {
+	0, "searchreplace/regex", 0, 2, 0,
+};
+
+GOConfNode *
+gnm_conf_get_searchreplace_regex_node (void)
+{
+	return get_node (watch_searchreplace_regex.key);
+}
+
+int
+gnm_conf_get_searchreplace_regex (void)
+{
+	if (!watch_searchreplace_regex.handler)
+		watch_int (&watch_searchreplace_regex);
+	return watch_searchreplace_regex.var;
+}
+
+void
+gnm_conf_set_searchreplace_regex (int x)
+{
+	if (!watch_searchreplace_regex.handler)
+		watch_int (&watch_searchreplace_regex);
+	set_int (&watch_searchreplace_regex, x);
+}
+
+static struct cb_watch_int watch_searchreplace_scope = {
+	0, "searchreplace/scope", 0, 2, 0,
+};
+
+GOConfNode *
+gnm_conf_get_searchreplace_scope_node (void)
+{
+	return get_node (watch_searchreplace_scope.key);
+}
+
+int
+gnm_conf_get_searchreplace_scope (void)
+{
+	if (!watch_searchreplace_scope.handler)
+		watch_int (&watch_searchreplace_scope);
+	return watch_searchreplace_scope.var;
+}
+
+void
+gnm_conf_set_searchreplace_scope (int x)
+{
+	if (!watch_searchreplace_scope.handler)
+		watch_int (&watch_searchreplace_scope);
+	set_int (&watch_searchreplace_scope, x);
+}
+
+static struct cb_watch_bool watch_searchreplace_whole_words_only = {
+	0, "searchreplace/whole-words-only", FALSE,
+};
+
+GOConfNode *
+gnm_conf_get_searchreplace_whole_words_only_node (void)
+{
+	return get_node (watch_searchreplace_whole_words_only.key);
+}
+
+gboolean
+gnm_conf_get_searchreplace_whole_words_only (void)
+{
+	if (!watch_searchreplace_whole_words_only.handler)
+		watch_bool (&watch_searchreplace_whole_words_only);
+	return watch_searchreplace_whole_words_only.var;
+}
+
+void
+gnm_conf_set_searchreplace_whole_words_only (gboolean x)
+{
+	if (!watch_searchreplace_whole_words_only.handler)
+		watch_bool (&watch_searchreplace_whole_words_only);
+	set_bool (&watch_searchreplace_whole_words_only, x);
+}
+
 static struct cb_watch_string watch_stf_export_separator = {
 	0, "stf/export/separator", ",",
 };
diff --git a/src/gnumeric-gconf.h b/src/gnumeric-gconf.h
index e5d7d8d..1ab6889 100644
--- a/src/gnumeric-gconf.h
+++ b/src/gnumeric-gconf.h
@@ -373,6 +373,58 @@ GOConfNode *gnm_conf_get_printsetup_scale_width_node (void);
 int gnm_conf_get_printsetup_scale_width (void);
 void gnm_conf_set_printsetup_scale_width (int);
 
+GOConfNode *gnm_conf_get_searchreplace_change_cell_expressions_node (void);
+gboolean gnm_conf_get_searchreplace_change_cell_expressions (void);
+void gnm_conf_set_searchreplace_change_cell_expressions (gboolean);
+
+GOConfNode *gnm_conf_get_searchreplace_change_cell_other_node (void);
+gboolean gnm_conf_get_searchreplace_change_cell_other (void);
+void gnm_conf_set_searchreplace_change_cell_other (gboolean);
+
+GOConfNode *gnm_conf_get_searchreplace_change_cell_strings_node (void);
+gboolean gnm_conf_get_searchreplace_change_cell_strings (void);
+void gnm_conf_set_searchreplace_change_cell_strings (gboolean);
+
+GOConfNode *gnm_conf_get_searchreplace_change_comments_node (void);
+gboolean gnm_conf_get_searchreplace_change_comments (void);
+void gnm_conf_set_searchreplace_change_comments (gboolean);
+
+GOConfNode *gnm_conf_get_searchreplace_columnmajor_node (void);
+gboolean gnm_conf_get_searchreplace_columnmajor (void);
+void gnm_conf_set_searchreplace_columnmajor (gboolean);
+
+GOConfNode *gnm_conf_get_searchreplace_error_behaviour_node (void);
+int gnm_conf_get_searchreplace_error_behaviour (void);
+void gnm_conf_set_searchreplace_error_behaviour (int);
+
+GOConfNode *gnm_conf_get_searchreplace_ignore_case_node (void);
+gboolean gnm_conf_get_searchreplace_ignore_case (void);
+void gnm_conf_set_searchreplace_ignore_case (gboolean);
+
+GOConfNode *gnm_conf_get_searchreplace_keep_strings_node (void);
+gboolean gnm_conf_get_searchreplace_keep_strings (void);
+void gnm_conf_set_searchreplace_keep_strings (gboolean);
+
+GOConfNode *gnm_conf_get_searchreplace_preserve_case_node (void);
+gboolean gnm_conf_get_searchreplace_preserve_case (void);
+void gnm_conf_set_searchreplace_preserve_case (gboolean);
+
+GOConfNode *gnm_conf_get_searchreplace_query_node (void);
+gboolean gnm_conf_get_searchreplace_query (void);
+void gnm_conf_set_searchreplace_query (gboolean);
+
+GOConfNode *gnm_conf_get_searchreplace_regex_node (void);
+int gnm_conf_get_searchreplace_regex (void);
+void gnm_conf_set_searchreplace_regex (int);
+
+GOConfNode *gnm_conf_get_searchreplace_scope_node (void);
+int gnm_conf_get_searchreplace_scope (void);
+void gnm_conf_set_searchreplace_scope (int);
+
+GOConfNode *gnm_conf_get_searchreplace_whole_words_only_node (void);
+gboolean gnm_conf_get_searchreplace_whole_words_only (void);
+void gnm_conf_set_searchreplace_whole_words_only (gboolean);
+
 GOConfNode *gnm_conf_get_stf_export_separator_node (void);
 const char *gnm_conf_get_stf_export_separator (void);
 void gnm_conf_set_stf_export_separator (const char *);
@@ -419,6 +471,8 @@ GOConfNode *gnm_conf_get_functionselector_dir_node (void);
 GOConfNode *gnm_conf_get_plugin_latex_dir_node (void);
 GOConfNode *gnm_conf_get_plugins_dir_node (void);
 GOConfNode *gnm_conf_get_printsetup_dir_node (void);
+GOConfNode *gnm_conf_get_searchreplace_dir_node (void);
+GOConfNode *gnm_conf_get_stf_export_dir_node (void);
 GOConfNode *gnm_conf_get_undo_dir_node (void);
 
 /* ----------- AUTOMATICALLY GENERATED CODE ABOVE -- DO NOT EDIT ----------- */
diff --git a/tools/ChangeLog b/tools/ChangeLog
index 1470c1a..c8558fd 100644
--- a/tools/ChangeLog
+++ b/tools/ChangeLog
@@ -1,3 +1,10 @@
+2010-06-30  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* handle-conf-options: add max & min for 
+	  /apps/gnumeric/searchreplace/scope,
+	  /apps/gnumeric/searchreplace/error-behaviour
+	  /apps/gnumeric/searchreplace/regex
+
 2010-06-28  Morten Welinder <terra gnome org>
 
 	* Release 1.10.7
diff --git a/tools/handle-conf-options b/tools/handle-conf-options
index 4d5219c..b7cc999 100644
--- a/tools/handle-conf-options
+++ b/tools/handle-conf-options
@@ -243,6 +243,21 @@ my %extra_attributes =
 	 'max' => 500,
      },
 
+     '/apps/gnumeric/searchreplace/scope' => {
+	 'min' => 0,
+	 'max' => 2,
+     },
+
+     '/apps/gnumeric/searchreplace/error-behaviour' => {
+	 'min' => 0,
+	 'max' => 4,
+     },
+
+     '/apps/gnumeric/searchreplace/regex' => {
+	 'min' => 0,
+	 'max' => 2,
+     },
+
     );
 
 sub apply_extra_attributes {



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