[sword-devel] List of global options

Ben Morgan benpmorgan at gmail.com
Mon May 5 04:52:22 MST 2008

Hi Manfred,

Yes, the options are text strings.
You can get the list of options available for all modules in the mgr by
using getGlobalOptions.
getGlobalOptionTip will give a tip, suitable for putting in a status bar or
getGlobalOptionValues will give the options for a given value. This will be
"On" or "Off" for simple boolean values, or different for other different

If you want to find out all the ones, I think you'll have to delve through
the SWORD source code. (or possibly have a look at the source code of other
frontends to see what other ones they use)
In src/mgr/swmgr.cpp, in SWMgr::init(), there are lots of lines like this:
    tmpFilter = new ThMLVariants();

If you look in src/modules/filters/thmlvariants.cpp, you find these lines:
const char ThMLVariants::primary[] = "Primary Reading";
const char ThMLVariants::secondary[] = "Secondary Reading";
const char ThMLVariants::all[] = "All Readings";

const char ThMLVariants::optName[] = "Textual Variants";
const char ThMLVariants::optTip[] = "Switch between Textual Variants modes";

ThMLVariants::ThMLVariants() {
    option = false;

So if thmlvariants is specified as a GlobalOptionFilter in a module, there
will be an option called Textual Variants, with tip
"Switch between Textual Variants modes". It will have the options "Primary
Reading", "Secondary Reading" and "All Readings"

By going through every filter you can find every different option (some will
be there in more than one filter).

However, I would recommend dynamically generating them for two reasons:
1) Only show options users can toggle which will affect at least one module
2) If new options are added, they will automatically appear on the list

This is what is done in BPBible.

However, I'm not sure whether these strings will be localized at all.

God Bless,
The Lord is not slow to fulfill his promise as some count slowness,
but is patient toward you, not wishing that any should perish,
but that all should reach repentance.
2 Peter 3:9 (ESV)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.crosswire.org/pipermail/sword-devel/attachments/20080505/e9c4853e/attachment.html 

More information about the sword-devel mailing list