From d7cc61e6d949361da7eedb0cbb2eb9c52bd79e4a Mon Sep 17 00:00:00 2001 From: WrinklyNinja Date: Fri, 9 Aug 2013 14:18:59 +0100 Subject: [PATCH] Made graph output dependent on GraphVis being present in the BOSS install. Also disabled the masterlist updater as a time-saver for testers. --- src/backend/globals.cpp | 2 ++ src/backend/globals.h | 2 ++ src/gui/main.cpp | 9 ++++++--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/backend/globals.cpp b/src/backend/globals.cpp index 7b6a2098..69a4d3b4 100644 --- a/src/backend/globals.cpp +++ b/src/backend/globals.cpp @@ -61,4 +61,6 @@ namespace boss { const boost::filesystem::path g_path_settings = g_path_local / "settings.yaml"; const boost::filesystem::path g_path_log = g_path_local / "BOSSDebugLog.txt"; const boost::filesystem::path g_path_l10n = "resources/l10n"; + const boost::filesystem::path g_path_graphvis = "resources/graphvis/dot.exe"; + const boost::filesystem::path g_path_graph = g_path_local / "graph.svg"; } diff --git a/src/backend/globals.h b/src/backend/globals.h index 8f8637e0..46fd7cb1 100644 --- a/src/backend/globals.h +++ b/src/backend/globals.h @@ -62,6 +62,8 @@ namespace boss { extern const boost::filesystem::path g_path_svn; extern const boost::filesystem::path g_path_log; extern const boost::filesystem::path g_path_l10n; + extern const boost::filesystem::path g_path_graphvis; + extern const boost::filesystem::path g_path_graph; } #endif diff --git a/src/gui/main.cpp b/src/gui/main.cpp index 0dd0840d..fdbd1b22 100644 --- a/src/gui/main.cpp +++ b/src/gui/main.cpp @@ -415,7 +415,7 @@ void Launcher::OnSortPlugins(wxCommandEvent& event) { vector parsingErrors; string revision; try { - revision = UpdateMasterlist(_game, parsingErrors); +// revision = UpdateMasterlist(_game, parsingErrors); } catch (boss::error& e) { BOOST_LOG_TRIVIAL(error) << "Masterlist update failed. Details: " << e.what(); messages.push_back(boss::Message(boss::g_message_error, (format(loc::translate("Masterlist update failed. Details: %1%")) % e.what()).str())); @@ -664,8 +664,11 @@ void Launcher::OnSortPlugins(wxCommandEvent& event) { //Just for fun - output the graph as a ".dot" file for external rendering. If I can get this pretty, I might add it to a tab in the BOSS Report - here's a few Javascript libraries for displaying .dot files, but in my test case the graph is too complex and both libraries I found ran out of memory. //The .dot file can be converted to an SVG using Graphviz: the command is `dot -Tsvg output.dot -o output.svg`. - BOOST_LOG_TRIVIAL(trace) << "Outputting the graph."; - boss::SaveGraph(graph, "output.dot"); + if (fs::exists(g_path_graphvis)) { + BOOST_LOG_TRIVIAL(trace) << "Outputting the graph."; + boss::SaveGraph(graph, "output.dot"); + + } //Check for back-edges, then perform a topological sort. try {