Merge pull request #1662 from girst/listify-tables

listify two-column tables
This commit is contained in:
Alexey Sokolov
2019-06-21 21:52:29 +01:00
committed by GitHub
12 changed files with 28 additions and 1 deletions
+1
View File
@@ -83,6 +83,7 @@ class CAutoCycleMod : public CModule {
void OnListCommand(const CString& sLine) {
CTable Table;
Table.AddColumn(t_s("Channel"));
Table.SetStyle(CTable::ListStyle);
for (const CString& sChan : m_vsChans) {
Table.AddRow();
+1
View File
@@ -169,6 +169,7 @@ class CSSLClientCertMod : public CModule {
Table.AddColumn(t_s("Id", "list"));
Table.AddColumn(t_s("Key", "list"));
Table.SetStyle(CTable::ListStyle);
MSCString::const_iterator it = m_PubKeys.find(GetUser()->GetUsername());
if (it == m_PubKeys.end()) {
+7
View File
@@ -50,6 +50,7 @@ class CAdminMod : public CModule {
CTable VarTable;
VarTable.AddColumn(t_s("Type", "helptable"));
VarTable.AddColumn(t_s("Variables", "helptable"));
VarTable.SetStyle(CTable::ListStyle);
std::map<CString, VCString> mvsTypedVariables;
for (unsigned int i = 0; i != uSize; ++i) {
CString sVar = CString(vars[i].name).AsLower();
@@ -119,6 +120,7 @@ class CAdminMod : public CModule {
{"ClientEncoding", str},
#endif
};
PutModule("");
PrintVarsHelp(sVarFilter, vars, ARRAY_SIZE(vars),
t_s("The following variables are available when "
"using the Set/Get commands:"));
@@ -142,6 +144,7 @@ class CAdminMod : public CModule {
{"TrustAllCerts", boolean},
{"TrustPKI", boolean},
};
PutModule("");
PrintVarsHelp(sVarFilter, nvars, ARRAY_SIZE(nvars),
t_s("The following variables are available when "
"using the SetNetwork/GetNetwork commands:"));
@@ -155,12 +158,14 @@ class CAdminMod : public CModule {
{"InConfig", boolean},
{"AutoClearChanBuffer", boolean},
{"Detached", boolean}};
PutModule("");
PrintVarsHelp(sVarFilter, cvars, ARRAY_SIZE(cvars),
t_s("The following variables are available when "
"using the SetChan/GetChan commands:"));
}
if (sCmdFilter.empty())
PutModule("");
PutModule(
t_s("You can use $user as the user name and $network as the "
"network name for modifying your own user and network."));
@@ -1279,6 +1284,7 @@ class CAdminMod : public CModule {
CTable Table;
Table.AddColumn(t_s("Request", "listctcp"));
Table.AddColumn(t_s("Reply", "listctcp"));
Table.SetStyle(CTable::ListStyle);
for (const auto& it : msCTCPReplies) {
Table.AddRow();
Table.SetCell(t_s("Request", "listctcp"), it.first);
@@ -1493,6 +1499,7 @@ class CAdminMod : public CModule {
CTable Table;
Table.AddColumn(t_s("Name", "listmodules"));
Table.AddColumn(t_s("Arguments", "listmodules"));
Table.SetStyle(CTable::ListStyle);
for (const CModule* pMod : Modules) {
Table.AddRow();
+1
View File
@@ -473,6 +473,7 @@ class CCryptMod : public CModule {
CTable Table;
Table.AddColumn(t_s("Target", "listkeys"));
Table.AddColumn(t_s("Key", "listkeys"));
Table.SetStyle(CTable::ListStyle);
for (MCString::iterator it = BeginNV(); it != EndNV(); ++it) {
if (!it->first.Equals(NICK_PREFIX_KEY)) {
+1
View File
@@ -176,6 +176,7 @@ class CFailToBanMod : public CModule {
CTable Table;
Table.AddColumn(t_s("Host", "list"));
Table.AddColumn(t_s("Attempts", "list"));
Table.SetStyle(CTable::ListStyle);
for (const auto& it : m_Cache.GetItems()) {
Table.AddRow();
+1
View File
@@ -60,6 +60,7 @@ class CLastSeenMod : public CModule {
Table.AddColumn(t_s("User", "show"));
Table.AddColumn(t_s("Last Seen", "show"));
Table.SetStyle(CTable::ListStyle);
for (it = mUsers.begin(); it != mUsers.end(); ++it) {
Table.AddRow();
+1
View File
@@ -167,6 +167,7 @@ void CLogMod::ListRulesCmd(const CString& sLine) {
CTable Table;
Table.AddColumn(t_s("Rule", "listrules"));
Table.AddColumn(t_s("Logging enabled", "listrules"));
Table.SetStyle(CTable::ListStyle);
for (const CLogRule& Rule : m_vRules) {
Table.AddRow();
+1
View File
@@ -163,6 +163,7 @@ class CNotesMod : public CModule {
CTable Table;
Table.AddColumn(t_s("Key"));
Table.AddColumn(t_s("Note"));
Table.SetStyle(CTable::ListStyle);
for (MCString::iterator it = BeginNV(); it != EndNV(); ++it) {
Table.AddRow();
+2
View File
@@ -87,6 +87,7 @@ class CSASLMod : public CModule {
CTable Mechanisms;
Mechanisms.AddColumn(t_s("Mechanism"));
Mechanisms.AddColumn(t_s("Description"));
Mechanisms.SetStyle(CTable::ListStyle);
for (const auto& it : SupportedMechanisms) {
Mechanisms.AddRow();
@@ -94,6 +95,7 @@ class CSASLMod : public CModule {
Mechanisms.SetCell(t_s("Description"), it.sDescription.Resolve());
}
PutModule("");
PutModule(t_s("The following mechanisms are available:"));
PutModule(Mechanisms);
}
+1
View File
@@ -599,6 +599,7 @@ class CWatcherMod : public CModule {
Table.AddColumn(t_s("Command"));
Table.AddColumn(t_s("Description"));
Table.SetStyle(CTable::ListStyle);
Table.AddRow();
Table.SetCell(t_s("Command"), t_s("Add <HostMask> [Target] [Pattern]"));