[sword-devel] feature request

Troy A. Griffitts sword-devel@crosswire.org
Sun, 11 Mar 2001 16:03:47 -0700


> Since we are planning ThML support, we will need a language= tag in the
> module config files; this will be necessary for the correct parsing of bible
> references. This tag would correspond to the language definition in the
> original ThML document's header.

    YES.  You may add any tag you wish to the config file of a modules. 
I will try to remember to place this tag in new modules that have other
than english verse refs, but please let me know if there is a specific
module that needs it...

> Is it possible to have some mechanism the frontend programs could use to
> write to the module config files (cipher key, font key etc.). We do this in a
> quite work intensive way in bibletime at the moment, and a feature like this
> would ease this tast of saving module specific information. If a mechanism
> like this does already exist, please tell me about it.

    YES!  This has been on the drawing board.  I've been planning on
changing the SWConfig SWMgr::config to use a new subclass of SWConfig
that will keep track of what sections came from what file and so
changing the object and then calling the Save() method will save to the
appropriate files.  I hope this will be much easier for you guys.

You may also consider that it might not be a good idea to save some
settings to the systemwide module config files.  It might be better to
save, say, a ~/.sword/modoptions.conf file and letting your subclass of
SWMgr merge the contents of ~/.sword/modoptions.conf into its config

    SWConfig localopts("~/.sword/localopts");
    swmgr->config += localopts;

The '+=' merge adds everything from localopts into the swmgr's config
entries (overriding any that were already there).

And you can just:

    localopts.config["KJV"]["MyOption"] = "My Value";

Hope this helps.