From bd1a5b9071087dad26dbe75b42d06f20bdd74180 Mon Sep 17 00:00:00 2001 From: WrinklyNinja Date: Sun, 22 Jun 2014 17:44:03 +0100 Subject: [PATCH] Added plugin counts to report summary. Also split the summary up into version info and plugin & message count sections. --- resources/report/report.html | 29 ++++++++++++++++++++--------- resources/report/script.js | 17 +++++++++++++++-- resources/report/style.css | 3 +++ src/backend/generators.cpp | 29 +++++++++++++++++++++++++---- 4 files changed, 63 insertions(+), 15 deletions(-) diff --git a/resources/report/report.html b/resources/report/report.html index f7156084..2054cb18 100644 --- a/resources/report/report.html +++ b/resources/report/report.html @@ -24,14 +24,25 @@

- - - - - - - - +
+
+
+
+
+ +
+

+ + +
+
+
+
+ + +
+
+
@@ -51,7 +62,7 @@

- : 0 / + : 0 /
: 0 / diff --git a/resources/report/script.js b/resources/report/script.js index 41ce3e64..37cc2ca0 100644 --- a/resources/report/script.js +++ b/resources/report/script.js @@ -224,6 +224,8 @@ function processURLParams() { var totalMessageNo = 0; var warnMessageNo = 0; var errorMessageNo = 0; + var activePluginNo = 0; + var dirtyPluginNo = 0; /* Fill report with data. */ document.getElementById('lootVersion').textContent = data.lootVersion; document.getElementById('masterlistRevision').textContent = data.masterlist.revision; @@ -250,6 +252,14 @@ function processURLParams() { li.setAttribute('data-active', data.plugins[i].isActive); + if (data.plugins[i].isActive) { + ++activePluginNo; + } + + if (data.plugins[i].isDirty) { + ++dirtyPluginNo; + } + var mod = document.createElement('div'); mod.className = 'mod'; mod.textContent = data.plugins[i].name; @@ -301,11 +311,14 @@ function processURLParams() { } pluginsList.appendChild(li); } - document.getElementById('totalMessageNo').textContent = totalMessageNo; document.getElementById('filterTotalMessageNo').textContent = totalMessageNo; - document.getElementById('totalPluginNo').textContent = data.plugins.length; + document.getElementById('totalMessageNo').textContent = totalMessageNo; document.getElementById('totalWarningNo').textContent = warnMessageNo; document.getElementById('totalErrorNo').textContent = errorMessageNo; + document.getElementById('filterTotalPluginNo').textContent = data.plugins.length; + document.getElementById('totalPluginNo').textContent = data.plugins.length; + document.getElementById('activePluginNo').textContent = activePluginNo; + document.getElementById('dirtyPluginNo').textContent = dirtyPluginNo; /* Now apply translated UI strings. */ for (var id in data.l10n) { diff --git a/resources/report/style.css b/resources/report/style.css index 62e60ae6..d64901c6 100644 --- a/resources/report/style.css +++ b/resources/report/style.css @@ -78,6 +78,9 @@ table td:first-child { text-align:left; padding-left:0; } +table:not(:last-child) { + margin-right: 3em; +} #noChanges { font-weight:bold; font-size:12pt; diff --git a/src/backend/generators.cpp b/src/backend/generators.cpp index 173a334b..7bdd19c6 100644 --- a/src/backend/generators.cpp +++ b/src/backend/generators.cpp @@ -184,6 +184,7 @@ namespace loot { std::list messages = plugin.Messages(); std::set dirtyInfo = plugin.DirtyInfo(); + size_t numDirtyInfo(0); for (const auto &element: dirtyInfo) { boost::format f; if (element.ITMs() > 0 && element.UDRs() > 0 && element.DeletedNavmeshes() > 0) @@ -208,8 +209,16 @@ namespace loot { f = boost::format(boost::locale::translate("Contains %1% ITM records and %2% UDR records. Clean with %3%.")) % element.ITMs() % element.UDRs() % element.CleaningUtility(); messages.push_back(loot::Message(loot::Message::warn, f.str())); + ++numDirtyInfo; } + //Also add some metadata so that the summary can count the total number of cleaning messages. + out << YAML::Key << "isDirty"; + if (numDirtyInfo > 0) + out << YAML::Value << true; + else + out << YAML::Value << false; + if (!messages.empty()) { out << YAML::Key << "messages" << YAML::Value << YAML::BeginSeq; @@ -312,7 +321,7 @@ namespace loot { << YAML::Value << boost::locale::translate("Summary").str() << YAML::Key << "txtSummary" - << YAML::Value << boost::locale::translate("Summary").str() + << YAML::Value << boost::locale::translate("Version Information").str() << YAML::Key << "txtLootVersion" << YAML::Value << boost::locale::translate("LOOT Version").str() @@ -326,14 +335,26 @@ namespace loot { << YAML::Key << "txtMasterlistUpdating" << YAML::Value << boost::locale::translate("Masterlist Updating").str() + << YAML::Key << "txtCounts" + << YAML::Value << boost::locale::translate("Plugin & Message Counts").str() + + << YAML::Key << "txtTotalPluginNo" + << YAML::Value << boost::locale::translate("Total Plugins").str() + + << YAML::Key << "txtActivePluginNo" + << YAML::Value << boost::locale::translate("Active Plugins").str() + + << YAML::Key << "txtDirtyPluginNo" + << YAML::Value << boost::locale::translate("Dirty Plugins").str() + << YAML::Key << "txtTotalMessageNo" - << YAML::Value << boost::locale::translate("Total Number of Messages").str() + << YAML::Value << boost::locale::translate("Total Messages").str() << YAML::Key << "txtTotalWarningNo" - << YAML::Value << boost::locale::translate("Number of Warnings").str() + << YAML::Value << boost::locale::translate("Warnings").str() << YAML::Key << "txtTotalErrorNo" - << YAML::Value << boost::locale::translate("Number of Errors").str() + << YAML::Value << boost::locale::translate("Errors").str() << YAML::Key << "txtGeneralMessages" << YAML::Value << boost::locale::translate("General Messages").str()