ui: print version number of used SourcetrailPythonIndexer in sourcegroup selection ui
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#include "QtProjectWizzardContentSelect.h"
|
||||
|
||||
#include <regex>
|
||||
|
||||
#include <QButtonGroup>
|
||||
#include <QMessageBox>
|
||||
#include <QLabel>
|
||||
@@ -11,6 +13,7 @@
|
||||
#include "ResourcePaths.h"
|
||||
#include "SqliteIndexStorage.h"
|
||||
#include "utilityString.h"
|
||||
#include "utilityApp.h"
|
||||
|
||||
QtProjectWizzardContentSelect::QtProjectWizzardContentSelect(
|
||||
QtProjectWizzardWindow* window
|
||||
@@ -21,6 +24,18 @@ QtProjectWizzardContentSelect::QtProjectWizzardContentSelect(
|
||||
|
||||
void QtProjectWizzardContentSelect::populate(QGridLayout* layout, int& row)
|
||||
{
|
||||
std::string pythonIndexerVersion = " ";
|
||||
{
|
||||
std::string str = utility::executeProcess("\"" + ResourcePaths::getPythonPath().str() + "SourcetrailPythonIndexer\" --version", FilePath(), 5000);
|
||||
std::regex regex("v\\d*\\.db\\d*\\.p\\d*"); // "\\d" matches any digit; "\\." matches the "." character
|
||||
std::smatch matches;
|
||||
std::regex_search(str, matches, regex);
|
||||
if (!matches.empty())
|
||||
{
|
||||
pythonIndexerVersion = matches.str(0) + " ";
|
||||
}
|
||||
}
|
||||
|
||||
struct SourceGroupInfo
|
||||
{
|
||||
SourceGroupInfo(SourceGroupType type, bool recommended = false)
|
||||
@@ -65,8 +80,8 @@ void QtProjectWizzardContentSelect::populate(QGridLayout* layout, int& row)
|
||||
m_sourceGroupTypeIconName[SOURCE_GROUP_CUSTOM_COMMAND] = L"empty_icon";
|
||||
|
||||
// define descriptions for each kind of Source Group
|
||||
m_sourceGroupTypeDescriptions[SOURCE_GROUP_C_EMPTY] = "Create a new Sourcetrail Source Group by defining which C files will be indexed.";
|
||||
m_sourceGroupTypeDescriptions[SOURCE_GROUP_CPP_EMPTY] = "Create a new Sourcetrail Source Group by defining which C++ files will be indexed.";
|
||||
m_sourceGroupTypeDescriptions[SOURCE_GROUP_C_EMPTY] = "Create a new Source Group by defining which C files will be indexed.";
|
||||
m_sourceGroupTypeDescriptions[SOURCE_GROUP_CPP_EMPTY] = "Create a new Source Group by defining which C++ files will be indexed.";
|
||||
m_sourceGroupTypeDescriptions[SOURCE_GROUP_CXX_CDB] =
|
||||
"Create a Source Group from an existing Compilation Database file (compile_commands.json). "
|
||||
"It can be exported from CMake<br />(-DCMAKE_EXPORT_COMPILE_COMMANDS=1) and Make projects or from the Qt Creator since version 4.8. Have a look at the "
|
||||
@@ -82,13 +97,18 @@ void QtProjectWizzardContentSelect::populate(QGridLayout* layout, int& row)
|
||||
m_sourceGroupTypeDescriptions[SOURCE_GROUP_CXX_CODEBLOCKS] =
|
||||
"<p>Create a new Source Group from an existing Code::Blocks project file.</p>"
|
||||
"<p><b>Note</b>: A \".cbp\" file will also get generated by the <b>Qt Creator</b> if a CMakeLists file is imported.</p>";
|
||||
m_sourceGroupTypeDescriptions[SOURCE_GROUP_JAVA_EMPTY] = "Create a new Sourcetrail Source Group by defining which Java files will be indexed.";
|
||||
m_sourceGroupTypeDescriptions[SOURCE_GROUP_JAVA_EMPTY] = "Create a new Source Group by defining which Java files will be indexed.";
|
||||
m_sourceGroupTypeDescriptions[SOURCE_GROUP_JAVA_MAVEN] = "Create a new Source Group from an existing Maven project.";
|
||||
m_sourceGroupTypeDescriptions[SOURCE_GROUP_JAVA_GRADLE] = "Create a new Source Group from an existing Gradle project.";
|
||||
m_sourceGroupTypeDescriptions[SOURCE_GROUP_JAVA_SONARGRAPH] =
|
||||
"Create a new Source Group from an existing <a href=\"https://www.hello2morrow.com/products/sonargraph\">Sonargraph</a> project file.";
|
||||
m_sourceGroupTypeDescriptions[SOURCE_GROUP_PYTHON_EMPTY] = "Create a new Sourcetrail Source Group by defining which Python files will be indexed. Note "
|
||||
"that this Source Group type uses the <a href=\"https://github.com/CoatiSoftware/SourcetrailPythonIndexer\">SourcetrailPythonIndexer</a> in the background.";
|
||||
m_sourceGroupTypeDescriptions[SOURCE_GROUP_PYTHON_EMPTY] =
|
||||
"<p>Create a new Source Group by defining which Python files will be indexed. This Source Group type uses the "
|
||||
"<a href=\"https://github.com/CoatiSoftware/SourcetrailPythonIndexer\">SourcetrailPythonIndexer</a> " + pythonIndexerVersion + "in the "
|
||||
"background.</p>"
|
||||
"<p><b>Note</b>: Python support is still in its <b>beta</b> phase. If you want to update the version of the SourcetrailPythonIndexer which is used "
|
||||
"by Sourcetrail, download the latest release package for your operating system from the linked repository and completely replace the contents of your "
|
||||
"\"Sourcetrail/data/python\" folder with the contents of the downloaded package.</p>";
|
||||
m_sourceGroupTypeDescriptions[SOURCE_GROUP_CUSTOM_COMMAND] = "Create a new Source Group executing a custom command on each source file. "
|
||||
"This Source Group type can be used on <a href=\"https://github.com/CoatiSoftware/SourcetrailDB\">SourcetrailDB</a> binaries that add "
|
||||
"custom language support to Sourcetrail.<br /><br />Current Database Version: " + std::to_string(SqliteIndexStorage::getStorageVersion());
|
||||
|
||||
Reference in New Issue
Block a user