[sword-svn] r46 - trunk/src/gui

bdrake at www.crosswire.org bdrake at www.crosswire.org
Tue Dec 4 09:34:21 MST 2007


Author: bdrake
Date: 2007-12-04 09:34:20 -0700 (Tue, 04 Dec 2007)
New Revision: 46

Modified:
   trunk/src/gui/SimpleNavigator.cpp
Log:


Modified: trunk/src/gui/SimpleNavigator.cpp
===================================================================
--- trunk/src/gui/SimpleNavigator.cpp	2007-12-04 11:01:22 UTC (rev 45)
+++ trunk/src/gui/SimpleNavigator.cpp	2007-12-04 16:34:20 UTC (rev 46)
@@ -220,30 +220,11 @@
 	}
 }
 
-int GetModIdx(const char* ModName) {
-	//I regard this as a kludge ........ it is only helpful on footnotes, and is there
-	//because of the limitations of the SwordIndex class
-	// setting module, book chapter and verse in SwordIndex seem to need numbers
-	// this is a pain ........  needs re-thinking ........
-	int modnum = -1;
-	sword::ModMap::iterator it;
-	sword::SWModule* curMod = 0;
-	for (it = SwordIndex::manager->Modules.begin(); it != SwordIndex::manager->Modules.end(); it++) {
-				curMod = (*it).second;
-				++modnum; 
-				if (strstr(curMod->Name(), ModName)) {
-					return(modnum); // at this point, modnum is the index into the translations menu that we want
-					// MessageBox(0, strtowstr(footnote.getParameterValue("module")), L"This is the module", MB_OK);
-					}
-		}  
-return(0); // it can't really get here, can it?
-}
-
 void SimpleNavigator::urlClicked(const WCHAR *target) {
 	const char * t = wstrtostr(target);
 	// MessageBox(0, strtowstr(t), L"This is 't'", MB_OK);
 	// SWMgr swmanager; // don't create new manager - use SwordIndex::manager
-	if (strstr(t, "showNote")) { // we don't do anything unless we have a footnote
+	if (strstr(t, "showNote")) {
 		URL footnote(t);  // t is char* to URL string
 		SWBuf module = footnote.getParameterValue("module");
 		SWBuf key = footnote.getParameterValue("passage");
@@ -253,24 +234,20 @@
 		// get the module it's in
 		SWModule *mod = SwordIndex::manager->getModule(module); // Thanks Troy for above ...  Nov 2007
 		// set that module to the correct entry
-		// problem caused by this - we get a permanent setting here
-		mod->setKey(key.c_str());  // this line of code makes all future verses become 'key'
+		SWKey *modKey = mod->getKey(); // get the persistent key
+		modKey->setText(key.c_str()); // set the key itself 
 		// force a parse of the entry
 		mod->RenderText(); 
 		MessageBox(0, strtowstr(mod->getEntryAttributes()["Footnote"][footnoteNumber]["body"]), L"Footnote", MB_OK);
-		// now we have to get rid of the 'permanent' setKey verse setting
-		// this gets correct module re-initialised with chap & Vs
-		// by 'pretending' that the appropriate translation has been selected
-		// as this is the footnote's translation it is OK, but this method won't do for cross refs
-		// add to which, it's very slow
-		SimpleNavigator::buttonClicked (GetModIdx(footnote.getParameterValue("module"))+transStartID); 
-		}  // </> if (strstr(t, "showNote"))
-	//comment next line out in release version
-	else MessageBox(0, strtowstr("Unable to show reference"), L"url clicked", MB_OK); // catch all
+		}
+//comment next line out in release version
+else MessageBox(0, strtowstr("Unable to show reference"), L"url clicked", MB_OK); // catch all
 }
 
 
 int SimpleNavigator::getID() {
+
 	return nextID++;
+
 }
 




More information about the sword-cvs mailing list