[sword-svn] r60 - trunk/src/gui
bdrake at www.crosswire.org
bdrake at www.crosswire.org
Fri Dec 14 12:56:37 MST 2007
Author: bdrake
Date: 2007-12-14 12:56:35 -0700 (Fri, 14 Dec 2007)
New Revision: 60
Modified:
trunk/src/gui/SimpleNavigator.cpp
Log:
Modified: trunk/src/gui/SimpleNavigator.cpp
===================================================================
--- trunk/src/gui/SimpleNavigator.cpp 2007-12-14 05:36:19 UTC (rev 59)
+++ trunk/src/gui/SimpleNavigator.cpp 2007-12-14 19:56:35 UTC (rev 60)
@@ -271,19 +271,51 @@
SWBuf type = footnote.getParameterValue("type");
SWBuf number = footnote.getParameterValue("value");
SWModule *mod = 0;
- if(strstr(type.c_str(), "robinson"))
+ if(strstr(type.c_str(), "robinson")) {
mod = SwordIndex::greekMorph;
- if(strstr(type.c_str(), "strongMorph"))
+ if (! mod) {
+ MessageBox(0, strtowstr("No Greek parsing Dictionary found - install Morphological modules"),
+ L"Greek Morphological tags", MB_ICONWARNING);
+ return;
+ }
+ }
+ if(strstr(type.c_str(), "strongMorph")) {
mod = SwordIndex::hebrewMorph;
- if (! mod) {
- MessageBox(0, strtowstr("No Dictionary found - install Morphological modules"),
- L"Morphological tags", MB_OK);
+ if (! mod) {
+ MessageBox(0, strtowstr("No Hebrew parsing Dictionary found - install Morphological modules"),
+ L"Hebrew Morphological tags", MB_ICONWARNING);
return;
+ }
}
SWKey *modKey = mod->getKey();
modKey->setText(number.c_str());
mod->RenderText();
MessageBox(0, strtowstr(mod->StripText()), L"Morph tags", MB_OK);
+ }
+ // X-Ref MessageBox
+ if (strstr(t, "scripRef")) {
+ URL footnote(t); // t is char* to URL string
+ SWBuf module = footnote.getParameterValue("module"); // very unlikely to have this
+ SWBuf key = footnote.getParameterValue("value");
+ // TODO the next piece of code need to check if there is a module referenced (unlikely!)
+ // and if not, pick a valid module ... user ought to be able to choose
+ // the module for cross referencing
+ //if (!strstr(module.c_str(), ""))
+ // SWModule *mod = SwordIndex::manager->getModule(module);
+ //else mod = SwordIndex::manager->getModule("KJV");
+ SWModule *mod = SwordIndex::manager->getModule("KJV");
+ if (!mod) {
+ MessageBox(0, strtowstr("No KJV bible found"),
+ L"Cross referencing", MB_ICONWARNING);
+ return;
+ }
+ SWKey *modKey = mod->getKey(); // get the persistent key
+ modKey->setText(key.c_str()); // set the key itself
+ mod->RenderText();
+ // strip out html if present
+ SWBuf body = mod->StripText();
+ // not sure if MessageBox can display html - if it can, re-think this some day
+ MessageBox(0, strtowstr(body), L"Scripture reference", MB_OK);
}
//comment next line out in release version
else MessageBox(0, strtowstr(t), L"Raw entry unresolved", MB_OK); // catch all
More information about the sword-cvs
mailing list