diff options
| author | Tannin <devnull@localhost> | 2014-06-02 19:15:23 +0200 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2014-06-02 19:15:23 +0200 |
| commit | 5a4b6e70fd815c9052ff71a4244bdeb707e92ba1 (patch) | |
| tree | df95709e24d2d417e463f59d9e6acf21fea35780 /src/mainwindow.cpp | |
| parent | 18574c2ba89737b2140236bde479e87616470270 (diff) | |
- plugin-list now displays loot messages
Diffstat (limited to 'src/mainwindow.cpp')
| -rw-r--r-- | src/mainwindow.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
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 <http://www.gnu.org/licenses/>. #include <scopeguard.h> #include <boost/thread.hpp> #include <boost/algorithm/string.hpp> - +#include <regex> #ifdef TEST_MODELS #include "modeltest.h" @@ -5158,6 +5158,9 @@ void MainWindow::processLOOTOut(const std::string &lootOut, std::string &reportU { std::vector<std::string> 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 |
