src: refactored project wizard file structure

* renamed wizzard to wizard
* split QtProjectWizardContentPath into multiple files
* split QtProjectWizardContentPaths into multiple files
* restructured subdirectories
This commit is contained in:
Eberhard Graether
2019-05-29 16:26:49 +02:00
parent 529b534939
commit 1cc61a93a2
87 changed files with 3834 additions and 3617 deletions
+76 -41
View File
@@ -106,6 +106,82 @@ add_files(
qt/network/QtUpdateChecker.cpp
qt/network/QtUpdateChecker.h
qt/project_wizard/content/path/QtProjectWizardContentPath.cpp
qt/project_wizard/content/path/QtProjectWizardContentPath.h
qt/project_wizard/content/path/QtProjectWizardContentPathCDB.cpp
qt/project_wizard/content/path/QtProjectWizardContentPathCDB.h
qt/project_wizard/content/path/QtProjectWizardContentPathCodeblocksProject.cpp
qt/project_wizard/content/path/QtProjectWizardContentPathCodeblocksProject.h
qt/project_wizard/content/path/QtProjectWizardContentPathDependenciesGradle.cpp
qt/project_wizard/content/path/QtProjectWizardContentPathDependenciesGradle.h
qt/project_wizard/content/path/QtProjectWizardContentPathDependenciesMaven.cpp
qt/project_wizard/content/path/QtProjectWizardContentPathDependenciesMaven.h
qt/project_wizard/content/path/QtProjectWizardContentPathPythonEnvironment.cpp
qt/project_wizard/content/path/QtProjectWizardContentPathPythonEnvironment.h
qt/project_wizard/content/path/QtProjectWizardContentPathSonargraphProject.cpp
qt/project_wizard/content/path/QtProjectWizardContentPathSonargraphProject.h
qt/project_wizard/content/path/QtProjectWizardContentPathSourceGradle.cpp
qt/project_wizard/content/path/QtProjectWizardContentPathSourceGradle.h
qt/project_wizard/content/path/QtProjectWizardContentPathSourceMaven.cpp
qt/project_wizard/content/path/QtProjectWizardContentPathSourceMaven.h
qt/project_wizard/content/paths/QtProjectWizardContentPaths.cpp
qt/project_wizard/content/paths/QtProjectWizardContentPaths.h
qt/project_wizard/content/paths/QtProjectWizardContentPathsClassJava.cpp
qt/project_wizard/content/paths/QtProjectWizardContentPathsClassJava.h
qt/project_wizard/content/paths/QtProjectWizardContentPathsExclude.cpp
qt/project_wizard/content/paths/QtProjectWizardContentPathsExclude.h
qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearch.cpp
qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearch.h
qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearchGlobal.cpp
qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearchGlobal.h
qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearch.cpp
qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearch.h
qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearchGlobal.cpp
qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearchGlobal.h
qt/project_wizard/content/paths/QtProjectWizardContentPathsIndexedHeaders.cpp
qt/project_wizard/content/paths/QtProjectWizardContentPathsIndexedHeaders.h
qt/project_wizard/content/paths/QtProjectWizardContentPathsSource.cpp
qt/project_wizard/content/paths/QtProjectWizardContentPathsSource.h
qt/project_wizard/content/QtProjectWizardContent.cpp
qt/project_wizard/content/QtProjectWizardContent.h
qt/project_wizard/content/QtProjectWizardContentCppStandard.cpp
qt/project_wizard/content/QtProjectWizardContentCppStandard.h
qt/project_wizard/content/QtProjectWizardContentCrossCompilationOptions.cpp
qt/project_wizard/content/QtProjectWizardContentCrossCompilationOptions.h
qt/project_wizard/content/QtProjectWizardContentCStandard.cpp
qt/project_wizard/content/QtProjectWizardContentCStandard.h
qt/project_wizard/content/QtProjectWizardContentCustomCommand.cpp
qt/project_wizard/content/QtProjectWizardContentCustomCommand.h
qt/project_wizard/content/QtProjectWizardContentExtensions.cpp
qt/project_wizard/content/QtProjectWizardContentExtensions.h
qt/project_wizard/content/QtProjectWizardContentFlags.cpp
qt/project_wizard/content/QtProjectWizardContentFlags.h
qt/project_wizard/content/QtProjectWizardContentGroup.cpp
qt/project_wizard/content/QtProjectWizardContentGroup.h
qt/project_wizard/content/QtProjectWizardContentJavaStandard.cpp
qt/project_wizard/content/QtProjectWizardContentJavaStandard.h
qt/project_wizard/content/QtProjectWizardContentPreferences.cpp
qt/project_wizard/content/QtProjectWizardContentPreferences.h
qt/project_wizard/content/QtProjectWizardContentProjectData.cpp
qt/project_wizard/content/QtProjectWizardContentProjectData.h
qt/project_wizard/content/QtProjectWizardContentSelect.cpp
qt/project_wizard/content/QtProjectWizardContentSelect.h
qt/project_wizard/content/QtProjectWizardContentSourceGroupData.cpp
qt/project_wizard/content/QtProjectWizardContentSourceGroupData.h
qt/project_wizard/content/QtProjectWizardContentSourceGroupInfoText.cpp
qt/project_wizard/content/QtProjectWizardContentSourceGroupInfoText.h
qt/project_wizard/content/QtProjectWizardContentVS.cpp
qt/project_wizard/content/QtProjectWizardContentVS.h
qt/project_wizard/QtProjectWizard.cpp
qt/project_wizard/QtProjectWizard.h
qt/project_wizard/QtProjectWizardWindow.cpp
qt/project_wizard/QtProjectWizardWindow.h
qt/project_wizard/QtSourceGroupWizard.h
qt/project_wizard/QtSourceGroupWizardPage.h
qt/utility/QtContextMenu.cpp
qt/utility/QtContextMenu.h
qt/utility/QtDeviceScaledPixmap.cpp
@@ -193,47 +269,6 @@ add_files(
qt/view/QtViewWidgetWrapper.cpp
qt/view/QtViewWidgetWrapper.h
qt/window/project_wizzard/QtProjectWizzard.cpp
qt/window/project_wizzard/QtProjectWizzard.h
qt/window/project_wizzard/QtProjectWizzardContent.cpp
qt/window/project_wizzard/QtProjectWizzardContent.h
qt/window/project_wizzard/QtProjectWizzardContentCppStandard.cpp
qt/window/project_wizzard/QtProjectWizzardContentCppStandard.h
qt/window/project_wizzard/QtProjectWizzardContentCrossCompilationOptions.cpp
qt/window/project_wizzard/QtProjectWizzardContentCrossCompilationOptions.h
qt/window/project_wizzard/QtProjectWizzardContentCStandard.cpp
qt/window/project_wizzard/QtProjectWizzardContentCStandard.h
qt/window/project_wizzard/QtProjectWizzardContentCustomCommand.cpp
qt/window/project_wizzard/QtProjectWizzardContentCustomCommand.h
qt/window/project_wizzard/QtProjectWizzardContentExtensions.cpp
qt/window/project_wizzard/QtProjectWizzardContentExtensions.h
qt/window/project_wizzard/QtProjectWizzardContentFlags.cpp
qt/window/project_wizzard/QtProjectWizzardContentFlags.h
qt/window/project_wizzard/QtProjectWizzardContentGroup.cpp
qt/window/project_wizzard/QtProjectWizzardContentGroup.h
qt/window/project_wizzard/QtProjectWizzardContentJavaStandard.cpp
qt/window/project_wizzard/QtProjectWizzardContentJavaStandard.h
qt/window/project_wizzard/QtProjectWizzardContentPath.cpp
qt/window/project_wizzard/QtProjectWizzardContentPath.h
qt/window/project_wizzard/QtProjectWizzardContentPaths.cpp
qt/window/project_wizzard/QtProjectWizzardContentPaths.h
qt/window/project_wizzard/QtProjectWizzardContentPreferences.cpp
qt/window/project_wizzard/QtProjectWizzardContentPreferences.h
qt/window/project_wizzard/QtProjectWizzardContentProjectData.cpp
qt/window/project_wizzard/QtProjectWizzardContentProjectData.h
qt/window/project_wizzard/QtProjectWizzardContentSelect.cpp
qt/window/project_wizzard/QtProjectWizzardContentSelect.h
qt/window/project_wizzard/QtProjectWizzardContentSourceGroupData.cpp
qt/window/project_wizzard/QtProjectWizzardContentSourceGroupData.h
qt/window/project_wizzard/QtProjectWizzardContentSourceGroupInfoText.cpp
qt/window/project_wizzard/QtProjectWizzardContentSourceGroupInfoText.h
qt/window/project_wizzard/QtProjectWizzardContentVS.cpp
qt/window/project_wizzard/QtProjectWizzardContentVS.h
qt/window/project_wizzard/QtProjectWizzardWindow.cpp
qt/window/project_wizzard/QtProjectWizzardWindow.h
qt/window/project_wizzard/QtSourceGroupWizzard.h
qt/window/project_wizzard/QtSourceGroupWizzardPage.h
qt/window/QtAbout.cpp
qt/window/QtAbout.h
qt/window/QtAboutLicense.cpp
@@ -1,4 +1,4 @@
#include "QtProjectWizzard.h"
#include "QtProjectWizard.h"
#include <QFileDialog>
#include <QListWidget>
@@ -7,23 +7,39 @@
#include <QSysInfo>
#include <QTimer>
#include "QtProjectWizzardContent.h"
#include "QtProjectWizzardContentCppStandard.h"
#include "QtProjectWizzardContentCrossCompilationOptions.h"
#include "QtProjectWizzardContentCStandard.h"
#include "QtProjectWizzardContentCustomCommand.h"
#include "QtProjectWizzardContentExtensions.h"
#include "QtProjectWizzardContentFlags.h"
#include "QtProjectWizzardContentJavaStandard.h"
#include "QtProjectWizzardContentPath.h"
#include "QtProjectWizzardContentPaths.h"
#include "QtProjectWizzardContentProjectData.h"
#include "QtProjectWizzardContentSelect.h"
#include "QtProjectWizzardContentSourceGroupData.h"
#include "QtProjectWizzardContentSourceGroupInfoText.h"
#include "QtProjectWizzardContentGroup.h"
#include "QtProjectWizzardContentVS.h"
#include "QtSourceGroupWizzardPage.h"
#include "QtProjectWizardContent.h"
#include "QtProjectWizardContentCppStandard.h"
#include "QtProjectWizardContentCrossCompilationOptions.h"
#include "QtProjectWizardContentCStandard.h"
#include "QtProjectWizardContentCustomCommand.h"
#include "QtProjectWizardContentExtensions.h"
#include "QtProjectWizardContentFlags.h"
#include "QtProjectWizardContentGroup.h"
#include "QtProjectWizardContentJavaStandard.h"
#include "QtProjectWizardContentPath.h"
#include "QtProjectWizardContentPathCDB.h"
#include "QtProjectWizardContentPathCodeblocksProject.h"
#include "QtProjectWizardContentPathDependenciesGradle.h"
#include "QtProjectWizardContentPathDependenciesMaven.h"
#include "QtProjectWizardContentPathPythonEnvironment.h"
#include "QtProjectWizardContentPathSonargraphProject.h"
#include "QtProjectWizardContentPathSourceGradle.h"
#include "QtProjectWizardContentPathSourceMaven.h"
#include "QtProjectWizardContentPaths.h"
#include "QtProjectWizardContentPathsClassJava.h"
#include "QtProjectWizardContentPathsExclude.h"
#include "QtProjectWizardContentPathsFrameworkSearch.h"
#include "QtProjectWizardContentPathsFrameworkSearchGlobal.h"
#include "QtProjectWizardContentPathsHeaderSearch.h"
#include "QtProjectWizardContentPathsHeaderSearchGlobal.h"
#include "QtProjectWizardContentPathsIndexedHeaders.h"
#include "QtProjectWizardContentPathsSource.h"
#include "QtProjectWizardContentProjectData.h"
#include "QtProjectWizardContentSelect.h"
#include "QtProjectWizardContentSourceGroupData.h"
#include "QtProjectWizardContentSourceGroupInfoText.h"
#include "QtProjectWizardContentVS.h"
#include "QtSourceGroupWizardPage.h"
#include "SourceGroupSettingsCEmpty.h"
#include "SourceGroupSettingsCppEmpty.h"
#include "SourceGroupSettingsCustomCommand.h"
@@ -90,41 +106,41 @@ namespace
}
template <typename SettingsType>
std::vector<QtSourceGroupWizzardPage<SettingsType>> getSourceGroupWizzardPages();
std::vector<QtSourceGroupWizardPage<SettingsType>> getSourceGroupWizardPages();
template <>
std::vector<QtSourceGroupWizzardPage<SourceGroupSettingsCEmpty>> getSourceGroupWizzardPages<SourceGroupSettingsCEmpty>()
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsCEmpty>> getSourceGroupWizardPages<SourceGroupSettingsCEmpty>()
{
std::vector<QtSourceGroupWizzardPage<SourceGroupSettingsCEmpty>> pages;
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsCEmpty>> pages;
{
QtSourceGroupWizzardPage<SourceGroupSettingsCEmpty> page("Language Standard", 470, 460);
page.addContentCreatorWithSettings<QtProjectWizzardContentCStandard>(WIZZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizzardContentCrossCompilationOptions>(WIZZARD_CONTENT_CONTEXT_ALL);
QtSourceGroupWizardPage<SourceGroupSettingsCEmpty> page("Language Standard", 470, 460);
page.addContentCreatorWithSettings<QtProjectWizardContentCStandard>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizardContentCrossCompilationOptions>(WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
{
QtSourceGroupWizzardPage<SourceGroupSettingsCEmpty> page("Indexed Paths");
page.addContentCreatorWithSettings<QtProjectWizzardContentPathsSource>(WIZZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizzardContentPathsExclude>(WIZZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizzardContentExtensions>(WIZZARD_CONTENT_CONTEXT_ALL);
QtSourceGroupWizardPage<SourceGroupSettingsCEmpty> page("Indexed Paths");
page.addContentCreatorWithSettings<QtProjectWizardContentPathsSource>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizardContentPathsExclude>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizardContentExtensions>(WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
{
QtSourceGroupWizzardPage<SourceGroupSettingsCEmpty> page("Include Paths");
page.addContentCreatorWithSettings<QtProjectWizzardContentPathsHeaderSearch>(WIZZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorSimple<QtProjectWizzardContentPathsHeaderSearchGlobal>(WIZZARD_CONTENT_CONTEXT_ALL);
QtSourceGroupWizardPage<SourceGroupSettingsCEmpty> page("Include Paths");
page.addContentCreatorWithSettings<QtProjectWizardContentPathsHeaderSearch>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorSimple<QtProjectWizardContentPathsHeaderSearchGlobal>(WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
if (utility::getOsType() == OS_MAC)
{
QtSourceGroupWizzardPage<SourceGroupSettingsCEmpty> page("Framework Search Paths");
page.addContentCreatorWithSettings<QtProjectWizzardContentPathsFrameworkSearch>(WIZZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorSimple<QtProjectWizzardContentPathsFrameworkSearchGlobal>(WIZZARD_CONTENT_CONTEXT_ALL);
QtSourceGroupWizardPage<SourceGroupSettingsCEmpty> page("Framework Search Paths");
page.addContentCreatorWithSettings<QtProjectWizardContentPathsFrameworkSearch>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorSimple<QtProjectWizardContentPathsFrameworkSearchGlobal>(WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
{
QtSourceGroupWizzardPage<SourceGroupSettingsCEmpty> page("Advanced (optional)");
page.addContentCreatorWithSettings<QtProjectWizzardContentFlags>(WIZZARD_CONTENT_CONTEXT_ALL);
QtSourceGroupWizardPage<SourceGroupSettingsCEmpty> page("Advanced (optional)");
page.addContentCreatorWithSettings<QtProjectWizardContentFlags>(WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
@@ -132,38 +148,38 @@ namespace
}
template <>
std::vector<QtSourceGroupWizzardPage<SourceGroupSettingsCppEmpty>> getSourceGroupWizzardPages<SourceGroupSettingsCppEmpty>()
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsCppEmpty>> getSourceGroupWizardPages<SourceGroupSettingsCppEmpty>()
{
std::vector<QtSourceGroupWizzardPage<SourceGroupSettingsCppEmpty>> pages;
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsCppEmpty>> pages;
{
QtSourceGroupWizzardPage<SourceGroupSettingsCppEmpty> page("Language Standard", 470, 460);
page.addContentCreatorWithSettings<QtProjectWizzardContentCppStandard>(WIZZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizzardContentCrossCompilationOptions>(WIZZARD_CONTENT_CONTEXT_ALL);
QtSourceGroupWizardPage<SourceGroupSettingsCppEmpty> page("Language Standard", 470, 460);
page.addContentCreatorWithSettings<QtProjectWizardContentCppStandard>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizardContentCrossCompilationOptions>(WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
{
QtSourceGroupWizzardPage<SourceGroupSettingsCppEmpty> page("Indexed Paths");
page.addContentCreatorWithSettings<QtProjectWizzardContentPathsSource>(WIZZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizzardContentPathsExclude>(WIZZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizzardContentExtensions>(WIZZARD_CONTENT_CONTEXT_ALL);
QtSourceGroupWizardPage<SourceGroupSettingsCppEmpty> page("Indexed Paths");
page.addContentCreatorWithSettings<QtProjectWizardContentPathsSource>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizardContentPathsExclude>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizardContentExtensions>(WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
{
QtSourceGroupWizzardPage<SourceGroupSettingsCppEmpty> page("Include Paths");
page.addContentCreatorWithSettings<QtProjectWizzardContentPathsHeaderSearch>(WIZZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorSimple<QtProjectWizzardContentPathsHeaderSearchGlobal>(WIZZARD_CONTENT_CONTEXT_ALL);
QtSourceGroupWizardPage<SourceGroupSettingsCppEmpty> page("Include Paths");
page.addContentCreatorWithSettings<QtProjectWizardContentPathsHeaderSearch>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorSimple<QtProjectWizardContentPathsHeaderSearchGlobal>(WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
if (utility::getOsType() == OS_MAC)
{
QtSourceGroupWizzardPage<SourceGroupSettingsCppEmpty> page("Framework Search Paths");
page.addContentCreatorWithSettings<QtProjectWizzardContentPathsFrameworkSearch>(WIZZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorSimple<QtProjectWizzardContentPathsFrameworkSearchGlobal>(WIZZARD_CONTENT_CONTEXT_ALL);
QtSourceGroupWizardPage<SourceGroupSettingsCppEmpty> page("Framework Search Paths");
page.addContentCreatorWithSettings<QtProjectWizardContentPathsFrameworkSearch>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorSimple<QtProjectWizardContentPathsFrameworkSearchGlobal>(WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
{
QtSourceGroupWizzardPage<SourceGroupSettingsCppEmpty> page("Advanced (optional)");
page.addContentCreatorWithSettings<QtProjectWizzardContentFlags>(WIZZARD_CONTENT_CONTEXT_ALL);
QtSourceGroupWizardPage<SourceGroupSettingsCppEmpty> page("Advanced (optional)");
page.addContentCreatorWithSettings<QtProjectWizardContentFlags>(WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
@@ -171,32 +187,32 @@ namespace
}
template <>
std::vector<QtSourceGroupWizzardPage<SourceGroupSettingsCxxCdb>> getSourceGroupWizzardPages<SourceGroupSettingsCxxCdb>()
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsCxxCdb>> getSourceGroupWizardPages<SourceGroupSettingsCxxCdb>()
{
std::vector<QtSourceGroupWizzardPage<SourceGroupSettingsCxxCdb>> pages;
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsCxxCdb>> pages;
{
QtSourceGroupWizzardPage<SourceGroupSettingsCxxCdb> page("Compilation Database Path");
page.addContentCreatorWithSettings<QtProjectWizzardContentPathCDB>(WIZZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizzardContentIndexedHeaderPaths>(WIZZARD_CONTENT_CONTEXT_ALL, "Compilation Database");
page.addContentCreatorWithSettings<QtProjectWizzardContentPathsExclude>(WIZZARD_CONTENT_CONTEXT_ALL);
QtSourceGroupWizardPage<SourceGroupSettingsCxxCdb> page("Compilation Database Path");
page.addContentCreatorWithSettings<QtProjectWizardContentPathCDB>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizardContentPathsIndexedHeaders>(WIZARD_CONTENT_CONTEXT_ALL, "Compilation Database");
page.addContentCreatorWithSettings<QtProjectWizardContentPathsExclude>(WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
{
QtSourceGroupWizzardPage<SourceGroupSettingsCxxCdb> page("Include Paths");
page.addContentCreatorWithSettings<QtProjectWizzardContentPathsHeaderSearch>(WIZZARD_CONTENT_CONTEXT_SUMMARY, true);
page.addContentCreatorSimple<QtProjectWizzardContentPathsHeaderSearchGlobal>(WIZZARD_CONTENT_CONTEXT_SUMMARY);
QtSourceGroupWizardPage<SourceGroupSettingsCxxCdb> page("Include Paths");
page.addContentCreatorWithSettings<QtProjectWizardContentPathsHeaderSearch>(WIZARD_CONTENT_CONTEXT_SUMMARY, true);
page.addContentCreatorSimple<QtProjectWizardContentPathsHeaderSearchGlobal>(WIZARD_CONTENT_CONTEXT_SUMMARY);
pages.push_back(page);
}
if (utility::getOsType() == OS_MAC)
{
QtSourceGroupWizzardPage<SourceGroupSettingsCxxCdb> page("Framework Search Paths");
page.addContentCreatorWithSettings<QtProjectWizzardContentPathsFrameworkSearch>(WIZZARD_CONTENT_CONTEXT_SUMMARY, true);
page.addContentCreatorSimple<QtProjectWizzardContentPathsFrameworkSearchGlobal>(WIZZARD_CONTENT_CONTEXT_SUMMARY);
QtSourceGroupWizardPage<SourceGroupSettingsCxxCdb> page("Framework Search Paths");
page.addContentCreatorWithSettings<QtProjectWizardContentPathsFrameworkSearch>(WIZARD_CONTENT_CONTEXT_SUMMARY, true);
page.addContentCreatorSimple<QtProjectWizardContentPathsFrameworkSearchGlobal>(WIZARD_CONTENT_CONTEXT_SUMMARY);
pages.push_back(page);
}
{
QtSourceGroupWizzardPage<SourceGroupSettingsCxxCdb> page("Advanced (optional)");
page.addContentCreatorWithSettings<QtProjectWizzardContentFlags>(WIZZARD_CONTENT_CONTEXT_SUMMARY, true);
QtSourceGroupWizardPage<SourceGroupSettingsCxxCdb> page("Advanced (optional)");
page.addContentCreatorWithSettings<QtProjectWizardContentFlags>(WIZARD_CONTENT_CONTEXT_SUMMARY, true);
pages.push_back(page);
}
@@ -204,35 +220,35 @@ namespace
}
template <>
std::vector<QtSourceGroupWizzardPage<SourceGroupSettingsCxxCodeblocks>> getSourceGroupWizzardPages<SourceGroupSettingsCxxCodeblocks>()
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsCxxCodeblocks>> getSourceGroupWizardPages<SourceGroupSettingsCxxCodeblocks>()
{
std::vector<QtSourceGroupWizzardPage<SourceGroupSettingsCxxCodeblocks>> pages;
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsCxxCodeblocks>> pages;
{
QtSourceGroupWizzardPage<SourceGroupSettingsCxxCodeblocks> page("Code::Blocks Project Path");
page.addContentCreatorWithSettings<QtProjectWizzardContentCppStandard>(WIZZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizzardContentCStandard>(WIZZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizzardContentCodeblocksProjectPath>(WIZZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizzardContentIndexedHeaderPaths>(WIZZARD_CONTENT_CONTEXT_ALL, std::string("Code::Blocks Project"));
page.addContentCreatorWithSettings<QtProjectWizzardContentPathsExclude>(WIZZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizzardContentExtensions>(WIZZARD_CONTENT_CONTEXT_ALL);
QtSourceGroupWizardPage<SourceGroupSettingsCxxCodeblocks> page("Code::Blocks Project Path");
page.addContentCreatorWithSettings<QtProjectWizardContentCppStandard>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizardContentCStandard>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizardContentPathCodeblocksProject>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizardContentPathsIndexedHeaders>(WIZARD_CONTENT_CONTEXT_ALL, std::string("Code::Blocks Project"));
page.addContentCreatorWithSettings<QtProjectWizardContentPathsExclude>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizardContentExtensions>(WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
{
QtSourceGroupWizzardPage<SourceGroupSettingsCxxCodeblocks> page("Include Paths");
page.addContentCreatorWithSettings<QtProjectWizzardContentPathsHeaderSearch>(WIZZARD_CONTENT_CONTEXT_SUMMARY, true);
page.addContentCreatorSimple<QtProjectWizzardContentPathsHeaderSearchGlobal>(WIZZARD_CONTENT_CONTEXT_SUMMARY);
QtSourceGroupWizardPage<SourceGroupSettingsCxxCodeblocks> page("Include Paths");
page.addContentCreatorWithSettings<QtProjectWizardContentPathsHeaderSearch>(WIZARD_CONTENT_CONTEXT_SUMMARY, true);
page.addContentCreatorSimple<QtProjectWizardContentPathsHeaderSearchGlobal>(WIZARD_CONTENT_CONTEXT_SUMMARY);
pages.push_back(page);
}
if (utility::getOsType() == OS_MAC)
{
QtSourceGroupWizzardPage<SourceGroupSettingsCxxCodeblocks> page("Framework Search Paths");
page.addContentCreatorWithSettings<QtProjectWizzardContentPathsFrameworkSearch>(WIZZARD_CONTENT_CONTEXT_SUMMARY, true);
page.addContentCreatorSimple<QtProjectWizzardContentPathsFrameworkSearchGlobal>(WIZZARD_CONTENT_CONTEXT_SUMMARY);
QtSourceGroupWizardPage<SourceGroupSettingsCxxCodeblocks> page("Framework Search Paths");
page.addContentCreatorWithSettings<QtProjectWizardContentPathsFrameworkSearch>(WIZARD_CONTENT_CONTEXT_SUMMARY, true);
page.addContentCreatorSimple<QtProjectWizardContentPathsFrameworkSearchGlobal>(WIZARD_CONTENT_CONTEXT_SUMMARY);
pages.push_back(page);
}
{
QtSourceGroupWizzardPage<SourceGroupSettingsCxxCodeblocks> page("Advanced (optional)");
page.addContentCreatorWithSettings<QtProjectWizzardContentFlags>(WIZZARD_CONTENT_CONTEXT_SUMMARY, true);
QtSourceGroupWizardPage<SourceGroupSettingsCxxCodeblocks> page("Advanced (optional)");
page.addContentCreatorWithSettings<QtProjectWizardContentFlags>(WIZARD_CONTENT_CONTEXT_SUMMARY, true);
pages.push_back(page);
}
@@ -240,38 +256,38 @@ namespace
}
template <>
std::vector<QtSourceGroupWizzardPage<SourceGroupSettingsCxxSonargraph>> getSourceGroupWizzardPages<SourceGroupSettingsCxxSonargraph>()
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsCxxSonargraph>> getSourceGroupWizardPages<SourceGroupSettingsCxxSonargraph>()
{
std::vector<QtSourceGroupWizzardPage<SourceGroupSettingsCxxSonargraph>> pages;
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsCxxSonargraph>> pages;
{
QtSourceGroupWizzardPage<SourceGroupSettingsCxxSonargraph> page("Sonargraph Project Path");
page.addContentCreatorWithSettings<QtProjectWizzardContentCppStandard>(WIZZARD_CONTENT_CONTEXT_ALL);
QtSourceGroupWizardPage<SourceGroupSettingsCxxSonargraph> page("Sonargraph Project Path");
page.addContentCreatorWithSettings<QtProjectWizardContentCppStandard>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreator(
WIZZARD_CONTENT_CONTEXT_ALL,
[](std::shared_ptr<SourceGroupSettingsCxxSonargraph> settings, QtProjectWizzardWindow* window)
WIZARD_CONTENT_CONTEXT_ALL,
[](std::shared_ptr<SourceGroupSettingsCxxSonargraph> settings, QtProjectWizardWindow* window)
{
return new QtProjectWizzardContentSonargraphProjectPath(settings, settings, settings, window);
return new QtProjectWizardContentPathSonargraphProject(settings, settings, settings, window);
}
);
page.addContentCreatorWithSettings<QtProjectWizzardContentIndexedHeaderPaths>(WIZZARD_CONTENT_CONTEXT_ALL, std::string("Sonargraph project"));
page.addContentCreatorWithSettings<QtProjectWizardContentPathsIndexedHeaders>(WIZARD_CONTENT_CONTEXT_ALL, std::string("Sonargraph project"));
pages.push_back(page);
}
{
QtSourceGroupWizzardPage<SourceGroupSettingsCxxSonargraph> page("Include Paths");
page.addContentCreatorWithSettings<QtProjectWizzardContentPathsHeaderSearch>(WIZZARD_CONTENT_CONTEXT_SUMMARY, true);
page.addContentCreatorSimple<QtProjectWizzardContentPathsHeaderSearchGlobal>(WIZZARD_CONTENT_CONTEXT_SUMMARY);
QtSourceGroupWizardPage<SourceGroupSettingsCxxSonargraph> page("Include Paths");
page.addContentCreatorWithSettings<QtProjectWizardContentPathsHeaderSearch>(WIZARD_CONTENT_CONTEXT_SUMMARY, true);
page.addContentCreatorSimple<QtProjectWizardContentPathsHeaderSearchGlobal>(WIZARD_CONTENT_CONTEXT_SUMMARY);
pages.push_back(page);
}
if (utility::getOsType() == OS_MAC)
{
QtSourceGroupWizzardPage<SourceGroupSettingsCxxSonargraph> page("Framework Search Paths");
page.addContentCreatorWithSettings<QtProjectWizzardContentPathsFrameworkSearch>(WIZZARD_CONTENT_CONTEXT_SUMMARY, true);
page.addContentCreatorSimple<QtProjectWizzardContentPathsFrameworkSearchGlobal>(WIZZARD_CONTENT_CONTEXT_SUMMARY);
QtSourceGroupWizardPage<SourceGroupSettingsCxxSonargraph> page("Framework Search Paths");
page.addContentCreatorWithSettings<QtProjectWizardContentPathsFrameworkSearch>(WIZARD_CONTENT_CONTEXT_SUMMARY, true);
page.addContentCreatorSimple<QtProjectWizardContentPathsFrameworkSearchGlobal>(WIZARD_CONTENT_CONTEXT_SUMMARY);
pages.push_back(page);
}
{
QtSourceGroupWizzardPage<SourceGroupSettingsCxxSonargraph> page("Advanced (optional)");
page.addContentCreatorWithSettings<QtProjectWizzardContentFlags>(WIZZARD_CONTENT_CONTEXT_SUMMARY, true);
QtSourceGroupWizardPage<SourceGroupSettingsCxxSonargraph> page("Advanced (optional)");
page.addContentCreatorWithSettings<QtProjectWizardContentFlags>(WIZARD_CONTENT_CONTEXT_SUMMARY, true);
pages.push_back(page);
}
@@ -279,33 +295,33 @@ namespace
}
template <>
std::vector<QtSourceGroupWizzardPage<SourceGroupSettingsCxxCdbVs>> getSourceGroupWizzardPages<SourceGroupSettingsCxxCdbVs>()
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsCxxCdbVs>> getSourceGroupWizardPages<SourceGroupSettingsCxxCdbVs>()
{
std::vector<QtSourceGroupWizzardPage<SourceGroupSettingsCxxCdbVs>> pages;
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsCxxCdbVs>> pages;
{
QtSourceGroupWizzardPage<SourceGroupSettingsCxxCdbVs> page("VS Solution");
page.addContentCreatorSimple<QtProjectWizzardContentVS>(WIZZARD_CONTENT_CONTEXT_SETUP);
page.addContentCreatorWithSettings<QtProjectWizzardContentPathCDB>(WIZZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizzardContentIndexedHeaderPaths>(WIZZARD_CONTENT_CONTEXT_ALL, std::string("Compilation Database"));
page.addContentCreatorWithSettings<QtProjectWizzardContentPathsExclude>(WIZZARD_CONTENT_CONTEXT_ALL);
QtSourceGroupWizardPage<SourceGroupSettingsCxxCdbVs> page("VS Solution");
page.addContentCreatorSimple<QtProjectWizardContentVS>(WIZARD_CONTENT_CONTEXT_SETUP);
page.addContentCreatorWithSettings<QtProjectWizardContentPathCDB>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizardContentPathsIndexedHeaders>(WIZARD_CONTENT_CONTEXT_ALL, std::string("Compilation Database"));
page.addContentCreatorWithSettings<QtProjectWizardContentPathsExclude>(WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
{
QtSourceGroupWizzardPage<SourceGroupSettingsCxxCdbVs> page("Include Paths");
page.addContentCreatorWithSettings<QtProjectWizzardContentPathsHeaderSearch>(WIZZARD_CONTENT_CONTEXT_SUMMARY, true);
page.addContentCreatorSimple<QtProjectWizzardContentPathsHeaderSearchGlobal>(WIZZARD_CONTENT_CONTEXT_SUMMARY);
QtSourceGroupWizardPage<SourceGroupSettingsCxxCdbVs> page("Include Paths");
page.addContentCreatorWithSettings<QtProjectWizardContentPathsHeaderSearch>(WIZARD_CONTENT_CONTEXT_SUMMARY, true);
page.addContentCreatorSimple<QtProjectWizardContentPathsHeaderSearchGlobal>(WIZARD_CONTENT_CONTEXT_SUMMARY);
pages.push_back(page);
}
if (utility::getOsType() == OS_MAC)
{
QtSourceGroupWizzardPage<SourceGroupSettingsCxxCdbVs> page("Framework Search Paths");
page.addContentCreatorWithSettings<QtProjectWizzardContentPathsFrameworkSearch>(WIZZARD_CONTENT_CONTEXT_SUMMARY, true);
page.addContentCreatorSimple<QtProjectWizzardContentPathsFrameworkSearchGlobal>(WIZZARD_CONTENT_CONTEXT_SUMMARY);
QtSourceGroupWizardPage<SourceGroupSettingsCxxCdbVs> page("Framework Search Paths");
page.addContentCreatorWithSettings<QtProjectWizardContentPathsFrameworkSearch>(WIZARD_CONTENT_CONTEXT_SUMMARY, true);
page.addContentCreatorSimple<QtProjectWizardContentPathsFrameworkSearchGlobal>(WIZARD_CONTENT_CONTEXT_SUMMARY);
pages.push_back(page);
}
{
QtSourceGroupWizzardPage<SourceGroupSettingsCxxCdbVs> page("Advanced (optional)");
page.addContentCreatorWithSettings<QtProjectWizzardContentFlags>(WIZZARD_CONTENT_CONTEXT_SUMMARY, true);
QtSourceGroupWizardPage<SourceGroupSettingsCxxCdbVs> page("Advanced (optional)");
page.addContentCreatorWithSettings<QtProjectWizardContentFlags>(WIZARD_CONTENT_CONTEXT_SUMMARY, true);
pages.push_back(page);
}
@@ -314,24 +330,24 @@ namespace
template<>
std::vector<QtSourceGroupWizzardPage<SourceGroupSettingsJavaEmpty>> getSourceGroupWizzardPages<SourceGroupSettingsJavaEmpty>()
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsJavaEmpty>> getSourceGroupWizardPages<SourceGroupSettingsJavaEmpty>()
{
std::vector<QtSourceGroupWizzardPage<SourceGroupSettingsJavaEmpty>> pages;
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsJavaEmpty>> pages;
{
QtSourceGroupWizzardPage<SourceGroupSettingsJavaEmpty> page("Language Standard", 470, 230);
page.addContentCreatorWithSettings<QtProjectWizzardContentJavaStandard>(WIZZARD_CONTENT_CONTEXT_ALL);
QtSourceGroupWizardPage<SourceGroupSettingsJavaEmpty> page("Language Standard", 470, 230);
page.addContentCreatorWithSettings<QtProjectWizardContentJavaStandard>(WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
{
QtSourceGroupWizzardPage<SourceGroupSettingsJavaEmpty> page("Indexed Paths", 750, 600);
page.addContentCreatorWithSettings<QtProjectWizzardContentPathsSource>(WIZZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizzardContentPathsExclude>(WIZZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizzardContentExtensions>(WIZZARD_CONTENT_CONTEXT_ALL);
QtSourceGroupWizardPage<SourceGroupSettingsJavaEmpty> page("Indexed Paths", 750, 600);
page.addContentCreatorWithSettings<QtProjectWizardContentPathsSource>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizardContentPathsExclude>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizardContentExtensions>(WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
{
QtSourceGroupWizzardPage<SourceGroupSettingsJavaEmpty> page("Dependencies", 750, 600);
page.addContentCreatorWithSettings<QtProjectWizzardContentPathsClassJava>(WIZZARD_CONTENT_CONTEXT_ALL);
QtSourceGroupWizardPage<SourceGroupSettingsJavaEmpty> page("Dependencies", 750, 600);
page.addContentCreatorWithSettings<QtProjectWizardContentPathsClassJava>(WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
@@ -339,20 +355,20 @@ namespace
}
template<>
std::vector<QtSourceGroupWizzardPage<SourceGroupSettingsJavaMaven>> getSourceGroupWizzardPages<SourceGroupSettingsJavaMaven>()
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsJavaMaven>> getSourceGroupWizardPages<SourceGroupSettingsJavaMaven>()
{
std::vector<QtSourceGroupWizzardPage<SourceGroupSettingsJavaMaven>> pages;
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsJavaMaven>> pages;
{
QtSourceGroupWizzardPage<SourceGroupSettingsJavaMaven> page("Indexed Paths");
page.addContentCreatorWithSettings<QtProjectWizzardContentJavaStandard>(WIZZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizzardContentPathSourceMaven>(WIZZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizzardContentPathDependenciesMaven>(WIZZARD_CONTENT_CONTEXT_ALL);
QtSourceGroupWizardPage<SourceGroupSettingsJavaMaven> page("Indexed Paths");
page.addContentCreatorWithSettings<QtProjectWizardContentJavaStandard>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizardContentPathSourceMaven>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizardContentPathDependenciesMaven>(WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
{
QtSourceGroupWizzardPage<SourceGroupSettingsJavaMaven> page("Advanced (optional)");
page.addContentCreatorWithSettings<QtProjectWizzardContentPathsExclude>(WIZZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizzardContentExtensions>(WIZZARD_CONTENT_CONTEXT_ALL);
QtSourceGroupWizardPage<SourceGroupSettingsJavaMaven> page("Advanced (optional)");
page.addContentCreatorWithSettings<QtProjectWizardContentPathsExclude>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizardContentExtensions>(WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
@@ -360,20 +376,20 @@ namespace
}
template<>
std::vector<QtSourceGroupWizzardPage<SourceGroupSettingsJavaGradle>> getSourceGroupWizzardPages<SourceGroupSettingsJavaGradle>()
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsJavaGradle>> getSourceGroupWizardPages<SourceGroupSettingsJavaGradle>()
{
std::vector<QtSourceGroupWizzardPage<SourceGroupSettingsJavaGradle>> pages;
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsJavaGradle>> pages;
{
QtSourceGroupWizzardPage<SourceGroupSettingsJavaGradle> page("Indexed Paths");
page.addContentCreatorWithSettings<QtProjectWizzardContentJavaStandard>(WIZZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizzardContentPathSourceGradle>(WIZZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizzardContentPathDependenciesGradle>(WIZZARD_CONTENT_CONTEXT_ALL);
QtSourceGroupWizardPage<SourceGroupSettingsJavaGradle> page("Indexed Paths");
page.addContentCreatorWithSettings<QtProjectWizardContentJavaStandard>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizardContentPathSourceGradle>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizardContentPathDependenciesGradle>(WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
{
QtSourceGroupWizzardPage<SourceGroupSettingsJavaGradle> page("Advanced (optional)");
page.addContentCreatorWithSettings<QtProjectWizzardContentPathsExclude>(WIZZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizzardContentExtensions>(WIZZARD_CONTENT_CONTEXT_ALL);
QtSourceGroupWizardPage<SourceGroupSettingsJavaGradle> page("Advanced (optional)");
page.addContentCreatorWithSettings<QtProjectWizardContentPathsExclude>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizardContentExtensions>(WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
@@ -381,24 +397,24 @@ namespace
}
template<>
std::vector<QtSourceGroupWizzardPage<SourceGroupSettingsJavaSonargraph>> getSourceGroupWizzardPages<SourceGroupSettingsJavaSonargraph>()
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsJavaSonargraph>> getSourceGroupWizardPages<SourceGroupSettingsJavaSonargraph>()
{
std::vector<QtSourceGroupWizzardPage<SourceGroupSettingsJavaSonargraph>> pages;
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsJavaSonargraph>> pages;
{
QtSourceGroupWizzardPage<SourceGroupSettingsJavaSonargraph> page("Sonargraph Project Path");
page.addContentCreatorWithSettings<QtProjectWizzardContentJavaStandard>(WIZZARD_CONTENT_CONTEXT_ALL);
QtSourceGroupWizardPage<SourceGroupSettingsJavaSonargraph> page("Sonargraph Project Path");
page.addContentCreatorWithSettings<QtProjectWizardContentJavaStandard>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreator(
WIZZARD_CONTENT_CONTEXT_ALL,
[](std::shared_ptr<SourceGroupSettingsJavaSonargraph> settings, QtProjectWizzardWindow* window)
WIZARD_CONTENT_CONTEXT_ALL,
[](std::shared_ptr<SourceGroupSettingsJavaSonargraph> settings, QtProjectWizardWindow* window)
{
return new QtProjectWizzardContentSonargraphProjectPath(settings, std::shared_ptr<SourceGroupSettingsCxxSonargraph>(), settings, window);
return new QtProjectWizardContentPathSonargraphProject(settings, std::shared_ptr<SourceGroupSettingsCxxSonargraph>(), settings, window);
}
);
pages.push_back(page);
}
{
QtSourceGroupWizzardPage<SourceGroupSettingsJavaSonargraph> page("Dependencies");
page.addContentCreatorWithSettings<QtProjectWizzardContentPathsClassJava>(WIZZARD_CONTENT_CONTEXT_ALL);
QtSourceGroupWizardPage<SourceGroupSettingsJavaSonargraph> page("Dependencies");
page.addContentCreatorWithSettings<QtProjectWizardContentPathsClassJava>(WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
@@ -407,15 +423,15 @@ namespace
template<>
std::vector<QtSourceGroupWizzardPage<SourceGroupSettingsPythonEmpty>> getSourceGroupWizzardPages<SourceGroupSettingsPythonEmpty>()
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsPythonEmpty>> getSourceGroupWizardPages<SourceGroupSettingsPythonEmpty>()
{
std::vector<QtSourceGroupWizzardPage<SourceGroupSettingsPythonEmpty>> pages;
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsPythonEmpty>> pages;
{
QtSourceGroupWizzardPage<SourceGroupSettingsPythonEmpty> page("Indexed Paths", 750, 600);
page.addContentCreatorWithSettings<QtProjectWizzardContentPathPythonEnvironment>(WIZZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizzardContentPathsSource>(WIZZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizzardContentPathsExclude>(WIZZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizzardContentExtensions>(WIZZARD_CONTENT_CONTEXT_ALL);
QtSourceGroupWizardPage<SourceGroupSettingsPythonEmpty> page("Indexed Paths", 750, 600);
page.addContentCreatorWithSettings<QtProjectWizardContentPathPythonEnvironment>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizardContentPathsSource>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizardContentPathsExclude>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizardContentExtensions>(WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
@@ -423,28 +439,28 @@ namespace
}
template<>
std::vector<QtSourceGroupWizzardPage<SourceGroupSettingsCustomCommand>> getSourceGroupWizzardPages<SourceGroupSettingsCustomCommand>()
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsCustomCommand>> getSourceGroupWizardPages<SourceGroupSettingsCustomCommand>()
{
std::vector<QtSourceGroupWizzardPage<SourceGroupSettingsCustomCommand>> pages;
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsCustomCommand>> pages;
{
QtSourceGroupWizzardPage<SourceGroupSettingsCustomCommand> page("Indexed Paths");
page.addContentCreatorWithSettings<QtProjectWizzardContentCustomCommand>(WIZZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizzardContentPathsSource>(WIZZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizzardContentPathsExclude>(WIZZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizzardContentExtensions>(WIZZARD_CONTENT_CONTEXT_ALL);
QtSourceGroupWizardPage<SourceGroupSettingsCustomCommand> page("Indexed Paths");
page.addContentCreatorWithSettings<QtProjectWizardContentCustomCommand>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizardContentPathsSource>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizardContentPathsExclude>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizardContentExtensions>(WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
return pages;
}
template <typename SettingsType>
void fillSummary(QtProjectWizzardContentGroup* summary, std::shared_ptr<SettingsType> settings, QtProjectWizzardWindow* window)
void fillSummary(QtProjectWizardContentGroup* summary, std::shared_ptr<SettingsType> settings, QtProjectWizardWindow* window)
{
const std::vector<QtSourceGroupWizzardPage<SettingsType>> pages = getSourceGroupWizzardPages<SettingsType>();
const std::vector<QtSourceGroupWizardPage<SettingsType>> pages = getSourceGroupWizardPages<SettingsType>();
for (const QtSourceGroupWizzardPage<SettingsType>& page : pages)
for (const QtSourceGroupWizardPage<SettingsType>& page : pages)
{
QtProjectWizzardContentGroup* contentGroup = page.createContentGroup(WIZZARD_CONTENT_CONTEXT_SUMMARY, settings, window);
QtProjectWizardContentGroup* contentGroup = page.createContentGroup(WIZARD_CONTENT_CONTEXT_SUMMARY, settings, window);
if (contentGroup && contentGroup->hasContents())
{
summary->addContent(contentGroup);
@@ -454,8 +470,8 @@ namespace
}
}
QtProjectWizzard::QtProjectWizzard(QWidget* parent)
: QtProjectWizzardWindow(parent, false)
QtProjectWizard::QtProjectWizard(QWidget* parent)
: QtProjectWizardWindow(parent, false)
, m_windowStack(this)
, m_editing(false)
, m_previouslySelectedIndex(-1)
@@ -463,9 +479,9 @@ QtProjectWizzard::QtProjectWizzard(QWidget* parent)
{
setScrollAble(true);
connect(&m_windowStack, &QtWindowStack::push, this, &QtProjectWizzard::windowStackChanged);
connect(&m_windowStack, &QtWindowStack::pop, this, &QtProjectWizzard::windowStackChanged);
connect(&m_windowStack, &QtWindowStack::empty, this, &QtProjectWizzard::windowStackChanged);
connect(&m_windowStack, &QtWindowStack::push, this, &QtProjectWizard::windowStackChanged);
connect(&m_windowStack, &QtWindowStack::pop, this, &QtProjectWizard::windowStackChanged);
connect(&m_windowStack, &QtWindowStack::empty, this, &QtProjectWizard::windowStackChanged);
// save old application settings so they can be compared later
ApplicationSettings* appSettings = ApplicationSettings::getInstance().get();
@@ -473,18 +489,18 @@ QtProjectWizzard::QtProjectWizzard(QWidget* parent)
m_appSettings.setFrameworkSearchPaths(appSettings->getFrameworkSearchPaths());
}
QSize QtProjectWizzard::sizeHint() const
QSize QtProjectWizard::sizeHint() const
{
return QSize(900, 600);
}
void QtProjectWizzard::newProject()
void QtProjectWizard::newProject()
{
m_projectSettings = std::make_shared<ProjectSettings>();
setup();
}
void QtProjectWizzard::newProjectFromCDB(const FilePath& filePath)
void QtProjectWizard::newProjectFromCDB(const FilePath& filePath)
{
if (!m_projectSettings)
{
@@ -514,14 +530,14 @@ void QtProjectWizzard::newProjectFromCDB(const FilePath& filePath)
executeSourceGroupSetup<SourceGroupSettingsCxxCdbVs>(sourceGroupSettings);
}
void QtProjectWizzard::editProject(const FilePath& settingsPath)
void QtProjectWizard::editProject(const FilePath& settingsPath)
{
std::shared_ptr<ProjectSettings> settings = std::make_shared<ProjectSettings>(settingsPath);
settings->reload();
editProject(settings);
}
void QtProjectWizzard::editProject(std::shared_ptr<ProjectSettings> settings)
void QtProjectWizard::editProject(std::shared_ptr<ProjectSettings> settings)
{
m_projectSettings = settings;
m_allSourceGroupSettings = settings->getAllSourceGroupSettings();
@@ -530,7 +546,7 @@ void QtProjectWizzard::editProject(std::shared_ptr<ProjectSettings> settings)
setup();
}
void QtProjectWizzard::populateWindow(QWidget* widget)
void QtProjectWizard::populateWindow(QWidget* widget)
{
QHBoxLayout* layout = new QHBoxLayout();
layout->setContentsMargins(0, 0, 0, 0);
@@ -549,7 +565,7 @@ void QtProjectWizzard::populateWindow(QWidget* widget)
m_generalButton = new QPushButton("General");
m_generalButton->setObjectName("general_button");
m_generalButton->setCheckable(true);
connect(m_generalButton, &QPushButton::clicked, this, &QtProjectWizzard::generalButtonClicked);
connect(m_generalButton, &QPushButton::clicked, this, &QtProjectWizard::generalButtonClicked);
menuLayout->addWidget(m_generalButton);
QLabel* sourceGroupLabel = new QLabel("Source Groups:");
@@ -557,7 +573,7 @@ void QtProjectWizzard::populateWindow(QWidget* widget)
m_sourceGroupList = new QListWidget();
m_sourceGroupList->setAttribute(Qt::WA_MacShowFocusRect, 0);
connect(m_sourceGroupList, &QListWidget::currentRowChanged, this, &QtProjectWizzard::selectedSourceGroupChanged);
connect(m_sourceGroupList, &QListWidget::currentRowChanged, this, &QtProjectWizard::selectedSourceGroupChanged);
menuLayout->addWidget(m_sourceGroupList);
QHBoxLayout* buttonsLayout = new QHBoxLayout();
@@ -594,9 +610,9 @@ void QtProjectWizzard::populateWindow(QWidget* widget)
m_removeButton->setEnabled(false);
m_duplicateButton->setEnabled(false);
connect(addButton, &QPushButton::clicked, this, &QtProjectWizzard::newSourceGroup);
connect(m_removeButton, &QPushButton::clicked, this, &QtProjectWizzard::removeSelectedSourceGroup);
connect(m_duplicateButton, &QPushButton::clicked, this, &QtProjectWizzard::duplicateSelectedSourceGroup);
connect(addButton, &QPushButton::clicked, this, &QtProjectWizard::newSourceGroup);
connect(m_removeButton, &QPushButton::clicked, this, &QtProjectWizard::removeSelectedSourceGroup);
connect(m_duplicateButton, &QPushButton::clicked, this, &QtProjectWizard::duplicateSelectedSourceGroup);
buttonsLayout->addWidget(addButton);
buttonsLayout->addWidget(m_removeButton);
@@ -630,7 +646,7 @@ void QtProjectWizzard::populateWindow(QWidget* widget)
widget->setLayout(layout);
}
void QtProjectWizzard::windowReady()
void QtProjectWizard::windowReady()
{
if (m_editing)
{
@@ -647,8 +663,8 @@ void QtProjectWizzard::windowReady()
updateSubTitle("Overview");
updatePreviousButton("Add Source Group");
connect(this, &QtProjectWizzard::previous, this, &QtProjectWizzard::newSourceGroup);
connect(this, &QtProjectWizzard::next, this, &QtProjectWizzard::createProject);
connect(this, &QtProjectWizard::previous, this, &QtProjectWizard::newSourceGroup);
connect(this, &QtProjectWizard::next, this, &QtProjectWizard::createProject);
updateSourceGroupList();
@@ -662,36 +678,36 @@ void QtProjectWizzard::windowReady()
}
}
void QtProjectWizzard::handlePrevious()
void QtProjectWizard::handlePrevious()
{
QtWindow::handlePrevious();
}
template <typename SettingsType>
void QtProjectWizzard::executeSourceGroupSetup(std::shared_ptr<SettingsType> settings)
void QtProjectWizard::executeSourceGroupSetup(std::shared_ptr<SettingsType> settings)
{
std::shared_ptr<QtSourceGroupWizzard<SettingsType>> wizzard = std::make_shared<QtSourceGroupWizzard<SettingsType>>(
std::shared_ptr<QtSourceGroupWizard<SettingsType>> wizard = std::make_shared<QtSourceGroupWizard<SettingsType>>(
settings,
std::bind(&QtProjectWizzard::cancelSourceGroup, this),
std::bind(&QtProjectWizzard::createSourceGroup, this, std::placeholders::_1)
std::bind(&QtProjectWizard::cancelSourceGroup, this),
std::bind(&QtProjectWizard::createSourceGroup, this, std::placeholders::_1)
);
for (const QtSourceGroupWizzardPage<SettingsType>& page : getSourceGroupWizzardPages<SettingsType>())
for (const QtSourceGroupWizardPage<SettingsType>& page : getSourceGroupWizardPages<SettingsType>())
{
wizzard->addPage(page);
wizard->addPage(page);
}
m_sourceGroupWizzard = wizzard;
m_sourceGroupWizzard->execute(m_windowStack);
m_sourceGroupWizard = wizard;
m_sourceGroupWizard->execute(m_windowStack);
}
QtProjectWizzardWindow* QtProjectWizzard::createWindowWithContent(
std::function<QtProjectWizzardContent*(QtProjectWizzardWindow*)> func
QtProjectWizardWindow* QtProjectWizard::createWindowWithContent(
std::function<QtProjectWizardContent*(QtProjectWizardWindow*)> func
){
QtProjectWizzardWindow* window = new QtProjectWizzardWindow(parentWidget());
QtProjectWizardWindow* window = new QtProjectWizardWindow(parentWidget());
connect(window, &QtProjectWizzardWindow::previous, &m_windowStack, &QtWindowStack::popWindow);
connect(window, &QtProjectWizzardWindow::canceled, this, &QtProjectWizzard::cancelSourceGroup);
connect(window, &QtProjectWizardWindow::previous, &m_windowStack, &QtWindowStack::popWindow);
connect(window, &QtProjectWizardWindow::canceled, this, &QtProjectWizard::cancelSourceGroup);
window->setPreferredSize(QSize(580, 340));
window->setContent(func(window));
@@ -703,15 +719,15 @@ QtProjectWizzardWindow* QtProjectWizzard::createWindowWithContent(
return window;
}
QtProjectWizzardWindow* QtProjectWizzard::createWindowWithContentGroup(
std::function<void(QtProjectWizzardWindow*, QtProjectWizzardContentGroup*)> func
QtProjectWizardWindow* QtProjectWizard::createWindowWithContentGroup(
std::function<void(QtProjectWizardWindow*, QtProjectWizardContentGroup*)> func
){
QtProjectWizzardWindow* window = new QtProjectWizzardWindow(parentWidget());
QtProjectWizardWindow* window = new QtProjectWizardWindow(parentWidget());
connect(window, &QtProjectWizzardWindow::previous, &m_windowStack, &QtWindowStack::popWindow);
connect(window, &QtProjectWizzardWindow::canceled, this, &QtProjectWizzard::cancelSourceGroup);
connect(window, &QtProjectWizardWindow::previous, &m_windowStack, &QtWindowStack::popWindow);
connect(window, &QtProjectWizardWindow::canceled, this, &QtProjectWizard::cancelSourceGroup);
QtProjectWizzardContentGroup* contentGroup = new QtProjectWizzardContentGroup(window);
QtProjectWizardContentGroup* contentGroup = new QtProjectWizardContentGroup(window);
window->setPreferredSize(QSize(750, 600));
window->setContent(contentGroup);
@@ -724,7 +740,7 @@ QtProjectWizzardWindow* QtProjectWizzard::createWindowWithContentGroup(
return window;
}
void QtProjectWizzard::updateSourceGroupList()
void QtProjectWizard::updateSourceGroupList()
{
m_sourceGroupList->clear();
@@ -741,7 +757,7 @@ void QtProjectWizzard::updateSourceGroupList()
}
}
bool QtProjectWizzard::canExitContent()
bool QtProjectWizard::canExitContent()
{
if (content())
{
@@ -756,7 +772,7 @@ bool QtProjectWizzard::canExitContent()
return true;
}
void QtProjectWizzard::generalButtonClicked()
void QtProjectWizard::generalButtonClicked()
{
if (!canExitContent())
{
@@ -764,19 +780,19 @@ void QtProjectWizzard::generalButtonClicked()
return;
}
QtProjectWizzardContentGroup* contentGroup = new QtProjectWizzardContentGroup(this);
contentGroup->addContent(new QtProjectWizzardContentProjectData(m_projectSettings, this, m_editing));
QtProjectWizardContentGroup* contentGroup = new QtProjectWizardContentGroup(this);
contentGroup->addContent(new QtProjectWizardContentProjectData(m_projectSettings, this, m_editing));
if (m_allSourceGroupSettings.empty())
{
contentGroup->addSpace();
contentGroup->addContent(new QtProjectWizzardContentSourceGroupInfoText(this));
contentGroup->addContent(new QtProjectWizardContentSourceGroupInfoText(this));
}
setContent(contentGroup);
qDeleteAll(m_contentWidget->children());
QtProjectWizzardWindow::populateWindow(m_contentWidget);
QtProjectWizardWindow::populateWindow(m_contentWidget);
loadContent();
@@ -786,7 +802,7 @@ void QtProjectWizzard::generalButtonClicked()
m_sourceGroupList->setCurrentRow(-1);
}
void QtProjectWizzard::selectedSourceGroupChanged(int index)
void QtProjectWizard::selectedSourceGroupChanged(int index)
{
if (index < 0 || index >= int(m_allSourceGroupSettings.size()))
{
@@ -812,11 +828,11 @@ void QtProjectWizzard::selectedSourceGroupChanged(int index)
std::shared_ptr<SourceGroupSettings> group = m_allSourceGroupSettings[index];
QtProjectWizzardContentGroup* summary = new QtProjectWizzardContentGroup(this);
QtProjectWizardContentGroup* summary = new QtProjectWizardContentGroup(this);
summary->setIsForm(true);
QtProjectWizzardContentSourceGroupData* content = new QtProjectWizzardContentSourceGroupData(group, this);
connect(content, &QtProjectWizzardContentSourceGroupData::nameUpdated, this, &QtProjectWizzard::selectedSourceGroupNameChanged);
QtProjectWizardContentSourceGroupData* content = new QtProjectWizardContentSourceGroupData(group, this);
connect(content, &QtProjectWizardContentSourceGroupData::nameUpdated, this, &QtProjectWizard::selectedSourceGroupNameChanged);
summary->addContent(content);
summary->addSpace();
@@ -872,19 +888,19 @@ void QtProjectWizzard::selectedSourceGroupChanged(int index)
setContent(summary);
qDeleteAll(m_contentWidget->children());
QtProjectWizzardWindow::populateWindow(m_contentWidget);
QtProjectWizardWindow::populateWindow(m_contentWidget);
loadContent();
m_previouslySelectedIndex = index;
}
void QtProjectWizzard::selectedSourceGroupNameChanged(QString name)
void QtProjectWizard::selectedSourceGroupNameChanged(QString name)
{
m_sourceGroupList->item(m_sourceGroupList->currentRow())->setText(name);
}
void QtProjectWizzard::removeSelectedSourceGroup()
void QtProjectWizard::removeSelectedSourceGroup()
{
if (!m_allSourceGroupSettings.size() || m_sourceGroupList->currentRow() < 0)
{
@@ -923,7 +939,7 @@ void QtProjectWizzard::removeSelectedSourceGroup()
}
}
void QtProjectWizzard::duplicateSelectedSourceGroup()
void QtProjectWizard::duplicateSelectedSourceGroup()
{
if (!m_allSourceGroupSettings.size() || m_sourceGroupList->currentRow() < 0 || !canExitContent())
{
@@ -977,30 +993,30 @@ void QtProjectWizzard::duplicateSelectedSourceGroup()
m_sourceGroupList->setCurrentRow(newRow);
}
void QtProjectWizzard::cancelSourceGroup()
void QtProjectWizard::cancelSourceGroup()
{
m_windowStack.clearWindows();
}
void QtProjectWizzard::cancelWizzard()
void QtProjectWizard::cancelWizard()
{
m_windowStack.clearWindows();
emit canceled();
}
void QtProjectWizzard::finishWizzard()
void QtProjectWizard::finishWizard()
{
m_windowStack.clearWindows();
emit finished();
}
void QtProjectWizzard::windowStackChanged()
void QtProjectWizard::windowStackChanged()
{
QWidget* window = m_windowStack.getTopWindow();
if (window)
{
dynamic_cast<QtProjectWizzardWindow*>(window)->content()->load();
dynamic_cast<QtProjectWizardWindow*>(window)->content()->load();
setEnabled(false);
}
else
@@ -1010,25 +1026,25 @@ void QtProjectWizzard::windowStackChanged()
}
}
void QtProjectWizzard::newSourceGroup()
void QtProjectWizard::newSourceGroup()
{
if (!canExitContent())
{
return;
}
QtProjectWizzardWindow* window = createWindowWithContent(
[](QtProjectWizzardWindow* window)
QtProjectWizardWindow* window = createWindowWithContent(
[](QtProjectWizardWindow* window)
{
window->setPreferredSize(QSize(560, 520));
return new QtProjectWizzardContentSelect(window);
return new QtProjectWizardContentSelect(window);
}
);
window->resize(QSize(560, 520));
connect(dynamic_cast<QtProjectWizzardContentSelect*>(window->content()),
&QtProjectWizzardContentSelect::selected,
this, &QtProjectWizzard::selectedProjectType);
connect(dynamic_cast<QtProjectWizardContentSelect*>(window->content()),
&QtProjectWizardContentSelect::selected,
this, &QtProjectWizard::selectedProjectType);
window->show();
window->setNextEnabled(false);
@@ -1036,7 +1052,7 @@ void QtProjectWizzard::newSourceGroup()
window->updateSubTitle("Type Selection");
}
void QtProjectWizzard::selectedProjectType(SourceGroupType sourceGroupType)
void QtProjectWizard::selectedProjectType(SourceGroupType sourceGroupType)
{
const std::string sourceGroupId = utility::getUuidString();
@@ -1139,7 +1155,7 @@ void QtProjectWizzard::selectedProjectType(SourceGroupType sourceGroupType)
}
}
void QtProjectWizzard::createSourceGroup(std::shared_ptr<SourceGroupSettings> settings)
void QtProjectWizard::createSourceGroup(std::shared_ptr<SourceGroupSettings> settings)
{
m_allSourceGroupSettings.push_back(settings);
@@ -1153,7 +1169,7 @@ void QtProjectWizzard::createSourceGroup(std::shared_ptr<SourceGroupSettings> se
m_sourceGroupList->setCurrentRow(m_allSourceGroupSettings.size() - 1);
}
void QtProjectWizzard::createProject()
void QtProjectWizard::createProject()
{
FilePath path = m_projectSettings->getFilePath();
@@ -1179,5 +1195,5 @@ void QtProjectWizzard::createProject()
MessageLoadProject(path, settingsChanged).dispatch();
finishWizzard();
finishWizard();
}
@@ -1,29 +1,29 @@
#ifndef QT_PROJECT_WIZZARD_H
#define QT_PROJECT_WIZZARD_H
#ifndef QT_PROJECT_WIZARD_H
#define QT_PROJECT_WIZARD_H
#include <functional>
#include <QWidget>
#include "QtProjectWizzardWindow.h"
#include "QtSourceGroupWizzard.h"
#include "QtProjectWizardWindow.h"
#include "QtSourceGroupWizard.h"
#include "QtWindow.h"
#include "ApplicationSettings.h"
#include "ProjectSettings.h"
class QListWidget;
class QPushButton;
class QtProjectWizzardContent;
class QtProjectWizzardContentGroup;
class QtProjectWizzardWindow;
class QtProjectWizardContent;
class QtProjectWizardContentGroup;
class QtProjectWizardWindow;
class QtProjectWizzard
: public QtProjectWizzardWindow
class QtProjectWizard
: public QtProjectWizardWindow
{
Q_OBJECT
public:
QtProjectWizzard(QWidget* parent = nullptr);
QtProjectWizard(QWidget* parent = nullptr);
virtual QSize sizeHint() const override;
public slots:
@@ -44,11 +44,11 @@ private:
template <typename SettingsType>
void executeSourceGroupSetup(std::shared_ptr<SettingsType> settings);
QtProjectWizzardWindow* createWindowWithContent(
std::function<QtProjectWizzardContent*(QtProjectWizzardWindow*)> func);
QtProjectWizardWindow* createWindowWithContent(
std::function<QtProjectWizardContent*(QtProjectWizardWindow*)> func);
QtProjectWizzardWindow* createWindowWithContentGroup(
std::function<void(QtProjectWizzardWindow*, QtProjectWizzardContentGroup*)> func);
QtProjectWizardWindow* createWindowWithContentGroup(
std::function<void(QtProjectWizardWindow*, QtProjectWizardContentGroup*)> func);
void updateSourceGroupList();
bool canExitContent();
@@ -57,7 +57,7 @@ private:
std::shared_ptr<ProjectSettings> m_projectSettings;
std::vector<std::shared_ptr<SourceGroupSettings>> m_allSourceGroupSettings;
std::shared_ptr<QtSourceGroupWizzardBase> m_sourceGroupWizzard;
std::shared_ptr<QtSourceGroupWizardBase> m_sourceGroupWizard;
ApplicationSettings m_appSettings;
bool m_editing;
@@ -78,8 +78,8 @@ private slots:
void cancelSourceGroup();
void cancelWizzard();
void finishWizzard();
void cancelWizard();
void finishWizard();
void windowStackChanged();
@@ -90,4 +90,4 @@ private slots:
void createProject();
};
#endif // QT_PROJECT_WIZZARD_H
#endif // QT_PROJECT_WIZARD_H
@@ -1,4 +1,4 @@
#include "QtProjectWizzardWindow.h"
#include "QtProjectWizardWindow.h"
#include <QGridLayout>
#include <QFrame>
@@ -6,16 +6,16 @@
#include <QScrollArea>
#include "utilityQt.h"
#include "QtProjectWizzardContent.h"
#include "QtProjectWizardContent.h"
QtProjectWizzardWindow::QtProjectWizzardWindow(QWidget *parent, bool showSeparator)
QtProjectWizardWindow::QtProjectWizardWindow(QWidget *parent, bool showSeparator)
: QtWindow(false, parent)
, m_content(nullptr)
, m_showSeparator(showSeparator)
{
}
QSize QtProjectWizzardWindow::sizeHint() const
QSize QtProjectWizardWindow::sizeHint() const
{
if (m_preferredSize.width())
{
@@ -24,38 +24,38 @@ QSize QtProjectWizzardWindow::sizeHint() const
return QSize(750, 620);
}
QtProjectWizzardContent* QtProjectWizzardWindow::content() const
QtProjectWizardContent* QtProjectWizardWindow::content() const
{
return m_content;
}
void QtProjectWizzardWindow::setContent(QtProjectWizzardContent* content)
void QtProjectWizardWindow::setContent(QtProjectWizardContent* content)
{
m_content = content;
}
void QtProjectWizzardWindow::setPreferredSize(QSize size)
void QtProjectWizardWindow::setPreferredSize(QSize size)
{
m_preferredSize = size;
}
void QtProjectWizzardWindow::saveContent()
void QtProjectWizardWindow::saveContent()
{
m_content->save();
}
void QtProjectWizzardWindow::loadContent()
void QtProjectWizardWindow::loadContent()
{
m_content->load();
}
void QtProjectWizzardWindow::populateWindow(QWidget* widget)
void QtProjectWizardWindow::populateWindow(QWidget* widget)
{
QGridLayout* layout = new QGridLayout();
layout->setContentsMargins(0, 0, 0, 0);
layout->setColumnStretch(QtProjectWizzardWindow::FRONT_COL, 1);
layout->setColumnStretch(QtProjectWizzardWindow::BACK_COL, 3);
layout->setColumnStretch(QtProjectWizardWindow::FRONT_COL, 1);
layout->setColumnStretch(QtProjectWizardWindow::BACK_COL, 3);
layout->setColumnStretch(HELP_COL, 0);
layout->setColumnStretch(LINE_COL, 0);
@@ -80,14 +80,14 @@ void QtProjectWizzardWindow::populateWindow(QWidget* widget)
widget->setLayout(layout);
}
void QtProjectWizzardWindow::windowReady()
void QtProjectWizardWindow::windowReady()
{
updateTitle("NEW SOURCE GROUP");
m_content->windowReady();
}
void QtProjectWizzardWindow::handleNext()
void QtProjectWizardWindow::handleNext()
{
if (m_content)
{
@@ -102,7 +102,7 @@ void QtProjectWizzardWindow::handleNext()
emit next();
}
void QtProjectWizzardWindow::handlePrevious()
void QtProjectWizardWindow::handlePrevious()
{
if (m_content)
{
@@ -1,21 +1,21 @@
#ifndef QT_PROJECT_WIZZARD_WINDOW_H
#define QT_PROJECT_WIZZARD_WINDOW_H
#ifndef QT_PROJECT_WIZARD_WINDOW_H
#define QT_PROJECT_WIZARD_WINDOW_H
#include "QtWindow.h"
class QtProjectWizzardContent;
class QtProjectWizardContent;
class QtProjectWizzardWindow
class QtProjectWizardWindow
: public QtWindow
{
Q_OBJECT
public:
QtProjectWizzardWindow(QWidget* parent, bool showSeparator = true);
QtProjectWizardWindow(QWidget* parent, bool showSeparator = true);
virtual QSize sizeHint() const override;
QtProjectWizzardContent* content() const;
void setContent(QtProjectWizzardContent* content);
QtProjectWizardContent* content() const;
void setContent(QtProjectWizardContent* content);
void setPreferredSize(QSize size);
@@ -36,9 +36,9 @@ protected:
virtual void handlePrevious() override;
private:
QtProjectWizzardContent* m_content;
QtProjectWizardContent* m_content;
QSize m_preferredSize;
bool m_showSeparator;
};
#endif // QT_PROJECT_WIZZARD_WINDOW_H
#endif // QT_PROJECT_WIZARD_WINDOW_H
@@ -1,78 +1,78 @@
#ifndef QT_SOURCE_GROUP_WIZZARD_H
#define QT_SOURCE_GROUP_WIZZARD_H
#ifndef QT_SOURCE_GROUP_WIZARD_H
#define QT_SOURCE_GROUP_WIZARD_H
#include <functional>
#include <memory>
#include <vector>
#include "QtProjectWizzardContentGroup.h"
#include "QtProjectWizzardWindow.h"
#include "QtSourceGroupWizzardPage.h"
#include "QtProjectWizardContentGroup.h"
#include "QtProjectWizardWindow.h"
#include "QtSourceGroupWizardPage.h"
#include "logging.h"
class SourceGroupSettings;
class QtSourceGroupWizzardBase
class QtSourceGroupWizardBase
{
public:
virtual ~QtSourceGroupWizzardBase() = default;
virtual ~QtSourceGroupWizardBase() = default;
virtual void execute(QtWindowStack& windowStack) = 0;
virtual bool canProcessSettings(std::shared_ptr<const SourceGroupSettings> settings) = 0;
};
template <typename SettingsType>
class QtSourceGroupWizzard: public QtSourceGroupWizzardBase
class QtSourceGroupWizard: public QtSourceGroupWizardBase
{
public:
QtSourceGroupWizzard(
QtSourceGroupWizard(
std::shared_ptr<SettingsType> settings,
std::function<void()> onCancelClicked,
std::function<void(std::shared_ptr<SourceGroupSettings>)> onFinishedWizzard
std::function<void(std::shared_ptr<SourceGroupSettings>)> onFinishedWizard
);
void addPage(const QtSourceGroupWizzardPage<SettingsType>& page);
void addPage(const QtSourceGroupWizardPage<SettingsType>& page);
void execute(QtWindowStack& windowStack) override;
bool canProcessSettings(std::shared_ptr<const SourceGroupSettings> settings) override;
private:
void createWindowForPage(const size_t pageId, QtWindowStack& windowStack);
int mapToPageIdWithContentForContext(size_t pageId, WizzardContentContextType contextType) const;
int mapToPageIdWithContentForContext(size_t pageId, WizardContentContextType contextType) const;
std::shared_ptr<SettingsType> m_settings;
std::function<void()> m_onCancelClicked;
std::function<void(std::shared_ptr<SourceGroupSettings>)> m_onFinishedWizzard;
std::vector<QtSourceGroupWizzardPage<SettingsType>> m_pages;
std::function<void(std::shared_ptr<SourceGroupSettings>)> m_onFinishedWizard;
std::vector<QtSourceGroupWizardPage<SettingsType>> m_pages;
};
template <typename SettingsType>
QtSourceGroupWizzard<SettingsType>::QtSourceGroupWizzard(
QtSourceGroupWizard<SettingsType>::QtSourceGroupWizard(
std::shared_ptr<SettingsType> settings,
std::function<void()> onCancelClicked,
std::function<void(std::shared_ptr<SourceGroupSettings>)> onFinishedWizzard
std::function<void(std::shared_ptr<SourceGroupSettings>)> onFinishedWizard
)
: m_settings(settings)
, m_onCancelClicked(onCancelClicked)
, m_onFinishedWizzard(onFinishedWizzard)
, m_onFinishedWizard(onFinishedWizard)
{
}
template <typename SettingsType>
void QtSourceGroupWizzard<SettingsType>::addPage(const QtSourceGroupWizzardPage<SettingsType>& page)
void QtSourceGroupWizard<SettingsType>::addPage(const QtSourceGroupWizardPage<SettingsType>& page)
{
m_pages.push_back(page);
}
template <typename SettingsType>
void QtSourceGroupWizzard<SettingsType>::execute(QtWindowStack& windowStack)
void QtSourceGroupWizard<SettingsType>::execute(QtWindowStack& windowStack)
{
if (!m_pages.empty())
{
createWindowForPage(mapToPageIdWithContentForContext(0, WIZZARD_CONTENT_CONTEXT_SETUP), windowStack);
createWindowForPage(mapToPageIdWithContentForContext(0, WIZARD_CONTENT_CONTEXT_SETUP), windowStack);
}
}
template <typename SettingsType>
bool QtSourceGroupWizzard<SettingsType>::canProcessSettings(std::shared_ptr<const SourceGroupSettings> settings)
bool QtSourceGroupWizard<SettingsType>::canProcessSettings(std::shared_ptr<const SourceGroupSettings> settings)
{
if (std::dynamic_pointer_cast<const SettingsType>(settings))
{
@@ -82,7 +82,7 @@ bool QtSourceGroupWizzard<SettingsType>::canProcessSettings(std::shared_ptr<cons
}
template <typename SettingsType>
void QtSourceGroupWizzard<SettingsType>::createWindowForPage(const size_t pageId, QtWindowStack& windowStack)
void QtSourceGroupWizard<SettingsType>::createWindowForPage(const size_t pageId, QtWindowStack& windowStack)
{
if (pageId >= m_pages.size())
{
@@ -90,27 +90,27 @@ void QtSourceGroupWizzard<SettingsType>::createWindowForPage(const size_t pageId
return;
}
const QtSourceGroupWizzardPage<SettingsType>& page = m_pages.at(pageId);
const int nextPageId = mapToPageIdWithContentForContext(pageId + 1, WIZZARD_CONTENT_CONTEXT_SETUP);
const QtSourceGroupWizardPage<SettingsType>& page = m_pages.at(pageId);
const int nextPageId = mapToPageIdWithContentForContext(pageId + 1, WIZARD_CONTENT_CONTEXT_SETUP);
QtProjectWizzardWindow* window = new QtProjectWizzardWindow(nullptr);
QtProjectWizardWindow* window = new QtProjectWizardWindow(nullptr);
window->connect(window, &QtProjectWizzardWindow::previous, &windowStack, &QtWindowStack::popWindow);
window->connect(window, &QtProjectWizzardWindow::canceled, m_onCancelClicked);
window->connect(window, &QtProjectWizardWindow::previous, &windowStack, &QtWindowStack::popWindow);
window->connect(window, &QtProjectWizardWindow::canceled, m_onCancelClicked);
if (nextPageId > 0)
{
window->connect(
window, &QtProjectWizzardWindow::next,
window, &QtProjectWizardWindow::next,
[this, nextPageId, &windowStack]() { this->createWindowForPage(nextPageId, windowStack); }
);
}
else
{
window->connect(window, &QtProjectWizzardWindow::next, [&]() { m_onFinishedWizzard(m_settings); });
window->connect(window, &QtProjectWizardWindow::next, [&]() { m_onFinishedWizard(m_settings); });
}
QtProjectWizzardContentGroup* contentGroup = page.createContentGroup(WIZZARD_CONTENT_CONTEXT_SETUP, m_settings, window);
QtProjectWizardContentGroup* contentGroup = page.createContentGroup(WIZARD_CONTENT_CONTEXT_SETUP, m_settings, window);
window->setPreferredSize(QSize(page.getPreferredWidth(), page.getPreferredHeight()));
window->setContent(contentGroup);
@@ -121,7 +121,7 @@ void QtSourceGroupWizzard<SettingsType>::createWindowForPage(const size_t pageId
size_t totalPages = 0;
for (size_t i = 0; i < m_pages.size(); i++)
{
if (m_pages[i].hasContentForContext(WIZZARD_CONTENT_CONTEXT_SETUP))
if (m_pages[i].hasContentForContext(WIZARD_CONTENT_CONTEXT_SETUP))
{
if (i <= pageId)
{
@@ -137,11 +137,11 @@ void QtSourceGroupWizzard<SettingsType>::createWindowForPage(const size_t pageId
}
template <typename SettingsType>
int QtSourceGroupWizzard<SettingsType>::mapToPageIdWithContentForContext(size_t pageId, WizzardContentContextType contextType) const
int QtSourceGroupWizard<SettingsType>::mapToPageIdWithContentForContext(size_t pageId, WizardContentContextType contextType) const
{
while (pageId < m_pages.size())
{
const QtSourceGroupWizzardPage<SettingsType>& page = m_pages.at(pageId);
const QtSourceGroupWizardPage<SettingsType>& page = m_pages.at(pageId);
if (page.hasContentForContext(contextType))
{
return pageId;
@@ -151,4 +151,4 @@ int QtSourceGroupWizzard<SettingsType>::mapToPageIdWithContentForContext(size_t
return -1;
}
#endif // QT_SOURCE_GROUP_WIZZARD_H
#endif // QT_SOURCE_GROUP_WIZARD_H
@@ -0,0 +1,163 @@
#ifndef QT_SOURCE_GROUP_WIZARD_PAGE_H
#define QT_SOURCE_GROUP_WIZARD_PAGE_H
#include <functional>
#include <memory>
#include <vector>
class QtProjectWizardWindow;
enum WizardContentContextType
{
WIZARD_CONTENT_CONTEXT_SETUP = 1,
WIZARD_CONTENT_CONTEXT_SUMMARY = 2,
WIZARD_CONTENT_CONTEXT_ALL = 3
};
template <typename SettingsType>
class QtSourceGroupWizardPage
{
public:
typedef std::function<QtProjectWizardContent* (std::shared_ptr<SettingsType> settings, QtProjectWizardWindow* window)> ContentCreator;
QtSourceGroupWizardPage(const std::string& title, int preferredWidth = 750, int preferredHeight = 600);
void addContentCreator(
WizardContentContextType contextType,
ContentCreator contentCreator
);
template <typename ContentType>
void addContentCreatorSimple(WizardContentContextType contextType);
template <typename ContentType>
void addContentCreatorWithSettings(WizardContentContextType contextType);
template <typename ContentType, typename ... ParamTypes>
void addContentCreatorWithSettings(WizardContentContextType contextType, ParamTypes ... params);
bool hasContentForContext(WizardContentContextType contextType) const;
std::string getTitle() const;
int getPreferredWidth() const;
int getPreferredHeight() const;
QtProjectWizardContentGroup* createContentGroup(WizardContentContextType contextType, std::shared_ptr<SettingsType> settings, QtProjectWizardWindow* window) const;
private:
const std::string m_title;
const int m_preferredWidth;
const int m_preferredHeight;
std::vector<std::pair<WizardContentContextType, ContentCreator>> m_contentCreators;
};
template <typename SettingsType>
QtSourceGroupWizardPage<SettingsType>::QtSourceGroupWizardPage(const std::string& title, int preferredWidth, int preferredHeight)
: m_title(title)
, m_preferredWidth(preferredWidth)
, m_preferredHeight(preferredHeight)
{
}
template <typename SettingsType>
void QtSourceGroupWizardPage<SettingsType>::addContentCreator(
WizardContentContextType contextType,
ContentCreator contentCreator
)
{
m_contentCreators.push_back(std::make_pair(contextType, contentCreator));
}
template <typename SettingsType>
template <typename ContentType>
void QtSourceGroupWizardPage<SettingsType>::addContentCreatorSimple(WizardContentContextType contextType)
{
addContentCreator(
contextType,
[](std::shared_ptr<SettingsType> settings, QtProjectWizardWindow* window)
{
return new ContentType(window);
}
);
}
template <typename SettingsType>
template <typename ContentType>
void QtSourceGroupWizardPage<SettingsType>::addContentCreatorWithSettings(WizardContentContextType contextType)
{
addContentCreator(
contextType,
[](std::shared_ptr<SettingsType> settings, QtProjectWizardWindow* window)
{
return new ContentType(settings, window);
}
);
}
template <typename SettingsType>
template <typename ContentType, typename ... ParamTypes>
void QtSourceGroupWizardPage<SettingsType>::addContentCreatorWithSettings(WizardContentContextType contextType, ParamTypes ... params)
{
addContentCreator(
contextType,
[=](std::shared_ptr<SettingsType> settings, QtProjectWizardWindow* window)
{
return new ContentType(settings, window, params...);
}
);
}
template <typename SettingsType>
std::string QtSourceGroupWizardPage<SettingsType>::getTitle() const
{
return m_title;
}
template <typename SettingsType>
int QtSourceGroupWizardPage<SettingsType>::getPreferredWidth() const
{
return m_preferredWidth;
}
template <typename SettingsType>
int QtSourceGroupWizardPage<SettingsType>::getPreferredHeight() const
{
return m_preferredHeight;
}
template <typename SettingsType>
bool QtSourceGroupWizardPage<SettingsType>::hasContentForContext(WizardContentContextType contextType) const
{
for (const std::pair<WizardContentContextType, ContentCreator>& contentCreator : m_contentCreators)
{
if (contentCreator.first & contextType)
{
return true;
}
}
return false;
}
template <typename SettingsType>
QtProjectWizardContentGroup* QtSourceGroupWizardPage<SettingsType>::createContentGroup(WizardContentContextType contextType, std::shared_ptr<SettingsType> settings, QtProjectWizardWindow* window) const
{
QtProjectWizardContentGroup* contentGroup = new QtProjectWizardContentGroup(window);
bool firstContentAdded = false;
for (const std::pair<WizardContentContextType, ContentCreator>& contentCreator : m_contentCreators)
{
if (contentCreator.first & contextType)
{
if (firstContentAdded)
{
contentGroup->addSpace();
}
contentGroup->addContent(contentCreator.second(settings, window));
firstContentAdded = true;
}
}
return contentGroup;
}
#endif // QT_SOURCE_GROUP_WIZARD_PAGE_H
@@ -1,4 +1,4 @@
#include "QtProjectWizzardContent.h"
#include "QtProjectWizardContent.h"
#include <thread>
@@ -6,66 +6,66 @@
#include "utility.h"
#include "utilityString.h"
QtProjectWizzardContent::QtProjectWizzardContent(QtProjectWizzardWindow* window)
QtProjectWizardContent::QtProjectWizardContent(QtProjectWizardWindow* window)
: QWidget(window)
, m_window(window)
, m_isInForm(false)
, m_showFilesFunctor(std::bind(&QtProjectWizzardContent::showFilesDialog, this, std::placeholders::_1))
, m_showFilesFunctor(std::bind(&QtProjectWizardContent::showFilesDialog, this, std::placeholders::_1))
{
}
void QtProjectWizzardContent::populate(QGridLayout* layout, int& row)
void QtProjectWizardContent::populate(QGridLayout* layout, int& row)
{
}
void QtProjectWizzardContent::windowReady()
void QtProjectWizardContent::windowReady()
{
}
void QtProjectWizzardContent::load()
void QtProjectWizardContent::load()
{
}
void QtProjectWizzardContent::save()
void QtProjectWizardContent::save()
{
}
bool QtProjectWizzardContent::check()
bool QtProjectWizardContent::check()
{
return true;
}
bool QtProjectWizzardContent::isScrollAble() const
bool QtProjectWizardContent::isScrollAble() const
{
return false;
}
std::vector<FilePath> QtProjectWizzardContent::getFilePaths() const
std::vector<FilePath> QtProjectWizardContent::getFilePaths() const
{
return {};
}
QString QtProjectWizzardContent::getFileNamesTitle() const
QString QtProjectWizardContent::getFileNamesTitle() const
{
return "File List";
}
QString QtProjectWizzardContent::getFileNamesDescription() const
QString QtProjectWizardContent::getFileNamesDescription() const
{
return "files";
}
bool QtProjectWizzardContent::isInForm() const
bool QtProjectWizardContent::isInForm() const
{
return m_isInForm;
}
void QtProjectWizzardContent::setIsInForm(bool isInForm)
void QtProjectWizardContent::setIsInForm(bool isInForm)
{
m_isInForm = isInForm;
}
QLabel* QtProjectWizzardContent::createFormLabel(QString name) const
QLabel* QtProjectWizardContent::createFormLabel(QString name) const
{
QLabel* label = new QLabel(name);
label->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
@@ -74,7 +74,7 @@ QLabel* QtProjectWizzardContent::createFormLabel(QString name) const
return label;
}
QLabel* QtProjectWizzardContent::createFormTitle(QString name) const
QLabel* QtProjectWizardContent::createFormTitle(QString name) const
{
QLabel* label = new QLabel(name);
label->setObjectName("titleLabel");
@@ -82,7 +82,7 @@ QLabel* QtProjectWizzardContent::createFormTitle(QString name) const
return label;
}
QToolButton* QtProjectWizzardContent::createSourceGroupButton(QString name, QString iconPath) const
QToolButton* QtProjectWizardContent::createSourceGroupButton(QString name, QString iconPath) const
{
QToolButton* button = new QToolButton();
button->setObjectName("sourceGroupButton");
@@ -94,28 +94,28 @@ QToolButton* QtProjectWizzardContent::createSourceGroupButton(QString name, QStr
return button;
}
QtHelpButton* QtProjectWizzardContent::addHelpButton(const QString& helpTitle, const QString& helpText, QGridLayout* layout, int row) const
QtHelpButton* QtProjectWizardContent::addHelpButton(const QString& helpTitle, const QString& helpText, QGridLayout* layout, int row) const
{
QtHelpButton* button = new QtHelpButton(helpTitle, helpText);
layout->addWidget(button, row, QtProjectWizzardWindow::HELP_COL, Qt::AlignTop);
layout->addWidget(button, row, QtProjectWizardWindow::HELP_COL, Qt::AlignTop);
return button;
}
QPushButton* QtProjectWizzardContent::addFilesButton(QString name, QGridLayout* layout, int row) const
QPushButton* QtProjectWizardContent::addFilesButton(QString name, QGridLayout* layout, int row) const
{
QPushButton* button = new QPushButton(name);
button->setObjectName("windowButton");
button->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
if (layout)
{
layout->addWidget(button, row, QtProjectWizzardWindow::BACK_COL, Qt::AlignRight | Qt::AlignTop);
layout->addWidget(button, row, QtProjectWizardWindow::BACK_COL, Qt::AlignRight | Qt::AlignTop);
}
connect(button, &QPushButton::clicked, this, &QtProjectWizzardContent::filesButtonClicked);
connect(button, &QPushButton::clicked, this, &QtProjectWizardContent::filesButtonClicked);
return button;
}
QFrame* QtProjectWizzardContent::addSeparator(QGridLayout* layout, int row) const
QFrame* QtProjectWizardContent::addSeparator(QGridLayout* layout, int row) const
{
QFrame* separator = new QFrame();
separator->setFrameShape(QFrame::HLine);
@@ -128,7 +128,7 @@ QFrame* QtProjectWizzardContent::addSeparator(QGridLayout* layout, int row) cons
return separator;
}
void QtProjectWizzardContent::filesButtonClicked()
void QtProjectWizardContent::filesButtonClicked()
{
m_window->saveContent();
m_window->loadContent();
@@ -139,7 +139,7 @@ void QtProjectWizzardContent::filesButtonClicked()
}).detach();
}
void QtProjectWizzardContent::showFilesDialog(const std::vector<FilePath>& filePaths)
void QtProjectWizardContent::showFilesDialog(const std::vector<FilePath>& filePaths)
{
if (!m_filesDialog)
{
@@ -151,15 +151,15 @@ void QtProjectWizzardContent::showFilesDialog(const std::vector<FilePath>& fileP
m_filesDialog->setCloseVisible(false);
m_filesDialog->setReadOnly(true);
connect(m_filesDialog.get(), &QtTextEditDialog::finished, this, &QtProjectWizzardContent::closedFilesDialog);
connect(m_filesDialog.get(), &QtTextEditDialog::canceled, this, &QtProjectWizzardContent::closedFilesDialog);
connect(m_filesDialog.get(), &QtTextEditDialog::finished, this, &QtProjectWizardContent::closedFilesDialog);
connect(m_filesDialog.get(), &QtTextEditDialog::canceled, this, &QtProjectWizardContent::closedFilesDialog);
}
m_filesDialog->showWindow();
m_filesDialog->raise();
}
void QtProjectWizzardContent::closedFilesDialog()
void QtProjectWizardContent::closedFilesDialog()
{
m_filesDialog->hide();
m_filesDialog.reset();
@@ -1,5 +1,5 @@
#ifndef QT_PROJECT_WIZZARD_CONTENT_H
#define QT_PROJECT_WIZZARD_CONTENT_H
#ifndef QT_PROJECT_WIZARD_CONTENT_H
#define QT_PROJECT_WIZARD_CONTENT_H
#include <QGridLayout>
#include <QLabel>
@@ -8,18 +8,18 @@
#include "QtHelpButton.h"
#include "QtThreadedFunctor.h"
#include "QtProjectWizzardWindow.h"
#include "QtProjectWizardWindow.h"
#include "FilePath.h"
class QtTextEditDialog;
class QtProjectWizzardContent
class QtProjectWizardContent
: public QWidget
{
Q_OBJECT
public:
QtProjectWizzardContent(QtProjectWizzardWindow* window);
QtProjectWizardContent(QtProjectWizardWindow* window);
virtual void populate(QGridLayout* layout, int& row);
virtual void windowReady();
@@ -46,7 +46,7 @@ protected:
QPushButton* addFilesButton(QString name, QGridLayout* layout, int row) const;
QFrame* addSeparator(QGridLayout* layout, int row) const;
QtProjectWizzardWindow* m_window;
QtProjectWizardWindow* m_window;
std::shared_ptr<QtTextEditDialog> m_filesDialog;
@@ -61,4 +61,4 @@ private:
QtThreadedFunctor<const std::vector<FilePath>&> m_showFilesFunctor;
};
#endif // QT_PROJECT_WIZZARD_CONTENT_H
#endif // QT_PROJECT_WIZARD_CONTENT_H
@@ -1,29 +1,29 @@
#include "QtProjectWizzardContentCStandard.h"
#include "QtProjectWizardContentCStandard.h"
#include <QComboBox>
#include <QLabel>
#include "SourceGroupSettingsWithCStandard.h"
QtProjectWizzardContentCStandard::QtProjectWizzardContentCStandard(
QtProjectWizardContentCStandard::QtProjectWizardContentCStandard(
std::shared_ptr<SourceGroupSettingsWithCStandard> sourceGroupSettings,
QtProjectWizzardWindow* window
QtProjectWizardWindow* window
)
: QtProjectWizzardContent(window)
: QtProjectWizardContent(window)
, m_sourceGroupSettings(sourceGroupSettings)
, m_standard(nullptr)
{
}
void QtProjectWizzardContentCStandard::populate(QGridLayout* layout, int& row)
void QtProjectWizardContentCStandard::populate(QGridLayout* layout, int& row)
{
m_standard = new QComboBox();
layout->addWidget(createFormLabel("C Standard"), row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignRight);
layout->addWidget(m_standard, row, QtProjectWizzardWindow::BACK_COL, Qt::AlignLeft);
layout->addWidget(createFormLabel("C Standard"), row, QtProjectWizardWindow::FRONT_COL, Qt::AlignRight);
layout->addWidget(m_standard, row, QtProjectWizardWindow::BACK_COL, Qt::AlignLeft);
row++;
}
void QtProjectWizzardContentCStandard::load()
void QtProjectWizardContentCStandard::load()
{
m_standard->clear();
@@ -39,7 +39,7 @@ void QtProjectWizzardContentCStandard::load()
}
}
void QtProjectWizzardContentCStandard::save()
void QtProjectWizardContentCStandard::save()
{
if (m_sourceGroupSettings)
{
@@ -1,22 +1,22 @@
#ifndef QT_PROJECT_WIZZARD_CONTENT_C_STANDARD
#define QT_PROJECT_WIZZARD_CONTENT_C_STANDARD
#ifndef QT_PROJECT_WIZARD_CONTENT_C_STANDARD
#define QT_PROJECT_WIZARD_CONTENT_C_STANDARD
#include "QtProjectWizzardContent.h"
#include "QtProjectWizardContent.h"
class QComboBox;
class SourceGroupSettingsWithCStandard;
class QtProjectWizzardContentCStandard
: public QtProjectWizzardContent
class QtProjectWizardContentCStandard
: public QtProjectWizardContent
{
Q_OBJECT
public:
QtProjectWizzardContentCStandard(
QtProjectWizardContentCStandard(
std::shared_ptr<SourceGroupSettingsWithCStandard> sourceGroupSettings,
QtProjectWizzardWindow* window);
QtProjectWizardWindow* window);
// QtProjectWizzardContent implementation
// QtProjectWizardContent implementation
virtual void populate(QGridLayout* layout, int& row) override;
virtual void load() override;
@@ -28,4 +28,4 @@ private:
QComboBox* m_standard;
};
#endif // QT_PROJECT_WIZZARD_CONTENT_C_STANDARD
#endif // QT_PROJECT_WIZARD_CONTENT_C_STANDARD
@@ -1,29 +1,29 @@
#include "QtProjectWizzardContentCppStandard.h"
#include "QtProjectWizardContentCppStandard.h"
#include <QComboBox>
#include <QLabel>
#include "SourceGroupSettingsWithCppStandard.h"
QtProjectWizzardContentCppStandard::QtProjectWizzardContentCppStandard(
QtProjectWizardContentCppStandard::QtProjectWizardContentCppStandard(
std::shared_ptr<SourceGroupSettingsWithCppStandard> sourceGroupSettings,
QtProjectWizzardWindow* window
QtProjectWizardWindow* window
)
: QtProjectWizzardContent(window)
: QtProjectWizardContent(window)
, m_sourceGroupSettings(sourceGroupSettings)
, m_standard(nullptr)
{
}
void QtProjectWizzardContentCppStandard::populate(QGridLayout* layout, int& row)
void QtProjectWizardContentCppStandard::populate(QGridLayout* layout, int& row)
{
m_standard = new QComboBox();
layout->addWidget(createFormLabel("C++ Standard"), row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignRight);
layout->addWidget(m_standard, row, QtProjectWizzardWindow::BACK_COL, Qt::AlignLeft);
layout->addWidget(createFormLabel("C++ Standard"), row, QtProjectWizardWindow::FRONT_COL, Qt::AlignRight);
layout->addWidget(m_standard, row, QtProjectWizardWindow::BACK_COL, Qt::AlignLeft);
row++;
}
void QtProjectWizzardContentCppStandard::load()
void QtProjectWizardContentCppStandard::load()
{
m_standard->clear();
@@ -39,7 +39,7 @@ void QtProjectWizzardContentCppStandard::load()
}
}
void QtProjectWizzardContentCppStandard::save()
void QtProjectWizardContentCppStandard::save()
{
if (m_sourceGroupSettings)
{
@@ -1,22 +1,22 @@
#ifndef QT_PROJECT_WIZZARD_CONTENT_CPP_STANDARD
#define QT_PROJECT_WIZZARD_CONTENT_CPP_STANDARD
#ifndef QT_PROJECT_WIZARD_CONTENT_CPP_STANDARD
#define QT_PROJECT_WIZARD_CONTENT_CPP_STANDARD
#include "QtProjectWizzardContent.h"
#include "QtProjectWizardContent.h"
class QComboBox;
class SourceGroupSettingsWithCppStandard;
class QtProjectWizzardContentCppStandard
: public QtProjectWizzardContent
class QtProjectWizardContentCppStandard
: public QtProjectWizardContent
{
Q_OBJECT
public:
QtProjectWizzardContentCppStandard(
QtProjectWizardContentCppStandard(
std::shared_ptr<SourceGroupSettingsWithCppStandard> sourceGroupSettings,
QtProjectWizzardWindow* window);
QtProjectWizardWindow* window);
// QtProjectWizzardContent implementation
// QtProjectWizardContent implementation
virtual void populate(QGridLayout* layout, int& row) override;
virtual void load() override;
@@ -28,4 +28,4 @@ private:
QComboBox* m_standard;
};
#endif // QT_PROJECT_WIZZARD_CONTENT_CPP_STANDARD
#endif // QT_PROJECT_WIZARD_CONTENT_CPP_STANDARD
@@ -1,4 +1,4 @@
#include "QtProjectWizzardContentCrossCompilationOptions.h"
#include "QtProjectWizardContentCrossCompilationOptions.h"
#include <QCheckBox>
#include <QComboBox>
@@ -7,11 +7,11 @@
#include "SourceGroupSettingsWithCxxCrossCompilationOptions.h"
#include "logging.h"
QtProjectWizzardContentCrossCompilationOptions::QtProjectWizzardContentCrossCompilationOptions(
QtProjectWizardContentCrossCompilationOptions::QtProjectWizardContentCrossCompilationOptions(
std::shared_ptr<SourceGroupSettingsWithCxxCrossCompilationOptions> sourceGroupSettings,
QtProjectWizzardWindow* window
QtProjectWizardWindow* window
)
: QtProjectWizzardContent(window)
: QtProjectWizardContent(window)
, m_sourceGroupSettings(sourceGroupSettings)
, m_useTargetOptions(nullptr)
, m_arch(nullptr)
@@ -21,7 +21,7 @@ QtProjectWizzardContentCrossCompilationOptions::QtProjectWizzardContentCrossComp
{
}
void QtProjectWizzardContentCrossCompilationOptions::populate(QGridLayout* layout, int& row)
void QtProjectWizardContentCrossCompilationOptions::populate(QGridLayout* layout, int& row)
{
if (!isInForm())
{
@@ -29,9 +29,9 @@ void QtProjectWizzardContentCrossCompilationOptions::populate(QGridLayout* layou
row++;
}
layout->addWidget(createFormLabel("Cross-Compilation"), row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignRight);
layout->addWidget(createFormLabel("Cross-Compilation"), row, QtProjectWizardWindow::FRONT_COL, Qt::AlignRight);
addHelpButton(
"Cross-Compilation",
"Cross-Compilation",
"<p>Use these options to specify the target architecture for the provided source code. Even though Sourcetrail will "
"not generate a target binary, providing these options will affect which headers the indexer will be looking for "
"while analyzing your source code.</p>"
@@ -42,7 +42,7 @@ void QtProjectWizzardContentCrossCompilationOptions::populate(QGridLayout* layou
{
m_useTargetOptions = new QCheckBox("Use specific target");
connect(m_useTargetOptions, &QCheckBox::stateChanged, this, &QtProjectWizzardContentCrossCompilationOptions::onUseTargetOptionsChanged);
connect(m_useTargetOptions, &QCheckBox::stateChanged, this, &QtProjectWizardContentCrossCompilationOptions::onUseTargetOptionsChanged);
QHBoxLayout* rowLayout = new QHBoxLayout();
rowLayout->setContentsMargins(0, 0, 0, 0);
@@ -51,7 +51,7 @@ void QtProjectWizzardContentCrossCompilationOptions::populate(QGridLayout* layou
QWidget* rowWidget = new QWidget();
rowWidget->setLayout(rowLayout);
layout->addWidget(rowWidget, row, QtProjectWizzardWindow::BACK_COL, Qt::AlignLeft | Qt::AlignTop);
layout->addWidget(rowWidget, row, QtProjectWizardWindow::BACK_COL, Qt::AlignLeft | Qt::AlignTop);
row++;
}
@@ -118,7 +118,7 @@ void QtProjectWizzardContentCrossCompilationOptions::populate(QGridLayout* layou
gridLayout->addWidget(m_abi, 3, 1, Qt::AlignLeft);
}
layout->addLayout(gridLayout, row++, QtProjectWizzardWindow::BACK_COL, Qt::AlignLeft | Qt::AlignTop);
layout->addLayout(gridLayout, row++, QtProjectWizardWindow::BACK_COL, Qt::AlignLeft | Qt::AlignTop);
if (!isInForm())
{
@@ -127,7 +127,7 @@ void QtProjectWizzardContentCrossCompilationOptions::populate(QGridLayout* layou
}
}
void QtProjectWizzardContentCrossCompilationOptions::load()
void QtProjectWizardContentCrossCompilationOptions::load()
{
m_useTargetOptions->setChecked(m_sourceGroupSettings->getTargetOptionsEnabled());
m_arch->setCurrentText(QString::fromStdWString(m_sourceGroupSettings->getTargetArch()));
@@ -138,7 +138,7 @@ void QtProjectWizzardContentCrossCompilationOptions::load()
updateTargetOptionsEnabled();
}
void QtProjectWizzardContentCrossCompilationOptions::save()
void QtProjectWizardContentCrossCompilationOptions::save()
{
m_sourceGroupSettings->setTargetOptionsEnabled(m_useTargetOptions->isChecked());
m_sourceGroupSettings->setTargetArch(m_arch->currentText().toStdWString());
@@ -147,17 +147,17 @@ void QtProjectWizzardContentCrossCompilationOptions::save()
m_sourceGroupSettings->setTargetAbi(m_abi->currentText().toStdWString());
}
bool QtProjectWizzardContentCrossCompilationOptions::check()
bool QtProjectWizardContentCrossCompilationOptions::check()
{
return true;
}
void QtProjectWizzardContentCrossCompilationOptions::onUseTargetOptionsChanged()
void QtProjectWizardContentCrossCompilationOptions::onUseTargetOptionsChanged()
{
updateTargetOptionsEnabled();
}
void QtProjectWizzardContentCrossCompilationOptions::updateTargetOptionsEnabled()
void QtProjectWizardContentCrossCompilationOptions::updateTargetOptionsEnabled()
{
const bool useTargetOptions = m_useTargetOptions->isChecked();
m_arch->setEnabled(useTargetOptions);
@@ -1,24 +1,24 @@
#ifndef QT_PROJECT_WIZZARD_CONTENT_CROSS_COMPILATION_OPTIONS
#define QT_PROJECT_WIZZARD_CONTENT_CROSS_COMPILATION_OPTIONS
#ifndef QT_PROJECT_WIZARD_CONTENT_CROSS_COMPILATION_OPTIONS
#define QT_PROJECT_WIZARD_CONTENT_CROSS_COMPILATION_OPTIONS
#include "QtProjectWizzardContent.h"
#include "QtProjectWizardContent.h"
class QCheckBox;
class QComboBox;
class QLabel;
class SourceGroupSettingsWithCxxCrossCompilationOptions;
class QtProjectWizzardContentCrossCompilationOptions
: public QtProjectWizzardContent
class QtProjectWizardContentCrossCompilationOptions
: public QtProjectWizardContent
{
Q_OBJECT
public:
QtProjectWizzardContentCrossCompilationOptions(
QtProjectWizardContentCrossCompilationOptions(
std::shared_ptr<SourceGroupSettingsWithCxxCrossCompilationOptions> sourceGroupSettings,
QtProjectWizzardWindow* window);
QtProjectWizardWindow* window);
// QtProjectWizzardContent implementation
// QtProjectWizardContent implementation
virtual void populate(QGridLayout* layout, int& row) override;
virtual void load() override;
@@ -38,4 +38,4 @@ private:
QComboBox* m_abi;
};
#endif // QT_PROJECT_WIZZARD_CONTENT_CROSS_COMPILATION_OPTIONS
#endif // QT_PROJECT_WIZARD_CONTENT_CROSS_COMPILATION_OPTIONS
@@ -1,4 +1,4 @@
#include "QtProjectWizzardContentCustomCommand.h"
#include "QtProjectWizardContentCustomCommand.h"
#include <QCheckBox>
#include <QLineEdit>
@@ -10,17 +10,17 @@
#include "SourceGroupSettingsCustomCommand.h"
#include "SqliteIndexStorage.h"
QtProjectWizzardContentCustomCommand::QtProjectWizzardContentCustomCommand(
QtProjectWizardContentCustomCommand::QtProjectWizardContentCustomCommand(
std::shared_ptr<SourceGroupSettingsCustomCommand> settings,
QtProjectWizzardWindow* window
QtProjectWizardWindow* window
)
: QtProjectWizzardContent(window)
: QtProjectWizardContent(window)
, m_settings(settings)
, m_customCommand(nullptr)
{
}
void QtProjectWizzardContentCustomCommand::populate(QGridLayout* layout, int& row)
void QtProjectWizardContentCustomCommand::populate(QGridLayout* layout, int& row)
{
if (!isInForm())
{
@@ -52,11 +52,11 @@ void QtProjectWizzardContentCustomCommand::populate(QGridLayout* layout, int& ro
layout->setRowMinimumHeight(row, 30);
layout->addWidget(nameLabel, row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignRight);
layout->addWidget(m_customCommand, row, QtProjectWizzardWindow::BACK_COL);
layout->addWidget(nameLabel, row, QtProjectWizardWindow::FRONT_COL, Qt::AlignRight);
layout->addWidget(m_customCommand, row, QtProjectWizardWindow::BACK_COL);
row++;
layout->addWidget(m_runInParallel, row, QtProjectWizzardWindow::BACK_COL);
layout->addWidget(m_runInParallel, row, QtProjectWizardWindow::BACK_COL);
row++;
if (!isInForm())
@@ -66,19 +66,19 @@ void QtProjectWizzardContentCustomCommand::populate(QGridLayout* layout, int& ro
}
}
void QtProjectWizzardContentCustomCommand::load()
void QtProjectWizardContentCustomCommand::load()
{
m_customCommand->setText(QString::fromStdWString(m_settings->getCustomCommand()));
m_runInParallel->setChecked(m_settings->getRunInParallel());
}
void QtProjectWizzardContentCustomCommand::save()
void QtProjectWizardContentCustomCommand::save()
{
m_settings->setCustomCommand(m_customCommand->text().toStdWString());
m_settings->setRunInParallel(m_runInParallel->isChecked());
}
bool QtProjectWizzardContentCustomCommand::check()
bool QtProjectWizardContentCustomCommand::check()
{
if (m_customCommand->text().isEmpty())
{
@@ -1,23 +1,23 @@
#ifndef QT_PROJECT_WIZZARD_CONTENT_CUSTOM_COMMAND_H
#define QT_PROJECT_WIZZARD_CONTENT_CUSTOM_COMMAND_H
#ifndef QT_PROJECT_WIZARD_CONTENT_CUSTOM_COMMAND_H
#define QT_PROJECT_WIZARD_CONTENT_CUSTOM_COMMAND_H
#include "QtProjectWizzardContent.h"
#include "QtProjectWizardContent.h"
class QCheckBox;
class QLineEdit;
class SourceGroupSettingsCustomCommand;
class QtProjectWizzardContentCustomCommand
: public QtProjectWizzardContent
class QtProjectWizardContentCustomCommand
: public QtProjectWizardContent
{
Q_OBJECT
public:
QtProjectWizzardContentCustomCommand(
QtProjectWizardContentCustomCommand(
std::shared_ptr<SourceGroupSettingsCustomCommand> settings,
QtProjectWizzardWindow* window);
QtProjectWizardWindow* window);
// QtProjectWizzardContent implementation
// QtProjectWizardContent implementation
virtual void populate(QGridLayout* layout, int& row) override;
virtual void load() override;
@@ -31,4 +31,4 @@ private:
QCheckBox* m_runInParallel;
};
#endif // QT_PROJECT_WIZZARD_CONTENT_CUSTOM_COMMAND_H
#endif // QT_PROJECT_WIZARD_CONTENT_CUSTOM_COMMAND_H
@@ -1,37 +1,37 @@
#include "QtProjectWizzardContentExtensions.h"
#include "QtProjectWizardContentExtensions.h"
#include <QFormLayout>
#include "SourceGroupSettingsWithSourceExtensions.h"
#include "QtStringListBox.h"
QtProjectWizzardContentExtensions::QtProjectWizzardContentExtensions(
std::shared_ptr<SourceGroupSettingsWithSourceExtensions> settings,
QtProjectWizzardWindow* window
QtProjectWizardContentExtensions::QtProjectWizardContentExtensions(
std::shared_ptr<SourceGroupSettingsWithSourceExtensions> settings,
QtProjectWizardWindow* window
)
: QtProjectWizzardContent(window)
: QtProjectWizardContent(window)
, m_settings(settings)
{
}
void QtProjectWizzardContentExtensions::populate(QGridLayout* layout, int& row)
void QtProjectWizardContentExtensions::populate(QGridLayout* layout, int& row)
{
QLabel* sourceLabel = createFormLabel("Source File Extensions");
layout->addWidget(sourceLabel, row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignTop);
layout->addWidget(sourceLabel, row, QtProjectWizardWindow::FRONT_COL, Qt::AlignTop);
addHelpButton("Source File Extensions", "Define extensions for source files including the dot (e.g. .cpp or .java)", layout, row);
m_listBox = new QtStringListBox(this, sourceLabel->text());
layout->addWidget(m_listBox, row, QtProjectWizzardWindow::BACK_COL);
layout->addWidget(m_listBox, row, QtProjectWizardWindow::BACK_COL);
row++;
}
void QtProjectWizzardContentExtensions::load()
void QtProjectWizardContentExtensions::load()
{
m_listBox->setStrings(m_settings->getSourceExtensions());
}
void QtProjectWizzardContentExtensions::save()
void QtProjectWizardContentExtensions::save()
{
m_settings->setSourceExtensions(m_listBox->getStrings());
}
@@ -1,25 +1,25 @@
#ifndef QT_PROJECT_WIZZARD_CONTENT_EXTENSIONS_H
#define QT_PROJECT_WIZZARD_CONTENT_EXTENSIONS_H
#ifndef QT_PROJECT_WIZARD_CONTENT_EXTENSIONS_H
#define QT_PROJECT_WIZARD_CONTENT_EXTENSIONS_H
#include <memory>
#include "QtProjectWizzardContent.h"
#include "QtProjectWizardContent.h"
class QtStringListBox;
class SourceGroupSettingsWithSourceExtensions;
class QtProjectWizzardContentExtensions
: public QtProjectWizzardContent
class QtProjectWizardContentExtensions
: public QtProjectWizardContent
{
Q_OBJECT
public:
QtProjectWizzardContentExtensions(
std::shared_ptr<SourceGroupSettingsWithSourceExtensions> settings,
QtProjectWizzardWindow* window
QtProjectWizardContentExtensions(
std::shared_ptr<SourceGroupSettingsWithSourceExtensions> settings,
QtProjectWizardWindow* window
);
// QtProjectWizzardContent implementation
// QtProjectWizardContent implementation
virtual void populate(QGridLayout* layout, int& row) override;
virtual void load() override;
@@ -31,4 +31,4 @@ private:
QtStringListBox* m_listBox;
};
#endif // QT_PROJECT_WIZZARD_CONTENT_EXTENSIONS_H
#endif // QT_PROJECT_WIZARD_CONTENT_EXTENSIONS_H
@@ -1,4 +1,4 @@
#include "QtProjectWizzardContentFlags.h"
#include "QtProjectWizardContentFlags.h"
#include <QFormLayout>
#include <QMessageBox>
@@ -6,44 +6,44 @@
#include "QtStringListBox.h"
#include "SourceGroupSettingsCxx.h"
QtProjectWizzardContentFlags::QtProjectWizzardContentFlags(std::shared_ptr<SourceGroupSettingsCxx> settings, QtProjectWizzardWindow* window, bool indicateAsAdditional)
: QtProjectWizzardContent(window)
QtProjectWizardContentFlags::QtProjectWizardContentFlags(std::shared_ptr<SourceGroupSettingsCxx> settings, QtProjectWizardWindow* window, bool indicateAsAdditional)
: QtProjectWizardContent(window)
, m_settings(settings)
, m_indicateAsAdditional(indicateAsAdditional)
{
}
void QtProjectWizzardContentFlags::populate(QGridLayout* layout, int& row)
void QtProjectWizardContentFlags::populate(QGridLayout* layout, int& row)
{
const QString labelText((std::string(m_indicateAsAdditional ? "Additional " : "") + "Compiler Flags").c_str());
QLabel* label = createFormLabel(labelText);
layout->addWidget(label, row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignTop);
layout->addWidget(label, row, QtProjectWizardWindow::FRONT_COL, Qt::AlignTop);
addHelpButton(
labelText,
labelText,
"<p>Define additional Clang compiler flags used during indexing. Here are some examples:</p>"
"<p>use \"-DRELEASE\" to add a preprocessor #define for \"RELEASE\"</p>"
"<p>use \"-U__clang__\" to remove the preprocessor #define for \"__clang__\"</p>",
layout,
layout,
row
);
m_list = new QtStringListBox(this, label->text());
layout->addWidget(m_list, row, QtProjectWizzardWindow::BACK_COL);
layout->addWidget(m_list, row, QtProjectWizardWindow::BACK_COL);
row++;
}
void QtProjectWizzardContentFlags::load()
void QtProjectWizardContentFlags::load()
{
m_list->setStrings(m_settings->getCompilerFlags());
}
void QtProjectWizzardContentFlags::save()
void QtProjectWizardContentFlags::save()
{
m_settings->setCompilerFlags(m_list->getStrings());
}
bool QtProjectWizzardContentFlags::check()
bool QtProjectWizardContentFlags::check()
{
std::wstring error;
@@ -0,0 +1,31 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_FLAGS_H
#define QT_PROJECT_WIZARD_CONTENT_FLAGS_H
#include "QtProjectWizardContent.h"
class QtStringListBox;
class SourceGroupSettingsCxx;
class QtProjectWizardContentFlags
: public QtProjectWizardContent
{
Q_OBJECT
public:
QtProjectWizardContentFlags(std::shared_ptr<SourceGroupSettingsCxx> settings, QtProjectWizardWindow* window, bool indicateAsAdditional = false);
// QtProjectWizardContent implementation
virtual void populate(QGridLayout* layout, int& row) override;
virtual void load() override;
virtual void save() override;
virtual bool check() override;
private:
std::shared_ptr<SourceGroupSettingsCxx> m_settings;
const bool m_indicateAsAdditional;
QtStringListBox* m_list;
};
#endif // QT_PROJECT_WIZARD_CONTENT_FLAGS_H
@@ -0,0 +1,128 @@
#include "QtProjectWizardContentGroup.h"
QtProjectWizardContentGroup::QtProjectWizardContentGroup(
QtProjectWizardWindow* window
)
: QtProjectWizardContent(window)
, m_isForm(false)
{
}
void QtProjectWizardContentGroup::addContent(QtProjectWizardContent* content)
{
m_contents.push_back(content);
if (content)
{
content->setIsInForm(m_isForm);
}
}
void QtProjectWizardContentGroup::addSpace()
{
m_contents.push_back(nullptr);
}
void QtProjectWizardContentGroup::setIsForm(bool isForm)
{
m_isForm = isForm;
}
bool QtProjectWizardContentGroup::hasContents() const
{
for (QtProjectWizardContent* content : m_contents)
{
if (content)
{
return true;
}
}
return false;
}
void QtProjectWizardContentGroup::populate(QGridLayout* layout, int& row)
{
if (m_isForm)
{
populateForm(layout, row);
return;
}
layout->setRowMinimumHeight(row++, 10);
for (QtProjectWizardContent* content : m_contents)
{
if (content)
{
content->populate(layout, row);
}
else
{
layout->setRowMinimumHeight(row++, 20);
}
}
layout->setRowMinimumHeight(row, 10);
layout->setRowStretch(row, 1);
}
void QtProjectWizardContentGroup::populateForm(QGridLayout* layout, int& row)
{
layout->setRowMinimumHeight(row++, 10);
for (QtProjectWizardContent* content : m_contents)
{
if (content)
{
content->populate(layout, row);
}
else
{
layout->setRowMinimumHeight(row++, 15);
}
}
layout->setRowMinimumHeight(row, 10);
layout->setRowStretch(row, 1);
}
void QtProjectWizardContentGroup::load()
{
for (QtProjectWizardContent* content : m_contents)
{
if (content)
{
content->load();
}
}
}
void QtProjectWizardContentGroup::save()
{
for (QtProjectWizardContent* content : m_contents)
{
if (content)
{
content->save();
}
}
}
bool QtProjectWizardContentGroup::check()
{
for (QtProjectWizardContent* content : m_contents)
{
if (content && !content->check())
{
return false;
}
}
return true;
}
bool QtProjectWizardContentGroup::isScrollAble() const
{
return true;
}
@@ -0,0 +1,38 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_GROUP_H
#define QT_PROJECT_WIZARD_CONTENT_GROUP_H
#include "QtProjectWizardContent.h"
class QCheckBox;
class QtProjectWizardContentGroup
: public QtProjectWizardContent
{
Q_OBJECT
public:
QtProjectWizardContentGroup(QtProjectWizardWindow* window);
void addContent(QtProjectWizardContent* content);
void addSpace();
void setIsForm(bool isForm);
bool hasContents() const;
protected:
// QtProjectWizardContent implementation
virtual void populate(QGridLayout* layout, int& row) override;
void populateForm(QGridLayout* layout, int& row);
virtual void load() override;
virtual void save() override;
virtual bool check() override;
virtual bool isScrollAble() const override;
private:
std::vector<QtProjectWizardContent*> m_contents;
bool m_isForm;
};
#endif // QT_PROJECT_WIZARD_CONTENT_GROUP_H
@@ -1,29 +1,29 @@
#include "QtProjectWizzardContentJavaStandard.h"
#include "QtProjectWizardContentJavaStandard.h"
#include <QComboBox>
#include <QLabel>
#include "SourceGroupSettingsWithJavaStandard.h"
QtProjectWizzardContentJavaStandard::QtProjectWizzardContentJavaStandard(
QtProjectWizardContentJavaStandard::QtProjectWizardContentJavaStandard(
std::shared_ptr<SourceGroupSettingsWithJavaStandard> sourceGroupSettings,
QtProjectWizzardWindow* window
QtProjectWizardWindow* window
)
: QtProjectWizzardContent(window)
: QtProjectWizardContent(window)
, m_sourceGroupSettings(sourceGroupSettings)
, m_standard(nullptr)
{
}
void QtProjectWizzardContentJavaStandard::populate(QGridLayout* layout, int& row)
void QtProjectWizardContentJavaStandard::populate(QGridLayout* layout, int& row)
{
m_standard = new QComboBox();
layout->addWidget(createFormLabel("Java Standard"), row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignRight);
layout->addWidget(m_standard, row, QtProjectWizzardWindow::BACK_COL, Qt::AlignLeft);
layout->addWidget(createFormLabel("Java Standard"), row, QtProjectWizardWindow::FRONT_COL, Qt::AlignRight);
layout->addWidget(m_standard, row, QtProjectWizardWindow::BACK_COL, Qt::AlignLeft);
row++;
}
void QtProjectWizzardContentJavaStandard::load()
void QtProjectWizardContentJavaStandard::load()
{
m_standard->clear();
@@ -39,7 +39,7 @@ void QtProjectWizzardContentJavaStandard::load()
}
}
void QtProjectWizzardContentJavaStandard::save()
void QtProjectWizardContentJavaStandard::save()
{
if (m_sourceGroupSettings)
{
@@ -1,22 +1,22 @@
#ifndef QT_PROJECT_WIZZARD_CONTENT_JAVA_STANDARD
#define QT_PROJECT_WIZZARD_CONTENT_JAVA_STANDARD
#ifndef QT_PROJECT_WIZARD_CONTENT_JAVA_STANDARD
#define QT_PROJECT_WIZARD_CONTENT_JAVA_STANDARD
#include "QtProjectWizzardContent.h"
#include "QtProjectWizardContent.h"
class QComboBox;
class SourceGroupSettingsWithJavaStandard;
class QtProjectWizzardContentJavaStandard
: public QtProjectWizzardContent
class QtProjectWizardContentJavaStandard
: public QtProjectWizardContent
{
Q_OBJECT
public:
QtProjectWizzardContentJavaStandard(
QtProjectWizardContentJavaStandard(
std::shared_ptr<SourceGroupSettingsWithJavaStandard> sourceGroupSettings,
QtProjectWizzardWindow* window);
QtProjectWizardWindow* window);
// QtProjectWizzardContent implementation
// QtProjectWizardContent implementation
virtual void populate(QGridLayout* layout, int& row) override;
virtual void load() override;
@@ -28,4 +28,4 @@ private:
QComboBox* m_standard;
};
#endif // QT_PROJECT_WIZZARD_CONTENT_JAVA_STANDARD
#endif // QT_PROJECT_WIZARD_CONTENT_JAVA_STANDARD
@@ -1,4 +1,4 @@
#include "QtProjectWizzardContentPreferences.h"
#include "QtProjectWizardContentPreferences.h"
#include <QCheckBox>
#include <QComboBox>
@@ -17,10 +17,10 @@
#include "utilityApp.h"
#include "utility.h"
QtProjectWizzardContentPreferences::QtProjectWizzardContentPreferences(
QtProjectWizzardWindow* window
QtProjectWizardContentPreferences::QtProjectWizardContentPreferences(
QtProjectWizardWindow* window
)
: QtProjectWizzardContent(window)
: QtProjectWizardContent(window)
, m_oldColorSchemeIndex(-1)
, m_newColorSchemeIndex(-1)
, m_screenAutoScaling(nullptr)
@@ -30,7 +30,7 @@ QtProjectWizzardContentPreferences::QtProjectWizzardContentPreferences(
FileSystem::getFilePathsFromDirectory(ResourcePaths::getColorSchemesPath(), { L".xml" });
}
QtProjectWizzardContentPreferences::~QtProjectWizzardContentPreferences()
QtProjectWizardContentPreferences::~QtProjectWizardContentPreferences()
{
if (m_oldColorSchemeIndex != -1 && m_oldColorSchemeIndex != m_newColorSchemeIndex)
{
@@ -38,7 +38,7 @@ QtProjectWizzardContentPreferences::~QtProjectWizzardContentPreferences()
}
}
void QtProjectWizzardContentPreferences::populate(QGridLayout* layout, int& row)
void QtProjectWizardContentPreferences::populate(QGridLayout* layout, int& row)
{
ApplicationSettings* appSettings = ApplicationSettings::getInstance().get();
@@ -92,7 +92,7 @@ void QtProjectWizzardContentPreferences::populate(QGridLayout* layout, int& row)
m_colorSchemes->insertItem(i, QString::fromStdWString(m_colorSchemePaths[i].withoutExtension().fileName()));
}
connect(m_colorSchemes, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
this, &QtProjectWizzardContentPreferences::colorSchemeChanged);
this, &QtProjectWizardContentPreferences::colorSchemeChanged);
// animations
m_useAnimations = addCheckBox("Animations", "Enable animations",
@@ -113,7 +113,7 @@ void QtProjectWizzardContentPreferences::populate(QGridLayout* layout, int& row)
QLabel* hint = new QLabel("<changes need restart>");
hint->setStyleSheet("color: grey");
layout->addWidget(hint, row-1, QtProjectWizzardWindow::BACK_COL, Qt::AlignRight);
layout->addWidget(hint, row-1, QtProjectWizardWindow::BACK_COL, Qt::AlignRight);
// auto scaling
m_screenAutoScalingInfoLabel = new QLabel("");
@@ -132,7 +132,7 @@ void QtProjectWizzardContentPreferences::populate(QGridLayout* layout, int& row)
m_screenAutoScaling->addItem("off", 0);
m_screenAutoScaling->addItem("on", 1);
connect(m_screenAutoScaling, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
this, &QtProjectWizzardContentPreferences::uiAutoScalingChanges);
this, &QtProjectWizardContentPreferences::uiAutoScalingChanges);
// scale factor
m_screenScaleFactorInfoLabel = new QLabel("");
@@ -160,7 +160,7 @@ void QtProjectWizzardContentPreferences::populate(QGridLayout* layout, int& row)
m_screenScaleFactor->addItem("300%", 3.0);
m_screenScaleFactor->addItem("400%", 4.0);
connect(m_screenScaleFactor, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
this, &QtProjectWizzardContentPreferences::uiScaleFactorChanges);
this, &QtProjectWizardContentPreferences::uiScaleFactorChanges);
addGap(layout, row);
}
@@ -193,7 +193,7 @@ void QtProjectWizzardContentPreferences::populate(QGridLayout* layout, int& row)
// logging
m_loggingEnabled = addCheckBox("Logging", "Enable console and file logging",
"<p>Show logs in the console and save this information in files.</p>", layout, row);
connect(m_loggingEnabled, &QCheckBox::clicked, this, &QtProjectWizzardContentPreferences::loggingEnabledChanged);
connect(m_loggingEnabled, &QCheckBox::clicked, this, &QtProjectWizardContentPreferences::loggingEnabledChanged);
m_verboseIndexerLoggingEnabled = addCheckBox(
"Indexer Logging",
@@ -246,7 +246,7 @@ void QtProjectWizzardContentPreferences::populate(QGridLayout* layout, int& row)
);
m_threads->setItemText(0, "default");
connect(m_threads, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
this, &QtProjectWizzardContentPreferences::indexerThreadsChanges);
this, &QtProjectWizardContentPreferences::indexerThreadsChanges);
// multi process indexing
m_multiProcessIndexing = addCheckBox("Multi Process<br />C/C++ Indexing",
@@ -326,7 +326,7 @@ void QtProjectWizzardContentPreferences::populate(QGridLayout* layout, int& row)
// JRE System Library
const QString title = "JRE System Library";
QLabel* label = createFormLabel(title);
layout->addWidget(label, row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignTop);
layout->addWidget(label, row, QtProjectWizardWindow::FRONT_COL, Qt::AlignTop);
addHelpButton(
"JRE System Library",
@@ -336,7 +336,7 @@ void QtProjectWizzardContentPreferences::populate(QGridLayout* layout, int& row)
m_jreSystemLibraryPaths = new QtPathListBox(this, title, QtPathListBox::SELECTION_POLICY_FILES_ONLY);
layout->addWidget(m_jreSystemLibraryPaths, row, QtProjectWizzardWindow::BACK_COL);
layout->addWidget(m_jreSystemLibraryPaths, row, QtProjectWizardWindow::BACK_COL);
row++;
m_jreSystemLibraryPathsDetector = utility::getJreSystemLibraryPathsDetector();
@@ -390,7 +390,7 @@ void QtProjectWizzardContentPreferences::populate(QGridLayout* layout, int& row)
addTitle("C/C++", layout, row);
}
void QtProjectWizzardContentPreferences::load()
void QtProjectWizardContentPreferences::load()
{
ApplicationSettings* appSettings = ApplicationSettings::getInstance().get();
@@ -464,7 +464,7 @@ void QtProjectWizzardContentPreferences::load()
m_pythonPostProcessing->setChecked(appSettings->getPythonPostProcessingEnabled());
}
void QtProjectWizzardContentPreferences::save()
void QtProjectWizardContentPreferences::save()
{
std::shared_ptr<ApplicationSettings> appSettings = ApplicationSettings::getInstance();
@@ -530,18 +530,18 @@ void QtProjectWizzardContentPreferences::save()
appSettings->save();
}
bool QtProjectWizzardContentPreferences::check()
bool QtProjectWizardContentPreferences::check()
{
return true;
}
void QtProjectWizzardContentPreferences::colorSchemeChanged(int index)
void QtProjectWizardContentPreferences::colorSchemeChanged(int index)
{
m_newColorSchemeIndex = index;
MessageSwitchColorScheme(m_colorSchemePaths[index]).dispatch();
}
void QtProjectWizzardContentPreferences::javaPathDetectionClicked()
void QtProjectWizardContentPreferences::javaPathDetectionClicked()
{
std::vector<FilePath> paths = m_javaPathDetector->getPaths(m_javaPathDetectorBox->currentText().toStdString());
if (!paths.empty())
@@ -550,7 +550,7 @@ void QtProjectWizzardContentPreferences::javaPathDetectionClicked()
}
}
void QtProjectWizzardContentPreferences::jreSystemLibraryPathsDetectionClicked()
void QtProjectWizardContentPreferences::jreSystemLibraryPathsDetectionClicked()
{
std::vector<FilePath> paths =
m_jreSystemLibraryPathsDetector->getPaths(m_jreSystemLibraryPathsDetectorBox->currentText().toStdString());
@@ -558,7 +558,7 @@ void QtProjectWizzardContentPreferences::jreSystemLibraryPathsDetectionClicked()
m_jreSystemLibraryPaths->setPaths(utility::unique(utility::concat(oldPaths, paths)));
}
void QtProjectWizzardContentPreferences::mavenPathDetectionClicked()
void QtProjectWizardContentPreferences::mavenPathDetectionClicked()
{
std::vector<FilePath> paths = m_mavenPathDetector->getPaths(m_mavenPathDetectorBox->currentText().toStdString());
if (!paths.empty())
@@ -567,12 +567,12 @@ void QtProjectWizzardContentPreferences::mavenPathDetectionClicked()
}
}
void QtProjectWizzardContentPreferences::loggingEnabledChanged()
void QtProjectWizardContentPreferences::loggingEnabledChanged()
{
m_verboseIndexerLoggingEnabled->setEnabled(m_loggingEnabled->isChecked());
}
void QtProjectWizzardContentPreferences::indexerThreadsChanges(int index)
void QtProjectWizardContentPreferences::indexerThreadsChanges(int index)
{
if (index == 0)
{
@@ -586,7 +586,7 @@ void QtProjectWizzardContentPreferences::indexerThreadsChanges(int index)
}
}
void QtProjectWizzardContentPreferences::uiAutoScalingChanges(int index)
void QtProjectWizardContentPreferences::uiAutoScalingChanges(int index)
{
if (index == 0)
{
@@ -609,7 +609,7 @@ void QtProjectWizzardContentPreferences::uiAutoScalingChanges(int index)
}
}
void QtProjectWizzardContentPreferences::uiScaleFactorChanges(int index)
void QtProjectWizardContentPreferences::uiScaleFactorChanges(int index)
{
if (index == 0)
{
@@ -630,7 +630,7 @@ void QtProjectWizzardContentPreferences::uiScaleFactorChanges(int index)
}
}
void QtProjectWizzardContentPreferences::addJavaPathDetection(QGridLayout* layout, int& row)
void QtProjectWizardContentPreferences::addJavaPathDetection(QGridLayout* layout, int& row)
{
std::vector<std::string> detectorNames = m_javaPathDetector->getWorkingDetectorNames();
if (detectorNames.empty())
@@ -649,7 +649,7 @@ void QtProjectWizzardContentPreferences::addJavaPathDetection(QGridLayout* layou
QPushButton* button = new QPushButton("detect");
button->setObjectName("windowButton");
connect(button, &QPushButton::clicked, this, &QtProjectWizzardContentPreferences::javaPathDetectionClicked);
connect(button, &QPushButton::clicked, this, &QtProjectWizardContentPreferences::javaPathDetectionClicked);
QHBoxLayout* hlayout = new QHBoxLayout();
hlayout->setContentsMargins(0, 0, 0, 0);
@@ -660,11 +660,11 @@ void QtProjectWizzardContentPreferences::addJavaPathDetection(QGridLayout* layou
QWidget* detectionWidget = new QWidget();
detectionWidget->setLayout(hlayout);
layout->addWidget(detectionWidget, row, QtProjectWizzardWindow::BACK_COL, Qt::AlignLeft | Qt::AlignTop);
layout->addWidget(detectionWidget, row, QtProjectWizardWindow::BACK_COL, Qt::AlignLeft | Qt::AlignTop);
row++;
}
void QtProjectWizzardContentPreferences::addJreSystemLibraryPathsDetection(QGridLayout* layout, int& row)
void QtProjectWizardContentPreferences::addJreSystemLibraryPathsDetection(QGridLayout* layout, int& row)
{
const std::vector<std::string> detectorNames = m_jreSystemLibraryPathsDetector->getWorkingDetectorNames();
if (detectorNames.empty())
@@ -683,7 +683,7 @@ void QtProjectWizzardContentPreferences::addJreSystemLibraryPathsDetection(QGrid
QPushButton* button = new QPushButton("detect");
button->setObjectName("windowButton");
connect(button, &QPushButton::clicked, this, &QtProjectWizzardContentPreferences::jreSystemLibraryPathsDetectionClicked);
connect(button, &QPushButton::clicked, this, &QtProjectWizardContentPreferences::jreSystemLibraryPathsDetectionClicked);
QHBoxLayout* hlayout = new QHBoxLayout();
hlayout->setContentsMargins(0, 0, 0, 0);
@@ -694,11 +694,11 @@ void QtProjectWizzardContentPreferences::addJreSystemLibraryPathsDetection(QGrid
QWidget* detectionWidget = new QWidget();
detectionWidget->setLayout(hlayout);
layout->addWidget(detectionWidget, row, QtProjectWizzardWindow::BACK_COL, Qt::AlignLeft | Qt::AlignTop);
layout->addWidget(detectionWidget, row, QtProjectWizardWindow::BACK_COL, Qt::AlignLeft | Qt::AlignTop);
row++;
}
void QtProjectWizzardContentPreferences::addMavenPathDetection(QGridLayout* layout, int& row)
void QtProjectWizardContentPreferences::addMavenPathDetection(QGridLayout* layout, int& row)
{
std::vector<std::string> detectorNames = m_mavenPathDetector->getWorkingDetectorNames();
if (detectorNames.empty())
@@ -717,7 +717,7 @@ void QtProjectWizzardContentPreferences::addMavenPathDetection(QGridLayout* layo
QPushButton* button = new QPushButton("detect");
button->setObjectName("windowButton");
connect(button, &QPushButton::clicked, this, &QtProjectWizzardContentPreferences::mavenPathDetectionClicked);
connect(button, &QPushButton::clicked, this, &QtProjectWizardContentPreferences::mavenPathDetectionClicked);
QHBoxLayout* hlayout = new QHBoxLayout();
hlayout->setContentsMargins(0, 0, 0, 0);
@@ -728,39 +728,39 @@ void QtProjectWizzardContentPreferences::addMavenPathDetection(QGridLayout* layo
QWidget* detectionWidget = new QWidget();
detectionWidget->setLayout(hlayout);
layout->addWidget(detectionWidget, row, QtProjectWizzardWindow::BACK_COL, Qt::AlignLeft | Qt::AlignTop);
layout->addWidget(detectionWidget, row, QtProjectWizardWindow::BACK_COL, Qt::AlignLeft | Qt::AlignTop);
row++;
}
void QtProjectWizzardContentPreferences::addTitle(QString title, QGridLayout* layout, int& row)
void QtProjectWizardContentPreferences::addTitle(QString title, QGridLayout* layout, int& row)
{
layout->addWidget(createFormTitle(title), row++, QtProjectWizzardWindow::FRONT_COL, Qt::AlignLeft);
layout->addWidget(createFormTitle(title), row++, QtProjectWizardWindow::FRONT_COL, Qt::AlignLeft);
}
void QtProjectWizzardContentPreferences::addLabel(QString label, QGridLayout* layout, int row)
void QtProjectWizardContentPreferences::addLabel(QString label, QGridLayout* layout, int row)
{
layout->addWidget(createFormLabel(label), row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignRight);
layout->addWidget(createFormLabel(label), row, QtProjectWizardWindow::FRONT_COL, Qt::AlignRight);
}
void QtProjectWizzardContentPreferences::addWidget(
void QtProjectWizardContentPreferences::addWidget(
QWidget* widget, QGridLayout* layout, int row, Qt::Alignment widgetAlignment)
{
layout->addWidget(widget, row, QtProjectWizzardWindow::BACK_COL, widgetAlignment);
layout->addWidget(widget, row, QtProjectWizardWindow::BACK_COL, widgetAlignment);
}
void QtProjectWizzardContentPreferences::addLabelAndWidget(
void QtProjectWizardContentPreferences::addLabelAndWidget(
QString label, QWidget* widget, QGridLayout* layout, int row, Qt::Alignment widgetAlignment)
{
addLabel(label, layout, row);
addWidget(widget, layout, row, widgetAlignment);
}
void QtProjectWizzardContentPreferences::addGap(QGridLayout* layout, int& row)
void QtProjectWizardContentPreferences::addGap(QGridLayout* layout, int& row)
{
layout->setRowMinimumHeight(row++, 20);
}
QCheckBox* QtProjectWizzardContentPreferences::addCheckBox(
QCheckBox* QtProjectWizardContentPreferences::addCheckBox(
QString label, QString text, QString helpText, QGridLayout* layout, int& row)
{
QCheckBox* checkBox = new QCheckBox(text, this);
@@ -776,7 +776,7 @@ QCheckBox* QtProjectWizzardContentPreferences::addCheckBox(
return checkBox;
}
QComboBox* QtProjectWizzardContentPreferences::addComboBox(
QComboBox* QtProjectWizardContentPreferences::addComboBox(
QString label, QString helpText, QGridLayout* layout, int& row)
{
QComboBox* comboBox = new QComboBox(this);
@@ -792,7 +792,7 @@ QComboBox* QtProjectWizzardContentPreferences::addComboBox(
return comboBox;
}
QComboBox* QtProjectWizzardContentPreferences::addComboBoxWithWidgets(
QComboBox* QtProjectWizardContentPreferences::addComboBoxWithWidgets(
QString label, QString helpText, std::vector<QWidget*> widgets, QGridLayout* layout, int& row)
{
QComboBox* comboBox = new QComboBox(this);
@@ -821,7 +821,7 @@ QComboBox* QtProjectWizzardContentPreferences::addComboBoxWithWidgets(
return comboBox;
}
QComboBox* QtProjectWizzardContentPreferences::addComboBox(
QComboBox* QtProjectWizardContentPreferences::addComboBox(
QString label, int min, int max, QString helpText, QGridLayout* layout, int& row)
{
QComboBox* comboBox = addComboBox(label, helpText, layout, row);
@@ -837,7 +837,7 @@ QComboBox* QtProjectWizzardContentPreferences::addComboBox(
return comboBox;
}
QComboBox* QtProjectWizzardContentPreferences::addComboBoxWithWidgets(
QComboBox* QtProjectWizardContentPreferences::addComboBoxWithWidgets(
QString label, int min, int max, QString helpText, std::vector<QWidget*> widgets, QGridLayout* layout, int& row)
{
QComboBox* comboBox = addComboBoxWithWidgets(label, helpText, widgets, layout, row);
@@ -853,7 +853,7 @@ QComboBox* QtProjectWizzardContentPreferences::addComboBoxWithWidgets(
return comboBox;
}
QLineEdit* QtProjectWizzardContentPreferences::addLineEdit(QString label, QString helpText, QGridLayout* layout, int& row)
QLineEdit* QtProjectWizardContentPreferences::addLineEdit(QString label, QString helpText, QGridLayout* layout, int& row)
{
QLineEdit* lineEdit = new QLineEdit(this);
lineEdit->setObjectName("name");
@@ -1,11 +1,11 @@
#ifndef QT_PROJECT_WIZZARD_CONTENT_PREFERENCES_H
#define QT_PROJECT_WIZZARD_CONTENT_PREFERENCES_H
#ifndef QT_PROJECT_WIZARD_CONTENT_PREFERENCES_H
#define QT_PROJECT_WIZARD_CONTENT_PREFERENCES_H
#include <QComboBox>
#include "QtLocationPicker.h"
#include "QtPathListBox.h"
#include "QtProjectWizzardContent.h"
#include "QtProjectWizardContent.h"
#include "CombinedPathDetector.h"
class QCheckBox;
@@ -30,16 +30,16 @@ public:
};
class QtProjectWizzardContentPreferences
: public QtProjectWizzardContent
class QtProjectWizardContentPreferences
: public QtProjectWizardContent
{
Q_OBJECT
public:
QtProjectWizzardContentPreferences(QtProjectWizzardWindow* window);
~QtProjectWizzardContentPreferences();
QtProjectWizardContentPreferences(QtProjectWizardWindow* window);
~QtProjectWizardContentPreferences();
// QtProjectWizzardContent implementation
// QtProjectWizardContent implementation
virtual void populate(QGridLayout* layout, int& row) override;
virtual void load() override;
@@ -129,4 +129,4 @@ private:
QCheckBox* m_pythonPostProcessing;
};
#endif // QT_PROJECT_WIZZARD_CONTENT_PREFERENCES_H
#endif // QT_PROJECT_WIZARD_CONTENT_PREFERENCES_H
@@ -1,4 +1,4 @@
#include "QtProjectWizzardContentProjectData.h"
#include "QtProjectWizardContentProjectData.h"
#include <QMessageBox>
#include <QRegularExpression>
@@ -7,12 +7,12 @@
#include "ProjectSettings.h"
#include "FileSystem.h"
QtProjectWizzardContentProjectData::QtProjectWizzardContentProjectData(
QtProjectWizardContentProjectData::QtProjectWizardContentProjectData(
std::shared_ptr<ProjectSettings> projectSettings,
QtProjectWizzardWindow* window,
QtProjectWizardWindow* window,
bool disableNameEditing
)
: QtProjectWizzardContent(window)
: QtProjectWizardContent(window)
, m_projectSettings(projectSettings)
, m_disableNameEditing(disableNameEditing)
, m_projectName(nullptr)
@@ -20,7 +20,7 @@ QtProjectWizzardContentProjectData::QtProjectWizzardContentProjectData(
{
}
void QtProjectWizzardContentProjectData::populate(QGridLayout* layout, int& row)
void QtProjectWizardContentProjectData::populate(QGridLayout* layout, int& row)
{
if (!isInForm())
{
@@ -33,10 +33,10 @@ void QtProjectWizzardContentProjectData::populate(QGridLayout* layout, int& row)
m_projectName->setObjectName("name");
m_projectName->setAttribute(Qt::WA_MacShowFocusRect, 0);
m_projectName->setEnabled(!m_disableNameEditing);
connect(m_projectName, &QLineEdit::textEdited, this, &QtProjectWizzardContentProjectData::onProjectNameEdited);
connect(m_projectName, &QLineEdit::textEdited, this, &QtProjectWizardContentProjectData::onProjectNameEdited);
layout->addWidget(nameLabel, row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignRight);
layout->addWidget(m_projectName, row, QtProjectWizzardWindow::BACK_COL);
layout->addWidget(nameLabel, row, QtProjectWizardWindow::FRONT_COL, Qt::AlignRight);
layout->addWidget(m_projectName, row, QtProjectWizardWindow::BACK_COL);
layout->setRowMinimumHeight(row, 30);
row++;
@@ -45,8 +45,8 @@ void QtProjectWizzardContentProjectData::populate(QGridLayout* layout, int& row)
m_projectFileLocation->setPickDirectory(true);
m_projectFileLocation->setEnabled(!m_disableNameEditing);
layout->addWidget(locationLabel, row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignRight);
layout->addWidget(m_projectFileLocation, row, QtProjectWizzardWindow::BACK_COL, Qt::AlignTop);
layout->addWidget(locationLabel, row, QtProjectWizardWindow::FRONT_COL, Qt::AlignRight);
layout->addWidget(m_projectFileLocation, row, QtProjectWizardWindow::BACK_COL, Qt::AlignTop);
addHelpButton("Sourcetrail Project Location", "The directory the Sourcetrail project file (.srctrlprj) will be saved to.", layout, row);
layout->setRowMinimumHeight(row, 30);
row++;
@@ -58,13 +58,13 @@ void QtProjectWizzardContentProjectData::populate(QGridLayout* layout, int& row)
}
}
void QtProjectWizzardContentProjectData::load()
void QtProjectWizardContentProjectData::load()
{
m_projectName->setText(QString::fromStdWString(m_projectSettings->getProjectName()));
m_projectFileLocation->setText(QString::fromStdWString(m_projectSettings->getProjectDirectoryPath().wstr()));
}
void QtProjectWizzardContentProjectData::save()
void QtProjectWizardContentProjectData::save()
{
m_projectSettings->setProjectFilePath(
m_projectName->text().toStdWString(),
@@ -72,7 +72,7 @@ void QtProjectWizzardContentProjectData::save()
);
}
bool QtProjectWizzardContentProjectData::check()
bool QtProjectWizardContentProjectData::check()
{
if (m_projectName->text().isEmpty())
{
@@ -128,7 +128,7 @@ bool QtProjectWizzardContentProjectData::check()
return true;
}
void QtProjectWizzardContentProjectData::onProjectNameEdited(QString text)
void QtProjectWizardContentProjectData::onProjectNameEdited(QString text)
{
const int cursorPosition = m_projectName->cursorPosition();
@@ -1,23 +1,23 @@
#ifndef QT_PROJECT_WIZZARD_CONTENT_PROJECT_DATA_H
#define QT_PROJECT_WIZZARD_CONTENT_PROJECT_DATA_H
#ifndef QT_PROJECT_WIZARD_CONTENT_PROJECT_DATA_H
#define QT_PROJECT_WIZARD_CONTENT_PROJECT_DATA_H
#include "QtLocationPicker.h"
#include "QtProjectWizzardContent.h"
#include "QtProjectWizardContent.h"
class ProjectSettings;
class QtProjectWizzardContentProjectData
: public QtProjectWizzardContent
class QtProjectWizardContentProjectData
: public QtProjectWizardContent
{
Q_OBJECT
public:
QtProjectWizzardContentProjectData(
QtProjectWizardContentProjectData(
std::shared_ptr<ProjectSettings> projectSettings,
QtProjectWizzardWindow* window,
QtProjectWizardWindow* window,
bool disableNameEditing = false);
// QtProjectWizzardContent implementation
// QtProjectWizardContent implementation
virtual void populate(QGridLayout* layout, int& row) override;
virtual void load() override;
@@ -35,4 +35,4 @@ private:
QtLocationPicker* m_projectFileLocation;
};
#endif // QT_PROJECT_WIZZARD_CONTENT_PROJECT_DATA_H
#endif // QT_PROJECT_WIZARD_CONTENT_PROJECT_DATA_H
@@ -1,4 +1,4 @@
#include "QtProjectWizzardContentSelect.h"
#include "QtProjectWizardContentSelect.h"
#include <regex>
@@ -8,21 +8,21 @@
#include <QPushButton>
#include "LanguageType.h"
#include "QtProjectWizzardWindow.h"
#include "QtProjectWizardWindow.h"
#include "QtFlowLayout.h"
#include "ResourcePaths.h"
#include "SqliteIndexStorage.h"
#include "utilityString.h"
#include "utilityApp.h"
QtProjectWizzardContentSelect::QtProjectWizzardContentSelect(
QtProjectWizzardWindow* window
QtProjectWizardContentSelect::QtProjectWizardContentSelect(
QtProjectWizardWindow* window
)
: QtProjectWizzardContent(window)
: QtProjectWizardContent(window)
{
}
void QtProjectWizzardContentSelect::populate(QGridLayout* layout, int& row)
void QtProjectWizardContentSelect::populate(QGridLayout* layout, int& row)
{
std::string pythonIndexerVersion = " ";
{
@@ -129,7 +129,7 @@ void QtProjectWizzardContentSelect::populate(QGridLayout* layout, int& row)
}
vlayout->addStretch();
layout->addLayout(vlayout, 0, QtProjectWizzardWindow::FRONT_COL, Qt::AlignRight);
layout->addLayout(vlayout, 0, QtProjectWizardWindow::FRONT_COL, Qt::AlignRight);
connect(m_languages, static_cast<void(QButtonGroup::*)(QAbstractButton*)>(&QButtonGroup::buttonClicked),
[this](QAbstractButton* button)
@@ -237,22 +237,22 @@ void QtProjectWizzardContentSelect::populate(QGridLayout* layout, int& row)
containerLayout->addWidget(m_description, 0);
container->setLayout(containerLayout);
layout->addWidget(container, 0, QtProjectWizzardWindow::BACK_COL);
layout->addWidget(container, 0, QtProjectWizardWindow::BACK_COL);
m_title = new QLabel("Source Group Types");
m_title->setObjectName("sourceGroupTitle");
layout->addWidget(m_title, 0, QtProjectWizzardWindow::BACK_COL, Qt::AlignLeft | Qt::AlignTop);
layout->addWidget(m_title, 0, QtProjectWizardWindow::BACK_COL, Qt::AlignLeft | Qt::AlignTop);
layout->setRowStretch(0, 0);
layout->setColumnStretch(QtProjectWizzardWindow::FRONT_COL, 0);
layout->setColumnStretch(QtProjectWizzardWindow::BACK_COL, 1);
layout->setColumnStretch(QtProjectWizardWindow::FRONT_COL, 0);
layout->setColumnStretch(QtProjectWizardWindow::BACK_COL, 1);
layout->setHorizontalSpacing(0);
m_languages->buttons().constFirst()->click();
}
void QtProjectWizzardContentSelect::save()
void QtProjectWizardContentSelect::save()
{
SourceGroupType selectedType;
@@ -272,7 +272,7 @@ void QtProjectWizzardContentSelect::save()
emit selected(selectedType);
}
bool QtProjectWizzardContentSelect::check()
bool QtProjectWizardContentSelect::check()
{
bool sourceGroupChosen = false;
@@ -296,7 +296,7 @@ bool QtProjectWizzardContentSelect::check()
return true;
}
bool QtProjectWizzardContentSelect::isScrollAble() const
bool QtProjectWizardContentSelect::isScrollAble() const
{
return true;
}
@@ -1,22 +1,22 @@
#ifndef QT_PROJECT_WIZZARD_CONTENT_SELECT_H
#define QT_PROJECT_WIZZARD_CONTENT_SELECT_H
#ifndef QT_PROJECT_WIZARD_CONTENT_SELECT_H
#define QT_PROJECT_WIZARD_CONTENT_SELECT_H
#include "QtProjectWizzardContent.h"
#include "QtProjectWizardContent.h"
#include "LanguageType.h"
#include "SourceGroupType.h"
class QButtonGroup;
class SolutionParserManager;
class QtProjectWizzardContentSelect
: public QtProjectWizzardContent
class QtProjectWizardContentSelect
: public QtProjectWizardContent
{
Q_OBJECT
public:
QtProjectWizzardContentSelect(QtProjectWizzardWindow* window);
QtProjectWizardContentSelect(QtProjectWizardWindow* window);
// QtProjectWizzardContent implementation
// QtProjectWizardContent implementation
void populate(QGridLayout* layout, int& row) override;
void save() override;
@@ -40,4 +40,4 @@ private:
std::vector<std::string> m_solutionDescription;
};
#endif // QT_PROJECT_WIZZARD_CONTENT_SELECT_H
#endif // QT_PROJECT_WIZARD_CONTENT_SELECT_H
@@ -1,4 +1,4 @@
#include "QtProjectWizzardContentSourceGroupData.h"
#include "QtProjectWizardContentSourceGroupData.h"
#include <QCheckBox>
#include <QLineEdit>
@@ -6,32 +6,32 @@
#include "SourceGroupSettings.h"
QtProjectWizzardContentSourceGroupData::QtProjectWizzardContentSourceGroupData(
QtProjectWizardContentSourceGroupData::QtProjectWizardContentSourceGroupData(
std::shared_ptr<SourceGroupSettings> settings,
QtProjectWizzardWindow* window
QtProjectWizardWindow* window
)
: QtProjectWizzardContent(window)
: QtProjectWizardContent(window)
, m_settings(settings)
, m_name(nullptr)
, m_status(nullptr)
{
}
void QtProjectWizzardContentSourceGroupData::populate(QGridLayout* layout, int& row)
void QtProjectWizardContentSourceGroupData::populate(QGridLayout* layout, int& row)
{
m_name = new QLineEdit();
m_name->setObjectName("name");
m_name->setAttribute(Qt::WA_MacShowFocusRect, 0);
connect(m_name, &QLineEdit::textEdited, this, &QtProjectWizzardContentSourceGroupData::editedName);
connect(m_name, &QLineEdit::textEdited, this, &QtProjectWizardContentSourceGroupData::editedName);
layout->addWidget(createFormLabel("Source Group Name"), row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignRight);
layout->addWidget(m_name, row, QtProjectWizzardWindow::BACK_COL);
layout->addWidget(createFormLabel("Source Group Name"), row, QtProjectWizardWindow::FRONT_COL, Qt::AlignRight);
layout->addWidget(m_name, row, QtProjectWizardWindow::BACK_COL);
row++;
m_status = new QCheckBox("active");
connect(m_status, &QCheckBox::toggled, this, &QtProjectWizzardContentSourceGroupData::changedStatus);
layout->addWidget(createFormLabel("Status"), row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignRight);
layout->addWidget(m_status, row, QtProjectWizzardWindow::BACK_COL);
connect(m_status, &QCheckBox::toggled, this, &QtProjectWizardContentSourceGroupData::changedStatus);
layout->addWidget(createFormLabel("Status"), row, QtProjectWizardWindow::FRONT_COL, Qt::AlignRight);
layout->addWidget(m_status, row, QtProjectWizardWindow::BACK_COL);
addHelpButton("Status", "<p>Only source files of active Source Groups will be processed during indexing. "
"Inactive Source Groups will be ignored or cleared from the index.</p><p>Use this setting to temporarily "
@@ -40,21 +40,21 @@ void QtProjectWizzardContentSourceGroupData::populate(QGridLayout* layout, int&
row++;
}
void QtProjectWizzardContentSourceGroupData::load()
void QtProjectWizardContentSourceGroupData::load()
{
m_name->setText(QString::fromStdString(m_settings->getName()));
m_status->setChecked(m_settings->getStatus() == SOURCE_GROUP_STATUS_ENABLED);
}
void QtProjectWizzardContentSourceGroupData::save()
void QtProjectWizardContentSourceGroupData::save()
{
m_settings->setName(m_name->text().toStdString());
m_settings->setStatus(m_status->isChecked() ? SOURCE_GROUP_STATUS_ENABLED : SOURCE_GROUP_STATUS_DISABLED);
}
bool QtProjectWizzardContentSourceGroupData::check()
bool QtProjectWizardContentSourceGroupData::check()
{
if (m_name->text().isEmpty())
{
@@ -67,7 +67,7 @@ bool QtProjectWizzardContentSourceGroupData::check()
return true;
}
void QtProjectWizzardContentSourceGroupData::editedName(QString name)
void QtProjectWizardContentSourceGroupData::editedName(QString name)
{
if (!m_status->isChecked())
{
@@ -77,7 +77,7 @@ void QtProjectWizzardContentSourceGroupData::editedName(QString name)
emit nameUpdated(name);
}
void QtProjectWizzardContentSourceGroupData::changedStatus(bool checked)
void QtProjectWizardContentSourceGroupData::changedStatus(bool checked)
{
emit statusUpdated(m_status->isChecked() ? SOURCE_GROUP_STATUS_ENABLED : SOURCE_GROUP_STATUS_DISABLED);
@@ -1,24 +1,24 @@
#ifndef QT_PROJECT_WIZZARD_CONTENT_SOURCE_GROUP_DATA_H
#define QT_PROJECT_WIZZARD_CONTENT_SOURCE_GROUP_DATA_H
#ifndef QT_PROJECT_WIZARD_CONTENT_SOURCE_GROUP_DATA_H
#define QT_PROJECT_WIZARD_CONTENT_SOURCE_GROUP_DATA_H
#include "QtProjectWizzardContent.h"
#include "QtProjectWizardContent.h"
#include "SourceGroupStatusType.h"
class QCheckBox;
class QLineEdit;
class SourceGroupSettings;
class QtProjectWizzardContentSourceGroupData
: public QtProjectWizzardContent
class QtProjectWizardContentSourceGroupData
: public QtProjectWizardContent
{
Q_OBJECT
public:
QtProjectWizzardContentSourceGroupData(
QtProjectWizardContentSourceGroupData(
std::shared_ptr<SourceGroupSettings> settings,
QtProjectWizzardWindow* window);
QtProjectWizardWindow* window);
// QtProjectWizzardContent implementation
// QtProjectWizardContent implementation
virtual void populate(QGridLayout* layout, int& row) override;
virtual void load() override;
@@ -40,4 +40,4 @@ private:
QCheckBox* m_status;
};
#endif // QT_PROJECT_WIZZARD_CONTENT_SOURCE_GROUP_DATA_H
#endif // QT_PROJECT_WIZARD_CONTENT_SOURCE_GROUP_DATA_H
@@ -1,17 +1,17 @@
#include "QtProjectWizzardContentSourceGroupInfoText.h"
#include "QtProjectWizardContentSourceGroupInfoText.h"
QtProjectWizzardContentSourceGroupInfoText::QtProjectWizzardContentSourceGroupInfoText(QtProjectWizzardWindow* window)
: QtProjectWizzardContent(window)
QtProjectWizardContentSourceGroupInfoText::QtProjectWizardContentSourceGroupInfoText(QtProjectWizardWindow* window)
: QtProjectWizardContent(window)
{
}
void QtProjectWizzardContentSourceGroupInfoText::populate(QGridLayout* layout, int& row)
void QtProjectWizardContentSourceGroupInfoText::populate(QGridLayout* layout, int& row)
{
QHBoxLayout* layoutHorz = new QHBoxLayout();
layout->addLayout(
layoutHorz,
row, QtProjectWizzardWindow::FRONT_COL,
1, 1 + QtProjectWizzardWindow::BACK_COL - QtProjectWizzardWindow::FRONT_COL,
layoutHorz,
row, QtProjectWizardWindow::FRONT_COL,
1, 1 + QtProjectWizardWindow::BACK_COL - QtProjectWizardWindow::FRONT_COL,
Qt::AlignTop
);
@@ -0,0 +1,18 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_SOURCE_GROUP_INFO_TEXT_H
#define QT_PROJECT_WIZARD_CONTENT_SOURCE_GROUP_INFO_TEXT_H
#include "QtProjectWizardContent.h"
class QtProjectWizardContentSourceGroupInfoText
: public QtProjectWizardContent
{
Q_OBJECT
public:
QtProjectWizardContentSourceGroupInfoText(QtProjectWizardWindow* window);
// QtProjectWizardContent implementation
virtual void populate(QGridLayout* layout, int& row) override;
};
#endif // QT_PROJECT_WIZARD_CONTENT_SOURCE_GROUP_INFO_TEXT_H
@@ -1,16 +1,16 @@
#include "QtProjectWizzardContentVS.h"
#include "QtProjectWizardContentVS.h"
#include "MessageIDECreateCDB.h"
QtProjectWizzardContentVS::QtProjectWizzardContentVS(QtProjectWizzardWindow* window)
: QtProjectWizzardContent(window)
QtProjectWizardContentVS::QtProjectWizardContentVS(QtProjectWizardWindow* window)
: QtProjectWizardContent(window)
{
}
void QtProjectWizzardContentVS::populate(QGridLayout* layout, int& row)
void QtProjectWizardContentVS::populate(QGridLayout* layout, int& row)
{
QLabel* nameLabel = createFormLabel("Create Compilation Database");
layout->addWidget(nameLabel, row, QtProjectWizzardWindow::FRONT_COL);
layout->addWidget(nameLabel, row, QtProjectWizardWindow::FRONT_COL);
addHelpButton(
"Create Compilation Database", "To create a new Compilation Database from a Visual Studio Solution, this Solution has to be open in Visual Studio.\n\
@@ -21,26 +21,26 @@ Note: Sourcetrail's Visual Studio plugin has to be installed. Visual Studio has
QLabel* descriptionLabel = createFormLabel("Call Visual Studio to create a Compilation Database from the loaded Solution.");
descriptionLabel->setObjectName("description");
descriptionLabel->setAlignment(Qt::AlignmentFlag::AlignLeft);
layout->addWidget(descriptionLabel, row, QtProjectWizzardWindow::BACK_COL);
layout->addWidget(descriptionLabel, row, QtProjectWizardWindow::BACK_COL);
row++;
QPushButton* button = new QPushButton("Create Compilation Database");
button->setObjectName("windowButton");
layout->addWidget(button, row, QtProjectWizzardWindow::BACK_COL);
layout->addWidget(button, row, QtProjectWizardWindow::BACK_COL);
row++;
QLabel* skipLabel = createFormLabel("*Skip this step if you already have a Compilation Database for your Solution.");
skipLabel->setObjectName("description");
skipLabel->setAlignment(Qt::AlignmentFlag::AlignLeft);
layout->addWidget(skipLabel, row, QtProjectWizzardWindow::BACK_COL);
layout->addWidget(skipLabel, row, QtProjectWizardWindow::BACK_COL);
row++;
addSeparator(layout, row++);
connect(button, &QPushButton::clicked, this, &QtProjectWizzardContentVS::handleVSCDBClicked);
connect(button, &QPushButton::clicked, this, &QtProjectWizardContentVS::handleVSCDBClicked);
}
void QtProjectWizzardContentVS::handleVSCDBClicked()
void QtProjectWizardContentVS::handleVSCDBClicked()
{
MessageIDECreateCDB().dispatch();
}
@@ -0,0 +1,20 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_VS_H
#define QT_PROJECT_WIZARD_CONTENT_VS_H
#include "QtProjectWizardContent.h"
class QtProjectWizardContentVS
: public QtProjectWizardContent
{
Q_OBJECT
public:
QtProjectWizardContentVS(QtProjectWizardWindow* window);
virtual void populate(QGridLayout* layout, int& row) override;
private slots:
void handleVSCDBClicked();
};
#endif // QT_PROJECT_WIZARD_CONTENT_VS_H
@@ -0,0 +1,112 @@
#include "QtProjectWizardContentPath.h"
#include <QMessageBox>
#include "SourceGroupSettings.h"
QtProjectWizardContentPath::QtProjectWizardContentPath(QtProjectWizardWindow* window)
: QtProjectWizardContent(window)
, m_makePathRelativeToProjectFileLocation(true)
, m_allowEmpty(false)
{
}
void QtProjectWizardContentPath::populate(QGridLayout* layout, int& row)
{
QLabel* label = createFormLabel(m_titleString);
layout->addWidget(label, row, QtProjectWizardWindow::FRONT_COL, Qt::AlignTop);
if (m_helpString.size() > 0)
{
addHelpButton(m_titleString, m_helpString, layout, row);
}
m_picker = new QtLocationPicker(this);
m_picker->setPickDirectory(true);
m_picker->setPlaceholderText(m_placeholderString);
if (m_makePathRelativeToProjectFileLocation)
{
m_picker->setRelativeRootDirectory(getSourceGroupSettings()->getProjectDirectoryPath());
}
layout->addWidget(m_picker, row, QtProjectWizardWindow::BACK_COL);
row++;
}
bool QtProjectWizardContentPath::check()
{
QString error;
while (true)
{
if (m_picker->getText().isEmpty())
{
if (m_allowEmpty)
{
break;
}
else
{
error = "Please define a path at \"" + m_titleString + "\".";
break;
}
}
FilePath path = getSourceGroupSettings()->makePathExpandedAndAbsolute(FilePath(m_picker->getText().toStdWString()));
if (m_picker->pickDirectory())
{
break;
}
if (!path.exists())
{
error = "The entered path does not exist at \"" + m_titleString + "\".";
break;
}
if (m_fileEndings.find(path.extension()) == m_fileEndings.end())
{
error = "The entered path does have a correct file ending at \"" + m_titleString + "\".";
break;
}
break;
}
if (!error.isEmpty())
{
QMessageBox msgBox;
msgBox.setText(error);
msgBox.exec();
return false;
}
return true;
}
void QtProjectWizardContentPath::setTitleString(const QString& title)
{
m_titleString = title;
}
void QtProjectWizardContentPath::setHelpString(const QString& help)
{
m_helpString = help;
}
void QtProjectWizardContentPath::setPlaceholderString(const QString& placeholder)
{
m_placeholderString = placeholder;
}
void QtProjectWizardContentPath::setFileEndings(const std::set<std::wstring>& fileEndings)
{
m_fileEndings = fileEndings;
}
void QtProjectWizardContentPath::setAllowEmpty(bool allowEmpty)
{
m_allowEmpty = allowEmpty;
}
@@ -0,0 +1,46 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_PATH_H
#define QT_PROJECT_WIZARD_CONTENT_PATH_H
#include <set>
#include "QtProjectWizardContent.h"
#include "QtLocationPicker.h"
class SourceGroupSettings;
class QtProjectWizardContentPath
: public QtProjectWizardContent
{
Q_OBJECT
public:
QtProjectWizardContentPath(QtProjectWizardWindow* window);
// QtSettingsWindow implementation
virtual void populate(QGridLayout* layout, int& row) override;
virtual bool check() override;
protected:
void setTitleString(const QString& title);
void setHelpString(const QString& help);
void setPlaceholderString(const QString& placeholder);
void setFileEndings(const std::set<std::wstring>& fileEndings);
void setAllowEmpty(bool allowEmpty);
QtLocationPicker* m_picker;
bool m_makePathRelativeToProjectFileLocation;
private:
virtual std::shared_ptr<SourceGroupSettings> getSourceGroupSettings() = 0;
QString m_titleString;
QString m_helpString;
QString m_placeholderString;
std::set<std::wstring> m_fileEndings;
bool m_allowEmpty;
};
#endif // QT_PROJECT_WIZARD_CONTENT_PATH_H
@@ -0,0 +1,118 @@
#include "QtProjectWizardContentPathCDB.h"
#include "QtProjectWizardContentPathsIndexedHeaders.h"
#include "SourceGroupCxxCdb.h"
#include "SourceGroupSettingsCxxCdb.h"
#include "utility.h"
#include "utilityFile.h"
QtProjectWizardContentPathCDB::QtProjectWizardContentPathCDB(
std::shared_ptr<SourceGroupSettingsCxxCdb> settings, QtProjectWizardWindow* window
)
: QtProjectWizardContentPath(window)
, m_settings(settings)
, m_filePaths([&]()
{
return utility::getAsRelativeIfShorter(
utility::toVector(SourceGroupCxxCdb(m_settings).getAllSourceFilePaths()),
m_settings->getProjectDirectoryPath()
);
}
)
{
setTitleString("Compilation Database (compile_commands.json)");
setHelpString(
"Select the compilation database file for the project. Sourcetrail will index your project based on the compile "
"commands. This file contains using all include paths and compiler flags of these compile commands. The project "
"will stay up to date with changes in the compilation database on every refresh.<br />"
"<br />"
"You can make use of environment variables with ${ENV_VAR}."
);
setFileEndings({ L".json" });
}
void QtProjectWizardContentPathCDB::populate(QGridLayout* layout, int& row)
{
QtProjectWizardContentPath::populate(layout, row);
m_picker->setPickDirectory(false);
m_picker->setFileFilter("JSON Compilation Database (*.json)");
connect(m_picker, &QtLocationPicker::locationPicked, this, &QtProjectWizardContentPathCDB::pickedPath);
QLabel* description = new QLabel(
"Sourcetrail will use all include paths and compiler flags from the Compilation Database and stay up-to-date "
"with changes on refresh.", this);
description->setObjectName("description");
description->setWordWrap(true);
layout->addWidget(description, row, QtProjectWizardWindow::BACK_COL);
row++;
QLabel* title = createFormLabel("Source Files to Index");
layout->addWidget(title, row, QtProjectWizardWindow::FRONT_COL, Qt::AlignTop);
layout->setRowStretch(row, 0);
m_fileCountLabel = new QLabel("");
m_fileCountLabel->setWordWrap(true);
layout->addWidget(m_fileCountLabel, row, QtProjectWizardWindow::BACK_COL, Qt::AlignTop);
row++;
addFilesButton("show source files", layout, row);
row++;
}
void QtProjectWizardContentPathCDB::load()
{
m_picker->setText(QString::fromStdWString(m_settings->getCompilationDatabasePath().wstr()));
m_filePaths.clear();
if (m_fileCountLabel)
{
m_fileCountLabel->setText("<b>" + QString::number(getFilePaths().size()) +
"</b> source files were found in the compilation database.");
}
}
void QtProjectWizardContentPathCDB::save()
{
m_settings->setCompilationDatabasePath(FilePath(m_picker->getText().toStdWString()));
}
std::vector<FilePath> QtProjectWizardContentPathCDB::getFilePaths() const
{
return m_filePaths.getValue();
}
QString QtProjectWizardContentPathCDB::getFileNamesTitle() const
{
return "Source Files";
}
QString QtProjectWizardContentPathCDB::getFileNamesDescription() const
{
return " source files will be indexed.";
}
void QtProjectWizardContentPathCDB::pickedPath()
{
m_window->saveContent();
const FilePath projectPath = m_settings->getProjectDirectoryPath();
std::set<FilePath> indexedHeaderPaths;
for (const FilePath& path : QtProjectWizardContentPathsIndexedHeaders::getIndexedPathsDerivedFromCDB(m_settings))
{
if (projectPath.contains(path))
{
// the relative path is always shorter than the absolute path
indexedHeaderPaths.insert(path.getRelativeTo(projectPath));
}
}
m_settings->setIndexedHeaderPaths(utility::toVector(indexedHeaderPaths));
m_window->loadContent();
}
std::shared_ptr<SourceGroupSettings> QtProjectWizardContentPathCDB::getSourceGroupSettings()
{
return m_settings;
}
@@ -0,0 +1,39 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_PATH_CDB_H
#define QT_PROJECT_WIZARD_CONTENT_PATH_CDB_H
#include "QtProjectWizardContentPath.h"
#include "SingleValueCache.h"
class SourceGroupSettingsCxxCdb;
class QtProjectWizardContentPathCDB
: public QtProjectWizardContentPath
{
Q_OBJECT
public:
QtProjectWizardContentPathCDB(
std::shared_ptr<SourceGroupSettingsCxxCdb> settings, QtProjectWizardWindow* window);
// QtProjectWizardContent implementation
void populate(QGridLayout* layout, int& row) override;
void load() override;
void save() override;
std::vector<FilePath> getFilePaths() const override;
QString getFileNamesTitle() const override;
QString getFileNamesDescription() const override;
private slots:
void pickedPath();
private:
std::shared_ptr<SourceGroupSettings> getSourceGroupSettings() override;
std::shared_ptr<SourceGroupSettingsCxxCdb> m_settings;
QLabel* m_fileCountLabel;
mutable SingleValueCache<std::vector<FilePath>> m_filePaths;
};
#endif // QT_PROJECT_WIZARD_CONTENT_PATH_CDB_H
@@ -0,0 +1,115 @@
#include "QtProjectWizardContentPathCodeblocksProject.h"
#include "QtProjectWizardContentPathsIndexedHeaders.h"
#include "SourceGroupCxxCodeblocks.h"
#include "SourceGroupSettingsCxxCodeblocks.h"
#include "utility.h"
#include "utilityFile.h"
QtProjectWizardContentPathCodeblocksProject::QtProjectWizardContentPathCodeblocksProject(
std::shared_ptr<SourceGroupSettingsCxxCodeblocks> settings, QtProjectWizardWindow* window
)
: QtProjectWizardContentPath(window)
, m_settings(settings)
, m_filePaths([&]()
{
return utility::getAsRelativeIfShorter(
utility::toVector(SourceGroupCxxCodeblocks(m_settings).getAllSourceFilePaths()),
m_settings->getProjectDirectoryPath()
);
}
)
{
setTitleString("Code::Blocks Project (.cbp)");
setHelpString(
"Select the Code::Blocks file for the project. Sourcetrail will index your project based on the settings "
"this file. It contains using all include paths and compiler flags required. The Sourcetrail project "
"will stay up to date with changes in the Code::Blocks project on every refresh.<br />"
"<br />"
"You can make use of environment variables with ${ENV_VAR}."
);
setFileEndings({ L".cbp" });
}
void QtProjectWizardContentPathCodeblocksProject::populate(QGridLayout* layout, int& row)
{
QtProjectWizardContentPath::populate(layout, row);
m_picker->setPickDirectory(false);
m_picker->setFileFilter("Code::Blocks Project (*.cbp)");
connect(m_picker, &QtLocationPicker::locationPicked, this, &QtProjectWizardContentPathCodeblocksProject::pickedPath);
QLabel* description = new QLabel(
"Sourcetrail will use all settings from the Code::Blocks project and stay up-to-date with changes on refresh.", this);
description->setObjectName("description");
description->setWordWrap(true);
layout->addWidget(description, row, QtProjectWizardWindow::BACK_COL);
row++;
QLabel* title = createFormLabel("Source Files to Index");
layout->addWidget(title, row, QtProjectWizardWindow::FRONT_COL, Qt::AlignTop);
layout->setRowStretch(row, 0);
m_fileCountLabel = new QLabel("");
m_fileCountLabel->setWordWrap(true);
layout->addWidget(m_fileCountLabel, row, QtProjectWizardWindow::BACK_COL, Qt::AlignTop);
row++;
addFilesButton("show source files", layout, row);
row++;
}
void QtProjectWizardContentPathCodeblocksProject::load()
{
m_picker->setText(QString::fromStdWString(m_settings->getCodeblocksProjectPath().wstr()));
m_filePaths.clear();
if (m_fileCountLabel)
{
m_fileCountLabel->setText("<b>" + QString::number(getFilePaths().size()) + "</b> source files were found in the Code::Blocks project.");
}
}
void QtProjectWizardContentPathCodeblocksProject::save()
{
m_settings->setCodeblocksProjectPath(FilePath(m_picker->getText().toStdWString()));
}
std::vector<FilePath> QtProjectWizardContentPathCodeblocksProject::getFilePaths() const
{
return m_filePaths.getValue();
}
QString QtProjectWizardContentPathCodeblocksProject::getFileNamesTitle() const
{
return "Source Files";
}
QString QtProjectWizardContentPathCodeblocksProject::getFileNamesDescription() const
{
return " source files will be indexed.";
}
void QtProjectWizardContentPathCodeblocksProject::pickedPath()
{
m_window->saveContent();
const FilePath projectPath = m_settings->getProjectDirectoryPath();
std::set<FilePath> indexedHeaderPaths;
for (const FilePath& path : QtProjectWizardContentPathsIndexedHeaders::getIndexedPathsDerivedFromCodeblocksProject(m_settings))
{
if (projectPath.contains(path))
{
indexedHeaderPaths.insert(path.getRelativeTo(projectPath)); // the relative path is always shorter than the absolute path
}
}
m_settings->setIndexedHeaderPaths(utility::toVector(indexedHeaderPaths));
m_window->loadContent();
}
std::shared_ptr<SourceGroupSettings> QtProjectWizardContentPathCodeblocksProject::getSourceGroupSettings()
{
return m_settings;
}
@@ -0,0 +1,40 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_PATH_CODE_BLOCKS_PROJECT_H
#define QT_PROJECT_WIZARD_CONTENT_PATH_CODE_BLOCKS_PROJECT_H
#include "QtProjectWizardContentPath.h"
#include "SingleValueCache.h"
class SourceGroupSettingsCxxCodeblocks;
class QtProjectWizardContentPathCodeblocksProject
: public QtProjectWizardContentPath
{
Q_OBJECT
public:
QtProjectWizardContentPathCodeblocksProject(
std::shared_ptr<SourceGroupSettingsCxxCodeblocks> settings,
QtProjectWizardWindow* window);
// QtProjectWizardContent implementation
void populate(QGridLayout* layout, int& row) override;
void load() override;
void save() override;
std::vector<FilePath> getFilePaths() const override;
QString getFileNamesTitle() const override;
QString getFileNamesDescription() const override;
private slots:
void pickedPath();
private:
std::shared_ptr<SourceGroupSettings> getSourceGroupSettings() override;
std::shared_ptr<SourceGroupSettingsCxxCodeblocks> m_settings;
QLabel* m_fileCountLabel;
mutable SingleValueCache<std::vector<FilePath>> m_filePaths;
};
#endif // QT_PROJECT_WIZARD_CONTENT_PATH_CODE_BLOCKS_PROJECT_H
@@ -0,0 +1,33 @@
#include "QtProjectWizardContentPathDependenciesGradle.h"
#include "SourceGroupSettingsJavaGradle.h"
QtProjectWizardContentPathDependenciesGradle::QtProjectWizardContentPathDependenciesGradle(
std::shared_ptr<SourceGroupSettingsJavaGradle> settings, QtProjectWizardWindow* window
)
: QtProjectWizardContentPath(window)
, m_settings(settings)
{
setTitleString("Intermediate Dependencies Directory");
setHelpString(
"This directory is used to temporarily download and store the dependencies (e.g. .jar files) of the Gradle "
"project while it is indexed.<br />"
"<br />"
"You can make use of environment variables with ${ENV_VAR}."
);
}
void QtProjectWizardContentPathDependenciesGradle::load()
{
m_picker->setText(QString::fromStdWString(m_settings->getGradleDependenciesDirectory().wstr()));
}
void QtProjectWizardContentPathDependenciesGradle::save()
{
m_settings->setGradleDependenciesDirectory(FilePath(m_picker->getText().toStdWString()));
}
std::shared_ptr<SourceGroupSettings> QtProjectWizardContentPathDependenciesGradle::getSourceGroupSettings()
{
return m_settings;
}
@@ -0,0 +1,27 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_PATH_DEPENDENCIES_GRADLE_H
#define QT_PROJECT_WIZARD_CONTENT_PATH_DEPENDENCIES_GRADLE_H
#include "QtProjectWizardContentPath.h"
class SourceGroupSettingsJavaGradle;
class QtProjectWizardContentPathDependenciesGradle
: public QtProjectWizardContentPath
{
Q_OBJECT
public:
QtProjectWizardContentPathDependenciesGradle(
std::shared_ptr<SourceGroupSettingsJavaGradle> settings, QtProjectWizardWindow* window);
// QtProjectWizardContent implementation
void load() override;
void save() override;
private:
std::shared_ptr<SourceGroupSettings> getSourceGroupSettings() override;
std::shared_ptr<SourceGroupSettingsJavaGradle> m_settings;
};
#endif // QT_PROJECT_WIZARD_CONTENT_PATH_DEPENDENCIES_GRADLE_H
@@ -0,0 +1,32 @@
#include "QtProjectWizardContentPathDependenciesMaven.h"
#include "SourceGroupSettingsJavaMaven.h"
QtProjectWizardContentPathDependenciesMaven::QtProjectWizardContentPathDependenciesMaven(
std::shared_ptr<SourceGroupSettingsJavaMaven> settings, QtProjectWizardWindow* window
)
: QtProjectWizardContentPath(window)
, m_settings(settings)
{
setTitleString("Intermediate Dependencies Directory");
setHelpString(
"This directory is used to temporarily download and store the dependencies (e.g. .jar files) of the Maven project while it is indexed.<br />"
"<br />"
"You can make use of environment variables with ${ENV_VAR}."
);
}
void QtProjectWizardContentPathDependenciesMaven::load()
{
m_picker->setText(QString::fromStdWString(m_settings->getMavenDependenciesDirectory().wstr()));
}
void QtProjectWizardContentPathDependenciesMaven::save()
{
m_settings->setMavenDependenciesDirectory(FilePath(m_picker->getText().toStdWString()));
}
std::shared_ptr<SourceGroupSettings> QtProjectWizardContentPathDependenciesMaven::getSourceGroupSettings()
{
return m_settings;
}
@@ -0,0 +1,26 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_PATH_DEPENDENCIES_MAVEN_H
#define QT_PROJECT_WIZARD_CONTENT_PATH_DEPENDENCIES_MAVEN_H
#include "QtProjectWizardContentPath.h"
class SourceGroupSettingsJavaMaven;
class QtProjectWizardContentPathDependenciesMaven
: public QtProjectWizardContentPath
{
Q_OBJECT
public:
QtProjectWizardContentPathDependenciesMaven(
std::shared_ptr<SourceGroupSettingsJavaMaven> settings, QtProjectWizardWindow* window);
// QtProjectWizardContent implementation
void load() override;
void save() override;
private:
std::shared_ptr<SourceGroupSettings> getSourceGroupSettings() override;
std::shared_ptr<SourceGroupSettingsJavaMaven> m_settings;
};
#endif // QT_PROJECT_WIZARD_CONTENT_PATH_DEPENDENCIES_MAVEN_H
@@ -0,0 +1,90 @@
#include "QtProjectWizardContentPathPythonEnvironment.h"
#include "ResourcePaths.h"
#include "SourceGroupSettingsPythonEmpty.h"
#include "utilityApp.h"
QtProjectWizardContentPathPythonEnvironment::QtProjectWizardContentPathPythonEnvironment(
std::shared_ptr<SourceGroupSettingsPythonEmpty> settings, QtProjectWizardWindow* window
)
: QtProjectWizardContentPath(window)
, m_settings(settings)
{
setTitleString("Python Environment");
setHelpString(
"Here you can specify the path to the directory or to the executable of the (virtual) Python environment that should be used to resolve "
"dependencies within the indexed source code. <br />"
"<br />"
"If you would run:<br />"
"<br />"
"$ cd C:\\dev\\python\\envs<br />"
"$ virtualenv py37<br />"
"<br />"
"you would set it to \"C:\\dev\\python\\envs\\py37\" or \"C:\\dev\\python\\envs\\py37\\Scripts\\python.exe\". <br />"
"Leave blank to use the default Python environment. You can make use of environment variables with ${ENV_VAR}."
);
setPlaceholderString("Use Default");
setAllowEmpty(true);
}
void QtProjectWizardContentPathPythonEnvironment::populate(QGridLayout* layout, int& row)
{
QtProjectWizardContentPath::populate(layout, row);
connect(
m_picker, &QtLocationPicker::textChanged,
this, &QtProjectWizardContentPathPythonEnvironment::onTextChanged
);
m_resultLabel = new QLabel();
m_resultLabel->setWordWrap(true);
layout->addWidget(m_resultLabel, row, QtProjectWizardWindow::BACK_COL);
row++;
}
void QtProjectWizardContentPathPythonEnvironment::load()
{
m_picker->setText(QString::fromStdWString(m_settings->getEnvironmentPath().wstr()));
}
void QtProjectWizardContentPathPythonEnvironment::save()
{
m_settings->setEnvironmentPath(FilePath(m_picker->getText().toStdWString()));
}
void QtProjectWizardContentPathPythonEnvironment::onTextChanged(const QString& text)
{
if (text.isEmpty())
{
m_resultLabel->clear();
}
else
{
m_resultLabel->setText("Checking validity of Python environment...");
std::thread([=]() {
std::pair<int, std::string> out = utility::executeProcess(
"\"" + ResourcePaths::getPythonPath().str() + "SourcetrailPythonIndexer\" check-environment " +
"--environment-path \"" + m_settings->makePathExpandedAndAbsolute(FilePath(text.toStdWString())).str() + "\"",
FilePath(),
5000
);
m_onQtThread(
[=]()
{
if (out.first == 0)
{
m_resultLabel->setText(QString::fromStdString(out.second));
}
else
{
m_resultLabel->setText("An error occurred while checking environment path. Unable to check validity.");
}
}
);
}).detach();
}
}
std::shared_ptr<SourceGroupSettings> QtProjectWizardContentPathPythonEnvironment::getSourceGroupSettings()
{
return m_settings;
}
@@ -0,0 +1,30 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_PATH_PYTHON_ENVIRONMENT_H
#define QT_PROJECT_WIZARD_CONTENT_PATH_PYTHON_ENVIRONMENT_H
#include "QtProjectWizardContentPath.h"
#include "QtThreadedFunctor.h"
class SourceGroupSettingsPythonEmpty;
class QtProjectWizardContentPathPythonEnvironment
: public QtProjectWizardContentPath
{
Q_OBJECT
public:
QtProjectWizardContentPathPythonEnvironment(std::shared_ptr<SourceGroupSettingsPythonEmpty> settings, QtProjectWizardWindow* window);
// QtProjectWizardContent implementation
void populate(QGridLayout* layout, int& row) override;
void load() override;
void save() override;
private:
void onTextChanged(const QString& text);
std::shared_ptr<SourceGroupSettings> getSourceGroupSettings() override;
std::shared_ptr<SourceGroupSettingsPythonEmpty> m_settings;
QtThreadedLambdaFunctor m_onQtThread;
QLabel* m_resultLabel;
};
#endif // QT_PROJECT_WIZARD_CONTENT_PATH_PYTHON_ENVIRONMENT_H
@@ -0,0 +1,166 @@
#include "QtProjectWizardContentPathSonargraphProject.h"
#include <QMessageBox>
#include "QtProjectWizardContentPathsIndexedHeaders.h"
#include "SonargraphProject.h"
#include "SourceGroupCxxSonargraph.h"
#include "SourceGroupJavaSonargraph.h"
#include "SourceGroupSettingsCxxSonargraph.h"
#include "SourceGroupSettingsJavaSonargraph.h"
#include "SourceGroupSettingsWithSonargraphProjectPath.h"
#include "utility.h"
#include "utilityFile.h"
QtProjectWizardContentPathSonargraphProject::QtProjectWizardContentPathSonargraphProject(
std::shared_ptr<SourceGroupSettings> settings,
std::shared_ptr<SourceGroupSettingsCxxSonargraph> settingsCxxSonargraph,
std::shared_ptr<SourceGroupSettingsWithSonargraphProjectPath> settingsWithSonargraphProjectPath,
QtProjectWizardWindow* window
)
: QtProjectWizardContentPath(window)
, m_settings(settings)
, m_settingsCxxSonargraph(settingsCxxSonargraph)
, m_settingsWithSonargraphProjectPath(settingsWithSonargraphProjectPath)
, m_filePaths([&]()
{
std::set<FilePath> allSourceFilePaths;
if (std::shared_ptr<SourceGroupSettingsCxxSonargraph> settings = std::dynamic_pointer_cast<SourceGroupSettingsCxxSonargraph>(m_settings))
{
allSourceFilePaths = SourceGroupCxxSonargraph(settings).getAllSourceFilePaths();
}
else if (std::shared_ptr<SourceGroupSettingsJavaSonargraph> settings = std::dynamic_pointer_cast<SourceGroupSettingsJavaSonargraph>(m_settings))
{
allSourceFilePaths = SourceGroupJavaSonargraph(settings).getAllSourceFilePaths();
}
return utility::getAsRelativeIfShorter(
utility::toVector(allSourceFilePaths),
m_settings->getProjectDirectoryPath()
);
}
)
{
setTitleString("Sonargraph Project (system.sonargraph)");
setHelpString(
"Select the Sonargraph file for the project. Sourcetrail will index your project based on the settings "
"this file. It contains using all include paths and compiler flags required. The Sourcetrail project "
"will stay up to date with changes in the Sonargraph project on every refresh.<br />"
"<br />"
"You can make use of environment variables with ${ENV_VAR}."
);
setFileEndings({ L".sonargraph" });
}
void QtProjectWizardContentPathSonargraphProject::populate(QGridLayout* layout, int& row)
{
QtProjectWizardContentPath::populate(layout, row);
m_picker->setPickDirectory(false);
m_picker->setFileFilter("Sonargraph Project (system.sonargraph)");
connect(m_picker, &QtLocationPicker::locationPicked, this, &QtProjectWizardContentPathSonargraphProject::pickedPath);
QLabel* description = new QLabel(
"Sourcetrail will use all settings from the Sonargraph project and stay up-to-date with changes on refresh.", this);
description->setObjectName("description");
description->setWordWrap(true);
layout->addWidget(description, row, QtProjectWizardWindow::BACK_COL);
row++;
QLabel* title = createFormLabel("Source Files to Index");
layout->addWidget(title, row, QtProjectWizardWindow::FRONT_COL, Qt::AlignTop);
layout->setRowStretch(row, 0);
m_fileCountLabel = new QLabel("");
m_fileCountLabel->setWordWrap(true);
layout->addWidget(m_fileCountLabel, row, QtProjectWizardWindow::BACK_COL, Qt::AlignTop);
row++;
addFilesButton("show source files", layout, row);
row++;
}
void QtProjectWizardContentPathSonargraphProject::load()
{
m_picker->setText(QString::fromStdWString(m_settingsWithSonargraphProjectPath->getSonargraphProjectPath().wstr()));
m_filePaths.clear();
if (m_fileCountLabel)
{
m_fileCountLabel->setText("<b>" + QString::number(getFilePaths().size()) + "</b> source files were found in the Sonargraph project.");
}
}
void QtProjectWizardContentPathSonargraphProject::save()
{
m_settingsWithSonargraphProjectPath->setSonargraphProjectPath(FilePath(m_picker->getText().toStdWString()));
}
bool QtProjectWizardContentPathSonargraphProject::check()
{
if (!QtProjectWizardContentPath::check())
{
return false;
}
if (std::shared_ptr<Sonargraph::Project> sonargraphProject = Sonargraph::Project::load(
m_settingsWithSonargraphProjectPath->getSonargraphProjectPathExpandedAndAbsolute(), m_settings->getLanguage()
))
{
if (sonargraphProject->getLoadedModuleCount() == 0)
{
QMessageBox msgBox;
msgBox.setText(QString::fromStdString(
"The Sonargraph project file doesn't seem to contain any supported " +
languageTypeToString(m_settings->getLanguage()) + " modules. Please " +
"consider choosing another project file or removing this sourcegroup."
));
msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
msgBox.setDefaultButton(QMessageBox::Ok);
return msgBox.exec() == QMessageBox::Ok;
}
}
return true;
}
std::vector<FilePath> QtProjectWizardContentPathSonargraphProject::getFilePaths() const
{
return m_filePaths.getValue();
}
QString QtProjectWizardContentPathSonargraphProject::getFileNamesTitle() const
{
return "Source Files";
}
QString QtProjectWizardContentPathSonargraphProject::getFileNamesDescription() const
{
return " source files will be indexed.";
}
void QtProjectWizardContentPathSonargraphProject::pickedPath()
{
m_window->saveContent();
if (m_settingsCxxSonargraph)
{
const FilePath projectPath = m_settings->getProjectDirectoryPath();
std::set<FilePath> indexedHeaderPaths;
for (const FilePath& path : QtProjectWizardContentPathsIndexedHeaders::getIndexedPathsDerivedFromSonargraphProject(m_settingsCxxSonargraph))
{
if (projectPath.contains(path))
{
indexedHeaderPaths.insert(path.getRelativeTo(projectPath)); // the relative path is always shorter than the absolute path
}
}
m_settingsCxxSonargraph->setIndexedHeaderPaths(utility::toVector(indexedHeaderPaths));
}
m_window->loadContent();
}
std::shared_ptr<SourceGroupSettings> QtProjectWizardContentPathSonargraphProject::getSourceGroupSettings()
{
return m_settings;
}
@@ -0,0 +1,46 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_PATH_SONARGRAPH_PROJECT_H
#define QT_PROJECT_WIZARD_CONTENT_PATH_SONARGRAPH_PROJECT_H
#include "QtProjectWizardContentPath.h"
#include "SingleValueCache.h"
class SourceGroupSettingsCxxSonargraph;
class SourceGroupSettingsWithSonargraphProjectPath;
class QtProjectWizardContentPathSonargraphProject
: public QtProjectWizardContentPath
{
Q_OBJECT
public:
QtProjectWizardContentPathSonargraphProject(
std::shared_ptr<SourceGroupSettings> settings,
std::shared_ptr<SourceGroupSettingsCxxSonargraph> settingsCxxSonargraph,
std::shared_ptr<SourceGroupSettingsWithSonargraphProjectPath> settingsWithSonargraphProjectPath,
QtProjectWizardWindow* window);
// QtProjectWizardContent implementation
void populate(QGridLayout* layout, int& row) override;
void load() override;
void save() override;
bool check() override;
std::vector<FilePath> getFilePaths() const override;
QString getFileNamesTitle() const override;
QString getFileNamesDescription() const override;
private slots:
void pickedPath();
private:
std::shared_ptr<SourceGroupSettings> getSourceGroupSettings() override;
std::shared_ptr<SourceGroupSettings> m_settings;
std::shared_ptr<SourceGroupSettingsCxxSonargraph> m_settingsCxxSonargraph;
std::shared_ptr<SourceGroupSettingsWithSonargraphProjectPath> m_settingsWithSonargraphProjectPath;
QLabel* m_fileCountLabel;
mutable SingleValueCache<std::vector<FilePath>> m_filePaths;
};
#endif // QT_PROJECT_WIZARD_CONTENT_PATH_SONARGRAPH_PROJECT_H
@@ -0,0 +1,73 @@
#include "QtProjectWizardContentPathSourceGradle.h"
#include <QCheckBox>
#include "Application.h"
#include "QtDialogView.h"
#include "SourceGroupJavaGradle.h"
#include "SourceGroupSettingsJavaGradle.h"
#include "utility.h"
#include "utilityFile.h"
QtProjectWizardContentPathSourceGradle::QtProjectWizardContentPathSourceGradle(
std::shared_ptr<SourceGroupSettingsJavaGradle> settings, QtProjectWizardWindow* window
)
: QtProjectWizardContentPath(window)
, m_settings(settings)
{
setTitleString("Gradle Project File (build.gradle)");
setHelpString(
"Enter the path to the main build.gradle file of your Gradle project.<br />"
"<br />"
"You can make use of environment variables with ${ENV_VAR}."
);
setFileEndings({ L".gradle" });
}
void QtProjectWizardContentPathSourceGradle::populate(QGridLayout* layout, int& row)
{
QtProjectWizardContentPath::populate(layout, row);
m_picker->setPickDirectory(false);
m_picker->setFileFilter("Gradle Build File (build.gradle)");
QPushButton* filesButton = addFilesButton("show source files", nullptr, row);
m_shouldIndexTests = new QCheckBox("Should Index Tests");
QHBoxLayout* hlayout = new QHBoxLayout();
hlayout->setContentsMargins(0, 0, 0, 0);
hlayout->addWidget(m_shouldIndexTests);
hlayout->addStretch();
hlayout->addWidget(filesButton);
layout->addLayout(hlayout, row, QtProjectWizardWindow::BACK_COL);
row++;
}
void QtProjectWizardContentPathSourceGradle::load()
{
m_picker->setText(QString::fromStdWString(m_settings->getGradleProjectFilePath().wstr()));
m_shouldIndexTests->setChecked(m_settings->getShouldIndexGradleTests());
}
void QtProjectWizardContentPathSourceGradle::save()
{
m_settings->setGradleProjectFilePath(FilePath(m_picker->getText().toStdWString()));
m_settings->setShouldIndexGradleTests(m_shouldIndexTests->isChecked());
}
std::vector<FilePath> QtProjectWizardContentPathSourceGradle::getFilePaths() const
{
QtDialogView* dialogView = dynamic_cast<QtDialogView*>(
Application::getInstance()->getDialogView(DialogView::UseCase::PROJECT_SETUP).get());
dialogView->setParentWindow(m_window);
return utility::getAsRelativeIfShorter(
utility::toVector(SourceGroupJavaGradle(m_settings).getAllSourceFilePaths()),
m_settings->getProjectDirectoryPath()
);
}
std::shared_ptr<SourceGroupSettings> QtProjectWizardContentPathSourceGradle::getSourceGroupSettings()
{
return m_settings;
}
@@ -0,0 +1,33 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_PATH_SOURCE_GRADLE_H
#define QT_PROJECT_WIZARD_CONTENT_PATH_SOURCE_GRADLE_H
#include "QtProjectWizardContentPath.h"
class QCheckBox;
class SourceGroupSettingsJavaGradle;
class QtProjectWizardContentPathSourceGradle
: public QtProjectWizardContentPath
{
Q_OBJECT
public:
QtProjectWizardContentPathSourceGradle(
std::shared_ptr<SourceGroupSettingsJavaGradle> settings, QtProjectWizardWindow* window);
// QtProjectWizardContent implementation
void populate(QGridLayout* layout, int& row) override;
void load() override;
void save() override;
std::vector<FilePath> getFilePaths() const override;
private:
std::shared_ptr<SourceGroupSettings> getSourceGroupSettings() override;
std::shared_ptr<SourceGroupSettingsJavaGradle> m_settings;
QCheckBox* m_shouldIndexTests;
};
#endif // QT_PROJECT_WIZARD_CONTENT_PATH_SOURCE_GRADLE_H
@@ -0,0 +1,102 @@
#include "QtProjectWizardContentPathSourceMaven.h"
#include <QCheckBox>
#include "Application.h"
#include "ApplicationSettings.h"
#include "MessageStatus.h"
#include "QtDialogView.h"
#include "ScopedFunctor.h"
#include "SourceGroupJavaMaven.h"
#include "SourceGroupSettingsJavaMaven.h"
#include "utility.h"
#include "utilityFile.h"
#include "utilityMaven.h"
QtProjectWizardContentPathSourceMaven::QtProjectWizardContentPathSourceMaven(
std::shared_ptr<SourceGroupSettingsJavaMaven> settings, QtProjectWizardWindow* window
)
: QtProjectWizardContentPath(window)
, m_settings(settings)
{
setTitleString("Maven Project File (pom.xml)");
setHelpString(
"Enter the path to the main pom.xml file of your Maven project.<br />"
"<br />"
"You can make use of environment variables with ${ENV_VAR}."
);
setFileEndings({ L".xml" });
}
void QtProjectWizardContentPathSourceMaven::populate(QGridLayout* layout, int& row)
{
QtProjectWizardContentPath::populate(layout, row);
m_picker->setPickDirectory(false);
m_picker->setFileFilter("POM File (pom.xml)");
QPushButton* filesButton = addFilesButton("show source files", nullptr, row);
m_shouldIndexTests = new QCheckBox("Should Index Tests");
QHBoxLayout* hlayout = new QHBoxLayout();
hlayout->setContentsMargins(0, 0, 0, 0);
hlayout->addWidget(m_shouldIndexTests);
hlayout->addStretch();
hlayout->addWidget(filesButton);
layout->addLayout(hlayout, row, QtProjectWizardWindow::BACK_COL);
row++;
}
void QtProjectWizardContentPathSourceMaven::load()
{
m_picker->setText(QString::fromStdWString(m_settings->getMavenProjectFilePath().wstr()));
m_shouldIndexTests->setChecked(m_settings->getShouldIndexMavenTests());
}
void QtProjectWizardContentPathSourceMaven::save()
{
m_settings->setMavenProjectFilePath(FilePath(m_picker->getText().toStdWString()));
m_settings->setShouldIndexMavenTests(m_shouldIndexTests->isChecked());
}
std::vector<FilePath> QtProjectWizardContentPathSourceMaven::getFilePaths() const
{
{
const FilePath mavenPath = ApplicationSettings::getInstance()->getMavenPath();
const FilePath mavenProjectRoot = m_settings->getMavenProjectFilePathExpandedAndAbsolute().getParentDirectory();
if (!mavenProjectRoot.exists())
{
LOG_INFO("Could not find any source file paths because Maven project path does not exist.");
return std::vector<FilePath>();
}
QtDialogView* dialogView = dynamic_cast<QtDialogView*>(
Application::getInstance()->getDialogView(DialogView::UseCase::PROJECT_SETUP).get());
ScopedFunctor scopedFunctor([&dialogView]() {
dialogView->hideUnknownProgressDialog();
});
dialogView->setParentWindow(m_window);
dialogView->showUnknownProgressDialog(L"Preparing Project", L"Maven\nGenerating Source Files");
const std::wstring errorMessage = utility::mavenGenerateSources(mavenPath, mavenProjectRoot);
if (!errorMessage.empty())
{
MessageStatus(errorMessage, true, false).dispatch();
Application::getInstance()->handleDialog(errorMessage);
return std::vector<FilePath>();
}
}
return utility::getAsRelativeIfShorter(
utility::toVector(SourceGroupJavaMaven(m_settings).getAllSourceFilePaths()),
m_settings->getProjectDirectoryPath()
);
}
std::shared_ptr<SourceGroupSettings> QtProjectWizardContentPathSourceMaven::getSourceGroupSettings()
{
return m_settings;
}
@@ -0,0 +1,33 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_PATH_SOURCE_MAVEN_H
#define QT_PROJECT_WIZARD_CONTENT_PATH_SOURCE_MAVEN_H
#include "QtProjectWizardContentPath.h"
class QCheckBox;
class SourceGroupSettingsJavaMaven;
class QtProjectWizardContentPathSourceMaven
: public QtProjectWizardContentPath
{
Q_OBJECT
public:
QtProjectWizardContentPathSourceMaven(
std::shared_ptr<SourceGroupSettingsJavaMaven> settings, QtProjectWizardWindow* window);
// QtProjectWizardContent implementation
void populate(QGridLayout* layout, int& row) override;
void load() override;
void save() override;
std::vector<FilePath> getFilePaths() const override;
private:
std::shared_ptr<SourceGroupSettings> getSourceGroupSettings() override;
std::shared_ptr<SourceGroupSettingsJavaMaven> m_settings;
QCheckBox* m_shouldIndexTests;
};
#endif // QT_PROJECT_WIZARD_CONTENT_PATH_SOURCE_MAVEN_H
@@ -0,0 +1,179 @@
#include "QtProjectWizardContentPaths.h"
#include <QComboBox>
#include <QMessageBox>
#include "SourceGroupSettings.h"
#include "utility.h"
QtProjectWizardContentPaths::QtProjectWizardContentPaths(
std::shared_ptr<SourceGroupSettings> settings,
QtProjectWizardWindow* window,
QtPathListBox::SelectionPolicyType selectionPolicy,
bool checkMissingPaths
)
: QtProjectWizardContent(window)
, m_settings(settings)
, m_makePathsRelativeToProjectFileLocation(true)
, m_selectionPolicy(selectionPolicy)
, m_checkMissingPaths(checkMissingPaths)
{
}
void QtProjectWizardContentPaths::populate(QGridLayout* layout, int& row)
{
QLabel* label = createFormLabel(m_titleString);
layout->addWidget(label, row, QtProjectWizardWindow::FRONT_COL, Qt::AlignTop);
if (m_helpString.size() > 0)
{
addHelpButton(m_titleString, m_helpString, layout, row);
}
m_list = new QtPathListBox(this, m_titleString, m_selectionPolicy);
if (m_makePathsRelativeToProjectFileLocation && m_settings)
{
m_list->setRelativeRootDirectory(m_settings->getProjectDirectoryPath());
}
layout->addWidget(m_list, row, QtProjectWizardWindow::BACK_COL);
row++;
if (m_showFilesString.size() > 0)
{
addFilesButton(m_showFilesString, layout, row);
row++;
}
if (m_pathDetector)
{
addDetection(layout, row);
row++;
}
}
bool QtProjectWizardContentPaths::check()
{
if (m_checkMissingPaths)
{
QString missingPaths;
std::vector<FilePath> existingPaths;
for (const FilePath& path : m_list->getPathsAsDisplayed())
{
std::vector<FilePath> expandedPaths(1, path);
if (m_settings)
{
expandedPaths = m_settings->makePathsExpandedAndAbsolute(expandedPaths);
}
size_t existingCount = 0;
for (const FilePath& expandedPath : expandedPaths)
{
if (!expandedPath.exists())
{
missingPaths.append(QString::fromStdWString(expandedPath.wstr() + L"\n"));
}
else
{
existingCount++;
}
}
if (!expandedPaths.empty() && expandedPaths.size() == existingCount)
{
existingPaths.push_back(path);
}
}
if (!missingPaths.isEmpty())
{
QMessageBox msgBox;
msgBox.setText(
QString(
"Some provided paths do not exist at \"%1\". Do you want to remove them before continuing?"
).arg(m_titleString)
);
msgBox.setDetailedText(missingPaths);
QPushButton* removeButton = msgBox.addButton("Remove", QMessageBox::YesRole);
QPushButton* keepButton = msgBox.addButton("Keep", QMessageBox::ButtonRole::NoRole);
QPushButton* cancelButton = msgBox.addButton("Cancel", QMessageBox::ButtonRole::RejectRole);
msgBox.exec();
if (msgBox.clickedButton() == removeButton)
{
m_list->setPaths(existingPaths);
save();
}
else if (msgBox.clickedButton() == keepButton)
{
return true;
}
else if (msgBox.clickedButton() == cancelButton)
{
return false;
}
}
}
return true;
}
void QtProjectWizardContentPaths::setTitleString(const QString& title)
{
m_titleString = title;
}
void QtProjectWizardContentPaths::setHelpString(const QString& help)
{
m_helpString = help;
}
void QtProjectWizardContentPaths::addDetection(QGridLayout* layout, int row)
{
std::vector<std::string> detectorNames = m_pathDetector->getWorkingDetectorNames();
if (!detectorNames.size())
{
return;
}
QLabel* label = new QLabel("Auto detection from:");
m_detectorBox = new QComboBox();
for (const std::string& detectorName: detectorNames)
{
m_detectorBox->addItem(detectorName.c_str());
}
QPushButton* button = new QPushButton("detect");
button->setObjectName("windowButton");
connect(button, &QPushButton::clicked, this, &QtProjectWizardContentPaths::detectionClicked);
QHBoxLayout* hlayout = new QHBoxLayout();
hlayout->setContentsMargins(0, 0, 0, 0);
hlayout->addWidget(label);
hlayout->addWidget(m_detectorBox);
hlayout->addWidget(button);
QWidget* detectionWidget = new QWidget();
detectionWidget->setLayout(hlayout);
layout->addWidget(detectionWidget, row, QtProjectWizardWindow::BACK_COL, Qt::AlignLeft | Qt::AlignTop);
}
void QtProjectWizardContentPaths::detectionClicked()
{
std::vector<FilePath> paths = m_pathDetector->getPaths(m_detectorBox->currentText().toStdString());
std::vector<FilePath> oldPaths = m_list->getPathsAsDisplayed();
paths = utility::unique(utility::concat(oldPaths, paths));
detectedPaths(paths);
}
void QtProjectWizardContentPaths::detectedPaths(const std::vector<FilePath>& paths)
{
m_list->setPaths(paths);
}
@@ -0,0 +1,62 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_PATHS_H
#define QT_PROJECT_WIZARD_CONTENT_PATHS_H
#include <set>
#include "QtPathListBox.h"
#include "QtProjectWizardContent.h"
#include "CombinedPathDetector.h"
class QComboBox;
class SourceGroupSettings;
class QtProjectWizardContentPaths
: public QtProjectWizardContent
{
Q_OBJECT
signals:
void showSourceFiles();
public:
QtProjectWizardContentPaths(
std::shared_ptr<SourceGroupSettings> settings,
QtProjectWizardWindow* window,
QtPathListBox::SelectionPolicyType selectionPolicy,
bool checkMissingPaths = true);
// QtSettingsWindow implementation
virtual void populate(QGridLayout* layout, int& row) override;
virtual bool check() override;
protected:
void setTitleString(const QString& title);
void setHelpString(const QString& help);
void addDetection(QGridLayout* layout, int row);
virtual void detectedPaths(const std::vector<FilePath>& paths);
std::shared_ptr<SourceGroupSettings> m_settings;
QtPathListBox* m_list;
QString m_showFilesString;
std::shared_ptr<CombinedPathDetector> m_pathDetector;
bool m_makePathsRelativeToProjectFileLocation;
private slots:
void detectionClicked();
private:
const QtPathListBox::SelectionPolicyType m_selectionPolicy;
const bool m_checkMissingPaths;
QString m_titleString;
QString m_helpString;
QComboBox* m_detectorBox;
};
#endif // QT_PROJECT_WIZARD_CONTENT_PATHS_H
@@ -0,0 +1,56 @@
#include "QtProjectWizardContentPathsClassJava.h"
#include <QCheckBox>
#include "SourceGroupSettings.h"
#include "SourceGroupSettingsWithClasspath.h"
QtProjectWizardContentPathsClassJava::QtProjectWizardContentPathsClassJava(
std::shared_ptr<SourceGroupSettings> settings, QtProjectWizardWindow* window
)
: QtProjectWizardContentPaths(settings, window, QtPathListBox::SELECTION_POLICY_FILES_AND_DIRECTORIES)
{
setTitleString("Class Path");
setHelpString(
"Enter all the .jar files your project depends on. If your project depends on uncompiled java code that should "
"not be indexed, please add the root directory of those .java files here (the one where all the package names "
"are relative to).<br />"
"<br />"
"You can make use of environment variables with ${ENV_VAR}."
);
}
void QtProjectWizardContentPathsClassJava::populate(QGridLayout* layout, int& row)
{
QtProjectWizardContentPaths::populate(layout, row);
QLabel* label = createFormLabel("JRE System Library");
layout->addWidget(label, row, QtProjectWizardWindow::FRONT_COL, Qt::AlignTop);
m_useJreSystemLibraryCheckBox = new QCheckBox("Use JRE System Library", this);
layout->addWidget(m_useJreSystemLibraryCheckBox, row, QtProjectWizardWindow::BACK_COL);
row++;
}
void QtProjectWizardContentPathsClassJava::load()
{
std::shared_ptr<SourceGroupSettingsWithClasspath> settings =
std::dynamic_pointer_cast<SourceGroupSettingsWithClasspath>(m_settings);
if (settings)
{
m_list->setPaths(settings->getClasspath());
m_useJreSystemLibraryCheckBox->setChecked(settings->getUseJreSystemLibrary());
}
}
void QtProjectWizardContentPathsClassJava::save()
{
std::shared_ptr<SourceGroupSettingsWithClasspath> settings =
std::dynamic_pointer_cast<SourceGroupSettingsWithClasspath>(m_settings);
if (settings)
{
settings->setClasspath(m_list->getPathsAsDisplayed());
settings->setUseJreSystemLibrary(m_useJreSystemLibraryCheckBox->isChecked());
}
}
@@ -0,0 +1,24 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_PATHS_CLASS_JAVA_H
#define QT_PROJECT_WIZARD_CONTENT_PATHS_CLASS_JAVA_H
#include "QtProjectWizardContentPaths.h"
class QCheckBox;
class QtProjectWizardContentPathsClassJava
: public QtProjectWizardContentPaths
{
Q_OBJECT
public:
QtProjectWizardContentPathsClassJava(std::shared_ptr<SourceGroupSettings> settings, QtProjectWizardWindow* window);
// QtProjectWizardContent implementation
virtual void populate(QGridLayout* layout, int& row) override;
virtual void load() override;
virtual void save() override;
private:
QCheckBox* m_useJreSystemLibraryCheckBox;
};
#endif // QT_PROJECT_WIZARD_CONTENT_PATHS_CLASS_JAVA_H
@@ -0,0 +1,39 @@
#include "QtProjectWizardContentPathsExclude.h"
#include "SourceGroupSettings.h"
#include "SourceGroupSettingsWithExcludeFilters.h"
#include "utility.h"
#include "utilityString.h"
QtProjectWizardContentPathsExclude::QtProjectWizardContentPathsExclude(
std::shared_ptr<SourceGroupSettings> settings, QtProjectWizardWindow* window
)
: QtProjectWizardContentPaths(settings, window, QtPathListBox::SELECTION_POLICY_FILES_AND_DIRECTORIES, false)
{
setTitleString("Excluded Files & Directories");
setHelpString(
"<p>These paths define the files and directories that will be left out from indexing.</p>"
"<p>Hints:"
"<ul>"
"<li>You can use the wildcard \"*\" which represents characters except \"\\\" or \"/\" (e.g. \"src/*/test.h\" matches \"src/app/test.h\" but does not match \"src/app/widget/test.h\" or \"src/test.h\")</li>"
"<li>You can use the wildcard \"**\" which represents arbitrary characters (e.g. \"src**test.h\" matches \"src/app/test.h\" as well as \"src/app/widget/test.h\" or \"src/test.h\")</li>"
"<li>You can make use of environment variables with ${ENV_VAR}</li>"
"</ul></p>"
);
}
void QtProjectWizardContentPathsExclude::load()
{
if (std::shared_ptr<SourceGroupSettingsWithExcludeFilters> settings = std::dynamic_pointer_cast<SourceGroupSettingsWithExcludeFilters>(m_settings)) // FIXME: pass msettings as required type
{
m_list->setPaths(utility::convert<std::wstring, FilePath>(settings->getExcludeFilterStrings(), [](const std::wstring& s) { return FilePath(s); }));
}
}
void QtProjectWizardContentPathsExclude::save()
{
if (std::shared_ptr<SourceGroupSettingsWithExcludeFilters> settings = std::dynamic_pointer_cast<SourceGroupSettingsWithExcludeFilters>(m_settings)) // FIXME: pass msettings as required type
{
settings->setExcludeFilterStrings(utility::toWStrings(m_list->getPathsAsDisplayed()));
}
}
@@ -0,0 +1,17 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_PATHS_EXCLUDE_H
#define QT_PROJECT_WIZARD_CONTENT_PATHS_EXCLUDE_H
#include "QtProjectWizardContentPaths.h"
class QtProjectWizardContentPathsExclude
: public QtProjectWizardContentPaths
{
Q_OBJECT
public:
QtProjectWizardContentPathsExclude(std::shared_ptr<SourceGroupSettings> settings, QtProjectWizardWindow* window);
virtual void load() override;
virtual void save() override;
};
#endif // QT_PROJECT_WIZARD_CONTENT_PATHS_EXCLUDE_H
@@ -0,0 +1,40 @@
#include "QtProjectWizardContentPathsFrameworkSearch.h"
#include "SourceGroupSettingsCxx.h"
QtProjectWizardContentPathsFrameworkSearch::QtProjectWizardContentPathsFrameworkSearch(
std::shared_ptr<SourceGroupSettings> settings, QtProjectWizardWindow* window, bool indicateAsAdditional
)
: QtProjectWizardContentPaths(settings, window, QtPathListBox::SELECTION_POLICY_DIRECTORIES_ONLY)
{
setTitleString(indicateAsAdditional ? "Additional Framework Search Paths" : "Framework Search Paths");
setHelpString(
"Framework Search Paths define where MacOS framework containers (.framework), that your project depends on, are "
"found. These paths are usually passed to the compiler with the '-iframework' flag.<br />"
"<br />"
"You can make use of environment variables with ${ENV_VAR}."
);
}
void QtProjectWizardContentPathsFrameworkSearch::load()
{
std::shared_ptr<SourceGroupSettingsCxx> cxxSettings = std::dynamic_pointer_cast<SourceGroupSettingsCxx>(m_settings);
if (cxxSettings)
{
m_list->setPaths(cxxSettings->getFrameworkSearchPaths());
}
}
void QtProjectWizardContentPathsFrameworkSearch::save()
{
std::shared_ptr<SourceGroupSettingsCxx> cxxSettings = std::dynamic_pointer_cast<SourceGroupSettingsCxx>(m_settings);
if (cxxSettings)
{
cxxSettings->setFrameworkSearchPaths(m_list->getPathsAsDisplayed());
}
}
bool QtProjectWizardContentPathsFrameworkSearch::isScrollAble() const
{
return true;
}
@@ -0,0 +1,21 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_PATHS_FRAMEWORK_SEARCH_H
#define QT_PROJECT_WIZARD_CONTENT_PATHS_FRAMEWORK_SEARCH_H
#include "QtProjectWizardContentPaths.h"
class QtProjectWizardContentPathsFrameworkSearch
: public QtProjectWizardContentPaths
{
Q_OBJECT
public:
QtProjectWizardContentPathsFrameworkSearch(
std::shared_ptr<SourceGroupSettings> settings, QtProjectWizardWindow* window, bool indicateAsAdditional = false);
// QtProjectWizardContent implementation
virtual void load() override;
virtual void save() override;
virtual bool isScrollAble() const override;
};
#endif // QT_PROJECT_WIZARD_CONTENT_PATHS_FRAMEWORK_SEARCH_H
@@ -0,0 +1,34 @@
#include "QtProjectWizardContentPathsFrameworkSearchGlobal.h"
#include "ApplicationSettings.h"
#include "utilityPathDetection.h"
QtProjectWizardContentPathsFrameworkSearchGlobal::QtProjectWizardContentPathsFrameworkSearchGlobal(
QtProjectWizardWindow* window
)
: QtProjectWizardContentPaths(std::shared_ptr<SourceGroupSettings>(), window, QtPathListBox::SELECTION_POLICY_DIRECTORIES_ONLY)
{
setTitleString("Global Framework Search Paths");
setHelpString(
"The Global Framework Search Paths will be used in all your projects - in addition to the project specific "
"Framework Search Paths.<br />"
"<br />"
"They define where MacOS framework containers (.framework) are found "
"(See <a href=\"https://sourcetrail.com/documentation/#FindingSystemHeaderLocations\">"
"Finding System Header Locations</a> or use the auto detection below)."
);
m_pathDetector = utility::getCxxFrameworkPathDetector();
m_makePathsRelativeToProjectFileLocation = false;
}
void QtProjectWizardContentPathsFrameworkSearchGlobal::load()
{
m_list->setPaths(ApplicationSettings::getInstance()->getFrameworkSearchPaths());
}
void QtProjectWizardContentPathsFrameworkSearchGlobal::save()
{
ApplicationSettings::getInstance()->setFrameworkSearchPaths(m_list->getPathsAsDisplayed());
ApplicationSettings::getInstance()->save();
}
@@ -0,0 +1,18 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_PATHS_FRAMEWORK_SEARCH_GLOBAL_H
#define QT_PROJECT_WIZARD_CONTENT_PATHS_FRAMEWORK_SEARCH_GLOBAL_H
#include "QtProjectWizardContentPaths.h"
class QtProjectWizardContentPathsFrameworkSearchGlobal
: public QtProjectWizardContentPaths
{
Q_OBJECT
public:
QtProjectWizardContentPathsFrameworkSearchGlobal(QtProjectWizardWindow* window);
// QtProjectWizardContent implementation
virtual void load() override;
virtual void save() override;
};
#endif // QT_PROJECT_WIZARD_CONTENT_PATHS_FRAMEWORK_SEARCH_GLOBAL_H
@@ -0,0 +1,394 @@
#include "QtProjectWizardContentPathsHeaderSearch.h"
#include <QMessageBox>
#include "Application.h"
#include "ApplicationSettings.h"
#include "FileManager.h"
#include "IncludeDirective.h"
#include "IncludeProcessing.h"
#include "QtDialogView.h"
#include "QtPathListDialog.h"
#include "QtTextEditDialog.h"
#include "ScopedFunctor.h"
#include "SourceGroupSettingsCxx.h"
#include "SourceGroupSettingsWithExcludeFilters.h"
#include "SourceGroupSettingsWithSourceExtensions.h"
#include "SourceGroupSettingsWithSourcePaths.h"
#include "utility.h"
#include "utilityFile.h"
QtProjectWizardContentPathsHeaderSearch::QtProjectWizardContentPathsHeaderSearch(
std::shared_ptr<SourceGroupSettings> settings, QtProjectWizardWindow* window, bool indicateAsAdditional
)
: QtProjectWizardContentPaths(settings, window, QtPathListBox::SELECTION_POLICY_DIRECTORIES_ONLY)
, m_showDetectedIncludesResultFunctor(std::bind(
&QtProjectWizardContentPathsHeaderSearch::showDetectedIncludesResult, this, std::placeholders::_1))
, m_showValidationResultFunctor(std::bind(
&QtProjectWizardContentPathsHeaderSearch::showValidationResult, this, std::placeholders::_1))
, m_indicateAsAdditional(indicateAsAdditional)
{
setTitleString(m_indicateAsAdditional ? "Additional Include Paths" : "Include Paths");
setHelpString(
(
(m_indicateAsAdditional ? "<b>Note</b>: Use the Additional Include Paths to add paths that are missing in the "
"referenced project file.<br /><br />" : ""
) + std::string(
"Include Paths are used for resolving #include directives in the indexed source and header files. These paths are "
"usually passed to the compiler with the '-I' or '-iquote' flags.<br />"
"<br />"
"Add all paths #include directives throughout your project are relative to. If all #include directives are "
"specified relative to the project's root directory, please add that root directory here.<br />"
"<br />"
"If your project also includes files from external libraries (e.g. boost), please add these directories as well "
"(e.g. add 'path/to/boost_home/include').<br />"
"<br />"
"You can make use of environment variables with ${ENV_VAR}."
)
).c_str()
);
}
void QtProjectWizardContentPathsHeaderSearch::populate(QGridLayout* layout, int& row)
{
QtProjectWizardContentPaths::populate(layout, row);
if (!m_indicateAsAdditional)
{
{
QPushButton* detectionButton = new QPushButton("auto-detect");
detectionButton->setObjectName("windowButton");
connect(detectionButton, &QPushButton::clicked, this, &QtProjectWizardContentPathsHeaderSearch::detectIncludesButtonClicked);
layout->addWidget(detectionButton, row, QtProjectWizardWindow::BACK_COL, Qt::AlignLeft | Qt::AlignTop);
}
{
QPushButton* validateionButton = new QPushButton("validate include directives");
validateionButton->setObjectName("windowButton");
connect(validateionButton, &QPushButton::clicked, this, &QtProjectWizardContentPathsHeaderSearch::validateIncludesButtonClicked);
layout->addWidget(validateionButton, row, QtProjectWizardWindow::BACK_COL, Qt::AlignRight | Qt::AlignTop);
}
row++;
}
}
void QtProjectWizardContentPathsHeaderSearch::load()
{
std::shared_ptr<SourceGroupSettingsCxx> cxxSettings = std::dynamic_pointer_cast<SourceGroupSettingsCxx>(m_settings);
if (cxxSettings)
{
m_list->setPaths(cxxSettings->getHeaderSearchPaths());
}
}
void QtProjectWizardContentPathsHeaderSearch::save()
{
std::shared_ptr<SourceGroupSettingsCxx> cxxSettings = std::dynamic_pointer_cast<SourceGroupSettingsCxx>(m_settings);
if (cxxSettings)
{
cxxSettings->setHeaderSearchPaths(m_list->getPathsAsDisplayed());
}
}
bool QtProjectWizardContentPathsHeaderSearch::isScrollAble() const
{
return true;
}
void QtProjectWizardContentPathsHeaderSearch::detectIncludesButtonClicked()
{
m_window->saveContent();
m_pathsDialog = std::make_shared<QtPathListDialog>(
"Detect Include Paths",
"<p>Automatically search for header files in the paths provided below to find missing include paths for "
"unresolved include directives in your source code.</p>"
"<p>The \"Files & Directories to Index\" will be searched by default, but you can add further paths, such "
"as directories of third-party libraries, if required.</p>",
QtPathListBox::SELECTION_POLICY_DIRECTORIES_ONLY
);
m_pathsDialog->setup();
m_pathsDialog->updateNextButton("Start");
m_pathsDialog->setCloseVisible(true);
m_pathsDialog->setRelativeRootDirectory(m_settings->getProjectDirectoryPath());
if (std::shared_ptr<SourceGroupSettingsWithSourcePaths> pathSettings = std::dynamic_pointer_cast<SourceGroupSettingsWithSourcePaths>(m_settings)) // FIXME: pass msettings as required type
{
m_pathsDialog->setPaths(pathSettings->getSourcePaths(), true);
}
m_pathsDialog->showWindow();
connect(m_pathsDialog.get(), &QtPathListDialog::finished, this, &QtProjectWizardContentPathsHeaderSearch::finishedSelectDetectIncludesRootPathsDialog);
connect(m_pathsDialog.get(), &QtPathListDialog::canceled, this, &QtProjectWizardContentPathsHeaderSearch::closedPathsDialog);
}
void QtProjectWizardContentPathsHeaderSearch::validateIncludesButtonClicked()
{
// TODO: regard Force Includes here, too!
m_window->saveContent();
std::thread([&]()
{
std::shared_ptr<SourceGroupSettingsWithSourceExtensions> extensionSettings = std::dynamic_pointer_cast<SourceGroupSettingsWithSourceExtensions>(m_settings);
std::shared_ptr<SourceGroupSettingsWithSourcePaths> pathSettings = std::dynamic_pointer_cast<SourceGroupSettingsWithSourcePaths>(m_settings);
std::shared_ptr<SourceGroupSettingsWithExcludeFilters> excludeFilterSettings = std::dynamic_pointer_cast<SourceGroupSettingsWithExcludeFilters>(m_settings);
if (extensionSettings && pathSettings && excludeFilterSettings) // FIXME: pass msettings as required type
{
std::vector<IncludeDirective> unresolvedIncludes;
{
QtDialogView* dialogView = dynamic_cast<QtDialogView*>(
Application::getInstance()->getDialogView(DialogView::UseCase::PROJECT_SETUP).get());
std::set<FilePath> sourceFilePaths;
std::vector<FilePath> indexedFilePaths;
std::vector<FilePath> headerSearchPaths;
{
dialogView->setParentWindow(m_window);
dialogView->showUnknownProgressDialog(L"Processing", L"Gathering Source Files");
ScopedFunctor dialogHider([&dialogView](){
dialogView->hideUnknownProgressDialog();
});
FileManager fileManager;
fileManager.update(
pathSettings->getSourcePathsExpandedAndAbsolute(),
excludeFilterSettings->getExcludeFiltersExpandedAndAbsolute(),
extensionSettings->getSourceExtensions()
);
sourceFilePaths = fileManager.getAllSourceFilePaths();
indexedFilePaths = pathSettings->getSourcePathsExpandedAndAbsolute();
headerSearchPaths = ApplicationSettings::getInstance()->getHeaderSearchPathsExpanded();
if (std::shared_ptr<SourceGroupSettingsCxx> cxxSettings =
std::dynamic_pointer_cast<SourceGroupSettingsCxx>(m_settings))
{
utility::append(headerSearchPaths, cxxSettings->getHeaderSearchPathsExpandedAndAbsolute());
}
}
{
dialogView->setParentWindow(m_window);
ScopedFunctor dialogHider([&dialogView](){
dialogView->hideProgressDialog();
});
unresolvedIncludes = IncludeProcessing::getUnresolvedIncludeDirectives(
sourceFilePaths,
utility::toSet(indexedFilePaths),
utility::toSet(headerSearchPaths),
log2(sourceFilePaths.size()),
[&](const float progress)
{
dialogView->showProgressDialog(
L"Processing", std::to_wstring(int(progress * sourceFilePaths.size())) + L" Files",
int(progress * 100.0f)
);
}
);
}
}
m_showValidationResultFunctor(unresolvedIncludes);
}
}).detach();
}
void QtProjectWizardContentPathsHeaderSearch::finishedSelectDetectIncludesRootPathsDialog()
{
// TODO: regard Force Includes here, too!
const std::vector<FilePath> searchedPaths = m_settings->makePathsExpandedAndAbsolute(m_pathsDialog->getPaths());
closedPathsDialog();
std::thread([=]()
{
std::shared_ptr<SourceGroupSettingsWithSourceExtensions> extensionSettings = std::dynamic_pointer_cast<SourceGroupSettingsWithSourceExtensions>(m_settings);
std::shared_ptr<SourceGroupSettingsWithSourcePaths> pathSettings = std::dynamic_pointer_cast<SourceGroupSettingsWithSourcePaths>(m_settings);
std::shared_ptr<SourceGroupSettingsWithExcludeFilters> excludeFilterSettings = std::dynamic_pointer_cast<SourceGroupSettingsWithExcludeFilters>(m_settings);
if (extensionSettings && pathSettings && excludeFilterSettings) // FIXME: pass msettings as required type
{
std::set<FilePath> detectedHeaderSearchPaths;
{
QtDialogView* dialogView = dynamic_cast<QtDialogView*>(
Application::getInstance()->getDialogView(DialogView::UseCase::PROJECT_SETUP).get());
std::set<FilePath> sourceFilePaths;
std::vector<FilePath> headerSearchPaths;
{
dialogView->setParentWindow(m_window);
dialogView->showUnknownProgressDialog(L"Processing", L"Gathering Source Files");
ScopedFunctor dialogHider([&dialogView]() {
dialogView->hideUnknownProgressDialog();
});
FileManager fileManager;
fileManager.update(
pathSettings->getSourcePathsExpandedAndAbsolute(),
excludeFilterSettings->getExcludeFiltersExpandedAndAbsolute(),
extensionSettings->getSourceExtensions()
);
sourceFilePaths = fileManager.getAllSourceFilePaths();
headerSearchPaths = ApplicationSettings::getInstance()->getHeaderSearchPathsExpanded();
if (std::shared_ptr<SourceGroupSettingsCxx> cxxSettings =
std::dynamic_pointer_cast<SourceGroupSettingsCxx>(m_settings))
{
utility::append(headerSearchPaths, cxxSettings->getHeaderSearchPathsExpandedAndAbsolute());
}
}
{
dialogView->setParentWindow(m_window);
ScopedFunctor dialogHider([&dialogView]() {
dialogView->hideProgressDialog();
});
detectedHeaderSearchPaths = IncludeProcessing::getHeaderSearchDirectories(
sourceFilePaths,
utility::toSet(searchedPaths),
utility::toSet(headerSearchPaths),
log2(sourceFilePaths.size()),
[&](const float progress)
{
dialogView->showProgressDialog(
L"Processing", std::to_wstring(int(progress * sourceFilePaths.size())) + L" Files",
int(progress * 100.0f)
);
}
);
}
}
m_showDetectedIncludesResultFunctor(detectedHeaderSearchPaths);
}
}).detach();
}
void QtProjectWizardContentPathsHeaderSearch::finishedAcceptDetectedIncludePathsDialog()
{
const std::vector<std::wstring> detectedPaths = utility::split<std::vector<std::wstring>>(m_filesDialog->getText(), L"\n");
closedFilesDialog();
std::vector<FilePath> headerSearchPaths = m_list->getPathsAsDisplayed();
headerSearchPaths.reserve(headerSearchPaths.size() + detectedPaths.size());
for (const std::wstring& detectedPath : detectedPaths)
{
if (!detectedPath.empty())
{
headerSearchPaths.push_back(FilePath(detectedPath));
}
}
m_list->setPaths(headerSearchPaths);
}
void QtProjectWizardContentPathsHeaderSearch::closedPathsDialog()
{
m_pathsDialog->hide();
m_pathsDialog.reset();
window()->raise();
}
void QtProjectWizardContentPathsHeaderSearch::showDetectedIncludesResult(const std::set<FilePath>& detectedHeaderSearchPaths)
{
const std::set<FilePath> headerSearchPaths = utility::toSet(m_settings->makePathsExpandedAndAbsolute(m_list->getPathsAsDisplayed()));
std::vector<FilePath> additionalHeaderSearchPaths;
{
const FilePath relativeRoot = m_list->getRelativeRootDirectory();
for (const FilePath& detectedHeaderSearchPath : detectedHeaderSearchPaths)
{
if (headerSearchPaths.find(detectedHeaderSearchPath) == headerSearchPaths.end())
{
additionalHeaderSearchPaths.push_back(utility::getAsRelativeIfShorter(detectedHeaderSearchPath, relativeRoot));
}
}
}
if (additionalHeaderSearchPaths.empty())
{
QMessageBox msgBox;
msgBox.setText("<p>No additional include paths have been detected while searching the provided paths.</p>");
msgBox.exec();
}
else
{
std::wstring detailedText = L"";
for (const FilePath& path : additionalHeaderSearchPaths)
{
detailedText += path.wstr() + L"\n";
}
m_filesDialog = std::make_shared<QtTextEditDialog>(
"Detected Include Paths",
(
"<p>The following <b>" + std::to_string(additionalHeaderSearchPaths.size()) + "</b> include paths have been "
"detected and will be added to the include paths of this Source Group.<b>"
).c_str()
);
m_filesDialog->setup();
m_filesDialog->setReadOnly(true);
m_filesDialog->setCloseVisible(true);
m_filesDialog->updateNextButton("Add");
m_filesDialog->setText(detailedText);
m_filesDialog->showWindow();
connect(m_filesDialog.get(), &QtTextEditDialog::finished, this, &QtProjectWizardContentPathsHeaderSearch::finishedAcceptDetectedIncludePathsDialog);
connect(m_filesDialog.get(), &QtTextEditDialog::canceled, this, &QtProjectWizardContentPathsHeaderSearch::closedFilesDialog);
}
}
void QtProjectWizardContentPathsHeaderSearch::showValidationResult(const std::vector<IncludeDirective>& unresolvedIncludes)
{
if (unresolvedIncludes.empty())
{
QMessageBox msgBox;
msgBox.setText("<p>All include directives throughout the indexed files have been resolved.</p>");
msgBox.exec();
}
else
{
std::map<std::wstring, std::map<size_t, std::wstring>> orderedIncludes;
for (const IncludeDirective& unresolvedInclude: unresolvedIncludes)
{
orderedIncludes[unresolvedInclude.getIncludingFile().wstr()].emplace(
unresolvedInclude.getLineNumber(), unresolvedInclude.getDirective());
}
std::wstring detailedText = L"";
for (const auto& p: orderedIncludes)
{
detailedText += p.first + L"\n";
for (const auto& p2: p.second)
{
detailedText += std::to_wstring(p2.first) + L":\t" + p2.second + L"\n";
}
detailedText += L"\n";
}
m_filesDialog = std::make_shared<QtTextEditDialog>("Unresolved Include Directives",
("<p>The indexed files contain <b>" + std::to_string(unresolvedIncludes.size()) + "</b> include directive" +
(unresolvedIncludes.size() == 1 ? "" : "s") + " that could not be resolved correctly. Please check the details "
"and add the respective header search paths.</p>"
"<p><b>Note</b>: This is only a quick pass that does not regard block commenting or conditional preprocessor "
"directives. This means that some of the unresolved includes may actually not be required by the indexer.</p>"
).c_str());
m_filesDialog->setup();
m_filesDialog->setCloseVisible(false);
m_filesDialog->setReadOnly(true);
m_filesDialog->setText(detailedText);
m_filesDialog->showWindow();
connect(m_filesDialog.get(), &QtTextEditDialog::finished, this, &QtProjectWizardContentPathsHeaderSearch::closedFilesDialog);
connect(m_filesDialog.get(), &QtTextEditDialog::canceled, this, &QtProjectWizardContentPathsHeaderSearch::closedFilesDialog);
}
}
@@ -0,0 +1,42 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_PATHS_HEADER_SEARCH_H
#define QT_PROJECT_WIZARD_CONTENT_PATHS_HEADER_SEARCH_H
#include "FilePathFilter.h"
#include "QtProjectWizardContentPaths.h"
class IncludeDirective;
class QtPathListDialog;
class QtProjectWizardContentPathsHeaderSearch
: public QtProjectWizardContentPaths
{
Q_OBJECT
public:
QtProjectWizardContentPathsHeaderSearch(
std::shared_ptr<SourceGroupSettings> settings, QtProjectWizardWindow* window, bool indicateAsAdditional = false);
// QtProjectWizardContent implementation
virtual void populate(QGridLayout* layout, int& row) override;
virtual void load() override;
virtual void save() override;
virtual bool isScrollAble() const override;
private slots:
void detectIncludesButtonClicked();
void validateIncludesButtonClicked();
void finishedSelectDetectIncludesRootPathsDialog();
void finishedAcceptDetectedIncludePathsDialog();
void closedPathsDialog();
private:
void showDetectedIncludesResult(const std::set<FilePath>& detectedHeaderSearchPaths);
void showValidationResult(const std::vector<IncludeDirective>& unresolvedIncludes);
QtThreadedFunctor<std::set<FilePath>> m_showDetectedIncludesResultFunctor;
QtThreadedFunctor<std::vector<IncludeDirective>> m_showValidationResultFunctor;
std::shared_ptr<QtPathListDialog> m_pathsDialog;
const bool m_indicateAsAdditional;
};
#endif // QT_PROJECT_WIZARD_CONTENT_PATHS_HEADER_SEARCH_H
@@ -0,0 +1,116 @@
#include "QtProjectWizardContentPathsHeaderSearchGlobal.h"
#include <QMessageBox>
#include "ApplicationSettings.h"
#include "ResourcePaths.h"
#include "utilityApp.h"
#include "utilityPathDetection.h"
QtProjectWizardContentPathsHeaderSearchGlobal::QtProjectWizardContentPathsHeaderSearchGlobal(
QtProjectWizardWindow* window
)
: QtProjectWizardContentPaths(std::shared_ptr<SourceGroupSettings>(), window, QtPathListBox::SELECTION_POLICY_DIRECTORIES_ONLY)
{
setTitleString("Global Include Paths");
setHelpString(
"The Global Include Paths will be used in all your projects in addition to the project specific Include Paths. "
"These paths are usually passed to the compiler with the '-isystem' flag.<br />"
"<br />"
"Use them to add system header paths (See <a href=\"https://sourcetrail.com/documentation/#FindingSystemHeaderLocations\">"
"Finding System Header Locations</a> or use the auto detection below)."
);
m_pathDetector = utility::getCxxHeaderPathDetector();
m_makePathsRelativeToProjectFileLocation = false;
}
void QtProjectWizardContentPathsHeaderSearchGlobal::load()
{
setPaths(ApplicationSettings::getInstance()->getHeaderSearchPaths());
}
void QtProjectWizardContentPathsHeaderSearchGlobal::save()
{
std::vector<FilePath> paths;
for (const FilePath& headerPath : m_list->getPathsAsDisplayed())
{
if (headerPath != ResourcePaths::getCxxCompilerHeaderPath())
{
paths.push_back(headerPath);
}
}
ApplicationSettings::getInstance()->setHeaderSearchPaths(paths);
ApplicationSettings::getInstance()->save();
}
bool QtProjectWizardContentPathsHeaderSearchGlobal::check()
{
if (utility::getOsType() == OS_WINDOWS)
{
return QtProjectWizardContentPaths::check();
}
bool hasOtherCompilerConfig = false;
for (const FilePath& headerPath : m_list->getPathsAsDisplayed())
{
if (headerPath != ResourcePaths::getCxxCompilerHeaderPath() &&
headerPath.getCanonical().getConcatenated(L"/stdarg.h").exists())
{
hasOtherCompilerConfig = true;
break;
}
}
if (hasOtherCompilerConfig)
{
QMessageBox msgBox;
msgBox.setText("Multiple Compiler Headers");
msgBox.setInformativeText("Your Global Include Paths contain another path that holds C/C++ compiler headers, "
"probably those of your local C/C++ compiler. They are possibly in conflict with the compiler headers of "
"Sourcetrail's C/C++ indexer. This can lead to compatiblity errors during indexing. Do you want to remove "
"these paths?");
msgBox.addButton("Remove", QMessageBox::ButtonRole::YesRole);
msgBox.addButton("Keep", QMessageBox::ButtonRole::NoRole);
msgBox.setIcon(QMessageBox::Icon::Question);
int ret = msgBox.exec();
if (ret == 0) // QMessageBox::Yes
{
std::vector<FilePath> paths;
for (const FilePath& headerPath : m_list->getPathsAsDisplayed())
{
if (headerPath != ResourcePaths::getCxxCompilerHeaderPath() &&
headerPath.getCanonical().getConcatenated(L"/stdarg.h").exists())
{
continue;
}
paths.push_back(headerPath);
}
setPaths(paths);
}
}
return QtProjectWizardContentPaths::check();
}
void QtProjectWizardContentPathsHeaderSearchGlobal::detectedPaths(const std::vector<FilePath>& paths)
{
std::vector<FilePath> headerPaths;
for (const FilePath& headerPath : paths)
{
if (headerPath != ResourcePaths::getCxxCompilerHeaderPath())
{
headerPaths.push_back(headerPath);
}
}
setPaths(headerPaths);
}
void QtProjectWizardContentPathsHeaderSearchGlobal::setPaths(const std::vector<FilePath>& paths)
{
m_list->setPaths({});
m_list->addPaths({ ResourcePaths::getCxxCompilerHeaderPath() }, true);
m_list->addPaths(paths);
}
@@ -0,0 +1,26 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_PATHS_HEADER_SEARCH_GLOBAL_H
#define QT_PROJECT_WIZARD_CONTENT_PATHS_HEADER_SEARCH_GLOBAL_H
#include "QtProjectWizardContentPaths.h"
class QtProjectWizardContentPathsHeaderSearchGlobal
: public QtProjectWizardContentPaths
{
Q_OBJECT
public:
QtProjectWizardContentPathsHeaderSearchGlobal(QtProjectWizardWindow* window);
// QtProjectWizardContent implementation
virtual void load() override;
virtual void save() override;
virtual bool check() override;
protected:
virtual void detectedPaths(const std::vector<FilePath>& paths) override;
private:
void setPaths(const std::vector<FilePath>& paths);
};
#endif // QT_PROJECT_WIZARD_CONTENT_PATHS_HEADER_SEARCH_GLOBAL_H
@@ -0,0 +1,324 @@
#include "QtProjectWizardContentPathsIndexedHeaders.h"
#include <QMessageBox>
#include "CodeblocksProject.h"
#include "CompilationDatabase.h"
#include "IndexerCommandCxx.h"
#include "logging.h"
#include "OrderedCache.h"
#include "QtPathListDialog.h"
#include "QtSelectPathsDialog.h"
#include "QtTextEditDialog.h"
#include "SonargraphProject.h"
#include "SourceGroupSettingsCxxCdb.h"
#include "SourceGroupSettingsCxxCodeblocks.h"
#include "SourceGroupSettingsCxxSonargraph.h"
#include "utility.h"
#include "utilityFile.h"
std::vector<FilePath> QtProjectWizardContentPathsIndexedHeaders::getIndexedPathsDerivedFromSonargraphProject(
std::shared_ptr<const SourceGroupSettingsCxxSonargraph> settings)
{
std::set<FilePath> indexedHeaderPaths;
{
const FilePath sonargraphProjectPath = settings->getSonargraphProjectPathExpandedAndAbsolute();
if (!sonargraphProjectPath.empty() && sonargraphProjectPath.exists())
{
if (std::shared_ptr<Sonargraph::Project> sonargraphProject = Sonargraph::Project::load(
sonargraphProjectPath, settings->getLanguage()
))
{
for (const FilePath& path : sonargraphProject->getAllSourceFilePathsCanonical())
{
indexedHeaderPaths.insert(path.getCanonical().getParentDirectory());
}
utility::append(indexedHeaderPaths, sonargraphProject->getAllCxxHeaderSearchPathsCanonical());
}
}
else
{
LOG_WARNING("Unable to fetch indexed header paths. The provided Sonargraph project path does not exist.");
}
}
std::vector<FilePath> topLevelPaths;
for (const FilePath& path : utility::getTopLevelPaths(indexedHeaderPaths))
{
if (path.exists())
{
topLevelPaths.push_back(path);
}
}
return topLevelPaths;
}
std::vector<FilePath> QtProjectWizardContentPathsIndexedHeaders::getIndexedPathsDerivedFromCodeblocksProject(
std::shared_ptr<const SourceGroupSettingsCxxCodeblocks> settings)
{
const FilePath projectPath = settings->getProjectDirectoryPath();
std::set<FilePath> indexedHeaderPaths;
{
const FilePath codeblocksProjectPath = settings->getCodeblocksProjectPathExpandedAndAbsolute();
if (!codeblocksProjectPath.empty() && codeblocksProjectPath.exists())
{
if (std::shared_ptr<Codeblocks::Project> codeblocksProject = Codeblocks::Project::load(codeblocksProjectPath))
{
OrderedCache<FilePath, FilePath> canonicalDirectoryPathCache([](const FilePath& path) {
return path.getCanonical();
});
for (const FilePath& path : codeblocksProject->getAllSourceFilePathsCanonical(settings->getSourceExtensions()))
{
indexedHeaderPaths.insert(canonicalDirectoryPathCache.getValue(path.getParentDirectory()));
}
utility::append(indexedHeaderPaths, codeblocksProject->getAllCxxHeaderSearchPathsCanonical());
}
}
else
{
LOG_WARNING("Unable to fetch indexed header paths. The provided Sonargraph project path does not exist.");
}
}
std::vector<FilePath> topLevelPaths;
for (const FilePath& path : utility::getTopLevelPaths(indexedHeaderPaths))
{
if (path.exists())
{
topLevelPaths.push_back(path);
}
}
return topLevelPaths;
}
std::vector<FilePath> QtProjectWizardContentPathsIndexedHeaders::getIndexedPathsDerivedFromCDB(
std::shared_ptr<const SourceGroupSettingsCxxCdb> settings)
{
std::set<FilePath> indexedHeaderPaths;
{
const FilePath cdbPath = settings->getCompilationDatabasePathExpandedAndAbsolute();
if (!cdbPath.empty() && cdbPath.exists())
{
for (const FilePath& path : IndexerCommandCxx::getSourceFilesFromCDB(cdbPath))
{
indexedHeaderPaths.insert(path.getCanonical().getParentDirectory());
}
for (const FilePath& path : utility::CompilationDatabase(cdbPath).getAllHeaderPaths())
{
if (path.exists())
{
indexedHeaderPaths.insert(path.getCanonical());
}
}
}
else
{
LOG_WARNING("Unable to fetch indexed header paths. The provided Compilation Database path does not exist.");
}
}
std::vector<FilePath> topLevelPaths;
for (const FilePath& path : utility::getTopLevelPaths(indexedHeaderPaths))
{
if (path.exists())
{
topLevelPaths.push_back(path);
}
}
return topLevelPaths;
}
QtProjectWizardContentPathsIndexedHeaders::QtProjectWizardContentPathsIndexedHeaders(
std::shared_ptr<SourceGroupSettings> settings, QtProjectWizardWindow* window, std::string projectKindName
)
: QtProjectWizardContentPaths(settings, window, QtPathListBox::SELECTION_POLICY_FILES_AND_DIRECTORIES)
, m_projectKindName(projectKindName)
{
m_showFilesString = "";
setTitleString("Header Files & Directories to Index");
setHelpString(QString::fromStdString(
"The provided " + m_projectKindName + " already specifies which source files are part of your project. But Sourcetrail still "
"needs to know which header files to index as part of your project and which to skip. Choosing to skip indexing "
"your system headers or external frameworks will significantly improve the overall indexing performance.<br />"
"<br />"
"Use this list to define which header files should be indexed by Sourcetrail. Provide a directory to recursively "
"add all contained files.<br />"
"<br />"
"You can make use of environment variables with ${ENV_VAR}.<br />"
"<br />"
"<b>Hint</b>: Just enter the root path of your project if you want Sourcetrail to index all contained headers it "
"encounters.<br />"
));
}
void QtProjectWizardContentPathsIndexedHeaders::populate(QGridLayout* layout, int& row)
{
QtProjectWizardContentPaths::populate(layout, row);
QPushButton* button = new QPushButton(QString::fromStdString("Select from " + m_projectKindName));
button->setObjectName("windowButton");
connect(button, &QPushButton::clicked, this, &QtProjectWizardContentPathsIndexedHeaders::buttonClicked);
layout->addWidget(button, row, QtProjectWizardWindow::BACK_COL, Qt::AlignRight | Qt::AlignTop);
row++;
}
void QtProjectWizardContentPathsIndexedHeaders::load()
{
if (std::shared_ptr<SourceGroupSettingsWithIndexedHeaderPaths> cdbSettings =
std::dynamic_pointer_cast<SourceGroupSettingsWithIndexedHeaderPaths>(m_settings))
{
m_list->setPaths(cdbSettings->getIndexedHeaderPaths());
}
}
void QtProjectWizardContentPathsIndexedHeaders::save()
{
if (std::shared_ptr<SourceGroupSettingsWithIndexedHeaderPaths> cdbSettings =
std::dynamic_pointer_cast<SourceGroupSettingsWithIndexedHeaderPaths>(m_settings))
{
cdbSettings->setIndexedHeaderPaths(m_list->getPathsAsDisplayed());
}
}
bool QtProjectWizardContentPathsIndexedHeaders::check()
{
if (m_list->getPathsAsDisplayed().empty())
{
QMessageBox msgBox;
msgBox.setText("You didn't specify any Header Files & Directories to Index.");
msgBox.setInformativeText(QString::fromStdString(
"Sourcetrail will only index the source files listed in the " + m_projectKindName +
" file and none of the included header files."
));
msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
msgBox.setDefaultButton(QMessageBox::Ok);
return msgBox.exec() == QMessageBox::Ok;
}
else
{
return QtProjectWizardContentPaths::check();
}
}
void QtProjectWizardContentPathsIndexedHeaders::buttonClicked()
{
save();
if (!m_filesDialog)
{
if (std::shared_ptr<SourceGroupSettingsCxxSonargraph> sonargraphSettings = std::dynamic_pointer_cast<SourceGroupSettingsCxxSonargraph>(m_settings))
{
const FilePath sonargraphProjectPath = sonargraphSettings->getSonargraphProjectPathExpandedAndAbsolute();
if (!sonargraphProjectPath.exists())
{
QMessageBox msgBox;
msgBox.setText("The provided Sonargraph project path does not exist.");
msgBox.setDetailedText(QString::fromStdWString(sonargraphProjectPath.wstr()));
msgBox.exec();
return;
}
m_filesDialog = std::make_shared<QtSelectPathsDialog>(
"Select from Include Paths",
"The list contains all Include Paths found in the Sonargraph project. Red paths do not exist. Select the "
"paths containing the header files you want to index with Sourcetrail.");
m_filesDialog->setup();
connect(m_filesDialog.get(), &QtSelectPathsDialog::finished, this, &QtProjectWizardContentPathsIndexedHeaders::savedFilesDialog);
connect(m_filesDialog.get(), &QtSelectPathsDialog::canceled, this, &QtProjectWizardContentPathsIndexedHeaders::closedFilesDialog);
const FilePath projectPath = sonargraphSettings->getProjectDirectoryPath();
dynamic_cast<QtSelectPathsDialog*>(m_filesDialog.get())->setPathsList(
utility::convert<FilePath, FilePath>(
getIndexedPathsDerivedFromSonargraphProject(sonargraphSettings),
[&](const FilePath& path) { return utility::getAsRelativeIfShorter(path, projectPath); }
),
sonargraphSettings->getIndexedHeaderPaths(),
m_settings->getProjectDirectoryPath()
);
}
else if (std::shared_ptr<SourceGroupSettingsCxxCodeblocks> codeblocksSettings = std::dynamic_pointer_cast<SourceGroupSettingsCxxCodeblocks>(m_settings))
{
const FilePath codeblocksProjectPath = codeblocksSettings->getCodeblocksProjectPathExpandedAndAbsolute();
if (!codeblocksProjectPath.exists())
{
QMessageBox msgBox;
msgBox.setText("The provided Code::Blocks project path does not exist.");
msgBox.setDetailedText(QString::fromStdWString(codeblocksProjectPath.wstr()));
msgBox.exec();
return;
}
m_filesDialog = std::make_shared<QtSelectPathsDialog>(
"Select from Include Paths",
"The list contains all Include Paths found in the Code::Blocks project. Red paths do not exist. Select the "
"paths containing the header files you want to index with Sourcetrail.");
m_filesDialog->setup();
connect(m_filesDialog.get(), &QtSelectPathsDialog::finished, this, &QtProjectWizardContentPathsIndexedHeaders::savedFilesDialog);
connect(m_filesDialog.get(), &QtSelectPathsDialog::canceled, this, &QtProjectWizardContentPathsIndexedHeaders::closedFilesDialog);
const FilePath projectPath = codeblocksSettings->getProjectDirectoryPath();
dynamic_cast<QtSelectPathsDialog*>(m_filesDialog.get())->setPathsList(
utility::convert<FilePath, FilePath>(
getIndexedPathsDerivedFromCodeblocksProject(codeblocksSettings),
[&](const FilePath& path) { return utility::getAsRelativeIfShorter(path, projectPath); }
),
codeblocksSettings->getIndexedHeaderPaths(),
m_settings->getProjectDirectoryPath()
);
}
else if (std::shared_ptr<SourceGroupSettingsCxxCdb> cdbSettings = std::dynamic_pointer_cast<SourceGroupSettingsCxxCdb>(m_settings))
{
const FilePath cdbPath = cdbSettings->getCompilationDatabasePathExpandedAndAbsolute();
if (!cdbPath.exists())
{
QMessageBox msgBox;
msgBox.setText("The provided Compilation Database path does not exist.");
msgBox.setDetailedText(QString::fromStdWString(cdbPath.wstr()));
msgBox.exec();
return;
}
m_filesDialog = std::make_shared<QtSelectPathsDialog>(
"Select from Include Paths",
"The list contains all Include Paths found in the Compilation Database. Red paths do not exist. Select the "
"paths containing the header files you want to index with Sourcetrail.");
m_filesDialog->setup();
connect(m_filesDialog.get(), &QtSelectPathsDialog::finished, this, &QtProjectWizardContentPathsIndexedHeaders::savedFilesDialog);
connect(m_filesDialog.get(), &QtSelectPathsDialog::canceled, this, &QtProjectWizardContentPathsIndexedHeaders::closedFilesDialog);
const FilePath projectPath = cdbSettings->getProjectDirectoryPath();
dynamic_cast<QtSelectPathsDialog*>(m_filesDialog.get())->setPathsList(
utility::convert<FilePath, FilePath>(
getIndexedPathsDerivedFromCDB(cdbSettings),
[&](const FilePath& path) { return utility::getAsRelativeIfShorter(path, projectPath); }
),
cdbSettings->getIndexedHeaderPaths(),
m_settings->getProjectDirectoryPath()
);
}
}
if (m_filesDialog)
{
m_filesDialog->showWindow();
m_filesDialog->raise();
}
}
void QtProjectWizardContentPathsIndexedHeaders::savedFilesDialog()
{
m_list->setPaths(dynamic_cast<QtSelectPathsDialog*>(m_filesDialog.get())->getPathsList());
closedFilesDialog();
}
@@ -0,0 +1,39 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_PATHS_INDEXED_HEADER_PATHS_H
#define QT_PROJECT_WIZARD_CONTENT_PATHS_INDEXED_HEADER_PATHS_H
#include "QtProjectWizardContentPaths.h"
class SourceGroupSettingsCxxCdb;
class SourceGroupSettingsCxxCodeblocks;
class SourceGroupSettingsCxxSonargraph;
class QtProjectWizardContentPathsIndexedHeaders
: public QtProjectWizardContentPaths
{
Q_OBJECT
public:
static std::vector<FilePath> getIndexedPathsDerivedFromSonargraphProject(std::shared_ptr<const SourceGroupSettingsCxxSonargraph> settings);
static std::vector<FilePath> getIndexedPathsDerivedFromCodeblocksProject(std::shared_ptr<const SourceGroupSettingsCxxCodeblocks> settings);
static std::vector<FilePath> getIndexedPathsDerivedFromCDB(std::shared_ptr<const SourceGroupSettingsCxxCdb> settings);
QtProjectWizardContentPathsIndexedHeaders(
std::shared_ptr<SourceGroupSettings> settings, QtProjectWizardWindow* window, std::string projectKindName);
virtual void populate(QGridLayout* layout, int& row) override;
// QtProjectWizardContent implementation
virtual void load() override;
virtual void save() override;
virtual bool check() override;
private slots:
void buttonClicked();
void savedFilesDialog();
private:
const std::string m_projectKindName;
};
#endif // QT_PROJECT_WIZARD_CONTENT_PATHS_INDEXED_HEADER_PATHS_H
@@ -0,0 +1,84 @@
#include "QtProjectWizardContentPathsSource.h"
#include "SourceGroupCustomCommand.h"
#include "SourceGroupCxxEmpty.h"
#include "SourceGroupJavaEmpty.h"
#include "SourceGroupPythonEmpty.h"
#include "SourceGroupSettingsCxx.h"
#include "SourceGroupSettingsCustomCommand.h"
#include "SourceGroupSettingsJavaEmpty.h"
#include "SourceGroupSettingsPythonEmpty.h"
#include "SourceGroupSettingsWithSourcePaths.h"
#include "utility.h"
#include "utilityFile.h"
QtProjectWizardContentPathsSource::QtProjectWizardContentPathsSource(
std::shared_ptr<SourceGroupSettings> settings, QtProjectWizardWindow* window
)
: QtProjectWizardContentPaths(settings, window, QtPathListBox::SELECTION_POLICY_FILES_AND_DIRECTORIES)
{
m_showFilesString = "show files";
setTitleString("Files & Directories to Index");
setHelpString(
"These paths define the files and directories that will be indexed by Sourcetrail. Provide a directory to recursively "
"add all contained source and header files.<br />"
"<br />"
"If your project's source code resides in one location, but generated source files are kept at a different location, "
"you will also need to add that directory.<br />"
"<br />"
"You can make use of environment variables with ${ENV_VAR}."
);
}
void QtProjectWizardContentPathsSource::load()
{
if (std::shared_ptr<SourceGroupSettingsWithSourcePaths> pathSettings = std::dynamic_pointer_cast<SourceGroupSettingsWithSourcePaths>(m_settings)) // FIXME: pass msettings as required type
{
m_list->setPaths(pathSettings->getSourcePaths());
}
}
void QtProjectWizardContentPathsSource::save()
{
if (std::shared_ptr<SourceGroupSettingsWithSourcePaths> pathSettings = std::dynamic_pointer_cast<SourceGroupSettingsWithSourcePaths>(m_settings)) // FIXME: pass msettings as required type
{
pathSettings->setSourcePaths(m_list->getPathsAsDisplayed());
}
}
std::vector<FilePath> QtProjectWizardContentPathsSource::getFilePaths() const
{
std::set<FilePath> allSourceFilePaths;
if (std::shared_ptr<SourceGroupSettingsCxx> settings = std::dynamic_pointer_cast<SourceGroupSettingsCxx>(m_settings))
{
allSourceFilePaths = SourceGroupCxxEmpty(settings).getAllSourceFilePaths();
}
else if (std::shared_ptr<SourceGroupSettingsJavaEmpty> settings = std::dynamic_pointer_cast<SourceGroupSettingsJavaEmpty>(m_settings))
{
allSourceFilePaths = SourceGroupJavaEmpty(settings).getAllSourceFilePaths();
}
else if (std::shared_ptr<SourceGroupSettingsPythonEmpty> settings = std::dynamic_pointer_cast<SourceGroupSettingsPythonEmpty>(m_settings))
{
allSourceFilePaths = SourceGroupPythonEmpty(settings).getAllSourceFilePaths();
}
else if (std::shared_ptr<SourceGroupSettingsCustomCommand> settings = std::dynamic_pointer_cast<SourceGroupSettingsCustomCommand>(m_settings))
{
allSourceFilePaths = SourceGroupCustomCommand(settings).getAllSourceFilePaths();
}
return utility::getAsRelativeIfShorter(
utility::toVector(allSourceFilePaths),
m_settings->getProjectDirectoryPath()
);
}
QString QtProjectWizardContentPathsSource::getFileNamesTitle() const
{
return "Indexed Files";
}
QString QtProjectWizardContentPathsSource::getFileNamesDescription() const
{
return " files will be indexed.";
}
@@ -0,0 +1,22 @@
#ifndef QT_PROJECT_WIZARD_CONTENT_PATHS_SOURCE_H
#define QT_PROJECT_WIZARD_CONTENT_PATHS_SOURCE_H
#include "QtProjectWizardContentPaths.h"
class QtProjectWizardContentPathsSource
: public QtProjectWizardContentPaths
{
Q_OBJECT
public:
QtProjectWizardContentPathsSource(std::shared_ptr<SourceGroupSettings> settings, QtProjectWizardWindow* window);
// QtProjectWizardContent implementation
virtual void load() override;
virtual void save() override;
virtual std::vector<FilePath> getFilePaths() const override;
virtual QString getFileNamesTitle() const override;
virtual QString getFileNamesDescription() const override;
};
#endif // QT_PROJECT_WIZARD_CONTENT_PATHS_SOURCE_H
+9 -9
View File
@@ -19,7 +19,7 @@
#include "QtFileDialog.h"
#include "utilityQt.h"
#include "QtViewWidgetWrapper.h"
#include "QtProjectWizzard.h"
#include "QtProjectWizard.h"
#include "QtAbout.h"
#include "QtAboutLicense.h"
#include "QtEulaWindow.h"
@@ -682,19 +682,19 @@ void QtMainWindow::hideStartScreen()
void QtMainWindow::newProject()
{
QtProjectWizzard* wizzard = createWindow<QtProjectWizzard>();
wizzard->newProject();
QtProjectWizard* wizard = createWindow<QtProjectWizard>();
wizard->newProject();
}
void QtMainWindow::newProjectFromCDB(const FilePath& filePath)
{
QtProjectWizzard* wizzard = dynamic_cast<QtProjectWizzard*>(m_windowStack.getTopWindow());
if (!wizzard)
QtProjectWizard* wizard = dynamic_cast<QtProjectWizard*>(m_windowStack.getTopWindow());
if (!wizard)
{
wizzard = createWindow<QtProjectWizzard>();
wizard = createWindow<QtProjectWizard>();
}
wizzard->newProjectFromCDB(filePath);
wizard->newProjectFromCDB(filePath);
}
void QtMainWindow::openProject()
@@ -714,9 +714,9 @@ void QtMainWindow::editProject()
Project* currentProject = Application::getInstance()->getCurrentProject().get();
if (currentProject)
{
QtProjectWizzard* wizzard = createWindow<QtProjectWizzard>();
QtProjectWizard* wizard = createWindow<QtProjectWizard>();
wizzard->editProject(currentProject->getProjectSettingsFilePath());
wizard->editProject(currentProject->getProjectSettingsFilePath());
}
}
+10 -9
View File
@@ -7,13 +7,14 @@
#include "Application.h"
#include "DialogView.h"
#include "QtProjectWizzardContentPaths.h"
#include "QtProjectWizzardContentPreferences.h"
#include "QtProjectWizzardContentGroup.h"
#include "QtProjectWizardContentPathsFrameworkSearchGlobal.h"
#include "QtProjectWizardContentPathsHeaderSearchGlobal.h"
#include "QtProjectWizardContentPreferences.h"
#include "QtProjectWizardContentGroup.h"
#include "utilityApp.h"
QtPreferencesWindow::QtPreferencesWindow(QWidget* parent)
: QtProjectWizzardWindow(parent)
: QtProjectWizardWindow(parent)
{
// save old application settings so they can be compared later
ApplicationSettings* appSettings = ApplicationSettings::getInstance().get();
@@ -27,14 +28,14 @@ QtPreferencesWindow::QtPreferencesWindow(QWidget* parent)
m_appSettings.setScreenScaleFactor(appSettings->getScreenScaleFactor());
QtProjectWizzardContentGroup* summary = new QtProjectWizzardContentGroup(this);
QtProjectWizardContentGroup* summary = new QtProjectWizardContentGroup(this);
summary->setIsForm(true);
summary->addContent(new QtProjectWizzardContentPreferences(this));
summary->addContent(new QtProjectWizardContentPreferences(this));
summary->addContent(new QtProjectWizzardContentPathsHeaderSearchGlobal(this));
summary->addContent(new QtProjectWizardContentPathsHeaderSearchGlobal(this));
if (utility::getOsType() == OS_MAC)
{
summary->addContent(new QtProjectWizzardContentPathsFrameworkSearchGlobal(this));
summary->addContent(new QtProjectWizardContentPathsFrameworkSearchGlobal(this));
}
setPreferredSize(QSize(750, 500));
@@ -48,7 +49,7 @@ QtPreferencesWindow::~QtPreferencesWindow()
void QtPreferencesWindow::windowReady()
{
QtProjectWizzardWindow::windowReady();
QtProjectWizardWindow::windowReady();
updateTitle("PREFERENCES");
updateNextButton("Save");
+2 -2
View File
@@ -1,12 +1,12 @@
#ifndef QT_PREFERENCES_WINDOW_H
#define QT_PREFERENCES_WINDOW_H
#include "QtProjectWizzardWindow.h"
#include "QtProjectWizardWindow.h"
#include "ApplicationSettings.h"
class QtPreferencesWindow
: public QtProjectWizzardWindow
: public QtProjectWizardWindow
{
Q_OBJECT
@@ -1,31 +0,0 @@
#ifndef QT_PROJECT_WIZZARD_CONTENT_FLAGS_H
#define QT_PROJECT_WIZZARD_CONTENT_FLAGS_H
#include "QtProjectWizzardContent.h"
class QtStringListBox;
class SourceGroupSettingsCxx;
class QtProjectWizzardContentFlags
: public QtProjectWizzardContent
{
Q_OBJECT
public:
QtProjectWizzardContentFlags(std::shared_ptr<SourceGroupSettingsCxx> settings, QtProjectWizzardWindow* window, bool indicateAsAdditional = false);
// QtProjectWizzardContent implementation
virtual void populate(QGridLayout* layout, int& row) override;
virtual void load() override;
virtual void save() override;
virtual bool check() override;
private:
std::shared_ptr<SourceGroupSettingsCxx> m_settings;
const bool m_indicateAsAdditional;
QtStringListBox* m_list;
};
#endif // QT_PROJECT_WIZZARD_CONTENT_FLAGS_H
@@ -1,128 +0,0 @@
#include "QtProjectWizzardContentGroup.h"
QtProjectWizzardContentGroup::QtProjectWizzardContentGroup(
QtProjectWizzardWindow* window
)
: QtProjectWizzardContent(window)
, m_isForm(false)
{
}
void QtProjectWizzardContentGroup::addContent(QtProjectWizzardContent* content)
{
m_contents.push_back(content);
if (content)
{
content->setIsInForm(m_isForm);
}
}
void QtProjectWizzardContentGroup::addSpace()
{
m_contents.push_back(nullptr);
}
void QtProjectWizzardContentGroup::setIsForm(bool isForm)
{
m_isForm = isForm;
}
bool QtProjectWizzardContentGroup::hasContents() const
{
for (QtProjectWizzardContent* content : m_contents)
{
if (content)
{
return true;
}
}
return false;
}
void QtProjectWizzardContentGroup::populate(QGridLayout* layout, int& row)
{
if (m_isForm)
{
populateForm(layout, row);
return;
}
layout->setRowMinimumHeight(row++, 10);
for (QtProjectWizzardContent* content : m_contents)
{
if (content)
{
content->populate(layout, row);
}
else
{
layout->setRowMinimumHeight(row++, 20);
}
}
layout->setRowMinimumHeight(row, 10);
layout->setRowStretch(row, 1);
}
void QtProjectWizzardContentGroup::populateForm(QGridLayout* layout, int& row)
{
layout->setRowMinimumHeight(row++, 10);
for (QtProjectWizzardContent* content : m_contents)
{
if (content)
{
content->populate(layout, row);
}
else
{
layout->setRowMinimumHeight(row++, 15);
}
}
layout->setRowMinimumHeight(row, 10);
layout->setRowStretch(row, 1);
}
void QtProjectWizzardContentGroup::load()
{
for (QtProjectWizzardContent* content : m_contents)
{
if (content)
{
content->load();
}
}
}
void QtProjectWizzardContentGroup::save()
{
for (QtProjectWizzardContent* content : m_contents)
{
if (content)
{
content->save();
}
}
}
bool QtProjectWizzardContentGroup::check()
{
for (QtProjectWizzardContent* content : m_contents)
{
if (content && !content->check())
{
return false;
}
}
return true;
}
bool QtProjectWizzardContentGroup::isScrollAble() const
{
return true;
}
@@ -1,38 +0,0 @@
#ifndef QT_PROJECT_WIZZARD_CONTENT_GROUP_H
#define QT_PROJECT_WIZZARD_CONTENT_GROUP_H
#include "QtProjectWizzardContent.h"
class QCheckBox;
class QtProjectWizzardContentGroup
: public QtProjectWizzardContent
{
Q_OBJECT
public:
QtProjectWizzardContentGroup(QtProjectWizzardWindow* window);
void addContent(QtProjectWizzardContent* content);
void addSpace();
void setIsForm(bool isForm);
bool hasContents() const;
protected:
// QtProjectWizzardContent implementation
virtual void populate(QGridLayout* layout, int& row) override;
void populateForm(QGridLayout* layout, int& row);
virtual void load() override;
virtual void save() override;
virtual bool check() override;
virtual bool isScrollAble() const override;
private:
std::vector<QtProjectWizzardContent*> m_contents;
bool m_isForm;
};
#endif // QT_PROJECT_WIZZARD_CONTENT_GROUP_H
@@ -1,815 +0,0 @@
#include "QtProjectWizzardContentPath.h"
#include <QCheckBox>
#include <QComboBox>
#include <QLabel>
#include <QMessageBox>
#include <QVBoxLayout>
#include "Application.h"
#include "ApplicationSettings.h"
#include "FileManager.h"
#include "MessageStatus.h"
#include "QtLocationPicker.h"
#include "QtDialogView.h"
#include "QtProjectWizzardContentPaths.h"
#include "ResourcePaths.h"
#include "ScopedFunctor.h"
#include "SonargraphProject.h"
#include "SourceGroupCxxCdb.h"
#include "SourceGroupCxxCodeblocks.h"
#include "SourceGroupCxxSonargraph.h"
#include "SourceGroupJavaSonargraph.h"
#include "SourceGroupJavaGradle.h"
#include "SourceGroupJavaMaven.h"
#include "SourceGroupSettingsCxxCdb.h"
#include "SourceGroupSettingsCxxCodeblocks.h"
#include "SourceGroupSettingsCxxSonargraph.h"
#include "SourceGroupSettingsJavaMaven.h"
#include "SourceGroupSettingsJavaGradle.h"
#include "SourceGroupSettingsJavaSonargraph.h"
#include "SourceGroupSettingsPythonEmpty.h"
#include "SourceGroupSettingsWithSonargraphProjectPath.h"
#include "utility.h"
#include "utilityApp.h"
#include "utilityFile.h"
#include "utilityGradle.h"
#include "utilityMaven.h"
QtProjectWizzardContentPath::QtProjectWizzardContentPath(QtProjectWizzardWindow* window)
: QtProjectWizzardContent(window)
, m_makePathRelativeToProjectFileLocation(true)
, m_allowEmpty(false)
{
}
void QtProjectWizzardContentPath::populate(QGridLayout* layout, int& row)
{
QLabel* label = createFormLabel(m_titleString);
layout->addWidget(label, row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignTop);
if (m_helpString.size() > 0)
{
addHelpButton(m_titleString, m_helpString, layout, row);
}
m_picker = new QtLocationPicker(this);
m_picker->setPickDirectory(true);
m_picker->setPlaceholderText(m_placeholderString);
if (m_makePathRelativeToProjectFileLocation)
{
m_picker->setRelativeRootDirectory(getSourceGroupSettings()->getProjectDirectoryPath());
}
layout->addWidget(m_picker, row, QtProjectWizzardWindow::BACK_COL);
row++;
}
bool QtProjectWizzardContentPath::check()
{
QString error;
while (true)
{
if (m_picker->getText().isEmpty())
{
if (m_allowEmpty)
{
break;
}
else
{
error = "Please define a path at \"" + m_titleString + "\".";
break;
}
}
FilePath path = getSourceGroupSettings()->makePathExpandedAndAbsolute(FilePath(m_picker->getText().toStdWString()));
if (m_picker->pickDirectory())
{
break;
}
if (!path.exists())
{
error = "The entered path does not exist at \"" + m_titleString + "\".";
break;
}
if (m_fileEndings.find(path.extension()) == m_fileEndings.end())
{
error = "The entered path does have a correct file ending at \"" + m_titleString + "\".";
break;
}
break;
}
if (!error.isEmpty())
{
QMessageBox msgBox;
msgBox.setText(error);
msgBox.exec();
return false;
}
return true;
}
void QtProjectWizzardContentPath::setTitleString(const QString& title)
{
m_titleString = title;
}
void QtProjectWizzardContentPath::setHelpString(const QString& help)
{
m_helpString = help;
}
void QtProjectWizzardContentPath::setPlaceholderString(const QString& placeholder)
{
m_placeholderString = placeholder;
}
void QtProjectWizzardContentPath::setFileEndings(const std::set<std::wstring>& fileEndings)
{
m_fileEndings = fileEndings;
}
void QtProjectWizzardContentPath::setAllowEmpty(bool allowEmpty)
{
m_allowEmpty = allowEmpty;
}
QtProjectWizzardContentPathCDB::QtProjectWizzardContentPathCDB(
std::shared_ptr<SourceGroupSettingsCxxCdb> settings, QtProjectWizzardWindow* window
)
: QtProjectWizzardContentPath(window)
, m_settings(settings)
, m_filePaths([&]()
{
return utility::getAsRelativeIfShorter(
utility::toVector(SourceGroupCxxCdb(m_settings).getAllSourceFilePaths()),
m_settings->getProjectDirectoryPath()
);
}
)
{
setTitleString("Compilation Database (compile_commands.json)");
setHelpString(
"Select the compilation database file for the project. Sourcetrail will index your project based on the compile "
"commands. This file contains using all include paths and compiler flags of these compile commands. The project "
"will stay up to date with changes in the compilation database on every refresh.<br />"
"<br />"
"You can make use of environment variables with ${ENV_VAR}."
);
setFileEndings({ L".json" });
}
void QtProjectWizzardContentPathCDB::populate(QGridLayout* layout, int& row)
{
QtProjectWizzardContentPath::populate(layout, row);
m_picker->setPickDirectory(false);
m_picker->setFileFilter("JSON Compilation Database (*.json)");
connect(m_picker, &QtLocationPicker::locationPicked, this, &QtProjectWizzardContentPathCDB::pickedPath);
QLabel* description = new QLabel(
"Sourcetrail will use all include paths and compiler flags from the Compilation Database and stay up-to-date "
"with changes on refresh.", this);
description->setObjectName("description");
description->setWordWrap(true);
layout->addWidget(description, row, QtProjectWizzardWindow::BACK_COL);
row++;
QLabel* title = createFormLabel("Source Files to Index");
layout->addWidget(title, row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignTop);
layout->setRowStretch(row, 0);
m_fileCountLabel = new QLabel("");
m_fileCountLabel->setWordWrap(true);
layout->addWidget(m_fileCountLabel, row, QtProjectWizzardWindow::BACK_COL, Qt::AlignTop);
row++;
addFilesButton("show source files", layout, row);
row++;
}
void QtProjectWizzardContentPathCDB::load()
{
m_picker->setText(QString::fromStdWString(m_settings->getCompilationDatabasePath().wstr()));
m_filePaths.clear();
if (m_fileCountLabel)
{
m_fileCountLabel->setText("<b>" + QString::number(getFilePaths().size()) + "</b> source files were found in the compilation database.");
}
}
void QtProjectWizzardContentPathCDB::save()
{
m_settings->setCompilationDatabasePath(FilePath(m_picker->getText().toStdWString()));
}
std::vector<FilePath> QtProjectWizzardContentPathCDB::getFilePaths() const
{
return m_filePaths.getValue();
}
QString QtProjectWizzardContentPathCDB::getFileNamesTitle() const
{
return "Source Files";
}
QString QtProjectWizzardContentPathCDB::getFileNamesDescription() const
{
return " source files will be indexed.";
}
void QtProjectWizzardContentPathCDB::pickedPath()
{
m_window->saveContent();
const FilePath projectPath = m_settings->getProjectDirectoryPath();
std::set<FilePath> indexedHeaderPaths;
for (const FilePath& path : QtProjectWizzardContentIndexedHeaderPaths::getIndexedPathsDerivedFromCDB(m_settings))
{
if (projectPath.contains(path))
{
indexedHeaderPaths.insert(path.getRelativeTo(projectPath)); // the relative path is always shorter than the absolute path
}
}
m_settings->setIndexedHeaderPaths(utility::toVector(indexedHeaderPaths));
m_window->loadContent();
}
std::shared_ptr<SourceGroupSettings> QtProjectWizzardContentPathCDB::getSourceGroupSettings()
{
return m_settings;
}
QtProjectWizzardContentCodeblocksProjectPath::QtProjectWizzardContentCodeblocksProjectPath(
std::shared_ptr<SourceGroupSettingsCxxCodeblocks> settings, QtProjectWizzardWindow* window
)
: QtProjectWizzardContentPath(window)
, m_settings(settings)
, m_filePaths([&]()
{
return utility::getAsRelativeIfShorter(
utility::toVector(SourceGroupCxxCodeblocks(m_settings).getAllSourceFilePaths()),
m_settings->getProjectDirectoryPath()
);
}
)
{
setTitleString("Code::Blocks Project (.cbp)");
setHelpString(
"Select the Code::Blocks file for the project. Sourcetrail will index your project based on the settings "
"this file. It contains using all include paths and compiler flags required. The Sourcetrail project "
"will stay up to date with changes in the Code::Blocks project on every refresh.<br />"
"<br />"
"You can make use of environment variables with ${ENV_VAR}."
);
setFileEndings({ L".cbp" });
}
void QtProjectWizzardContentCodeblocksProjectPath::populate(QGridLayout* layout, int& row)
{
QtProjectWizzardContentPath::populate(layout, row);
m_picker->setPickDirectory(false);
m_picker->setFileFilter("Code::Blocks Project (*.cbp)");
connect(m_picker, &QtLocationPicker::locationPicked, this, &QtProjectWizzardContentCodeblocksProjectPath::pickedPath);
QLabel* description = new QLabel(
"Sourcetrail will use all settings from the Code::Blocks project and stay up-to-date with changes on refresh.", this);
description->setObjectName("description");
description->setWordWrap(true);
layout->addWidget(description, row, QtProjectWizzardWindow::BACK_COL);
row++;
QLabel* title = createFormLabel("Source Files to Index");
layout->addWidget(title, row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignTop);
layout->setRowStretch(row, 0);
m_fileCountLabel = new QLabel("");
m_fileCountLabel->setWordWrap(true);
layout->addWidget(m_fileCountLabel, row, QtProjectWizzardWindow::BACK_COL, Qt::AlignTop);
row++;
addFilesButton("show source files", layout, row);
row++;
}
void QtProjectWizzardContentCodeblocksProjectPath::load()
{
m_picker->setText(QString::fromStdWString(m_settings->getCodeblocksProjectPath().wstr()));
m_filePaths.clear();
if (m_fileCountLabel)
{
m_fileCountLabel->setText("<b>" + QString::number(getFilePaths().size()) + "</b> source files were found in the Code::Blocks project.");
}
}
void QtProjectWizzardContentCodeblocksProjectPath::save()
{
m_settings->setCodeblocksProjectPath(FilePath(m_picker->getText().toStdWString()));
}
std::vector<FilePath> QtProjectWizzardContentCodeblocksProjectPath::getFilePaths() const
{
return m_filePaths.getValue();
}
QString QtProjectWizzardContentCodeblocksProjectPath::getFileNamesTitle() const
{
return "Source Files";
}
QString QtProjectWizzardContentCodeblocksProjectPath::getFileNamesDescription() const
{
return " source files will be indexed.";
}
void QtProjectWizzardContentCodeblocksProjectPath::pickedPath()
{
m_window->saveContent();
const FilePath projectPath = m_settings->getProjectDirectoryPath();
std::set<FilePath> indexedHeaderPaths;
for (const FilePath& path : QtProjectWizzardContentIndexedHeaderPaths::getIndexedPathsDerivedFromCodeblocksProject(m_settings))
{
if (projectPath.contains(path))
{
indexedHeaderPaths.insert(path.getRelativeTo(projectPath)); // the relative path is always shorter than the absolute path
}
}
m_settings->setIndexedHeaderPaths(utility::toVector(indexedHeaderPaths));
m_window->loadContent();
}
std::shared_ptr<SourceGroupSettings> QtProjectWizzardContentCodeblocksProjectPath::getSourceGroupSettings()
{
return m_settings;
}
QtProjectWizzardContentSonargraphProjectPath::QtProjectWizzardContentSonargraphProjectPath(
std::shared_ptr<SourceGroupSettings> settings,
std::shared_ptr<SourceGroupSettingsCxxSonargraph> settingsCxxSonargraph,
std::shared_ptr<SourceGroupSettingsWithSonargraphProjectPath> settingsWithSonargraphProjectPath,
QtProjectWizzardWindow* window
)
: QtProjectWizzardContentPath(window)
, m_settings(settings)
, m_settingsCxxSonargraph(settingsCxxSonargraph)
, m_settingsWithSonargraphProjectPath(settingsWithSonargraphProjectPath)
, m_filePaths([&]()
{
std::set<FilePath> allSourceFilePaths;
if (std::shared_ptr<SourceGroupSettingsCxxSonargraph> settings = std::dynamic_pointer_cast<SourceGroupSettingsCxxSonargraph>(m_settings))
{
allSourceFilePaths = SourceGroupCxxSonargraph(settings).getAllSourceFilePaths();
}
else if (std::shared_ptr<SourceGroupSettingsJavaSonargraph> settings = std::dynamic_pointer_cast<SourceGroupSettingsJavaSonargraph>(m_settings))
{
allSourceFilePaths = SourceGroupJavaSonargraph(settings).getAllSourceFilePaths();
}
return utility::getAsRelativeIfShorter(
utility::toVector(allSourceFilePaths),
m_settings->getProjectDirectoryPath()
);
}
)
{
setTitleString("Sonargraph Project (system.sonargraph)");
setHelpString(
"Select the Sonargraph file for the project. Sourcetrail will index your project based on the settings "
"this file. It contains using all include paths and compiler flags required. The Sourcetrail project "
"will stay up to date with changes in the Sonargraph project on every refresh.<br />"
"<br />"
"You can make use of environment variables with ${ENV_VAR}."
);
setFileEndings({ L".sonargraph" });
}
void QtProjectWizzardContentSonargraphProjectPath::populate(QGridLayout* layout, int& row)
{
QtProjectWizzardContentPath::populate(layout, row);
m_picker->setPickDirectory(false);
m_picker->setFileFilter("Sonargraph Project (system.sonargraph)");
connect(m_picker, &QtLocationPicker::locationPicked, this, &QtProjectWizzardContentSonargraphProjectPath::pickedPath);
QLabel* description = new QLabel(
"Sourcetrail will use all settings from the Sonargraph project and stay up-to-date with changes on refresh.", this);
description->setObjectName("description");
description->setWordWrap(true);
layout->addWidget(description, row, QtProjectWizzardWindow::BACK_COL);
row++;
QLabel* title = createFormLabel("Source Files to Index");
layout->addWidget(title, row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignTop);
layout->setRowStretch(row, 0);
m_fileCountLabel = new QLabel("");
m_fileCountLabel->setWordWrap(true);
layout->addWidget(m_fileCountLabel, row, QtProjectWizzardWindow::BACK_COL, Qt::AlignTop);
row++;
addFilesButton("show source files", layout, row);
row++;
}
void QtProjectWizzardContentSonargraphProjectPath::load()
{
m_picker->setText(QString::fromStdWString(m_settingsWithSonargraphProjectPath->getSonargraphProjectPath().wstr()));
m_filePaths.clear();
if (m_fileCountLabel)
{
m_fileCountLabel->setText("<b>" + QString::number(getFilePaths().size()) + "</b> source files were found in the Sonargraph project.");
}
}
void QtProjectWizzardContentSonargraphProjectPath::save()
{
m_settingsWithSonargraphProjectPath->setSonargraphProjectPath(FilePath(m_picker->getText().toStdWString()));
}
bool QtProjectWizzardContentSonargraphProjectPath::check()
{
if (!QtProjectWizzardContentPath::check())
{
return false;
}
if (std::shared_ptr<Sonargraph::Project> sonargraphProject = Sonargraph::Project::load(
m_settingsWithSonargraphProjectPath->getSonargraphProjectPathExpandedAndAbsolute(), m_settings->getLanguage()
))
{
if (sonargraphProject->getLoadedModuleCount() == 0)
{
QMessageBox msgBox;
msgBox.setText(QString::fromStdString(
"The Sonargraph project file doesn't seem to contain any supported " +
languageTypeToString(m_settings->getLanguage()) + " modules. Please " +
"consider choosing another project file or removing this sourcegroup."
));
msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
msgBox.setDefaultButton(QMessageBox::Ok);
return msgBox.exec() == QMessageBox::Ok;
}
}
return true;
}
std::vector<FilePath> QtProjectWizzardContentSonargraphProjectPath::getFilePaths() const
{
return m_filePaths.getValue();
}
QString QtProjectWizzardContentSonargraphProjectPath::getFileNamesTitle() const
{
return "Source Files";
}
QString QtProjectWizzardContentSonargraphProjectPath::getFileNamesDescription() const
{
return " source files will be indexed.";
}
void QtProjectWizzardContentSonargraphProjectPath::pickedPath()
{
m_window->saveContent();
if (m_settingsCxxSonargraph)
{
const FilePath projectPath = m_settings->getProjectDirectoryPath();
std::set<FilePath> indexedHeaderPaths;
for (const FilePath& path : QtProjectWizzardContentIndexedHeaderPaths::getIndexedPathsDerivedFromSonargraphProject(m_settingsCxxSonargraph))
{
if (projectPath.contains(path))
{
indexedHeaderPaths.insert(path.getRelativeTo(projectPath)); // the relative path is always shorter than the absolute path
}
}
m_settingsCxxSonargraph->setIndexedHeaderPaths(utility::toVector(indexedHeaderPaths));
}
m_window->loadContent();
}
std::shared_ptr<SourceGroupSettings> QtProjectWizzardContentSonargraphProjectPath::getSourceGroupSettings()
{
return m_settings;
}
QtProjectWizzardContentPathSourceMaven::QtProjectWizzardContentPathSourceMaven(
std::shared_ptr<SourceGroupSettingsJavaMaven> settings, QtProjectWizzardWindow* window
)
: QtProjectWizzardContentPath(window)
, m_settings(settings)
{
setTitleString("Maven Project File (pom.xml)");
setHelpString(
"Enter the path to the main pom.xml file of your Maven project.<br />"
"<br />"
"You can make use of environment variables with ${ENV_VAR}."
);
setFileEndings({ L".xml" });
}
void QtProjectWizzardContentPathSourceMaven::populate(QGridLayout* layout, int& row)
{
QtProjectWizzardContentPath::populate(layout, row);
m_picker->setPickDirectory(false);
m_picker->setFileFilter("POM File (pom.xml)");
QPushButton* filesButton = addFilesButton("show source files", nullptr, row);
m_shouldIndexTests = new QCheckBox("Should Index Tests");
QHBoxLayout* hlayout = new QHBoxLayout();
hlayout->setContentsMargins(0, 0, 0, 0);
hlayout->addWidget(m_shouldIndexTests);
hlayout->addStretch();
hlayout->addWidget(filesButton);
layout->addLayout(hlayout, row, QtProjectWizzardWindow::BACK_COL);
row++;
}
void QtProjectWizzardContentPathSourceMaven::load()
{
m_picker->setText(QString::fromStdWString(m_settings->getMavenProjectFilePath().wstr()));
m_shouldIndexTests->setChecked(m_settings->getShouldIndexMavenTests());
}
void QtProjectWizzardContentPathSourceMaven::save()
{
m_settings->setMavenProjectFilePath(FilePath(m_picker->getText().toStdWString()));
m_settings->setShouldIndexMavenTests(m_shouldIndexTests->isChecked());
}
std::vector<FilePath> QtProjectWizzardContentPathSourceMaven::getFilePaths() const
{
{
const FilePath mavenPath = ApplicationSettings::getInstance()->getMavenPath();
const FilePath mavenProjectRoot = m_settings->getMavenProjectFilePathExpandedAndAbsolute().getParentDirectory();
if (!mavenProjectRoot.exists())
{
LOG_INFO("Could not find any source file paths because Maven project path does not exist.");
return std::vector<FilePath>();
}
QtDialogView* dialogView = dynamic_cast<QtDialogView*>(
Application::getInstance()->getDialogView(DialogView::UseCase::PROJECT_SETUP).get());
ScopedFunctor scopedFunctor([&dialogView]() {
dialogView->hideUnknownProgressDialog();
});
dialogView->setParentWindow(m_window);
dialogView->showUnknownProgressDialog(L"Preparing Project", L"Maven\nGenerating Source Files");
const std::wstring errorMessage = utility::mavenGenerateSources(mavenPath, mavenProjectRoot);
if (!errorMessage.empty())
{
MessageStatus(errorMessage, true, false).dispatch();
Application::getInstance()->handleDialog(errorMessage);
return std::vector<FilePath>();
}
}
return utility::getAsRelativeIfShorter(
utility::toVector(SourceGroupJavaMaven(m_settings).getAllSourceFilePaths()),
m_settings->getProjectDirectoryPath()
);
}
std::shared_ptr<SourceGroupSettings> QtProjectWizzardContentPathSourceMaven::getSourceGroupSettings()
{
return m_settings;
}
QtProjectWizzardContentPathDependenciesMaven::QtProjectWizzardContentPathDependenciesMaven(
std::shared_ptr<SourceGroupSettingsJavaMaven> settings, QtProjectWizzardWindow* window
)
: QtProjectWizzardContentPath(window)
, m_settings(settings)
{
setTitleString("Intermediate Dependencies Directory");
setHelpString(
"This directory is used to temporarily download and store the dependencies (e.g. .jar files) of the Maven project while it is indexed.<br />"
"<br />"
"You can make use of environment variables with ${ENV_VAR}."
);
}
void QtProjectWizzardContentPathDependenciesMaven::load()
{
m_picker->setText(QString::fromStdWString(m_settings->getMavenDependenciesDirectory().wstr()));
}
void QtProjectWizzardContentPathDependenciesMaven::save()
{
m_settings->setMavenDependenciesDirectory(FilePath(m_picker->getText().toStdWString()));
}
std::shared_ptr<SourceGroupSettings> QtProjectWizzardContentPathDependenciesMaven::getSourceGroupSettings()
{
return m_settings;
}
QtProjectWizzardContentPathSourceGradle::QtProjectWizzardContentPathSourceGradle(
std::shared_ptr<SourceGroupSettingsJavaGradle> settings, QtProjectWizzardWindow* window
)
: QtProjectWizzardContentPath(window)
, m_settings(settings)
{
setTitleString("Gradle Project File (build.gradle)");
setHelpString(
"Enter the path to the main build.gradle file of your Gradle project.<br />"
"<br />"
"You can make use of environment variables with ${ENV_VAR}."
);
setFileEndings({ L".gradle" });
}
void QtProjectWizzardContentPathSourceGradle::populate(QGridLayout* layout, int& row)
{
QtProjectWizzardContentPath::populate(layout, row);
m_picker->setPickDirectory(false);
m_picker->setFileFilter("Gradle Build File (build.gradle)");
QPushButton* filesButton = addFilesButton("show source files", nullptr, row);
m_shouldIndexTests = new QCheckBox("Should Index Tests");
QHBoxLayout* hlayout = new QHBoxLayout();
hlayout->setContentsMargins(0, 0, 0, 0);
hlayout->addWidget(m_shouldIndexTests);
hlayout->addStretch();
hlayout->addWidget(filesButton);
layout->addLayout(hlayout, row, QtProjectWizzardWindow::BACK_COL);
row++;
}
void QtProjectWizzardContentPathSourceGradle::load()
{
m_picker->setText(QString::fromStdWString(m_settings->getGradleProjectFilePath().wstr()));
m_shouldIndexTests->setChecked(m_settings->getShouldIndexGradleTests());
}
void QtProjectWizzardContentPathSourceGradle::save()
{
m_settings->setGradleProjectFilePath(FilePath(m_picker->getText().toStdWString()));
m_settings->setShouldIndexGradleTests(m_shouldIndexTests->isChecked());
}
std::vector<FilePath> QtProjectWizzardContentPathSourceGradle::getFilePaths() const
{
QtDialogView* dialogView = dynamic_cast<QtDialogView*>(
Application::getInstance()->getDialogView(DialogView::UseCase::PROJECT_SETUP).get());
dialogView->setParentWindow(m_window);
return utility::getAsRelativeIfShorter(
utility::toVector(SourceGroupJavaGradle(m_settings).getAllSourceFilePaths()),
m_settings->getProjectDirectoryPath()
);
}
std::shared_ptr<SourceGroupSettings> QtProjectWizzardContentPathSourceGradle::getSourceGroupSettings()
{
return m_settings;
}
QtProjectWizzardContentPathDependenciesGradle::QtProjectWizzardContentPathDependenciesGradle(
std::shared_ptr<SourceGroupSettingsJavaGradle> settings, QtProjectWizzardWindow* window
)
: QtProjectWizzardContentPath(window)
, m_settings(settings)
{
setTitleString("Intermediate Dependencies Directory");
setHelpString(
"This directory is used to temporarily download and store the dependencies (e.g. .jar files) of the Gradle project while it is indexed.<br />"
"<br />"
"You can make use of environment variables with ${ENV_VAR}."
);
}
void QtProjectWizzardContentPathDependenciesGradle::load()
{
m_picker->setText(QString::fromStdWString(m_settings->getGradleDependenciesDirectory().wstr()));
}
void QtProjectWizzardContentPathDependenciesGradle::save()
{
m_settings->setGradleDependenciesDirectory(FilePath(m_picker->getText().toStdWString()));
}
std::shared_ptr<SourceGroupSettings> QtProjectWizzardContentPathDependenciesGradle::getSourceGroupSettings()
{
return m_settings;
}
QtProjectWizzardContentPathPythonEnvironment::QtProjectWizzardContentPathPythonEnvironment(
std::shared_ptr<SourceGroupSettingsPythonEmpty> settings, QtProjectWizzardWindow* window
)
: QtProjectWizzardContentPath(window)
, m_settings(settings)
{
setTitleString("Python Environment");
setHelpString(
"Here you can specify the path to the directory or to the executable of the (virtual) Python environment that should be used to resolve "
"dependencies within the indexed source code. <br />"
"<br />"
"If you would run:<br />"
"<br />"
"$ cd C:\\dev\\python\\envs<br />"
"$ virtualenv py37<br />"
"<br />"
"you would set it to \"C:\\dev\\python\\envs\\py37\" or \"C:\\dev\\python\\envs\\py37\\Scripts\\python.exe\". <br />"
"Leave blank to use the default Python environment. You can make use of environment variables with ${ENV_VAR}."
);
setPlaceholderString("Use Default");
setAllowEmpty(true);
}
void QtProjectWizzardContentPathPythonEnvironment::populate(QGridLayout* layout, int& row)
{
QtProjectWizzardContentPath::populate(layout, row);
connect(
m_picker, &QtLocationPicker::textChanged,
this, &QtProjectWizzardContentPathPythonEnvironment::onTextChanged
);
m_resultLabel = new QLabel();
m_resultLabel->setWordWrap(true);
layout->addWidget(m_resultLabel, row, QtProjectWizzardWindow::BACK_COL);
row++;
}
void QtProjectWizzardContentPathPythonEnvironment::load()
{
m_picker->setText(QString::fromStdWString(m_settings->getEnvironmentPath().wstr()));
}
void QtProjectWizzardContentPathPythonEnvironment::save()
{
m_settings->setEnvironmentPath(FilePath(m_picker->getText().toStdWString()));
}
void QtProjectWizzardContentPathPythonEnvironment::onTextChanged(const QString& text)
{
if (text.isEmpty())
{
m_resultLabel->clear();
}
else
{
m_resultLabel->setText("Checking validity of Python environment...");
std::thread([=]() {
std::pair<int, std::string> out = utility::executeProcess(
"\"" + ResourcePaths::getPythonPath().str() + "SourcetrailPythonIndexer\" check-environment " +
"--environment-path \"" + m_settings->makePathExpandedAndAbsolute(FilePath(text.toStdWString())).str() + "\"",
FilePath(),
5000
);
m_onQtThread(
[=]()
{
if (out.first == 0)
{
m_resultLabel->setText(QString::fromStdString(out.second));
}
else
{
m_resultLabel->setText("An error occurred while checking environment path. Unable to check validity.");
}
}
);
}).detach();
}
}
std::shared_ptr<SourceGroupSettings> QtProjectWizzardContentPathPythonEnvironment::getSourceGroupSettings()
{
return m_settings;
}
@@ -1,262 +0,0 @@
#ifndef QT_PROJECT_WIZZARD_CONTENT_PATH_H
#define QT_PROJECT_WIZZARD_CONTENT_PATH_H
#include <set>
#include "QtProjectWizzardContent.h"
#include "QtThreadedFunctor.h"
#include "SingleValueCache.h"
class QCheckBox;
class QComboBox;
class QPushButton;
class QtLocationPicker;
class SourceGroupSettings;
class SourceGroupSettingsCxxCdb;
class SourceGroupSettingsCxxCodeblocks;
class SourceGroupSettingsCxxSonargraph;
class SourceGroupSettingsJavaGradle;
class SourceGroupSettingsPythonEmpty;
class SourceGroupSettingsJavaMaven;
class SourceGroupSettingsWithSonargraphProjectPath;
class QtProjectWizzardContentPath
: public QtProjectWizzardContent
{
Q_OBJECT
public:
QtProjectWizzardContentPath(QtProjectWizzardWindow* window);
// QtSettingsWindow implementation
virtual void populate(QGridLayout* layout, int& row) override;
virtual bool check() override;
protected:
void setTitleString(const QString& title);
void setHelpString(const QString& help);
void setPlaceholderString(const QString& placeholder);
void setFileEndings(const std::set<std::wstring>& fileEndings);
void setAllowEmpty(bool allowEmpty);
QtLocationPicker* m_picker;
bool m_makePathRelativeToProjectFileLocation;
private:
virtual std::shared_ptr<SourceGroupSettings> getSourceGroupSettings() = 0;
QString m_titleString;
QString m_helpString;
QString m_placeholderString;
std::set<std::wstring> m_fileEndings;
bool m_allowEmpty;
};
class QtProjectWizzardContentPathCDB
: public QtProjectWizzardContentPath
{
Q_OBJECT
public:
QtProjectWizzardContentPathCDB(std::shared_ptr<SourceGroupSettingsCxxCdb> settings, QtProjectWizzardWindow* window);
// QtProjectWizzardContent implementation
void populate(QGridLayout* layout, int& row) override;
void load() override;
void save() override;
std::vector<FilePath> getFilePaths() const override;
QString getFileNamesTitle() const override;
QString getFileNamesDescription() const override;
private slots:
void pickedPath();
private:
std::shared_ptr<SourceGroupSettings> getSourceGroupSettings() override;
std::shared_ptr<SourceGroupSettingsCxxCdb> m_settings;
QLabel* m_fileCountLabel;
mutable SingleValueCache<std::vector<FilePath>> m_filePaths;
};
class QtProjectWizzardContentCodeblocksProjectPath
: public QtProjectWizzardContentPath
{
Q_OBJECT
public:
QtProjectWizzardContentCodeblocksProjectPath(
std::shared_ptr<SourceGroupSettingsCxxCodeblocks> settings,
QtProjectWizzardWindow* window);
// QtProjectWizzardContent implementation
void populate(QGridLayout* layout, int& row) override;
void load() override;
void save() override;
std::vector<FilePath> getFilePaths() const override;
QString getFileNamesTitle() const override;
QString getFileNamesDescription() const override;
private slots:
void pickedPath();
private:
std::shared_ptr<SourceGroupSettings> getSourceGroupSettings() override;
std::shared_ptr<SourceGroupSettingsCxxCodeblocks> m_settings;
QLabel* m_fileCountLabel;
mutable SingleValueCache<std::vector<FilePath>> m_filePaths;
};
class QtProjectWizzardContentSonargraphProjectPath
: public QtProjectWizzardContentPath
{
Q_OBJECT
public:
QtProjectWizzardContentSonargraphProjectPath(
std::shared_ptr<SourceGroupSettings> settings,
std::shared_ptr<SourceGroupSettingsCxxSonargraph> settingsCxxSonargraph,
std::shared_ptr<SourceGroupSettingsWithSonargraphProjectPath> settingsWithSonargraphProjectPath,
QtProjectWizzardWindow* window);
// QtProjectWizzardContent implementation
void populate(QGridLayout* layout, int& row) override;
void load() override;
void save() override;
bool check() override;
std::vector<FilePath> getFilePaths() const override;
QString getFileNamesTitle() const override;
QString getFileNamesDescription() const override;
private slots:
void pickedPath();
private:
std::shared_ptr<SourceGroupSettings> getSourceGroupSettings() override;
std::shared_ptr<SourceGroupSettings> m_settings;
std::shared_ptr<SourceGroupSettingsCxxSonargraph> m_settingsCxxSonargraph;
std::shared_ptr<SourceGroupSettingsWithSonargraphProjectPath> m_settingsWithSonargraphProjectPath;
QLabel* m_fileCountLabel;
mutable SingleValueCache<std::vector<FilePath>> m_filePaths;
};
class QtProjectWizzardContentPathSourceMaven
: public QtProjectWizzardContentPath
{
Q_OBJECT
public:
QtProjectWizzardContentPathSourceMaven(std::shared_ptr<SourceGroupSettingsJavaMaven> settings, QtProjectWizzardWindow* window);
// QtProjectWizzardContent implementation
void populate(QGridLayout* layout, int& row) override;
void load() override;
void save() override;
std::vector<FilePath> getFilePaths() const override;
private:
std::shared_ptr<SourceGroupSettings> getSourceGroupSettings() override;
std::shared_ptr<SourceGroupSettingsJavaMaven> m_settings;
QCheckBox* m_shouldIndexTests;
};
class QtProjectWizzardContentPathDependenciesMaven
: public QtProjectWizzardContentPath
{
Q_OBJECT
public:
QtProjectWizzardContentPathDependenciesMaven(std::shared_ptr<SourceGroupSettingsJavaMaven> settings, QtProjectWizzardWindow* window);
// QtProjectWizzardContent implementation
void load() override;
void save() override;
private:
std::shared_ptr<SourceGroupSettings> getSourceGroupSettings() override;
std::shared_ptr<SourceGroupSettingsJavaMaven> m_settings;
};
class QtProjectWizzardContentPathSourceGradle
: public QtProjectWizzardContentPath
{
Q_OBJECT
public:
QtProjectWizzardContentPathSourceGradle(std::shared_ptr<SourceGroupSettingsJavaGradle> settings, QtProjectWizzardWindow* window);
// QtProjectWizzardContent implementation
void populate(QGridLayout* layout, int& row) override;
void load() override;
void save() override;
std::vector<FilePath> getFilePaths() const override;
private:
std::shared_ptr<SourceGroupSettings> getSourceGroupSettings() override;
std::shared_ptr<SourceGroupSettingsJavaGradle> m_settings;
QCheckBox* m_shouldIndexTests;
};
class QtProjectWizzardContentPathDependenciesGradle
: public QtProjectWizzardContentPath
{
Q_OBJECT
public:
QtProjectWizzardContentPathDependenciesGradle(std::shared_ptr<SourceGroupSettingsJavaGradle> settings, QtProjectWizzardWindow* window);
// QtProjectWizzardContent implementation
void load() override;
void save() override;
private:
std::shared_ptr<SourceGroupSettings> getSourceGroupSettings() override;
std::shared_ptr<SourceGroupSettingsJavaGradle> m_settings;
};
class QtProjectWizzardContentPathPythonEnvironment
: public QtProjectWizzardContentPath
{
Q_OBJECT
public:
QtProjectWizzardContentPathPythonEnvironment(std::shared_ptr<SourceGroupSettingsPythonEmpty> settings, QtProjectWizzardWindow* window);
// QtProjectWizzardContent implementation
void populate(QGridLayout* layout, int& row) override;
void load() override;
void save() override;
private:
void onTextChanged(const QString& text);
std::shared_ptr<SourceGroupSettings> getSourceGroupSettings() override;
std::shared_ptr<SourceGroupSettingsPythonEmpty> m_settings;
QtThreadedLambdaFunctor m_onQtThread;
QLabel* m_resultLabel;
};
#endif // QT_PROJECT_WIZZARD_CONTENT_PATH_H
File diff suppressed because it is too large Load Diff
@@ -1,225 +0,0 @@
#ifndef QT_PROJECT_WIZZARD_CONTENT_PATHS_H
#define QT_PROJECT_WIZZARD_CONTENT_PATHS_H
#include <set>
#include "QtPathListBox.h"
#include "QtProjectWizzardContent.h"
#include "CombinedPathDetector.h"
class IncludeDirective;
class QCheckBox;
class QComboBox;
class QPushButton;
class QtPathListDialog;
class SourceGroupSettings;
class SourceGroupSettingsCxxCdb;
class SourceGroupSettingsCxxCodeblocks;
class SourceGroupSettingsCxxSonargraph;
class QtProjectWizzardContentPaths
: public QtProjectWizzardContent
{
Q_OBJECT
signals:
void showSourceFiles();
public:
QtProjectWizzardContentPaths(
std::shared_ptr<SourceGroupSettings> settings,
QtProjectWizzardWindow* window,
QtPathListBox::SelectionPolicyType selectionPolicy,
bool checkMissingPaths = true);
// QtSettingsWindow implementation
virtual void populate(QGridLayout* layout, int& row) override;
virtual bool check() override;
protected:
void setTitleString(const QString& title);
void setHelpString(const QString& help);
void addDetection(QGridLayout* layout, int row);
virtual void detectedPaths(const std::vector<FilePath>& paths);
std::shared_ptr<SourceGroupSettings> m_settings;
QtPathListBox* m_list;
QString m_showFilesString;
std::shared_ptr<CombinedPathDetector> m_pathDetector;
bool m_makePathsRelativeToProjectFileLocation;
private slots:
void detectionClicked();
private:
const QtPathListBox::SelectionPolicyType m_selectionPolicy;
const bool m_checkMissingPaths;
QString m_titleString;
QString m_helpString;
QComboBox* m_detectorBox;
};
class QtProjectWizzardContentPathsSource
: public QtProjectWizzardContentPaths
{
Q_OBJECT
public:
QtProjectWizzardContentPathsSource(std::shared_ptr<SourceGroupSettings> settings, QtProjectWizzardWindow* window);
// QtProjectWizzardContent implementation
virtual void load() override;
virtual void save() override;
virtual std::vector<FilePath> getFilePaths() const override;
virtual QString getFileNamesTitle() const override;
virtual QString getFileNamesDescription() const override;
};
class QtProjectWizzardContentIndexedHeaderPaths
: public QtProjectWizzardContentPaths
{
Q_OBJECT
public:
static std::vector<FilePath> getIndexedPathsDerivedFromSonargraphProject(std::shared_ptr<const SourceGroupSettingsCxxSonargraph> settings);
static std::vector<FilePath> getIndexedPathsDerivedFromCodeblocksProject(std::shared_ptr<const SourceGroupSettingsCxxCodeblocks> settings);
static std::vector<FilePath> getIndexedPathsDerivedFromCDB(std::shared_ptr<const SourceGroupSettingsCxxCdb> settings);
QtProjectWizzardContentIndexedHeaderPaths(
std::shared_ptr<SourceGroupSettings> settings, QtProjectWizzardWindow* window, std::string projectKindName);
virtual void populate(QGridLayout* layout, int& row) override;
// QtProjectWizzardContent implementation
virtual void load() override;
virtual void save() override;
virtual bool check() override;
private slots:
void buttonClicked();
void savedFilesDialog();
private:
const std::string m_projectKindName;
};
class QtProjectWizzardContentPathsExclude
: public QtProjectWizzardContentPaths
{
Q_OBJECT
public:
QtProjectWizzardContentPathsExclude(std::shared_ptr<SourceGroupSettings> settings, QtProjectWizzardWindow* window);
virtual void load() override;
virtual void save() override;
};
class QtProjectWizzardContentPathsHeaderSearch
: public QtProjectWizzardContentPaths
{
Q_OBJECT
public:
QtProjectWizzardContentPathsHeaderSearch(
std::shared_ptr<SourceGroupSettings> settings, QtProjectWizzardWindow* window, bool indicateAsAdditional = false);
// QtProjectWizzardContent implementation
virtual void populate(QGridLayout* layout, int& row) override;
virtual void load() override;
virtual void save() override;
virtual bool isScrollAble() const override;
private slots:
void detectIncludesButtonClicked();
void validateIncludesButtonClicked();
void finishedSelectDetectIncludesRootPathsDialog();
void finishedAcceptDetectedIncludePathsDialog();
void closedPathsDialog();
private:
void showDetectedIncludesResult(const std::set<FilePath>& detectedHeaderSearchPaths);
void showValidationResult(const std::vector<IncludeDirective>& unresolvedIncludes);
QtThreadedFunctor<std::set<FilePath>> m_showDetectedIncludesResultFunctor;
QtThreadedFunctor<std::vector<IncludeDirective>> m_showValidationResultFunctor;
std::shared_ptr<QtPathListDialog> m_pathsDialog;
const bool m_indicateAsAdditional;
};
class QtProjectWizzardContentPathsHeaderSearchGlobal
: public QtProjectWizzardContentPaths
{
Q_OBJECT
public:
QtProjectWizzardContentPathsHeaderSearchGlobal(QtProjectWizzardWindow* window);
// QtProjectWizzardContent implementation
virtual void load() override;
virtual void save() override;
virtual bool check() override;
protected:
virtual void detectedPaths(const std::vector<FilePath>& paths) override;
private:
void setPaths(const std::vector<FilePath>& paths);
};
class QtProjectWizzardContentPathsFrameworkSearch
: public QtProjectWizzardContentPaths
{
Q_OBJECT
public:
QtProjectWizzardContentPathsFrameworkSearch(
std::shared_ptr<SourceGroupSettings> settings, QtProjectWizzardWindow* window, bool indicateAsAdditional = false);
// QtProjectWizzardContent implementation
virtual void load() override;
virtual void save() override;
virtual bool isScrollAble() const override;
};
class QtProjectWizzardContentPathsFrameworkSearchGlobal
: public QtProjectWizzardContentPaths
{
Q_OBJECT
public:
QtProjectWizzardContentPathsFrameworkSearchGlobal(QtProjectWizzardWindow* window);
// QtProjectWizzardContent implementation
virtual void load() override;
virtual void save() override;
};
class QtProjectWizzardContentPathsClassJava
: public QtProjectWizzardContentPaths
{
Q_OBJECT
public:
QtProjectWizzardContentPathsClassJava(std::shared_ptr<SourceGroupSettings> settings, QtProjectWizzardWindow* window);
// QtProjectWizzardContent implementation
virtual void populate(QGridLayout* layout, int& row) override;
virtual void load() override;
virtual void save() override;
private:
QCheckBox* m_useJreSystemLibraryCheckBox;
};
#endif // QT_PROJECT_WIZZARD_CONTENT_PATHS_H
@@ -1,18 +0,0 @@
#ifndef QT_PROJECT_WIZZARD_CONTENT_SOURCE_GROUP_INFO_TEXT_H
#define QT_PROJECT_WIZZARD_CONTENT_SOURCE_GROUP_INFO_TEXT_H
#include "QtProjectWizzardContent.h"
class QtProjectWizzardContentSourceGroupInfoText
: public QtProjectWizzardContent
{
Q_OBJECT
public:
QtProjectWizzardContentSourceGroupInfoText(QtProjectWizzardWindow* window);
// QtProjectWizzardContent implementation
virtual void populate(QGridLayout* layout, int& row) override;
};
#endif // QT_PROJECT_WIZZARD_CONTENT_SOURCE_GROUP_INFO_TEXT_H
@@ -1,20 +0,0 @@
#ifndef QT_PROJECT_WIZZARD_CONTENT_VS_H
#define QT_PROJECT_WIZZARD_CONTENT_VS_H
#include "QtProjectWizzardContent.h"
class QtProjectWizzardContentVS
: public QtProjectWizzardContent
{
Q_OBJECT
public:
QtProjectWizzardContentVS(QtProjectWizzardWindow* window);
virtual void populate(QGridLayout* layout, int& row) override;
private slots:
void handleVSCDBClicked();
};
#endif // QT_PROJECT_WIZZARD_CONTENT_VS_H
@@ -1,163 +0,0 @@
#ifndef QT_SOURCE_GROUP_WIZZARD_PAGE_H
#define QT_SOURCE_GROUP_WIZZARD_PAGE_H
#include <functional>
#include <memory>
#include <vector>
class QtProjectWizzardWindow;
enum WizzardContentContextType
{
WIZZARD_CONTENT_CONTEXT_SETUP = 1,
WIZZARD_CONTENT_CONTEXT_SUMMARY = 2,
WIZZARD_CONTENT_CONTEXT_ALL = 3
};
template <typename SettingsType>
class QtSourceGroupWizzardPage
{
public:
typedef std::function<QtProjectWizzardContent* (std::shared_ptr<SettingsType> settings, QtProjectWizzardWindow* window)> ContentCreator;
QtSourceGroupWizzardPage(const std::string& title, int preferredWidth = 750, int preferredHeight = 600);
void addContentCreator(
WizzardContentContextType contextType,
ContentCreator contentCreator
);
template <typename ContentType>
void addContentCreatorSimple(WizzardContentContextType contextType);
template <typename ContentType>
void addContentCreatorWithSettings(WizzardContentContextType contextType);
template <typename ContentType, typename ... ParamTypes>
void addContentCreatorWithSettings(WizzardContentContextType contextType, ParamTypes ... params);
bool hasContentForContext(WizzardContentContextType contextType) const;
std::string getTitle() const;
int getPreferredWidth() const;
int getPreferredHeight() const;
QtProjectWizzardContentGroup* createContentGroup(WizzardContentContextType contextType, std::shared_ptr<SettingsType> settings, QtProjectWizzardWindow* window) const;
private:
const std::string m_title;
const int m_preferredWidth;
const int m_preferredHeight;
std::vector<std::pair<WizzardContentContextType, ContentCreator>> m_contentCreators;
};
template <typename SettingsType>
QtSourceGroupWizzardPage<SettingsType>::QtSourceGroupWizzardPage(const std::string& title, int preferredWidth, int preferredHeight)
: m_title(title)
, m_preferredWidth(preferredWidth)
, m_preferredHeight(preferredHeight)
{
}
template <typename SettingsType>
void QtSourceGroupWizzardPage<SettingsType>::addContentCreator(
WizzardContentContextType contextType,
ContentCreator contentCreator
)
{
m_contentCreators.push_back(std::make_pair(contextType, contentCreator));
}
template <typename SettingsType>
template <typename ContentType>
void QtSourceGroupWizzardPage<SettingsType>::addContentCreatorSimple(WizzardContentContextType contextType)
{
addContentCreator(
contextType,
[](std::shared_ptr<SettingsType> settings, QtProjectWizzardWindow* window)
{
return new ContentType(window);
}
);
}
template <typename SettingsType>
template <typename ContentType>
void QtSourceGroupWizzardPage<SettingsType>::addContentCreatorWithSettings(WizzardContentContextType contextType)
{
addContentCreator(
contextType,
[](std::shared_ptr<SettingsType> settings, QtProjectWizzardWindow* window)
{
return new ContentType(settings, window);
}
);
}
template <typename SettingsType>
template <typename ContentType, typename ... ParamTypes>
void QtSourceGroupWizzardPage<SettingsType>::addContentCreatorWithSettings(WizzardContentContextType contextType, ParamTypes ... params)
{
addContentCreator(
contextType,
[=](std::shared_ptr<SettingsType> settings, QtProjectWizzardWindow* window)
{
return new ContentType(settings, window, params...);
}
);
}
template <typename SettingsType>
std::string QtSourceGroupWizzardPage<SettingsType>::getTitle() const
{
return m_title;
}
template <typename SettingsType>
int QtSourceGroupWizzardPage<SettingsType>::getPreferredWidth() const
{
return m_preferredWidth;
}
template <typename SettingsType>
int QtSourceGroupWizzardPage<SettingsType>::getPreferredHeight() const
{
return m_preferredHeight;
}
template <typename SettingsType>
bool QtSourceGroupWizzardPage<SettingsType>::hasContentForContext(WizzardContentContextType contextType) const
{
for (const std::pair<WizzardContentContextType, ContentCreator>& contentCreator : m_contentCreators)
{
if (contentCreator.first & contextType)
{
return true;
}
}
return false;
}
template <typename SettingsType>
QtProjectWizzardContentGroup* QtSourceGroupWizzardPage<SettingsType>::createContentGroup(WizzardContentContextType contextType, std::shared_ptr<SettingsType> settings, QtProjectWizzardWindow* window) const
{
QtProjectWizzardContentGroup* contentGroup = new QtProjectWizzardContentGroup(window);
bool firstContentAdded = false;
for (const std::pair<WizzardContentContextType, ContentCreator>& contentCreator : m_contentCreators)
{
if (contentCreator.first & contextType)
{
if (firstContentAdded)
{
contentGroup->addSpace();
}
contentGroup->addContent(contentCreator.second(settings, window));
firstContentAdded = true;
}
}
return contentGroup;
}
#endif // QT_SOURCE_GROUP_WIZZARD_PAGE_H