Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Show list of common modules in --makeconfig without any question befo…

…re it.

"Don't ask to ask!"
  • Loading branch information...
commit 92304835ef3e0309a5e83c3ef09e0e5016d3e756 1 parent fbd8d69
Alexey Sokolov authored
Showing with 56 additions and 60 deletions.
  1. +56 −60 znc.cpp
View
116 znc.cpp
@@ -729,41 +729,39 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) {
CUtils::PrintMessage("-- Global Modules --");
CUtils::PrintMessage("");
- if (CUtils::GetBoolInput("Do you want to load any global modules?")) {
- CTable Table;
- Table.AddColumn("Name");
- Table.AddColumn("Description");
- set<CModInfo>::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));
- }
+ CTable Table;
+ Table.AddColumn("Name");
+ Table.AddColumn("Description");
+ set<CModInfo>::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);
- }
+ unsigned int uTableIdx = 0; CString sLine;
+ while (Table.GetLine(uTableIdx++, sLine)) {
+ CUtils::PrintMessage(sLine);
+ }
- if (uNrOtherGlobalMods > 0) {
- CUtils::PrintMessage("And " + CString(uNrOtherGlobalMods) + " other (uncommon) modules. You can enable those later.");
- }
+ if (uNrOtherGlobalMods > 0) {
+ CUtils::PrintMessage("And " + CString(uNrOtherGlobalMods) + " other (uncommon) modules. You can enable those later.");
+ }
- CUtils::PrintMessage("");
+ CUtils::PrintMessage("");
- for (it = ssGlobalMods.begin(); it != ssGlobalMods.end(); ++it) {
- const CModInfo& Info = *it;
- CString sName = Info.GetName();
+ for (it = ssGlobalMods.begin(); it != ssGlobalMods.end(); ++it) {
+ const CModInfo& Info = *it;
+ CString sName = Info.GetName();
- if (CUtils::StdoutIsTTY()) {
- if (CUtils::GetBoolInput("Load global module <\033[1m" + sName + "\033[22m>?", false))
- vsLines.push_back("LoadModule = " + sName);
- } else {
- if (CUtils::GetBoolInput("Load global module <" + sName + ">?", false))
- vsLines.push_back("LoadModule = " + sName);
- }
+ if (CUtils::StdoutIsTTY()) {
+ if (CUtils::GetBoolInput("Load global module <\033[1m" + sName + "\033[22m>?", false))
+ vsLines.push_back("LoadModule = " + sName);
+ } else {
+ if (CUtils::GetBoolInput("Load global module <" + sName + ">?", false))
+ vsLines.push_back("LoadModule = " + sName);
}
}
}
@@ -837,41 +835,39 @@ bool CZNC::WriteNewConfig(const CString& sConfigFile) {
CUtils::PrintMessage("-- User Modules --");
CUtils::PrintMessage("");
- if (CUtils::GetBoolInput("Do you want to automatically load any user modules for this user?")) {
- CTable Table;
- Table.AddColumn("Name");
- Table.AddColumn("Description");
- set<CModInfo>::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));
- }
+ CTable Table;
+ Table.AddColumn("Name");
+ Table.AddColumn("Description");
+ set<CModInfo>::iterator it;
- unsigned int uTableIdx = 0; CString sLine;
- while (Table.GetLine(uTableIdx++, sLine)) {
- CUtils::PrintMessage(sLine);
- }
+ 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));
+ }
- if (uNrOtherUserMods > 0) {
- CUtils::PrintMessage("And " + CString(uNrOtherUserMods) + " other (uncommon) modules. You can enable those later.");
- }
+ unsigned int uTableIdx = 0; CString sLine;
+ while (Table.GetLine(uTableIdx++, sLine)) {
+ CUtils::PrintMessage(sLine);
+ }
- CUtils::PrintMessage("");
+ if (uNrOtherUserMods > 0) {
+ CUtils::PrintMessage("And " + CString(uNrOtherUserMods) + " other (uncommon) modules. You can enable those later.");
+ }
- for (it = ssUserMods.begin(); it != ssUserMods.end(); ++it) {
- const CModInfo& Info = *it;
- CString sName = Info.GetName();
+ CUtils::PrintMessage("");
- if (CUtils::StdoutIsTTY()) {
- if (CUtils::GetBoolInput("Load module <\033[1m" + sName + "\033[22m>?", false))
- vsLines.push_back("\tLoadModule = " + sName);
- } else {
- if (CUtils::GetBoolInput("Load module <" + sName + ">?", false))
- vsLines.push_back("\tLoadModule = " + sName);
- }
+ for (it = ssUserMods.begin(); it != ssUserMods.end(); ++it) {
+ const CModInfo& Info = *it;
+ CString sName = Info.GetName();
+
+ if (CUtils::StdoutIsTTY()) {
+ if (CUtils::GetBoolInput("Load module <\033[1m" + sName + "\033[22m>?", false))
+ vsLines.push_back("\tLoadModule = " + sName);
+ } else {
+ if (CUtils::GetBoolInput("Load module <" + sName + ">?", false))
+ vsLines.push_back("\tLoadModule = " + sName);
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.