From 5a4b6e70fd815c9052ff71a4244bdeb707e92ba1 Mon Sep 17 00:00:00 2001 From: Tannin Date: Mon, 2 Jun 2014 19:15:23 +0200 Subject: - plugin-list now displays loot messages --- src/mainwindow.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 496d0d9e..8fcd4024 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -116,7 +116,7 @@ along with Mod Organizer. If not, see . #include #include #include - +#include #ifdef TEST_MODELS #include "modeltest.h" @@ -5158,6 +5158,9 @@ void MainWindow::processLOOTOut(const std::string &lootOut, std::string &reportU { std::vector lines; boost::split(lines, lootOut, boost::is_any_of("\r\n")); + + std::tr1::regex exRequires("\"([^\"]*)\" requires \"([^\"]*)\", but it is missing\\."); + foreach (const std::string &line, lines) { if (line.length() > 0) { size_t progidx = line.find("[progress]"); @@ -5171,7 +5174,14 @@ void MainWindow::processLOOTOut(const std::string &lootOut, std::string &reportU qWarning("%s", line.c_str()); errorMessages.append(boost::algorithm::trim_copy(line.substr(erroridx + 8)) + "\n"); } else { - qDebug("%s", line.c_str()); + std::tr1::smatch match; + if (std::tr1::regex_match(line, match, exRequires)) { + std::string modName(match[1].first, match[1].second); + std::string dependency(match[2].first, match[2].second); + m_PluginList.addInformation(modName.c_str(), tr("depends on missing \"%1\"").arg(dependency.c_str())); + } else { + qDebug("%s", line.c_str()); + } } } } @@ -5258,6 +5268,8 @@ void MainWindow::on_bossButton_clicked() // we don't use the write end ::CloseHandle(stdOutWrite); + m_PluginList.clearAdditionalInformation(); + if (loot != INVALID_HANDLE_VALUE) { while (::WaitForSingleObject(loot, 100) == WAIT_TIMEOUT) { // keep processing events so the app doesn't appear dead -- cgit v1.3.1