From 1c90fd9beb242e0941b5a4ae04c0af7b765f2eee Mon Sep 17 00:00:00 2001 From: prozacx Date: Thu, 26 May 2005 20:41:45 +0000 Subject: [PATCH] Added output table of modules with descriptions git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@365 726aef4b-f618-498e-8847-2d620e286838 --- znc.cpp | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/znc.cpp b/znc.cpp index 95ad580c..c5cb435b 100644 --- a/znc.cpp +++ b/znc.cpp @@ -294,7 +294,26 @@ bool CZNC::WriteNewConfig(const CString& sConfig) { CUtils::PrintMessage(""); if (CUtils::GetBoolInput("Do you want to load any global modules?")) { - for (set::iterator it = ssGlobalMods.begin(); it != ssGlobalMods.end(); it++) { + CTable Table; + Table.AddColumn("Name"); + Table.AddColumn("Description"); + set::iterator it; + + for (it = ssGlobalMods.begin(); it != ssGlobalMods.end(); it++) { + const CModInfo& Info = *it; + Table.AddRow(); + Table.SetCell("Name", Info.GetName()); + Table.SetCell("Description", Info.GetDescription().Ellipsize(128)); + } + + unsigned int uTableIdx = 0; CString sLine; + while (Table.GetLine(uTableIdx++, sLine)) { + CUtils::PrintMessage(sLine); + } + + CUtils::PrintMessage(""); + + for (it = ssGlobalMods.begin(); it != ssGlobalMods.end(); it++) { const CModInfo& Info = *it; CString sName = Info.GetName(); @@ -361,7 +380,26 @@ bool CZNC::WriteNewConfig(const CString& sConfig) { CUtils::PrintMessage(""); if (CUtils::GetBoolInput("Do you want to automatically load any user modules for this user?")) { - for (set::iterator it = ssUserMods.begin(); it != ssUserMods.end(); it++) { + CTable Table; + Table.AddColumn("Name"); + Table.AddColumn("Description"); + set::iterator it; + + for (it = ssUserMods.begin(); it != ssUserMods.end(); it++) { + const CModInfo& Info = *it; + Table.AddRow(); + Table.SetCell("Name", Info.GetName()); + Table.SetCell("Description", Info.GetDescription().Ellipsize(128)); + } + + unsigned int uTableIdx = 0; CString sLine; + while (Table.GetLine(uTableIdx++, sLine)) { + CUtils::PrintMessage(sLine); + } + + CUtils::PrintMessage(""); + + for (it = ssUserMods.begin(); it != ssUserMods.end(); it++) { const CModInfo& Info = *it; CString sName = Info.GetName();