[Gnucash-changes] Remove unused global options code.

David Hampton hampton at cvs.gnucash.org
Sat Oct 8 21:00:43 EDT 2005


Log Message:
-----------
Remove unused global options code.  Global options are now all stored
in gconf.

Tags:
----
gnucash-gnome2-dev

Modified Files:
--------------
    gnucash:
        ChangeLog
    gnucash/src/app-utils:
        Makefile.am
        app-utils.scm
        gw-app-utils-spec.scm
        prefs.scm
    gnucash/src/gnome-utils:
        dialog-options.c
        dialog-options.h
    gnucash/src/scm:
        main.scm

Removed Files:
-------------
    gnucash/src/app-utils:
        global-options.c
        global-options.h

Revision Data
-------------
Index: ChangeLog
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/ChangeLog,v
retrieving revision 1.1487.2.320
retrieving revision 1.1487.2.321
diff -LChangeLog -LChangeLog -u -r1.1487.2.320 -r1.1487.2.321
--- ChangeLog
+++ ChangeLog
@@ -1,5 +1,24 @@
 2005-10-08  David Hampton  <hampton at employees.org>
 
+	* src/app-utils/Makefile.am:
+	* src/app-utils/app-utils.scm:
+	* src/app-utils/global-options.[ch]:
+	* src/app-utils/gw-app-utils-spec.scm:
+	* src/app-utils/prefs.scm:
+	* src/gnome-utils/dialog-options.[ch]:
+	* src/scm/main.scm: Remove unused global options code.  Global
+	options are now all stored in gconf.
+
+	* numerous: Remove include of global-options.h.
+
+	* src/register/ledger-core/split-register-control.c:
+	* src/register/ledger-core/split-register-load.c:
+	* src/register/ledger-core/split-register-model.c:
+	* src/register/ledger-core/split-register-util.c:
+	* src/register/ledger-core/split-register.c: Remove unneeded
+	include files.  Call function with their current name, not the
+	backward compatibility name.
+
 	* src/app-utils/global-options.[ch]:
 	* src/app-utils/gnc-ui-util.[ch]: Migrate a couple of functions
 	from one global-options to gnc-ui-utils.
Index: prefs.scm
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/app-utils/prefs.scm,v
retrieving revision 1.28.4.22
retrieving revision 1.28.4.23
diff -Lsrc/app-utils/prefs.scm -Lsrc/app-utils/prefs.scm -u -r1.28.4.22 -r1.28.4.23
--- src/app-utils/prefs.scm
+++ src/app-utils/prefs.scm
@@ -57,43 +57,8 @@
 ;;    eq?
 ;;    #f))
 
-(define gnc:*options-entries* (gnc:new-options))
 
