[sword-svn] r2223 - trunk/utilities

scribe at crosswire.org scribe at crosswire.org
Sat Jan 10 15:34:00 MST 2009


Author: scribe
Date: 2009-01-10 15:34:00 -0700 (Sat, 10 Jan 2009)
New Revision: 2223

Modified:
   trunk/utilities/installmgr.cpp
Log:
added visual symbols to show module status


Modified: trunk/utilities/installmgr.cpp
===================================================================
--- trunk/utilities/installmgr.cpp	2009-01-10 22:03:24 UTC (rev 2222)
+++ trunk/utilities/installmgr.cpp	2009-01-10 22:34:00 UTC (rev 2223)
@@ -134,13 +134,19 @@
 }
 
 
-void listModules(SWMgr *mgr) {
+void listModules(SWMgr *otherMgr) {
 	cout << "Installed Modules:\n\n";
 	SWModule *module;
-	for (ModMap::iterator it = mgr->Modules.begin(); it != mgr->Modules.end(); it++) {
-		module = it->second;
+	std::map<SWModule *, int> mods = InstallMgr::getModuleStatus(*mgr, *otherMgr);
+	for (std::map<SWModule *, int>::iterator it = mods.begin(); it != mods.end(); it++) {
+		module = it->first;
 		SWBuf version = module->getConfigEntry("Version");
-		cout << "[" << module->Name() << "]  \t(" << version << ")  \t- " << module->Description() << "\n";
+		SWBuf status = " ";
+		if (it->second & InstallMgr::MODSTAT_NEW) status = "*";
+		if (it->second & InstallMgr::MODSTAT_OLDER) status = "-";
+		if (it->second & InstallMgr::MODSTAT_UPDATED) status = ">";
+
+		cout << status << "[" << module->Name() << "]  \t(" << version << ")  \t- " << module->Description() << "\n";
 	}
 }
 




More information about the sword-cvs mailing list