-(define (gnc:register-configuration-option new-option)
-  (gnc:register-option gnc:*options-entries* new-option))
-
-(define (gnc:lookup-global-option section name)
-  (gnc:lookup-option gnc:*options-entries* section name))
-
-(define (gnc:send-global-options) gnc:*options-entries*)
-
-(define (gnc:global-options-clear-changes)
-  (gnc:options-clear-changes gnc:*options-entries*))
-
-;; save-all-options: this is the actual hook that gets called at
-;; shutdown.  right now, we put all the options in the same file so
-;; it's important to make sure it happens in this order.  later the
-;; hook should probably revert back to just save-global-options.
-(define (gnc:save-all-options)
-  (gnc:save-global-options)
-  (gnc:hook-run-danglers gnc:*save-options-hook*))
-
-(define (gnc:save-global-options)
-  (gnc:make-home-dir)
-  (gnc:save-options gnc:*options-entries*
-                    (symbol->string 'gnc:*options-entries*)
-                    gnc:current-config-auto
-                    (string-append
-                     "(gnc:config-file-format-version 1)\n\n"
-                     ";"
-                     (_ "GnuCash Configuration Options")
-                     "\n")
-                    #t))
-
-(define (gnc:config-file-format-version version) #t)
-
-
-;;;;;; Create default options and config vars
+;;;;;; Create config vars
 
 (define gnc:*debit-strings*
   (list (cons 'NO_TYPE   (N_ "Funds In"))
@@ -132,10 +97,3 @@
 
 (define (gnc:get-credit-string type)
   (_ (assoc-ref gnc:*credit-strings* type)))
-
-;;; Internal options -- Section names that start with "__" are not
-;;; displayed in option dialogs.
-
-(gnc:register-configuration-option
- (gnc:make-internal-option
-  "__exp_parser" "defined_variables" '()))
--- src/app-utils/global-options.c
+++ /dev/null
@@ -1,529 +0,0 @@
-/********************************************************************\
- * global-options.c -- GNOME global option handling                 *
- * Copyright (C) 1998,1999 Linas Vepstas                            *
- *                                                                  *
- * This program is free software; you can redistribute it and/or    *
- * modify it under the terms of the GNU General Public License as   *
- * published by the Free Software Foundation; either version 2 of   *
- * the License, or (at your option) any later version.              *
- *                                                                  *
- * This program is distributed in the hope that it will be useful,  *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
- * GNU General Public License for more details.                     *
- *                                                                  *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact:                        *
- *                                                                  *
- * Free Software Foundation           Voice:  +1-617-542-5942       *
- * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652       *
- * Boston, MA  02111-1307,  USA       gnu at gnu.org                   *
-\********************************************************************/
-
-#include "config.h"
-
-#include "global-options.h"
-#include "option-util.h"
-#include "qof.h"
-#include "gnc-gconf-utils.h"
-#include "gnc-ui-util.h"
-
-
-/* This static indicates the debugging module that this .o belongs to.  */
-static QofLogModule log_module = GNC_MOD_GUI;
-
-static GNCOptionDB *global_options = NULL;
-
-
-/********************************************************************\
- * gnc_options_init                                                 *
- *   initialize the options structures from the guile side          *
- *                                                                  *
- * Args: none                                                       *
- * Returns: nothing                                                 *
-\********************************************************************/
-void
-gnc_options_init(void)
-{
-  SCM func = scm_c_eval_string("gnc:send-global-options");
-  SCM options;
-
-  if (SCM_PROCEDUREP(func))
-    options = scm_call_0(func);
-  else
-  {
-    PERR("gnc_options_init: no guile options!");
-    return;
-  }
-
-  global_options = gnc_option_db_new(options);
-}
-
-
-/********************************************************************\
- * gnc_options_shutdown                                             *
- *   unregister the scheme options and free the structure memory    *
- *                                                                  *
- * Args: none                                                       *
- * Returns: nothing                                                 *
-\********************************************************************/
-void
-gnc_options_shutdown(void)
-{
-  gnc_option_db_destroy(global_options);
-  global_options = NULL;
-}
-
-
-/********************************************************************\
- * gnc_register_option_change_callback                              *
- *   register a callback to be called whenever an option changes    *
- *                                                                  *
- * Args: callback  - the callback function                          *
- *       user_data - the user data for the callback                 *
- *       section   - the section to get callbacks for.              *
- *                   If NULL, get callbacks for any section changes.*
- *       name      - the option name to get callbacks for.          *
- *                   If NULL, get callbacks for any option in the   *
- *                   section. Only used if section is non-NULL.     *
- * Returns: SCM handle for unregistering                            *
-\********************************************************************/
-SCM
-gnc_register_option_change_callback(GNCOptionChangeCallback callback,
-                                    gpointer user_data,
-                                    char *section,
-                                    char *name)
-{
-  return gnc_option_db_register_change_callback(global_options, callback,
-                                                user_data, section, name);
-}
-
-
-/********************************************************************\
- * gnc_unregister_option_change_callback_id                         *
- *   unregister the change callback associated with the given id    *
- *                                                                  *
- * Args: callback_id - the callback function id                     *
- * Returns: nothing                                                 *
-\********************************************************************/
-void
-gnc_unregister_option_change_callback_id(SCM callback_id)
-{
-  if (callback_id == 0)
-    return;
-  gnc_option_db_unregister_change_callback_id(global_options, callback_id);
-}
-
-
-/********************************************************************\
- * gnc_get_option_by_name                                           *
- *   returns an option given section name and name                  *
- *                                                                  *
- * Args: section_name - name of section to search for               *
- *       name         - name to search for                          *
- * Returns: given option, or NULL if none                           *
-\********************************************************************/
-GNCOption *
-gnc_get_option_by_name(const char *section_name, const char *name)
-{
-  return gnc_option_db_get_option_by_name(global_options,
-                                          section_name, name);
-}
-
-
-/********************************************************************\
- * gnc_get_option_by_SCM                                            *
- *   returns an option given SCM handle. Uses section and name.     *
- *                                                                  *
- * Args: guile_option - SCM handle of option                        *
- * Returns: given option, or NULL if none                           *
-\********************************************************************/
-GNCOption *
-gnc_get_option_by_SCM(SCM guile_option)
-{
-  return gnc_option_db_get_option_by_SCM(global_options, guile_option);
-}
-
-
-/********************************************************************\
- * gnc_lookup_option                                                *
- *   looks up an option. If present, returns its SCM value,         *
- *   otherwise returns the default.                                 *
- *                                                                  *
- * Args: section - section name of option                           *
- *       name    - name of option                                   *
- *       default - default value if not found                       *
- * Return: option value                                             *
-\********************************************************************/
-SCM
-gnc_lookup_option(const char *section, const char *name, SCM default_value)
-{
-  return gnc_option_db_lookup_option(global_options, section,
-                                     name, default_value);
-}
-
-
-/********************************************************************\
- * gnc_lookup_boolean_option                                        *
- *   looks up a boolean option. If present, returns its value,      *
- *   otherwise returns the default.                                 *
- *                                                                  *
- * Args: section - section name of option                           *
- *       name    - name of option                                   *
- *       default - default value if not found                       *
- * Return: gboolean option value                                    *
-\********************************************************************/
-gboolean
-gnc_lookup_boolean_option(const char *section, const char *name,
-                          gboolean default_value)
-{
-  return gnc_option_db_lookup_boolean_option(global_options, section,
-                                             name, default_value);
-}
-
-
-/********************************************************************\
- * gnc_lookup_string_option                                         *
- *   looks up a string option. If present, returns its malloc'ed    *
- *   value, otherwise returns the strdup'ed default, or NULL if     *
- *   default was NULL.                                              *
- *                                                                  *
- * Args: section - section name of option                           *
- *       name    - name of option                                   *
- *       default - default value if not found                       *
- * Return: char * option value                                      *
-\********************************************************************/
-char *
-gnc_lookup_string_option(const char *section, const char *name,
-                         const char *default_value)
-{
-  return gnc_option_db_lookup_string_option(global_options, section,
-                                            name, default_value);
-}
-
-
-/********************************************************************\
- * gnc_lookup_font_option                                           *
- *   looks up a font option. If present, returns its malloc'ed      *
- *   string value, otherwise returns the strdup'ed default, or NULL *
- *   if default was NULL.                                           *
- *                                                                  *
- * Args: section - section name of option                           *
- *       name    - name of option                                   *
- *       default - default value if not found                       *
- * Return: char * option value                                      *
-\********************************************************************/
-char *
-gnc_lookup_font_option(const char *section, const char *name,
-                       const char *default_value)
-{
-  return gnc_option_db_lookup_font_option(global_options, section,
-                                          name, default_value);
-}
-
-
-/********************************************************************\
- * gnc_lookup_multichoice_option                                    *
- *   looks up a multichoice option. If present, returns its         *
- *   name as a malloc'ed string                                     *
- *   value, otherwise returns the strdup'ed default, or NULL if     *
- *   default was NULL.                                              *
- *                                                                  *
- * Args: section - section name of option                           *
- *       name    - name of option                                   *
- *       default - default value if not found                       *
- * Return: char * option value                                      *
-\********************************************************************/
-char *
-gnc_lookup_multichoice_option(const char *section, const char *name,
-                              const char *default_value)
-{
-  return gnc_option_db_lookup_multichoice_option(global_options, section,
-                                                 name, default_value);
-}
-
-/********************************************************************\
- * gnc_lookup_date_option                                           *
- *   looks up a date option. If present, returns the absolute date  *
- *   represented in the set_ab_value argument provided, otherwise   *
- *   copies the default_value argument (if non-NULL) to the         *
- *   set_value argument. If the default_value argument is NULL,     *
- *   copies the current date to set_ab_value. Whatever value is     *
- *   stored in set_value is return as an approximate (no            *
- *   nanoseconds) time_t value. set_value may be NULL, in which     *
- *   case only the return value can be used. If is_relative is      *
- *   non-NULL, it is set to whether the date option is currently    *
- *   storing a relative date.  If it is, and set_rel_value          *
- *   is non-NULL, it returns a newly allocated string               *
- *   representing the scheme symbol for that relative date          *
- *                                                                  *
- * Args: section       - section name of option                     *
- *       name          - name of option                             *
- *       set_ab_value  - location to store absolute option value    *
- *       set_rel_value - location to store relative option value    *
- *       default       - default value if not found                 *
- * Return: time_t approximation of set_value                        *
-\********************************************************************/
-time_t 
-gnc_lookup_date_option(const char *section,
-		       const char *name,
-		       gboolean *is_relative,
-		       Timespec *set_ab_value,
-		       char **set_rel_value, 
-		       Timespec *default_value)
-{
-  return gnc_option_db_lookup_date_option(global_options, section, name,
-					  is_relative, set_ab_value,
-					  set_rel_value, default_value);
-}
-
-/********************************************************************\
- * gnc_lookup_number_option                                         *
- *   looks up a number option. If present, return its value         *
- *   as a gdouble, otherwise returns default_value.                 *
- *                                                                  *
- * Args: section - section name of option                           *
- *       name    - name of option                                   *
- *       default - default value if not found                       *
- * Return: char * option value                                      *
-\********************************************************************/
-gdouble
-gnc_lookup_number_option(const char *section, const char *name,
-                         gdouble default_value)
-{
-  return gnc_option_db_lookup_number_option(global_options, section,
-                                            name, default_value);
-}
-
-
-/********************************************************************\
- * gnc_lookup_color_option                                          *
- *   looks up a color option. If present, returns its value in the  *
- *   color variable, otherwise leaves the color variable alone.     *
- *                                                                  *
- * Args: section   - section name of option                         *
- *       name      - name of option                                 *
- *       red       - where to store the red value                   *
- *       blue      - where to store the blue value                  *
- *       green     - where to store the green value                 *
- *       alpha     - where to store the alpha value                 *
- * Return: true if option was found                                 *
-\********************************************************************/
-gboolean gnc_lookup_color_option(const char *section, const char *name,
-                                 gdouble *red, gdouble *green,
-                                 gdouble *blue, gdouble *alpha)
-{
-  return gnc_option_db_lookup_color_option(global_options, section, name,
-                                           red, green, blue, alpha);
-}
-
-
-/********************************************************************\
- * gnc_lookup_color_option_argb                                     *
- *   looks up a color option. If present, returns its argb value,   *
- *   otherwise returns the given default value.                     *
- *                                                                  *
- * Args: odb       - option database to search in                   *
- *       section   - section name of option                         *
- *       name      - name of option                                 *
- *       default_value - default value to return if problem         *
- * Return: argb value                                               *
-\********************************************************************/
-guint32
-gnc_lookup_color_option_argb(const char *section, const char *name,
-                             guint32 default_value)
-{
-  return gnc_option_db_lookup_color_option_argb(global_options, section, name,
-                                                default_value);
-}
-
-
-/********************************************************************\
- * gnc_lookup_list_option                                           *
- *   looks up a list option. If present, returns its value as a     *
- *   list of strings representing the symbols.                      *
- *                                                                  *
- * Args: section   - section name of option                         *
- *       name      - name of option                                 *
- *       default_value - default value to return if problem         *
- * Return: list of values                                           *
-\********************************************************************/
-GSList *
-gnc_lookup_list_option(const char *section, const char *name,
-                       GSList *default_value)
-{
-  return gnc_option_db_lookup_list_option(global_options, section, name,
-                                          default_value);
-}
-
-
-/********************************************************************\
- * gnc_lookup_currency_option                                       *
- *   looks up a currency option.                                    *
- *                                                                  *
- * Args: section   - section name of option                         *
- *       name      - name of option                                 *
- *       default_value - default value to return if problem         *
- * Return: currency object or NULL                                  *
-\********************************************************************/
-gnc_commodity *
-gnc_lookup_currency_option(const char *section,
-                           const char *name,
-                           gnc_commodity *default_value)
-{
-  return gnc_option_db_lookup_currency_option(global_options, section, name,
-                                              default_value);
-}
-
-
-/********************************************************************\
- * gnc_set_option_default                                           *
- *   set the option to its default value                            *
- *                                                                  *
- * Args: section - section name of option                           *
- *       name    - name of option                                   *
- * Returns: nothing                                                 *
-\********************************************************************/
-void
-gnc_set_option_default(const char *section, const char *name)
-{
-  gnc_option_db_set_option_default(global_options, section, name);
-}
-
-
-/********************************************************************\
- * gnc_set_option                                                   *
- *   sets the option to the given value. If successful              *
- *   returns TRUE, otherwise FALSE.                                 *
- *                                                                  *
- * Args: section   - section name of option                         *
- *       name      - name of option                                 *
- *       value     - value to set to                                *
- * Return: success indicator                                        *
-\********************************************************************/
-gboolean
-gnc_set_option(const char *section, const char *name, SCM value)
-{
-  return gnc_option_db_set_option(global_options, section, name, value);
-}
-
-
-/********************************************************************\
- * gnc_set_number_option                                            *
- *   sets the number option to the given value. If successful       *
- *   returns TRUE, otherwise FALSE.                                 *
- *                                                                  *
- * Args: section   - section name of option                         *
- *       name      - name of option                                 *
- *       value     - value to set to                                *
- * Return: success indicator                                        *
-\********************************************************************/
-gboolean
-gnc_set_number_option(const char *section, const char *name, gdouble value)
-{
-  return gnc_option_db_set_number_option(global_options, section, name, value);
-}
-
-/********************************************************************\
- * gnc_set_boolean_option                                           *
- *   sets the boolean option to the given value. If successful      *
- *   returns TRUE, otherwise FALSE.                                 *
- *                                                                  *
- * Args: section   - section name of option                         *
- *       name      - name of option                                 *
- *       value     - value to set to                                *
- * Return: success indicator                                        *
-\********************************************************************/
-gboolean
-gnc_set_boolean_option(const char *section, const char *name, gboolean value)
-{
-  return gnc_option_db_set_boolean_option(global_options, section, name, value);
-}
-
-
-/********************************************************************\
- * gnc_set_string_option                                            *
- *   sets the string option to the given value. If successful       *
- *   returns TRUE, otherwise FALSE.                                 *
- *                                                                  *
- * Args: section   - section name of option                         *
- *       name      - name of option                                 *
- *       value     - value to set to                                *
- * Return: success indicator                                        *
-\********************************************************************/
-gboolean
-gnc_set_string_option(const char *section, const char *name, const char *value)
-{
-  return gnc_option_db_set_string_option(global_options, section, name, value);
-}
-
-
-/********************************************************************\
- * _gnc_option_refresh_ui                                           *
- *   sets the GUI representation of an option with its              *
- *   current guile value.  Designed to be called from guile         *
- *                                                                  *
- * Args: option - SCM handle to option                              *
- * Return: nothing                                                  *
-\********************************************************************/
-void
-gncp_option_refresh_ui(SCM guile_option)
-{
-  GNCOption *option;
-
-  option = gnc_option_db_get_option_by_SCM(global_options, guile_option);
-  gnc_option_set_ui_value(option, FALSE);
-}
-
-/********************************************************************\
- *  gnc_option_refresh_ui_by_name                                   *
- *   sets the GUI representation of an option with its current      *
- *   current guile value.  Designed to be called from GUI           *
- *                                                                  *
- * Args: section_name: name of option's section                     *
- *       name        : name of option                               *
- * Return: nothing                                                  *
-\********************************************************************/
-void 
-gnc_option_refresh_ui_by_name(const char *section_name, const char *name)
-{
-  GNCOption *option;
-  option = gnc_option_db_get_option_by_name(global_options, section_name,
-					    name);
-  gnc_option_set_ui_value(option, FALSE);
-}
-
-/********************************************************************\
- *  gnc_set_option_selectable_by_name                               *
- *   sets the the sensitivity of a global option widget             *
- *                                                                  *
- * Args: section_name: name of option's section                     *
- *       name        : name of option                               *
- * Return: nothing                                                  *
-\********************************************************************/
-void
-gnc_set_option_selectable_by_name(const char *section_name, 
-                                  const char *name,
-                                  gboolean selectable)
-{
-  GNCOption *option;
-
-  option = gnc_option_db_get_option_by_name(global_options, section_name,
-                                            name);
-  if (option)
-    gnc_option_set_selectable (option, selectable);
-}
-
-/********************************************************************\
- * gnc_get_global_options                                           *
- *   returns the global options database. Should only be called     *
- *   be the options gui builder, nothing else                       *
- *                                                                  *
- * Args: none                                                       *
- * Return: global options database                                  *
-\********************************************************************/
-GNCOptionDB *
-gnc_get_global_options(void)
-{
-  return global_options;
-}
Index: gw-app-utils-spec.scm
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/app-utils/gw-app-utils-spec.scm,v
retrieving revision 1.16.4.1
retrieving revision 1.16.4.2
diff -Lsrc/app-utils/gw-app-utils-spec.scm -Lsrc/app-utils/gw-app-utils-spec.scm -u -r1.16.4.1 -r1.16.4.2
--- src/app-utils/gw-app-utils-spec.scm
+++ src/app-utils/gw-app-utils-spec.scm
@@ -26,9 +26,6 @@
    ws
    (lambda (wrapset client-wrapset) 
      (list 
-      "#include <global-options.h>\n"
-      "#include <option-util.h>\n"
-      "#include <global-options.h>\n"
       "#include <option-util.h>\n"
       "#include <gnc-euro.h>\n"
       "#include <gnc-exp-parser.h>\n"
@@ -136,32 +133,6 @@
 
   (gw:wrap-function
    ws
-   'gnc:c-options-init
-   '<gw:void>
-   "gnc_options_init"
-   '()
-   "Initialize the C side options code.")
-
-  (gw:wrap-function
-   ws
-   'gnc:c-options-shutdown
-   '<gw:void>
-   "gnc_options_shutdown"
-   '()
-   "Shutdown the C side options code.")
-
-  (gw:wrap-function
-   ws
-   'gnc:set-option-selectable-by-name
-   '<gw:void>
-   "gnc_set_option_selectable_by_name"
-   '(((<gw:mchars> caller-owned const) section)
-     ((<gw:mchars> caller-owned const) name)
-     (<gw:bool> selectable))
-   "Set the appropriate option widget to be selectable or not selectable, depending on if <gw:bool> selectable is true or false respectively.")
-
-  (gw:wrap-function
-   ws
    'gnc:option-db-set-option-selectable-by-name
    '<gw:void>
    "gnc_option_db_set_option_selectable_by_name"
@@ -199,14 +170,6 @@
 
   (gw:wrap-function
    ws
-   'gnc:option-refresh-ui
-   '<gw:void>
-   "gncp_option_refresh_ui"
-   '((<gw:scm> option))
-   "Refresh the gui option with the current values.")
-
-  (gw:wrap-function
-   ws
    'gnc:option-invoke-callback
    '<gw:void>
    "gncp_option_invoke_callback"
Index: app-utils.scm
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/app-utils/app-utils.scm,v
retrieving revision 1.22.4.4
retrieving revision 1.22.4.5
diff -Lsrc/app-utils/app-utils.scm -Lsrc/app-utils/app-utils.scm -u -r1.22.4.4 -r1.22.4.5
--- src/app-utils/app-utils.scm
+++ src/app-utils/app-utils.scm
@@ -118,15 +118,10 @@
 (export gnc:config-var-value-is-default?)
 
 ;; prefs.scm
-(export gnc:register-configuration-option)
-(export gnc:lookup-global-option)
-(export gnc:send-global-options)
-(export gnc:global-options-clear-changes)
-(export gnc:save-all-options)
 (export gnc:get-debit-string)
 (export gnc:get-credit-string)
-(export gnc:*options-entries*)
-(export gnc:config-file-format-version)
+
+;; gw-engine-spec.scm
 (re-export gnc:*save-options-hook*)
 
 ;; date-utilities.scm
@@ -274,10 +269,6 @@
 (gnc:hook-add-dangler gnc:*startup-hook*
                       (lambda ()
                         (begin
-                          ;; Initialize the C side options code.
-                          ;; Must come after the scheme options are loaded.
-                          (gnc:c-options-init)
-
                           ;; Initialize the expression parser.
                           ;; Must come after the C side options initialization.
                           (gnc:exp-parser-init))))
@@ -289,13 +280,5 @@
                           ;; Shutdown the expression parser
                           (gnc:exp-parser-shutdown)
 
-                          ;; This saves global options plus (for the
-                          ;; moment) saved report and account tree
-                          ;; window parameters. Reports and parameters
-                          ;; should probably be in a separate file,
-                          ;; with the main data file, or something
-                          ;; else.
-                          (gnc:save-all-options)
-
-                          ;; Shut down the C side options code
-                          (gnc:c-options-shutdown))))
+                          ;; This saves options. E.G. Stylesheets.
+			  (gnc:hook-run-danglers gnc:*save-options-hook*))))
Index: Makefile.am
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/app-utils/Makefile.am,v
retrieving revision 1.29.4.13
retrieving revision 1.29.4.14
diff -Lsrc/app-utils/Makefile.am -Lsrc/app-utils/Makefile.am -u -r1.29.4.13 -r1.29.4.14
--- src/app-utils/Makefile.am
+++ src/app-utils/Makefile.am
@@ -18,7 +18,6 @@
 libgncmod_app_utils_la_SOURCES = \
   file-utils.c \
   gfec.c \
-  global-options.c \
   gnc-accounting-period.c \
   gnc-component-manager.c \
   gnc-druid.c \
@@ -43,7 +42,6 @@
 gncinclude_HEADERS = \
   file-utils.h \
   gfec.h \
-  global-options.h \
   gnc-basic-gobject.h \
   gnc-accounting-period.h \
   gnc-component-manager.h \
--- src/app-utils/global-options.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/********************************************************************\
- * global-options.h -- GNOME global option handling                 *
- * Copyright (C) 1998,1999 Linas Vepstas                            *
- *                                                                  *
- * This program is free software; you can redistribute it and/or    *
- * modify it under the terms of the GNU General Public License as   *
- * published by the Free Software Foundation; either version 2 of   *
- * the License, or (at your option) any later version.              *
- *                                                                  *
- * This program is distributed in the hope that it will be useful,  *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
- * GNU General Public License for more details.                     *
- *                                                                  *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact:                        *
- *                                                                  *
- * Free Software Foundation           Voice:  +1-617-542-5942       *
- * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652       *
- * Boston, MA  02111-1307,  USA       gnu at gnu.org                   *
-\********************************************************************/
-
-#ifndef GLOBAL_OPTIONS_H
-#define GLOBAL_OPTIONS_H
-
-#include <glib.h>
-
-#include "option-util.h"
-
-
-void gnc_options_init(void);
-void gnc_options_shutdown(void);
-
-SCM gnc_register_option_change_callback(GNCOptionChangeCallback callback,
-                                        gpointer user_data,
-                                        char *section,
-                                        char *name);
-
-void gnc_unregister_option_change_callback_id(SCM callback_id);
-
-GNCOption * gnc_get_option_by_name(const char *section_name, const char *name);
-GNCOption * gnc_get_option_by_SCM(SCM guile_option);
-
-SCM gnc_lookup_option(const char *section, const char *name,
-                      SCM default_value);
-
-gboolean gnc_lookup_boolean_option(const char *section, const char *name,
-				   gboolean default_value);
-
-char * gnc_lookup_string_option(const char *section, const char *name,
-				const char *default_value);
-
-char * gnc_lookup_font_option(const char *section, const char *name,
-                              const char *default_value);
-
-char * gnc_lookup_multichoice_option(const char *section, const char *name,
-                                     const char *default_value);
-
-time_t gnc_lookup_date_option(const char *section, const char *name,
-			      gboolean *is_relative, Timespec *set_ab_value,
-			      char **set_rel_value, Timespec *default_value);
-
-gdouble gnc_lookup_number_option(const char *section, const char *name,
-                                 gdouble default_value);
-
-gboolean gnc_lookup_color_option(const char *section, const char *name,
-                                 gdouble *red, gdouble *green,
-                                 gdouble *blue, gdouble *alpha);
-
-guint32 gnc_lookup_color_option_argb(const char *section, const char *name,
-                                     guint32 default_value);
-
-GSList * gnc_lookup_list_option(const char *section, const char *name,
-                                GSList *default_value);
-
-gnc_commodity *
-gnc_lookup_currency_option(const char *section,
-                           const char *name,
-                           gnc_commodity *default_value);
-
-void gnc_set_option_default(const char *section, const char *name);
-
-gboolean gnc_set_option(const char *section, const char *name, SCM value);
-
-gboolean gnc_set_number_option(const char *section, const char *name,
-                               gdouble value);
-
-gboolean gnc_set_boolean_option(const char *section, const char *name,
-                                gboolean value);
-
-gboolean gnc_set_string_option(const char *section, const char *name,
-			       const char *value);
-
-void gnc_option_refresh_ui_by_name(const char *section_name, 
-				   const char *name);
-
-void gnc_set_option_selectable_by_name(const char *section, 
-                                       const char *name,
-                                       gboolean selectable);
-
-/* private */
-
-void gncp_option_refresh_ui(SCM option);
-GNCOptionDB * gnc_get_global_options(void);
-
-#endif /* GLOBAL_OPTIONS_H */
Index: dialog-options.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome-utils/dialog-options.h,v
retrieving revision 1.5.4.4
retrieving revision 1.5.4.5
diff -Lsrc/gnome-utils/dialog-options.h -Lsrc/gnome-utils/dialog-options.h -u -r1.5.4.4 -r1.5.4.5
--- src/gnome-utils/dialog-options.h
+++ src/gnome-utils/dialog-options.h
@@ -61,7 +61,6 @@
 void gnc_options_dialog_set_global_help_cb(GNCOptionWinCallback thunk,
                                            gpointer cb_data);
 
-void gnc_show_options_dialog(void);
 void gnc_build_options_dialog_contents(GNCOptionWin *win,
                                        GNCOptionDB  *odb);
 
Index: dialog-options.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome-utils/dialog-options.c,v
retrieving revision 1.22.2.24
retrieving revision 1.22.2.25
diff -Lsrc/gnome-utils/dialog-options.c -Lsrc/gnome-utils/dialog-options.c -u -r1.22.2.24 -r1.22.2.25
--- src/gnome-utils/dialog-options.c
+++ src/gnome-utils/dialog-options.c
@@ -29,7 +29,6 @@
 #include "dialog-utils.h"
 #include "engine-helpers.h"
 #include "glib-helpers.h"
-#include "global-options.h"
 #include "gnc-account-sel.h"
 #include "gnc-tree-view-account.h"
 #include "gnc-commodity-edit.h"
@@ -1210,114 +1209,6 @@
 }
 
 
-/* Global options dialog... this should house all of the config
- * options like where the docs reside, and whatever else is deemed
- * necessary */
-
-static void
-gnc_option_show_advanced_pages(GNCOptionWin * propertybox)
-{
-  GtkWidget *page, *listitem;
-  gboolean advanced, show_advanced;
-  gint i;
-
-  show_advanced = gnc_lookup_boolean_option("General",
-					    "Show Advanced Settings", FALSE);
-  i = 0;
-  while (TRUE) {
-    page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(propertybox->notebook), i++);
-    if (page == NULL)
-      break;
-    advanced =
-      GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(page), "advanced"));
-    if (advanced) {
-      listitem = gtk_object_get_data(GTK_OBJECT(page), "listitem");
-      if (show_advanced) {
-	gtk_widget_show(page);
-	gtk_widget_show(listitem);
-      } else {
-	gtk_widget_hide(page);
-	gtk_widget_hide(listitem);
-      }
-    }
-  };
-}
-
-static void
-gnc_options_dialog_apply_cb(GNCOptionWin *propertybox,
-                            gpointer user_data)
-{
-  GNCOptionDB *global_options = user_data;
-
-  gnc_option_db_commit(global_options);
-  gnc_option_show_advanced_pages(propertybox);
-}
-
-static void
-gnc_options_dialog_help_cb(GNCOptionWin *propertybox,
-			   gpointer user_data)
-{
-  if (global_help_cb)
-    global_help_cb (propertybox, global_help_cb_data);
-}
-
-static void
-gnc_options_dialog_close_cb(GNCOptionWin *propertybox,
-                            gpointer user_data)
-{
-  GNCOptionWin **options_dialog = user_data;
-
-  gnc_options_dialog_destroy(propertybox);
-
-  *options_dialog = NULL;
-}
-
-
-void
-gnc_show_options_dialog(void)
-{
-  static GNCOptionWin *options_dialog = NULL;
-  GNCOptionDB *global_options;
-
-  global_options = gnc_get_global_options();
-
-  if (gnc_option_db_num_sections(global_options) == 0)
-  {
-    gnc_warning_dialog(NULL, _("No options!"));
-    return;
-  }
-
-  if (gnc_option_db_dirty(global_options))
-  {
-    if (options_dialog != NULL)
-      gnc_options_dialog_destroy(options_dialog);
-
-    options_dialog = NULL;
-  }
-
-  if (options_dialog == NULL)
-  {
-    options_dialog = gnc_options_dialog_new(_("GnuCash Preferences"));
-
-    gnc_build_options_dialog_contents(options_dialog, global_options);
-    gnc_option_db_clean(global_options);
-
-    gnc_options_dialog_set_apply_cb(options_dialog, 
-                                    gnc_options_dialog_apply_cb,
-                                    global_options);
-
-    gnc_options_dialog_set_help_cb(options_dialog, 
-                                   gnc_options_dialog_help_cb,
-                                   global_options);
-
-    gnc_options_dialog_set_close_cb (options_dialog,
-                                     gnc_options_dialog_close_cb,
-                                     &options_dialog);
-  }
-
-  gtk_window_present(GTK_WINDOW(options_dialog->dialog));
-}
-
 /*****************************************************************/
 /* Option Registration                                           */
 
Index: main.scm
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/scm/main.scm,v
retrieving revision 1.109.2.25
retrieving revision 1.109.2.26
diff -Lsrc/scm/main.scm -Lsrc/scm/main.scm -u -r1.109.2.25 -r1.109.2.26
--- src/scm/main.scm
+++ src/scm/main.scm
@@ -468,9 +468,6 @@
   ;; Load the user configs
   (gnc:load-user-config-if-needed)
 
-  ;; Clear the change flags caused by loading the configs
-  (gnc:global-options-clear-changes)
-
   (gnc:report-menu-setup)
 
   ;; the Welcome to GnuCash "extravaganza" report


More information about the gnucash-changes mailing list