Removed multiple dialog steps in Source Group setup (issue #723) (#913)

* removed QtSourceGroupWizard, QtSourceGroupWizardPage and context types
* removed isInForm flag of QtProjectWizardContent
* added check of empty source paths
* set project window as parent for message boxes, so they don't get hidden behind main window
* fixed issues when removing and duplicating source groups
* updated project setup tests to no steps
This commit is contained in:
Eberhard Gräther
2020-02-10 20:00:36 +01:00
committed by GitHub
parent 7f9f098c70
commit 260f1227bc
51 changed files with 485 additions and 1010 deletions
@@ -1,8 +1,10 @@
QLabel, QCheckBox, QRadioButton {
#window QLabel,
#window QCheckBox,
#window QRadioButton {
color: white;
}
QRadioButton::indicator {
#window QRadioButton::indicator {
background: white;
border-radius: 6px;
border: 3px solid white;
@@ -11,7 +13,7 @@ QRadioButton::indicator {
margin-right: 5px;
}
QRadioButton::indicator:checked {
#window QRadioButton::indicator:checked {
background: #444;
}
+4 -4
View File
@@ -1,16 +1,16 @@
* {
#window * {
font-size: 12px;
}
QLabel, QCheckBox {
#window QLabel, #window QCheckBox {
color: black;
}
QCheckBox::indicator {
#window QCheckBox::indicator {
color: black;
}
QCheckBox:disabled {
#window QCheckBox:disabled {
color: gray;
}
@@ -141,7 +141,7 @@ void ErrorController::handleMessage(MessageErrorsHelpMessage* message)
appSettings->setSeenErrorHelpMessage(true);
appSettings->save();
m_onQtThread([=]() { createErrorHelpButtonInfo().displayMessage(); });
m_onQtThread([=]() { createErrorHelpButtonInfo().displayMessage(nullptr); });
}
void ErrorController::handleMessage(MessageIndexingFinished* message)
-2
View File
@@ -179,8 +179,6 @@ add_files(
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
@@ -22,7 +22,12 @@ QtHelpButton::QtHelpButton(const QtHelpButtonInfo& info, QWidget* parent)
connect(this, &QtHelpButton::clicked, this, &QtHelpButton::handleHelpPress);
}
void QtHelpButton::setMessageBoxParent(QWidget* messageBoxParent)
{
m_messageBoxParent = messageBoxParent;
}
void QtHelpButton::handleHelpPress()
{
m_info.displayMessage();
m_info.displayMessage(m_messageBoxParent);
}
@@ -11,11 +11,14 @@ class QtHelpButton: public QtIconButton
public:
QtHelpButton(const QtHelpButtonInfo& info, QWidget* parent = nullptr);
void setMessageBoxParent(QWidget* messageBoxParent);
private slots:
void handleHelpPress();
private:
QtHelpButtonInfo m_info;
QWidget* m_messageBoxParent = nullptr;
};
#endif // QT_HELP_BUTTON_H
+193 -457
View File
@@ -24,7 +24,6 @@
#include "QtProjectWizardContentSourceGroupData.h"
#include "QtProjectWizardContentSourceGroupInfoText.h"
#include "QtProjectWizardContentUnloadable.h"
#include "QtSourceGroupWizardPage.h"
#include "ResourcePaths.h"
#include "SourceGroupSettingsCustomCommand.h"
#include "SourceGroupSettingsUnloadable.h"
@@ -122,258 +121,147 @@ void addMsvcCompatibilityFlagsOnDemand(std::shared_ptr<SourceGroupSettingsWithCx
#endif // BUILD_CXX_LANGUAGE_PACKAGE
template <typename SettingsType>
std::vector<QtSourceGroupWizardPage<SettingsType>> getSourceGroupWizardPages();
void addSourceGroupContents(
QtProjectWizardContentGroup* group, std::shared_ptr<SettingsType> settings, QtProjectWizardWindow* window);
#if BUILD_CXX_LANGUAGE_PACKAGE
template <>
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsCEmpty>> getSourceGroupWizardPages<
SourceGroupSettingsCEmpty>()
void addSourceGroupContents<SourceGroupSettingsCEmpty>(
QtProjectWizardContentGroup* group, std::shared_ptr<SourceGroupSettingsCEmpty> settings, QtProjectWizardWindow* window)
{
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsCEmpty>> pages;
{
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);
}
{
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);
}
{
QtSourceGroupWizardPage<SourceGroupSettingsCEmpty> page("Include Paths");
page.addContentCreatorWithSettings<QtProjectWizardContentPathsHeaderSearch>(
WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorSimple<QtProjectWizardContentPathsHeaderSearchGlobal>(
WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
group->addContent(new QtProjectWizardContentCStandard(settings, window));
group->addContent(new QtProjectWizardContentCrossCompilationOptions(settings, window));
group->addSpace();
group->addContent(new QtProjectWizardContentPathsSource(settings, window));
group->addContent(new QtProjectWizardContentPathsExclude(settings, window));
group->addContent(new QtProjectWizardContentExtensions(settings, window));
group->addSpace();
group->addContent(new QtProjectWizardContentPathsHeaderSearch(settings, window));
group->addContent(new QtProjectWizardContentPathsHeaderSearchGlobal(window));
group->addSpace();
if (utility::getOsType() == OS_MAC)
{
QtSourceGroupWizardPage<SourceGroupSettingsCEmpty> page("Framework Search Paths");
page.addContentCreatorWithSettings<QtProjectWizardContentPathsFrameworkSearch>(
WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorSimple<QtProjectWizardContentPathsFrameworkSearchGlobal>(
WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
{
QtSourceGroupWizardPage<SourceGroupSettingsCEmpty> page("Advanced (optional)");
page.addContentCreatorWithSettings<QtProjectWizardContentFlags>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreator(
WIZARD_CONTENT_CONTEXT_ALL,
[](std::shared_ptr<SourceGroupSettingsCEmpty> settings, QtProjectWizardWindow* window) {
return new QtProjectWizardContentPathCxxPch(settings, settings, window);
});
page.addContentCreatorWithSettings<QtProjectWizardContentCxxPchFlags>(
WIZARD_CONTENT_CONTEXT_ALL, false);
pages.push_back(page);
group->addContent(new QtProjectWizardContentPathsFrameworkSearch(settings, window));
group->addContent(new QtProjectWizardContentPathsFrameworkSearchGlobal(window));
group->addSpace();
}
return pages;
group->addContent(new QtProjectWizardContentFlags(settings, window));
group->addContent(new QtProjectWizardContentPathCxxPch(settings, settings, window));
group->addContent(new QtProjectWizardContentCxxPchFlags(settings, window, false));
}
template <>
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsCppEmpty>> getSourceGroupWizardPages<
SourceGroupSettingsCppEmpty>()
void addSourceGroupContents<SourceGroupSettingsCppEmpty>(
QtProjectWizardContentGroup* group, std::shared_ptr<SourceGroupSettingsCppEmpty> settings, QtProjectWizardWindow* window)
{
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsCppEmpty>> pages;
{
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);
}
{
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);
}
{
QtSourceGroupWizardPage<SourceGroupSettingsCppEmpty> page("Include Paths");
page.addContentCreatorWithSettings<QtProjectWizardContentPathsHeaderSearch>(
WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorSimple<QtProjectWizardContentPathsHeaderSearchGlobal>(
WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
group->addContent(new QtProjectWizardContentCppStandard(settings, window));
group->addContent(new QtProjectWizardContentCrossCompilationOptions(settings, window));
group->addSpace();
group->addContent(new QtProjectWizardContentPathsSource(settings, window));
group->addContent(new QtProjectWizardContentPathsExclude(settings, window));
group->addContent(new QtProjectWizardContentExtensions(settings, window));
group->addSpace();
group->addContent(new QtProjectWizardContentPathsHeaderSearch(settings, window));
group->addContent(new QtProjectWizardContentPathsHeaderSearchGlobal(window));
group->addSpace();
if (utility::getOsType() == OS_MAC)
{
QtSourceGroupWizardPage<SourceGroupSettingsCppEmpty> page("Framework Search Paths");
page.addContentCreatorWithSettings<QtProjectWizardContentPathsFrameworkSearch>(
WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorSimple<QtProjectWizardContentPathsFrameworkSearchGlobal>(
WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
{
QtSourceGroupWizardPage<SourceGroupSettingsCppEmpty> page("Advanced (optional)");
page.addContentCreatorWithSettings<QtProjectWizardContentFlags>(WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreator(
WIZARD_CONTENT_CONTEXT_ALL,
[](std::shared_ptr<SourceGroupSettingsCppEmpty> settings, QtProjectWizardWindow* window) {
return new QtProjectWizardContentPathCxxPch(settings, settings, window);
});
page.addContentCreatorWithSettings<QtProjectWizardContentCxxPchFlags>(
WIZARD_CONTENT_CONTEXT_ALL, false);
pages.push_back(page);
group->addContent(new QtProjectWizardContentPathsFrameworkSearch(settings, window));
group->addContent(new QtProjectWizardContentPathsFrameworkSearchGlobal(window));
group->addSpace();
}
return pages;
group->addContent(new QtProjectWizardContentFlags(settings, window));
group->addContent(new QtProjectWizardContentPathCxxPch(settings, settings, window));
group->addContent(new QtProjectWizardContentCxxPchFlags(settings, window, false));
}
template <>
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsCxxCdb>> getSourceGroupWizardPages<
SourceGroupSettingsCxxCdb>()
void addSourceGroupContents<SourceGroupSettingsCxxCdb>(
QtProjectWizardContentGroup* group, std::shared_ptr<SourceGroupSettingsCxxCdb> settings, QtProjectWizardWindow* window)
{
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsCxxCdb>> pages;
{
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);
}
{
QtSourceGroupWizardPage<SourceGroupSettingsCxxCdb> page("Include Paths");
page.addContentCreatorWithSettings<QtProjectWizardContentPathsHeaderSearch>(
WIZARD_CONTENT_CONTEXT_SUMMARY, true);
page.addContentCreatorSimple<QtProjectWizardContentPathsHeaderSearchGlobal>(
WIZARD_CONTENT_CONTEXT_SUMMARY);
pages.push_back(page);
}
group->addContent(new QtProjectWizardContentPathCDB(settings, window));
group->addContent(new QtProjectWizardContentPathsIndexedHeaders(settings, window, "Compilation Database"));
group->addContent(new QtProjectWizardContentPathsExclude(settings, window));
group->addSpace();
group->addContent(new QtProjectWizardContentPathsHeaderSearch(settings, window, true));
group->addContent(new QtProjectWizardContentPathsHeaderSearchGlobal(window));
group->addSpace();
if (utility::getOsType() == OS_MAC)
{
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);
}
{
QtSourceGroupWizardPage<SourceGroupSettingsCxxCdb> page("Advanced (optional)");
page.addContentCreatorWithSettings<QtProjectWizardContentFlags>(
WIZARD_CONTENT_CONTEXT_SUMMARY, true);
page.addContentCreator(
WIZARD_CONTENT_CONTEXT_ALL,
[](std::shared_ptr<SourceGroupSettingsCxxCdb> settings, QtProjectWizardWindow* window) {
return new QtProjectWizardContentPathCxxPch(settings, settings, window);
});
page.addContentCreatorWithSettings<QtProjectWizardContentCxxPchFlags>(
WIZARD_CONTENT_CONTEXT_ALL, true);
pages.push_back(page);
group->addContent(new QtProjectWizardContentPathsFrameworkSearch(settings, window, true));
group->addContent(new QtProjectWizardContentPathsFrameworkSearchGlobal(window));
group->addSpace();
}
return pages;
group->addContent(new QtProjectWizardContentFlags(settings, window, true));
group->addContent(new QtProjectWizardContentPathCxxPch(settings, settings, window));
group->addContent(new QtProjectWizardContentCxxPchFlags(settings, window, true));
}
template <>
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsCxxCodeblocks>> getSourceGroupWizardPages<
SourceGroupSettingsCxxCodeblocks>()
void addSourceGroupContents<SourceGroupSettingsCxxCodeblocks>(
QtProjectWizardContentGroup* group, std::shared_ptr<SourceGroupSettingsCxxCodeblocks> settings, QtProjectWizardWindow* window)
{
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsCxxCodeblocks>> pages;
{
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);
}
{
QtSourceGroupWizardPage<SourceGroupSettingsCxxCodeblocks> page("Include Paths");
page.addContentCreatorWithSettings<QtProjectWizardContentPathsHeaderSearch>(
WIZARD_CONTENT_CONTEXT_SUMMARY, true);
page.addContentCreatorSimple<QtProjectWizardContentPathsHeaderSearchGlobal>(
WIZARD_CONTENT_CONTEXT_SUMMARY);
pages.push_back(page);
}
group->addContent(new QtProjectWizardContentCppStandard(settings, window));
group->addContent(new QtProjectWizardContentCStandard(settings, window));
group->addContent(new QtProjectWizardContentPathCodeblocksProject(settings, window));
group->addSpace();
group->addContent(new QtProjectWizardContentPathsIndexedHeaders(settings, window, "Code::Blocks Project"));
group->addContent(new QtProjectWizardContentPathsExclude(settings, window));
group->addContent(new QtProjectWizardContentExtensions(settings, window));
group->addSpace();
group->addContent(new QtProjectWizardContentPathsHeaderSearch(settings, window, true));
group->addContent(new QtProjectWizardContentPathsHeaderSearchGlobal(window));
group->addSpace();
if (utility::getOsType() == OS_MAC)
{
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);
}
{
QtSourceGroupWizardPage<SourceGroupSettingsCxxCodeblocks> page("Advanced (optional)");
page.addContentCreatorWithSettings<QtProjectWizardContentFlags>(
WIZARD_CONTENT_CONTEXT_SUMMARY, true);
pages.push_back(page);
group->addContent(new QtProjectWizardContentPathsFrameworkSearch(settings, window, true));
group->addContent(new QtProjectWizardContentPathsFrameworkSearchGlobal(window));
group->addSpace();
}
return pages;
group->addContent(new QtProjectWizardContentFlags(settings, window, true));
}
template <>
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsCxxCdbVs>> getSourceGroupWizardPages<
SourceGroupSettingsCxxCdbVs>()
void addSourceGroupContents<SourceGroupSettingsCxxCdbVs>(
QtProjectWizardContentGroup* group, std::shared_ptr<SourceGroupSettingsCxxCdbVs> settings, QtProjectWizardWindow* window)
{
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsCxxCdbVs>> pages;
{
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);
}
{
QtSourceGroupWizardPage<SourceGroupSettingsCxxCdbVs> page("Include Paths");
page.addContentCreatorWithSettings<QtProjectWizardContentPathsHeaderSearch>(
WIZARD_CONTENT_CONTEXT_SUMMARY, true);
page.addContentCreatorSimple<QtProjectWizardContentPathsHeaderSearchGlobal>(
WIZARD_CONTENT_CONTEXT_SUMMARY);
pages.push_back(page);
}
group->addContent(new QtProjectWizardContentVS(window)); // TODO make separate window
group->addSpace();
group->addContent(new QtProjectWizardContentPathCDB(settings, window));
group->addContent(new QtProjectWizardContentPathsIndexedHeaders(settings, window, "Compilation Database"));
group->addContent(new QtProjectWizardContentPathsExclude(settings, window));
group->addSpace();
group->addContent(new QtProjectWizardContentPathsHeaderSearch(settings, window, true));
group->addContent(new QtProjectWizardContentPathsHeaderSearchGlobal(window));
group->addSpace();
if (utility::getOsType() == OS_MAC)
{
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);
}
{
QtSourceGroupWizardPage<SourceGroupSettingsCxxCdbVs> page("Advanced (optional)");
page.addContentCreatorWithSettings<QtProjectWizardContentFlags>(
WIZARD_CONTENT_CONTEXT_SUMMARY, true);
pages.push_back(page);
group->addContent(new QtProjectWizardContentPathsFrameworkSearch(settings, window, true));
group->addContent(new QtProjectWizardContentPathsFrameworkSearchGlobal(window));
group->addSpace();
}
return pages;
group->addContent(new QtProjectWizardContentFlags(settings, window, true));
}
#endif // BUILD_CXX_LANGUAGE_PACKAGE
@@ -381,167 +269,71 @@ std::vector<QtSourceGroupWizardPage<SourceGroupSettingsCxxCdbVs>> getSourceGroup
#if BUILD_JAVA_LANGUAGE_PACKAGE
template <>
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsJavaEmpty>> getSourceGroupWizardPages<
SourceGroupSettingsJavaEmpty>()
void addSourceGroupContents<SourceGroupSettingsJavaEmpty>(
QtProjectWizardContentGroup* group, std::shared_ptr<SourceGroupSettingsJavaEmpty> settings, QtProjectWizardWindow* window)
{
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsJavaEmpty>> pages;
{
QtSourceGroupWizardPage<SourceGroupSettingsJavaEmpty> page("Language Standard", 470, 230);
page.addContentCreatorWithSettings<QtProjectWizardContentJavaStandard>(
WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
{
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);
}
{
QtSourceGroupWizardPage<SourceGroupSettingsJavaEmpty> page("Dependencies", 750, 600);
page.addContentCreatorWithSettings<QtProjectWizardContentPathsClassJava>(
WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
return pages;
group->addContent(new QtProjectWizardContentJavaStandard(settings, window));
group->addSpace();
group->addContent(new QtProjectWizardContentPathsSource(settings, window));
group->addContent(new QtProjectWizardContentPathsExclude(settings, window));
group->addContent(new QtProjectWizardContentExtensions(settings, window));
group->addSpace();
group->addContent(new QtProjectWizardContentPathsClassJava(settings, window));
}
template <>
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsJavaMaven>> getSourceGroupWizardPages<
SourceGroupSettingsJavaMaven>()
void addSourceGroupContents<SourceGroupSettingsJavaMaven>(
QtProjectWizardContentGroup* group, std::shared_ptr<SourceGroupSettingsJavaMaven> settings, QtProjectWizardWindow* window)
{
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsJavaMaven>> pages;
{
QtSourceGroupWizardPage<SourceGroupSettingsJavaMaven> page("Indexed Paths");
page.addContentCreatorWithSettings<QtProjectWizardContentJavaStandard>(
WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizardContentPathSourceMaven>(
WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizardContentPathSettingsMaven>(
WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
{
QtSourceGroupWizardPage<SourceGroupSettingsJavaMaven> page("Advanced (optional)");
page.addContentCreatorWithSettings<QtProjectWizardContentPathsExclude>(
WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizardContentExtensions>(
WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
return pages;
group->addContent(new QtProjectWizardContentJavaStandard(settings, window));
group->addContent(new QtProjectWizardContentPathSourceMaven(settings, window));
group->addContent(new QtProjectWizardContentPathSettingsMaven(settings, window));
group->addSpace();
group->addContent(new QtProjectWizardContentPathsExclude(settings, window));
group->addContent(new QtProjectWizardContentExtensions(settings, window));
}
template <>
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsJavaGradle>> getSourceGroupWizardPages<
SourceGroupSettingsJavaGradle>()
void addSourceGroupContents<SourceGroupSettingsJavaGradle>(
QtProjectWizardContentGroup* group, std::shared_ptr<SourceGroupSettingsJavaGradle> settings, QtProjectWizardWindow* window)
{
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsJavaGradle>> pages;
{
QtSourceGroupWizardPage<SourceGroupSettingsJavaGradle> page("Indexed Paths");
page.addContentCreatorWithSettings<QtProjectWizardContentJavaStandard>(
WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizardContentPathSourceGradle>(
WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
{
QtSourceGroupWizardPage<SourceGroupSettingsJavaGradle> page("Advanced (optional)");
page.addContentCreatorWithSettings<QtProjectWizardContentPathsExclude>(
WIZARD_CONTENT_CONTEXT_ALL);
page.addContentCreatorWithSettings<QtProjectWizardContentExtensions>(
WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
return pages;
group->addContent(new QtProjectWizardContentJavaStandard(settings, window));
group->addContent(new QtProjectWizardContentPathSourceGradle(settings, window));
group->addSpace();
group->addContent(new QtProjectWizardContentPathsExclude(settings, window));
group->addContent(new QtProjectWizardContentExtensions(settings, window));
}
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#if BUILD_PYTHON_LANGUAGE_PACKAGE
template <>
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsPythonEmpty>> getSourceGroupWizardPages<
SourceGroupSettingsPythonEmpty>()
void addSourceGroupContents<SourceGroupSettingsPythonEmpty>(
QtProjectWizardContentGroup* group, std::shared_ptr<SourceGroupSettingsPythonEmpty> settings, QtProjectWizardWindow* window)
{
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsPythonEmpty>> pages;
{
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);
}
return pages;
group->addContent(new QtProjectWizardContentPathPythonEnvironment(settings, window));
group->addContent(new QtProjectWizardContentPathsSource(settings, window));
group->addContent(new QtProjectWizardContentPathsExclude(settings, window));
group->addContent(new QtProjectWizardContentExtensions(settings, window));
}
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
template <>
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsCustomCommand>> getSourceGroupWizardPages<
SourceGroupSettingsCustomCommand>()
void addSourceGroupContents<SourceGroupSettingsCustomCommand>(
QtProjectWizardContentGroup* group, std::shared_ptr<SourceGroupSettingsCustomCommand> settings, QtProjectWizardWindow* window)
{
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsCustomCommand>> pages;
{
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;
group->addContent(new QtProjectWizardContentCustomCommand(settings, window));
group->addContent(new QtProjectWizardContentPathsSource(settings, window));
group->addContent(new QtProjectWizardContentPathsExclude(settings, window));
group->addContent(new QtProjectWizardContentExtensions(settings, window));
}
template <>
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsUnloadable>> getSourceGroupWizardPages<
SourceGroupSettingsUnloadable>()
void addSourceGroupContents<SourceGroupSettingsUnloadable>(
QtProjectWizardContentGroup* group, std::shared_ptr<SourceGroupSettingsUnloadable> settings, QtProjectWizardWindow* window)
{
std::vector<QtSourceGroupWizardPage<SourceGroupSettingsUnloadable>> pages;
{
QtSourceGroupWizardPage<SourceGroupSettingsUnloadable> page("");
page.addContentCreatorWithSettings<QtProjectWizardContentUnloadable>(
WIZARD_CONTENT_CONTEXT_ALL);
pages.push_back(page);
}
return pages;
}
template <typename SettingsType>
void fillSummary(
QtProjectWizardContentGroup* summary,
std::shared_ptr<SettingsType> settings,
QtProjectWizardWindow* window)
{
const std::vector<QtSourceGroupWizardPage<SettingsType>> pages =
getSourceGroupWizardPages<SettingsType>();
for (const QtSourceGroupWizardPage<SettingsType>& page: pages)
{
QtProjectWizardContentGroup* contentGroup = page.createContentGroup(
WIZARD_CONTENT_CONTEXT_SUMMARY, settings, window);
if (contentGroup && contentGroup->hasContents())
{
summary->addContent(contentGroup);
summary->addSpace();
}
}
group->addContent(new QtProjectWizardContentUnloadable(settings, window));
}
} // namespace
@@ -605,7 +397,7 @@ void QtProjectWizard::newProjectFromCDB(const FilePath& filePath)
utility::getUuidString(), m_projectSettings.get());
sourceGroupSettings->setCompilationDatabasePath(filePath);
executeSourceGroupSetup<SourceGroupSettingsCxxCdbVs>(sourceGroupSettings);
createSourceGroup(sourceGroupSettings);
#endif // BUILD_CXX_LANGUAGE_PACKAGE
}
@@ -768,24 +560,6 @@ void QtProjectWizard::handlePrevious()
QtWindow::handlePrevious();
}
template <typename SettingsType>
void QtProjectWizard::executeSourceGroupSetup(std::shared_ptr<SettingsType> settings)
{
std::shared_ptr<QtSourceGroupWizard<SettingsType>> wizard =
std::make_shared<QtSourceGroupWizard<SettingsType>>(
settings,
std::bind(&QtProjectWizard::cancelSourceGroup, this),
std::bind(&QtProjectWizard::createSourceGroup, this, std::placeholders::_1));
for (const QtSourceGroupWizardPage<SettingsType>& page: getSourceGroupWizardPages<SettingsType>())
{
wizard->addPage(page);
}
m_sourceGroupWizard = wizard;
m_sourceGroupWizard->execute(m_windowStack);
}
QtProjectWizardWindow* QtProjectWizard::createWindowWithContent(
std::function<QtProjectWizardContent*(QtProjectWizardWindow*)> func)
{
@@ -796,28 +570,7 @@ QtProjectWizardWindow* QtProjectWizard::createWindowWithContent(
window->setPreferredSize(QSize(580, 340));
window->setContent(func(window));
window->setScrollAble(window->content()->isScrollAble());
window->setup();
m_windowStack.pushWindow(window);
return window;
}
QtProjectWizardWindow* QtProjectWizard::createWindowWithContentGroup(
std::function<void(QtProjectWizardWindow*, QtProjectWizardContentGroup*)> func)
{
QtProjectWizardWindow* window = new QtProjectWizardWindow(parentWidget());
connect(window, &QtProjectWizardWindow::previous, &m_windowStack, &QtWindowStack::popWindow);
connect(window, &QtProjectWizardWindow::canceled, this, &QtProjectWizard::cancelSourceGroup);
QtProjectWizardContentGroup* contentGroup = new QtProjectWizardContentGroup(window);
window->setPreferredSize(QSize(750, 600));
window->setContent(contentGroup);
window->setScrollAble(window->content()->isScrollAble());
func(window, contentGroup);
window->setScrollAble(true);
window->setup();
m_windowStack.pushWindow(window);
@@ -827,6 +580,7 @@ QtProjectWizardWindow* QtProjectWizard::createWindowWithContentGroup(
void QtProjectWizard::updateSourceGroupList()
{
m_sourceGroupList->blockSignals(true);
m_sourceGroupList->clear();
for (const std::shared_ptr<SourceGroupSettings>& group: m_allSourceGroupSettings)
@@ -840,6 +594,7 @@ void QtProjectWizard::updateSourceGroupList()
QListWidgetItem* item = new QListWidgetItem(name);
m_sourceGroupList->addItem(item);
}
m_sourceGroupList->blockSignals(false);
}
bool QtProjectWizard::canExitContent()
@@ -915,7 +670,6 @@ void QtProjectWizard::selectedSourceGroupChanged(int index)
std::shared_ptr<SourceGroupSettings> group = m_allSourceGroupSettings[index];
QtProjectWizardContentGroup* summary = new QtProjectWizardContentGroup(this);
summary->setIsForm(true);
QtProjectWizardContentSourceGroupData* content = new QtProjectWizardContentSourceGroupData(
group, this);
@@ -930,43 +684,43 @@ void QtProjectWizard::selectedSourceGroupChanged(int index)
if (std::shared_ptr<SourceGroupSettingsCustomCommand> settings =
std::dynamic_pointer_cast<SourceGroupSettingsCustomCommand>(group))
{
fillSummary(summary, settings, this);
addSourceGroupContents(summary, settings, this);
}
if (std::shared_ptr<SourceGroupSettingsUnloadable> settings =
else if (std::shared_ptr<SourceGroupSettingsUnloadable> settings =
std::dynamic_pointer_cast<SourceGroupSettingsUnloadable>(group))
{
fillSummary(summary, settings, this);
addSourceGroupContents(summary, settings, this);
}
#if BUILD_CXX_LANGUAGE_PACKAGE
else if (
std::shared_ptr<SourceGroupSettingsCEmpty> settings =
std::dynamic_pointer_cast<SourceGroupSettingsCEmpty>(group))
{
fillSummary(summary, settings, this);
addSourceGroupContents(summary, settings, this);
}
else if (
std::shared_ptr<SourceGroupSettingsCppEmpty> settings =
std::dynamic_pointer_cast<SourceGroupSettingsCppEmpty>(group))
{
fillSummary(summary, settings, this);
addSourceGroupContents(summary, settings, this);
}
else if (
std::shared_ptr<SourceGroupSettingsCxxCdb> settings =
std::dynamic_pointer_cast<SourceGroupSettingsCxxCdb>(group))
{
fillSummary(summary, settings, this);
addSourceGroupContents(summary, settings, this);
}
else if (
std::shared_ptr<SourceGroupSettingsCxxCodeblocks> settings =
std::dynamic_pointer_cast<SourceGroupSettingsCxxCodeblocks>(group))
{
fillSummary(summary, settings, this);
addSourceGroupContents(summary, settings, this);
}
else if (
std::shared_ptr<SourceGroupSettingsCxxCdbVs> settings =
std::dynamic_pointer_cast<SourceGroupSettingsCxxCdbVs>(group))
{
fillSummary(summary, settings, this);
addSourceGroupContents(summary, settings, this);
}
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
@@ -974,19 +728,19 @@ void QtProjectWizard::selectedSourceGroupChanged(int index)
std::shared_ptr<SourceGroupSettingsJavaEmpty> settings =
std::dynamic_pointer_cast<SourceGroupSettingsJavaEmpty>(group))
{
fillSummary(summary, settings, this);
addSourceGroupContents(summary, settings, this);
}
else if (
std::shared_ptr<SourceGroupSettingsJavaMaven> settings =
std::dynamic_pointer_cast<SourceGroupSettingsJavaMaven>(group))
{
fillSummary(summary, settings, this);
addSourceGroupContents(summary, settings, this);
}
else if (
std::shared_ptr<SourceGroupSettingsJavaGradle> settings =
std::dynamic_pointer_cast<SourceGroupSettingsJavaGradle>(group))
{
fillSummary(summary, settings, this);
addSourceGroupContents(summary, settings, this);
}
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#if BUILD_PYTHON_LANGUAGE_PACKAGE
@@ -994,7 +748,7 @@ void QtProjectWizard::selectedSourceGroupChanged(int index)
std::shared_ptr<SourceGroupSettingsPythonEmpty> settings =
std::dynamic_pointer_cast<SourceGroupSettingsPythonEmpty>(group))
{
fillSummary(summary, settings, this);
addSourceGroupContents(summary, settings, this);
}
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
@@ -1020,7 +774,7 @@ void QtProjectWizard::removeSelectedSourceGroup()
return;
}
QMessageBox msgBox;
QMessageBox msgBox(this);
msgBox.setText(QStringLiteral("Remove Source Group"));
msgBox.setInformativeText(
QStringLiteral("Do you really want to remove this source group from the project?"));
@@ -1033,7 +787,9 @@ void QtProjectWizard::removeSelectedSourceGroup()
{
int currentRow = m_sourceGroupList->currentRow();
m_allSourceGroupSettings.erase(m_allSourceGroupSettings.begin() + currentRow);
updateSourceGroupList();
setContent(nullptr);
if (m_allSourceGroupSettings.empty())
{
@@ -1102,6 +858,7 @@ void QtProjectWizard::duplicateSelectedSourceGroup()
m_allSourceGroupSettings.insert(m_allSourceGroupSettings.begin() + newRow, newSourceGroup);
updateSourceGroupList();
setContent(nullptr);
m_previouslySelectedIndex = -1;
@@ -1169,93 +926,72 @@ void QtProjectWizard::newSourceGroup()
void QtProjectWizard::selectedProjectType(SourceGroupType sourceGroupType)
{
const std::string sourceGroupId = utility::getUuidString();
std::shared_ptr<SourceGroupSettings> settings;
switch (sourceGroupType)
{
#if BUILD_CXX_LANGUAGE_PACKAGE
case SOURCE_GROUP_C_EMPTY:
{
std::shared_ptr<SourceGroupSettingsCEmpty> settings =
std::shared_ptr<SourceGroupSettingsCEmpty> cxxSettings =
std::make_shared<SourceGroupSettingsCEmpty>(sourceGroupId, m_projectSettings.get());
addMsvcCompatibilityFlagsOnDemand(settings);
executeSourceGroupSetup<SourceGroupSettingsCEmpty>(settings);
addMsvcCompatibilityFlagsOnDemand(cxxSettings);
settings = cxxSettings;
}
break;
case SOURCE_GROUP_CPP_EMPTY:
{
std::shared_ptr<SourceGroupSettingsCppEmpty> settings =
std::shared_ptr<SourceGroupSettingsCppEmpty> cxxSettings =
std::make_shared<SourceGroupSettingsCppEmpty>(sourceGroupId, m_projectSettings.get());
addMsvcCompatibilityFlagsOnDemand(settings);
executeSourceGroupSetup<SourceGroupSettingsCppEmpty>(settings);
addMsvcCompatibilityFlagsOnDemand(cxxSettings);
settings = cxxSettings;
}
break;
case SOURCE_GROUP_CXX_CDB:
{
std::shared_ptr<SourceGroupSettingsCxxCdb> settings =
std::make_shared<SourceGroupSettingsCxxCdb>(sourceGroupId, m_projectSettings.get());
executeSourceGroupSetup<SourceGroupSettingsCxxCdb>(settings);
}
break;
settings = std::make_shared<SourceGroupSettingsCxxCdb>(sourceGroupId, m_projectSettings.get());
break;
case SOURCE_GROUP_CXX_CODEBLOCKS:
{
std::shared_ptr<SourceGroupSettingsCxxCodeblocks> settings =
std::make_shared<SourceGroupSettingsCxxCodeblocks>(
sourceGroupId, m_projectSettings.get());
addMsvcCompatibilityFlagsOnDemand(settings);
executeSourceGroupSetup<SourceGroupSettingsCxxCodeblocks>(settings);
std::shared_ptr<SourceGroupSettingsCxxCodeblocks> cxxSettings =
std::make_shared<SourceGroupSettingsCxxCodeblocks>(sourceGroupId, m_projectSettings.get());
addMsvcCompatibilityFlagsOnDemand(cxxSettings);
settings = cxxSettings;
}
break;
case SOURCE_GROUP_CXX_VS:
{
std::shared_ptr<SourceGroupSettingsCxxCdbVs> settings =
std::make_shared<SourceGroupSettingsCxxCdbVs>(sourceGroupId, m_projectSettings.get());
executeSourceGroupSetup<SourceGroupSettingsCxxCdbVs>(settings);
}
break;
settings = std::make_shared<SourceGroupSettingsCxxCdbVs>(sourceGroupId, m_projectSettings.get());
break;
#endif // BUILD_CXX_LANGUAGE_PACKAGE
#if BUILD_JAVA_LANGUAGE_PACKAGE
case SOURCE_GROUP_JAVA_EMPTY:
{
std::shared_ptr<SourceGroupSettingsJavaEmpty> settings =
std::make_shared<SourceGroupSettingsJavaEmpty>(sourceGroupId, m_projectSettings.get());
executeSourceGroupSetup<SourceGroupSettingsJavaEmpty>(settings);
}
break;
settings = std::make_shared<SourceGroupSettingsJavaEmpty>(sourceGroupId, m_projectSettings.get());
break;
case SOURCE_GROUP_JAVA_MAVEN:
{
std::shared_ptr<SourceGroupSettingsJavaMaven> settings =
std::make_shared<SourceGroupSettingsJavaMaven>(sourceGroupId, m_projectSettings.get());
executeSourceGroupSetup<SourceGroupSettingsJavaMaven>(settings);
}
break;
settings = std::make_shared<SourceGroupSettingsJavaMaven>(sourceGroupId, m_projectSettings.get());
break;
case SOURCE_GROUP_JAVA_GRADLE:
{
std::shared_ptr<SourceGroupSettingsJavaGradle> settings =
std::make_shared<SourceGroupSettingsJavaGradle>(sourceGroupId, m_projectSettings.get());
executeSourceGroupSetup<SourceGroupSettingsJavaGradle>(settings);
}
break;
settings = std::make_shared<SourceGroupSettingsJavaGradle>(sourceGroupId, m_projectSettings.get());
break;
#endif // BUILD_JAVA_LANGUAGE_PACKAGE
#if BUILD_PYTHON_LANGUAGE_PACKAGE
case SOURCE_GROUP_PYTHON_EMPTY:
{
std::shared_ptr<SourceGroupSettingsPythonEmpty> settings =
std::make_shared<SourceGroupSettingsPythonEmpty>(sourceGroupId, m_projectSettings.get());
executeSourceGroupSetup<SourceGroupSettingsPythonEmpty>(settings);
}
break;
settings = std::make_shared<SourceGroupSettingsPythonEmpty>(sourceGroupId, m_projectSettings.get());
break;
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE
case SOURCE_GROUP_CUSTOM_COMMAND:
{
std::shared_ptr<SourceGroupSettingsCustomCommand> settings =
std::make_shared<SourceGroupSettingsCustomCommand>(
sourceGroupId, m_projectSettings.get());
executeSourceGroupSetup<SourceGroupSettingsCustomCommand>(settings);
}
break;
settings = std::make_shared<SourceGroupSettingsCustomCommand>(sourceGroupId, m_projectSettings.get());
break;
case SOURCE_GROUP_UNKNOWN:
break;
}
if (settings)
{
createSourceGroup(settings);
}
}
void QtProjectWizard::createSourceGroup(std::shared_ptr<SourceGroupSettings> settings)
@@ -1282,7 +1018,7 @@ void QtProjectWizard::createProject()
{
MessageStatus(L"Unable to save project to location: " + path.wstr()).dispatch();
QMessageBox msgBox;
QMessageBox msgBox(this);
msgBox.setText("Could not create Project");
msgBox.setInformativeText(QString::fromStdWString(
L"<p>Sourcetrail was unable to save the project to the specified path. Please pick a "
@@ -8,7 +8,6 @@
#include "ApplicationSettings.h"
#include "ProjectSettings.h"
#include "QtProjectWizardWindow.h"
#include "QtSourceGroupWizard.h"
#include "QtWindow.h"
class QListWidget;
@@ -40,15 +39,9 @@ protected:
virtual void handlePrevious() override;
private:
template <typename SettingsType>
void executeSourceGroupSetup(std::shared_ptr<SettingsType> settings);
QtProjectWizardWindow* createWindowWithContent(
std::function<QtProjectWizardContent*(QtProjectWizardWindow*)> func);
QtProjectWizardWindow* createWindowWithContentGroup(
std::function<void(QtProjectWizardWindow*, QtProjectWizardContentGroup*)> func);
void updateSourceGroupList();
bool canExitContent();
@@ -56,7 +49,6 @@ private:
std::shared_ptr<ProjectSettings> m_projectSettings;
std::vector<std::shared_ptr<SourceGroupSettings>> m_allSourceGroupSettings;
std::shared_ptr<QtSourceGroupWizardBase> m_sourceGroupWizard;
ApplicationSettings m_appSettings;
bool m_editing;
@@ -1,156 +0,0 @@
#ifndef QT_SOURCE_GROUP_WIZARD_H
#define QT_SOURCE_GROUP_WIZARD_H
#include <functional>
#include <memory>
#include <vector>
#include "QtProjectWizardContentGroup.h"
#include "QtProjectWizardWindow.h"
#include "QtSourceGroupWizardPage.h"
#include "logging.h"
class SourceGroupSettings;
class QtSourceGroupWizardBase
{
public:
virtual ~QtSourceGroupWizardBase() = default;
virtual void execute(QtWindowStack& windowStack) = 0;
virtual bool canProcessSettings(std::shared_ptr<const SourceGroupSettings> settings) = 0;
};
template <typename SettingsType>
class QtSourceGroupWizard: public QtSourceGroupWizardBase
{
public:
QtSourceGroupWizard(
std::shared_ptr<SettingsType> settings,
std::function<void()> onCancelClicked,
std::function<void(std::shared_ptr<SourceGroupSettings>)> onFinishedWizard);
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, WizardContentContextType contextType) const;
std::shared_ptr<SettingsType> m_settings;
std::function<void()> m_onCancelClicked;
std::function<void(std::shared_ptr<SourceGroupSettings>)> m_onFinishedWizard;
std::vector<QtSourceGroupWizardPage<SettingsType>> m_pages;
};
template <typename SettingsType>
QtSourceGroupWizard<SettingsType>::QtSourceGroupWizard(
std::shared_ptr<SettingsType> settings,
std::function<void()> onCancelClicked,
std::function<void(std::shared_ptr<SourceGroupSettings>)> onFinishedWizard)
: m_settings(settings), m_onCancelClicked(onCancelClicked), m_onFinishedWizard(onFinishedWizard)
{
}
template <typename SettingsType>
void QtSourceGroupWizard<SettingsType>::addPage(const QtSourceGroupWizardPage<SettingsType>& page)
{
m_pages.push_back(page);
}
template <typename SettingsType>
void QtSourceGroupWizard<SettingsType>::execute(QtWindowStack& windowStack)
{
if (!m_pages.empty())
{
createWindowForPage(
mapToPageIdWithContentForContext(0, WIZARD_CONTENT_CONTEXT_SETUP), windowStack);
}
}
template <typename SettingsType>
bool QtSourceGroupWizard<SettingsType>::canProcessSettings(
std::shared_ptr<const SourceGroupSettings> settings)
{
if (std::dynamic_pointer_cast<const SettingsType>(settings))
{
return true;
}
return false;
}
template <typename SettingsType>
void QtSourceGroupWizard<SettingsType>::createWindowForPage(const size_t pageId, QtWindowStack& windowStack)
{
if (pageId >= m_pages.size())
{
LOG_ERROR("Project Setup does not contain page " + std::to_string(pageId));
return;
}
const QtSourceGroupWizardPage<SettingsType>& page = m_pages.at(pageId);
const int nextPageId = mapToPageIdWithContentForContext(pageId + 1, WIZARD_CONTENT_CONTEXT_SETUP);
QtProjectWizardWindow* window = new QtProjectWizardWindow(nullptr);
window->connect(
window, &QtProjectWizardWindow::previous, &windowStack, &QtWindowStack::popWindow);
window->connect(window, &QtProjectWizardWindow::canceled, m_onCancelClicked);
if (nextPageId > 0)
{
window->connect(window, &QtProjectWizardWindow::next, [this, nextPageId, &windowStack]() {
this->createWindowForPage(nextPageId, windowStack);
});
}
else
{
window->connect(
window, &QtProjectWizardWindow::next, [&]() { m_onFinishedWizard(m_settings); });
}
QtProjectWizardContentGroup* contentGroup = page.createContentGroup(
WIZARD_CONTENT_CONTEXT_SETUP, m_settings, window);
window->setPreferredSize(QSize(page.getPreferredWidth(), page.getPreferredHeight()));
window->setContent(contentGroup);
window->setScrollAble(window->content()->isScrollAble());
window->setup();
size_t currentPage = 0;
size_t totalPages = 0;
for (size_t i = 0; i < m_pages.size(); i++)
{
if (m_pages[i].hasContentForContext(WIZARD_CONTENT_CONTEXT_SETUP))
{
if (i <= pageId)
{
currentPage++;
}
totalPages++;
}
}
window->updateSubTitle(QString::fromStdString(
page.getTitle() + " - " + std::to_string(currentPage) + "/" + std::to_string(totalPages)));
windowStack.pushWindow(window);
}
template <typename SettingsType>
int QtSourceGroupWizard<SettingsType>::mapToPageIdWithContentForContext(
size_t pageId, WizardContentContextType contextType) const
{
while (pageId < m_pages.size())
{
const QtSourceGroupWizardPage<SettingsType>& page = m_pages.at(pageId);
if (page.hasContentForContext(contextType))
{
return pageId;
}
pageId++;
}
return -1;
}
#endif // QT_SOURCE_GROUP_WIZARD_H
@@ -1,159 +0,0 @@
#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
@@ -9,7 +9,6 @@
QtProjectWizardContent::QtProjectWizardContent(QtProjectWizardWindow* window)
: QWidget(window)
, m_window(window)
, m_isInForm(false)
, m_showFilesFunctor(
std::bind(&QtProjectWizardContent::showFilesDialog, this, std::placeholders::_1))
{
@@ -28,11 +27,6 @@ bool QtProjectWizardContent::check()
return true;
}
bool QtProjectWizardContent::isScrollAble() const
{
return false;
}
std::vector<FilePath> QtProjectWizardContent::getFilePaths() const
{
return {};
@@ -48,16 +42,6 @@ QString QtProjectWizardContent::getFileNamesDescription() const
return QStringLiteral("files");
}
bool QtProjectWizardContent::isInForm() const
{
return m_isInForm;
}
void QtProjectWizardContent::setIsInForm(bool isInForm)
{
m_isInForm = isInForm;
}
QLabel* QtProjectWizardContent::createFormLabel(QString name) const
{
QLabel* label = new QLabel(name);
@@ -91,6 +75,7 @@ QtHelpButton* QtProjectWizardContent::addHelpButton(
const QString& helpTitle, const QString& helpText, QGridLayout* layout, int row) const
{
QtHelpButton* button = new QtHelpButton(QtHelpButtonInfo(helpTitle, helpText));
button->setMessageBoxParent(m_window);
layout->addWidget(button, row, QtProjectWizardWindow::HELP_COL, Qt::AlignTop);
return button;
}
@@ -126,7 +111,6 @@ QFrame* QtProjectWizardContent::addSeparator(QGridLayout* layout, int row) const
void QtProjectWizardContent::filesButtonClicked()
{
m_window->saveContent();
m_window->loadContent();
std::thread([&]() {
const std::vector<FilePath> filePaths = getFilePaths();
@@ -27,15 +27,10 @@ public:
virtual void save();
virtual bool check();
virtual bool isScrollAble() const;
virtual std::vector<FilePath> getFilePaths() const;
virtual QString getFileNamesTitle() const;
virtual QString getFileNamesDescription() const;
bool isInForm() const;
void setIsInForm(bool isInForm);
protected:
QLabel* createFormLabel(QString name) const;
QLabel* createFormTitle(QString name) const;
@@ -57,7 +52,6 @@ protected slots:
private:
void showFilesDialog(const std::vector<FilePath>& filePaths);
bool m_isInForm;
QtThreadedFunctor<const std::vector<FilePath>&> m_showFilesFunctor;
};
@@ -22,12 +22,6 @@ QtProjectWizardContentCrossCompilationOptions::QtProjectWizardContentCrossCompil
void QtProjectWizardContentCrossCompilationOptions::populate(QGridLayout* layout, int& row)
{
if (!isInForm())
{
layout->setRowMinimumHeight(row, 15);
row++;
}
layout->addWidget(
createFormLabel("Cross-Compilation"), row, QtProjectWizardWindow::FRONT_COL, Qt::AlignRight);
addHelpButton(
@@ -132,12 +126,6 @@ void QtProjectWizardContentCrossCompilationOptions::populate(QGridLayout* layout
layout->addLayout(
gridLayout, row++, QtProjectWizardWindow::BACK_COL, Qt::AlignLeft | Qt::AlignTop);
if (!isInForm())
{
layout->setRowMinimumHeight(row, 15);
layout->setRowStretch(row, 1);
}
}
void QtProjectWizardContentCrossCompilationOptions::load()
@@ -18,12 +18,6 @@ QtProjectWizardContentCustomCommand::QtProjectWizardContentCustomCommand(
void QtProjectWizardContentCustomCommand::populate(QGridLayout* layout, int& row)
{
if (!isInForm())
{
layout->setRowMinimumHeight(row, 15);
row++;
}
QLabel* nameLabel = createFormLabel(QStringLiteral("Custom Command"));
addHelpButton(
QStringLiteral("Custom Command"),
@@ -59,12 +53,6 @@ void QtProjectWizardContentCustomCommand::populate(QGridLayout* layout, int& row
layout->addWidget(m_runInParallel, row, QtProjectWizardWindow::BACK_COL);
row++;
if (!isInForm())
{
layout->setRowMinimumHeight(row, 15);
layout->setRowStretch(row, 1);
}
}
void QtProjectWizardContentCustomCommand::load()
@@ -83,7 +71,7 @@ bool QtProjectWizardContentCustomCommand::check()
{
if (m_customCommand->text().isEmpty())
{
QMessageBox msgBox;
QMessageBox msgBox(m_window);
msgBox.setText(QStringLiteral("Please enter a custom command."));
msgBox.exec();
return false;
@@ -91,7 +79,7 @@ bool QtProjectWizardContentCustomCommand::check()
if (m_customCommand->text().toStdWString().find(L"%{SOURCE_FILE_PATH}") == std::wstring::npos)
{
QMessageBox msgBox;
QMessageBox msgBox(m_window);
msgBox.setText(QStringLiteral("The variable %{SOURCE_FILE_PATH} is missing in the custom command."));
msgBox.exec();
return false;
@@ -82,7 +82,7 @@ bool QtProjectWizardContentCxxPchFlags::check()
if (!error.empty())
{
QMessageBox msgBox;
QMessageBox msgBox(m_window);
msgBox.setText(QString::fromStdWString(error));
msgBox.exec();
return false;
@@ -63,7 +63,7 @@ bool QtProjectWizardContentFlags::check()
if (!error.empty())
{
QMessageBox msgBox;
QMessageBox msgBox(m_window);
msgBox.setText(QString::fromStdWString(error));
msgBox.exec();
return false;
@@ -1,18 +1,13 @@
#include "QtProjectWizardContentGroup.h"
QtProjectWizardContentGroup::QtProjectWizardContentGroup(QtProjectWizardWindow* window)
: QtProjectWizardContent(window), m_isForm(false)
: QtProjectWizardContent(window)
{
}
void QtProjectWizardContentGroup::addContent(QtProjectWizardContent* content)
{
m_contents.push_back(content);
if (content)
{
content->setIsInForm(m_isForm);
}
}
void QtProjectWizardContentGroup::addSpace()
@@ -20,11 +15,6 @@ 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)
@@ -39,32 +29,6 @@ bool QtProjectWizardContentGroup::hasContents() const
}
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);
@@ -118,8 +82,3 @@ bool QtProjectWizardContentGroup::check()
return true;
}
bool QtProjectWizardContentGroup::isScrollAble() const
{
return true;
}
@@ -15,20 +15,16 @@ public:
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;
@@ -21,12 +21,6 @@ QtProjectWizardContentProjectData::QtProjectWizardContentProjectData(
void QtProjectWizardContentProjectData::populate(QGridLayout* layout, int& row)
{
if (!isInForm())
{
layout->setRowMinimumHeight(row, 15);
row++;
}
QLabel* nameLabel = createFormLabel(QStringLiteral("Sourcetrail Project Name"));
m_projectName = new QLineEdit();
m_projectName->setObjectName(QStringLiteral("name"));
@@ -57,12 +51,6 @@ void QtProjectWizardContentProjectData::populate(QGridLayout* layout, int& row)
row);
layout->setRowMinimumHeight(row, 30);
row++;
if (!isInForm())
{
layout->setRowMinimumHeight(row, 15);
layout->setRowStretch(row, 1);
}
}
void QtProjectWizardContentProjectData::load()
@@ -83,7 +71,7 @@ bool QtProjectWizardContentProjectData::check()
{
if (m_projectName->text().isEmpty())
{
QMessageBox msgBox;
QMessageBox msgBox(m_window);
msgBox.setText(QStringLiteral("Please enter a project name."));
msgBox.exec();
return false;
@@ -91,7 +79,7 @@ bool QtProjectWizardContentProjectData::check()
if (!boost::filesystem::portable_file_name(m_projectName->text().toStdString()))
{
QMessageBox msgBox;
QMessageBox msgBox(m_window);
msgBox.setText(
"The provided project name is not a valid file name. Please adjust the name "
"accordingly.");
@@ -101,7 +89,7 @@ bool QtProjectWizardContentProjectData::check()
if (m_projectFileLocation->getText().isEmpty())
{
QMessageBox msgBox;
QMessageBox msgBox(m_window);
msgBox.setText(QStringLiteral("Please define the location for the Sourcetrail project file."));
msgBox.exec();
return false;
@@ -111,7 +99,7 @@ bool QtProjectWizardContentProjectData::check()
FilePath(m_projectFileLocation->getText().toStdWString()).expandEnvironmentVariables();
if (paths.size() != 1)
{
QMessageBox msgBox;
QMessageBox msgBox(m_window);
msgBox.setText(
"The specified location seems to be invalid. Please make sure that the used "
"environment variables are unambiguous.");
@@ -120,7 +108,7 @@ bool QtProjectWizardContentProjectData::check()
}
else if (!paths.front().isAbsolute())
{
QMessageBox msgBox;
QMessageBox msgBox(m_window);
msgBox.setText(
"The specified location seems to be invalid. Please specify an absolute directory "
"path.");
@@ -129,7 +117,7 @@ bool QtProjectWizardContentProjectData::check()
}
else if (!paths.front().isValid())
{
QMessageBox msgBox;
QMessageBox msgBox(m_window);
msgBox.setText(
"The specified location seems to be invalid. Please check the characters used in the "
"path.");
@@ -138,7 +126,7 @@ bool QtProjectWizardContentProjectData::check()
}
else if (!paths[0].exists())
{
QMessageBox msgBox;
QMessageBox msgBox(m_window);
msgBox.setText(
QStringLiteral("The specified location does not exist. Do you want to create the directory?"));
msgBox.addButton(QStringLiteral("Abort"), QMessageBox::ButtonRole::NoRole);
@@ -321,7 +321,7 @@ bool QtProjectWizardContentSelect::check()
if (!sourceGroupChosen)
{
QMessageBox msgBox;
QMessageBox msgBox(m_window);
msgBox.setText(QStringLiteral("Please choose a method of creating a new Source Group."));
msgBox.exec();
return false;
@@ -329,8 +329,3 @@ bool QtProjectWizardContentSelect::check()
return true;
}
bool QtProjectWizardContentSelect::isScrollAble() const
{
return true;
}
@@ -21,8 +21,6 @@ public:
void save() override;
bool check() override;
bool isScrollAble() const override;
signals:
void selected(SourceGroupType);
@@ -62,7 +62,7 @@ bool QtProjectWizardContentSourceGroupData::check()
{
if (m_name->text().isEmpty())
{
QMessageBox msgBox;
QMessageBox msgBox(m_window);
msgBox.setText(QStringLiteral("Please enter a source group name."));
msgBox.exec();
return false;
@@ -1,14 +1,6 @@
#include "QtProjectWizardContentUnloadable.h"
#include <QCheckBox>
#include <QLineEdit>
#include <QMessageBox>
#include <boost/filesystem/path.hpp>
#include "FileSystem.h"
#include "ProjectSettings.h"
#include "SourceGroupSettingsUnloadable.h"
#include "SqliteIndexStorage.h"
QtProjectWizardContentUnloadable::QtProjectWizardContentUnloadable(
std::shared_ptr<SourceGroupSettingsUnloadable> settings, QtProjectWizardWindow* window)
@@ -75,7 +75,7 @@ bool QtProjectWizardContentPath::check()
if (!error.isEmpty())
{
QMessageBox msgBox;
QMessageBox msgBox(m_window);
msgBox.setText(error);
msgBox.exec();
return false;
@@ -57,7 +57,7 @@ bool QtProjectWizardContentPathCxxPch::check()
std::shared_ptr<clang::tooling::JSONCompilationDatabase> cdb = utility::loadCDB(cdbPath);
if (!cdb)
{
QMessageBox msgBox;
QMessageBox msgBox(m_window);
msgBox.setText("Unable to open and read the provided compilation database file.");
msgBox.exec();
return false;
@@ -67,7 +67,7 @@ bool QtProjectWizardContentPathCxxPch::check()
{
if (m_settingsCxxPch->getPchInputFilePath().empty())
{
QMessageBox msgBox;
QMessageBox msgBox(m_window);
msgBox.setText(
"The provided compilation database file uses precompiled headers. If you want "
"to make use of "
@@ -89,7 +89,7 @@ bool QtProjectWizardContentPathCxxPch::check()
{
if (!m_settingsCxxPch->getPchInputFilePath().empty())
{
QMessageBox msgBox;
QMessageBox msgBox(m_window);
msgBox.setText(
"The provided compilation database file does not use precompiled headers. The "
"specified input file at "
@@ -2,17 +2,7 @@
#include <QCheckBox>
//#include "Application.h"
//#include "ApplicationSettings.h"
//#include "MessageStatus.h"
//#include "QtDialogView.h"
//#include "ScopedFunctor.h"
//#include "SourceGroupJavaMaven.h"
#include "SourceGroupSettingsJavaMaven.h"
//#include "logging.h"
//#include "utility.h"
//#include "utilityFile.h"
//#include "utilityMaven.h"
QtProjectWizardContentPathSettingsMaven::QtProjectWizardContentPathSettingsMaven(
std::shared_ptr<SourceGroupSettingsJavaMaven> settings, QtProjectWizardWindow* window)
@@ -88,7 +88,7 @@ bool QtProjectWizardContentPaths::check()
if (!missingPaths.isEmpty())
{
QMessageBox msgBox;
QMessageBox msgBox(m_window);
msgBox.setText(QString("Some provided paths do not exist at \"%1\". Do you want to "
"remove them before continuing?")
.arg(m_titleString));
@@ -22,7 +22,7 @@ public:
std::shared_ptr<SourceGroupSettings> settings,
QtProjectWizardWindow* window,
QtPathListBox::SelectionPolicyType selectionPolicy,
bool checkMissingPaths = true);
bool checkMissingPaths);
// QtSettingsWindow implementation
virtual void populate(QGridLayout* layout, int& row) override;
@@ -8,7 +8,7 @@
QtProjectWizardContentPathsClassJava::QtProjectWizardContentPathsClassJava(
std::shared_ptr<SourceGroupSettings> settings, QtProjectWizardWindow* window)
: QtProjectWizardContentPaths(
settings, window, QtPathListBox::SELECTION_POLICY_FILES_AND_DIRECTORIES)
settings, window, QtPathListBox::SELECTION_POLICY_FILES_AND_DIRECTORIES, true)
{
setTitleString("Class Path");
setHelpString(
@@ -7,7 +7,7 @@ QtProjectWizardContentPathsFrameworkSearch::QtProjectWizardContentPathsFramework
std::shared_ptr<SourceGroupSettings> settings,
QtProjectWizardWindow* window,
bool indicateAsAdditional)
: QtProjectWizardContentPaths(settings, window, QtPathListBox::SELECTION_POLICY_DIRECTORIES_ONLY)
: QtProjectWizardContentPaths(settings, window, QtPathListBox::SELECTION_POLICY_DIRECTORIES_ONLY, true)
{
setTitleString(
indicateAsAdditional ? "Additional Framework Search Paths" : "Framework Search Paths");
@@ -38,8 +38,3 @@ void QtProjectWizardContentPathsFrameworkSearch::save()
cxxSettings->setFrameworkSearchPaths(m_list->getPathsAsDisplayed());
}
}
bool QtProjectWizardContentPathsFrameworkSearch::isScrollAble() const
{
return true;
}
@@ -15,8 +15,6 @@ public:
// QtProjectWizardContent implementation
virtual void load() override;
virtual void save() override;
virtual bool isScrollAble() const override;
};
#endif // QT_PROJECT_WIZARD_CONTENT_PATHS_FRAMEWORK_SEARCH_H
@@ -8,7 +8,8 @@ QtProjectWizardContentPathsFrameworkSearchGlobal::QtProjectWizardContentPathsFra
: QtProjectWizardContentPaths(
std::shared_ptr<SourceGroupSettings>(),
window,
QtPathListBox::SELECTION_POLICY_DIRECTORIES_ONLY)
QtPathListBox::SELECTION_POLICY_DIRECTORIES_ONLY,
true)
{
setTitleString("Global Framework Search Paths");
setHelpString(
@@ -25,7 +25,7 @@ QtProjectWizardContentPathsHeaderSearch::QtProjectWizardContentPathsHeaderSearch
std::shared_ptr<SourceGroupSettings> settings,
QtProjectWizardWindow* window,
bool indicateAsAdditional)
: QtProjectWizardContentPaths(settings, window, QtPathListBox::SELECTION_POLICY_DIRECTORIES_ONLY)
: QtProjectWizardContentPaths(settings, window, QtPathListBox::SELECTION_POLICY_DIRECTORIES_ONLY, true)
, m_showDetectedIncludesResultFunctor(std::bind(
&QtProjectWizardContentPathsHeaderSearch::showDetectedIncludesResult,
this,
@@ -109,11 +109,6 @@ void QtProjectWizardContentPathsHeaderSearch::save()
}
}
bool QtProjectWizardContentPathsHeaderSearch::isScrollAble() const
{
return true;
}
void QtProjectWizardContentPathsHeaderSearch::detectIncludesButtonClicked()
{
m_window->saveContent();
@@ -348,7 +343,7 @@ void QtProjectWizardContentPathsHeaderSearch::showDetectedIncludesResult(
if (additionalHeaderSearchPaths.empty())
{
QMessageBox msgBox;
QMessageBox msgBox(m_window);
msgBox.setText(
"<p>No additional include paths have been detected while searching the provided "
"paths.</p>");
@@ -395,7 +390,7 @@ void QtProjectWizardContentPathsHeaderSearch::showValidationResult(
{
if (unresolvedIncludes.empty())
{
QMessageBox msgBox;
QMessageBox msgBox(m_window);
msgBox.setText(
"<p>All include directives throughout the indexed files have been resolved.</p>");
msgBox.exec();
@@ -20,7 +20,6 @@ public:
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();
@@ -12,7 +12,8 @@ QtProjectWizardContentPathsHeaderSearchGlobal::QtProjectWizardContentPathsHeader
: QtProjectWizardContentPaths(
std::shared_ptr<SourceGroupSettings>(),
window,
QtPathListBox::SELECTION_POLICY_DIRECTORIES_ONLY)
QtPathListBox::SELECTION_POLICY_DIRECTORIES_ONLY,
true)
{
setTitleString("Global Include Paths");
setHelpString(
@@ -72,7 +73,7 @@ bool QtProjectWizardContentPathsHeaderSearchGlobal::check()
if (compilerHeaderPaths.size())
{
QMessageBox msgBox;
QMessageBox msgBox(m_window);
msgBox.setText("Multiple Compiler Headers");
msgBox.setInformativeText(
"Your Global Include Paths contain other paths that hold C/C++ compiler headers, "
@@ -112,6 +113,33 @@ void QtProjectWizardContentPathsHeaderSearchGlobal::detectedPaths(const std::vec
void QtProjectWizardContentPathsHeaderSearchGlobal::setPaths(const std::vector<FilePath>& paths)
{
// check data change to avoid UI update that messes with the scroll position
{
std::vector<FilePath> currentPaths = m_list->getPathsAsDisplayed();
if (currentPaths.size())
{
currentPaths.erase(currentPaths.begin());
}
if (currentPaths.size() == paths.size())
{
bool same = true;
for (size_t i = 0; i < paths.size(); ++i)
{
if (currentPaths[i] != paths[i])
{
same = false;
break;
}
}
if (same)
{
return;
}
}
}
m_list->setPaths({});
m_list->addPaths({ResourcePaths::getCxxCompilerHeaderPath()}, true);
m_list->addPaths(paths);
@@ -105,7 +105,7 @@ QtProjectWizardContentPathsIndexedHeaders::QtProjectWizardContentPathsIndexedHea
QtProjectWizardWindow* window,
std::string projectKindName)
: QtProjectWizardContentPaths(
settings, window, QtPathListBox::SELECTION_POLICY_FILES_AND_DIRECTORIES)
settings, window, QtPathListBox::SELECTION_POLICY_FILES_AND_DIRECTORIES, true)
, m_projectKindName(projectKindName)
{
m_showFilesString = "";
@@ -165,19 +165,22 @@ bool QtProjectWizardContentPathsIndexedHeaders::check()
{
if (m_list->getPathsAsDisplayed().empty())
{
QMessageBox msgBox;
QMessageBox msgBox(m_window);
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();
QPushButton* yesButton = msgBox.addButton(QStringLiteral("Continue"), QMessageBox::ButtonRole::YesRole);
msgBox.addButton(QStringLiteral("Cancel"), QMessageBox::ButtonRole::NoRole);
msgBox.setDefaultButton(yesButton);
if (msgBox.exec() != 0)
{
return false;
}
}
return QtProjectWizardContentPaths::check();
}
void QtProjectWizardContentPathsIndexedHeaders::buttonClicked()
@@ -193,7 +196,7 @@ void QtProjectWizardContentPathsIndexedHeaders::buttonClicked()
codeblocksSettings->getCodeblocksProjectPathExpandedAndAbsolute();
if (!codeblocksProjectPath.exists())
{
QMessageBox msgBox;
QMessageBox msgBox(m_window);
msgBox.setText("The provided Code::Blocks project path does not exist.");
msgBox.setDetailedText(QString::fromStdWString(codeblocksProjectPath.wstr()));
msgBox.exec();
@@ -237,7 +240,7 @@ void QtProjectWizardContentPathsIndexedHeaders::buttonClicked()
const FilePath cdbPath = cdbSettings->getCompilationDatabasePathExpandedAndAbsolute();
if (!cdbPath.exists())
{
QMessageBox msgBox;
QMessageBox msgBox(m_window);
msgBox.setText("The provided Compilation Database path does not exist.");
msgBox.setDetailedText(QString::fromStdWString(cdbPath.wstr()));
msgBox.exec();
@@ -1,5 +1,7 @@
#include "QtProjectWizardContentPathsSource.h"
#include <QMessageBox>
#include "language_packages.h"
#include "SourceGroupCustomCommand.h"
@@ -26,7 +28,7 @@
QtProjectWizardContentPathsSource::QtProjectWizardContentPathsSource(
std::shared_ptr<SourceGroupSettings> settings, QtProjectWizardWindow* window)
: QtProjectWizardContentPaths(
settings, window, QtPathListBox::SELECTION_POLICY_FILES_AND_DIRECTORIES)
settings, window, QtPathListBox::SELECTION_POLICY_FILES_AND_DIRECTORIES, true)
{
m_showFilesString = QStringLiteral("show files");
@@ -63,6 +65,28 @@ void QtProjectWizardContentPathsSource::save()
}
}
bool QtProjectWizardContentPathsSource::check()
{
if (m_list->getPathsAsDisplayed().empty())
{
QMessageBox msgBox(m_window);
msgBox.setText(QStringLiteral("You didn't specify any 'Files & Directories to Index'."));
msgBox.setInformativeText(QStringLiteral(
"Sourcetrail will not index any files for this Source Group. Please add paths to files or directories "
"that should be indexed."));
QPushButton* yesButton = msgBox.addButton(QStringLiteral("Continue"), QMessageBox::ButtonRole::YesRole);
msgBox.addButton(QStringLiteral("Cancel"), QMessageBox::ButtonRole::NoRole);
msgBox.setDefaultButton(yesButton);
if (msgBox.exec() != 0)
{
return false;
}
}
return QtProjectWizardContentPaths::check();
}
std::vector<FilePath> QtProjectWizardContentPathsSource::getFilePaths() const
{
std::set<FilePath> allSourceFilePaths;
@@ -14,6 +14,8 @@ public:
virtual void load() override;
virtual void save() override;
virtual bool check() override;
virtual std::vector<FilePath> getFilePaths() const override;
virtual QString getFileNamesTitle() const override;
virtual QString getFileNamesDescription() const override;
+2 -2
View File
@@ -7,9 +7,9 @@ QtHelpButtonInfo::QtHelpButtonInfo(const QString& title, const QString& text)
{
}
void QtHelpButtonInfo::displayMessage()
void QtHelpButtonInfo::displayMessage(QWidget* messageBoxParent)
{
QMessageBox msgBox;
QMessageBox msgBox(messageBoxParent);
msgBox.setWindowTitle(QStringLiteral("Sourcetrail"));
msgBox.setIcon(QMessageBox::Information);
msgBox.setText("<b>" + m_title + "</b>");
+3 -1
View File
@@ -3,12 +3,14 @@
#include <QString>
class QWidget;
class QtHelpButtonInfo
{
public:
QtHelpButtonInfo(const QString& helpTitle, const QString& helpText);
void displayMessage();
void displayMessage(QWidget* messageBoxParent);
private:
QString m_title;
@@ -30,7 +30,6 @@ QtPreferencesWindow::QtPreferencesWindow(QWidget* parent): QtProjectWizardWindow
QtProjectWizardContentGroup* summary = new QtProjectWizardContentGroup(this);
summary->setIsForm(true);
summary->addContent(new QtProjectWizardContentPreferences(this));
#if BUILD_CXX_LANGUAGE_PACKAGE
@@ -43,7 +42,7 @@ QtPreferencesWindow::QtPreferencesWindow(QWidget* parent): QtProjectWizardWindow
setPreferredSize(QSize(750, 500));
setContent(summary);
setScrollAble(content()->isScrollAble());
setScrollAble(true);
}
QtPreferencesWindow::~QtPreferencesWindow() {}
+16 -5
View File
@@ -1,35 +1,46 @@
* Run "1_setup.sh"
* Start up Sourcetrail
* Click "New Project"
* Enter a project name
* Set "./working_copy" as project location
* Click "Add Source Group"
* Select "C++" -> Empty C++ Source Group"
* Click "Next"
* Click "Next"
* Add "./src" to "Files & Directories to Index"
* Click "show files" button
* Validate "Source Files" list contains "src/main.cpp"
* Add "**/Foo.h" to "Excluded Files & Directories"
* Click "Next"
* Click "validate include directives"
* Validate result: "All include directives are resolved"
* Click "Next"
* Click "Next"
* Click "Create"
* Validate "All files" is the only option selectable
* Click "Start"
* Validate Project indexed without error
* Click "OK"
* Press "Refresh" button
* Validate "Updated files" is selected
* Validate "source files to index" shows "0"
* Click "Cancel"
* Run "2_update.sh"
* Press "Refresh" button
* Validate "Files to clear" shows "3"
* Validate "source files to index" shows "1"
* Click "Start"
* Validate Project indexed without error
* Click "OK"
* Close Sourcetrail
* Run "3_teardown.sh"
@@ -1,25 +1,32 @@
* Run "1_setup.sh"
* Start up Sourcetrail
* Click "New Project"
* Enter a project name
* Set "./working_copy" as project location
* Click "Add Source Group"
* Select "C++" -> Empty C++ Source Group"
* Click "Next"
* Click "Next"
* Add "./src" to "Files & Directories to Index"
* Click "show files" button
* Validate "Source Files" list contains "src/main.cpp"
* Add "**/Foo.h" to "Excluded Files & Directories"
* Click "Next"
* Click "Next"
* Click "Next"
* Add "-DCOMPILER_FLAG" to "Compiler Flags"
* Add "./src/pch.h" to "Precompiled Header File"
* Add "-DPCH_FLAG" to "Precompiled Header Flags"
* Click "Next"
* Click "Create"
* Validate "All files" is the only option selectable
* Click "Start"
* Validate Project indexed without error
* Click "OK"
* Close Sourcetrail
* Run "2_teardown.sh"
@@ -1,67 +1,98 @@
* Run "1_setup.sh"
* Download the SourcetrailPythonIndexer project from https://github.com/CoatiSoftware/SourcetrailPythonIndexer
* Extract the archive to "./working_copy/SourcetrailPythonIndexer"
* Fetch the SourcetrailDB release for your OS from https://github.com/CoatiSoftware/SourcetrailDB/releases
* Extract the archive to "./working_copy/SourcetrailPythonIndexer"
* Start up Sourcetrail
* Click "New Project"
* Enter a project name
* Set "./working_copy" as project location
* Click "Add Source Group"
* Select "Custom" -> "Custom Command Source Group"
* Click "Next"
* Add "python <path/to/working_copy>/SourcetrailPythonIndexer/run.py index --source-file-path=%{SOURCE_FILE_PATH} --database-file-path=%{DATABASE_FILE_PATH}" to "Custom Command"
* Add "./src" to "Files & Directories to Index"
* Add "**main*" to "Excluded Files & Directories"
* Add ".py" to "Source File Extensions"
* Click "Next"
* Click "show files" button
* Validate "Source Files" list contains "src/bar.py" and "src/foo.py"
* Click "Create"
* Validate "All files" is the only option selectable
* Validate "source files to index" shows "2"
* Click "Start"
* Validate Project indexed without error
* Click "OK"
* Enter "print" in the search bar and press "Enter"
* Validate the search bar shows "foo.Foo.print"
* Validate the graph shows some nodes and edges
* Validate the code view shows some code with syntax highlighting
* Press "Refresh" button
* Validate "Updated files" is selected
* Validate "source files to index" shows "0"
* Click "Cancel"
* Click "Edit Project"
* Clear the "Excluded Files & Directories" list
* Click "Save"
* Validate a project-file-was-changed-notification appears
* Click "Reindex"
* Validate "All files" is selected
* Validate "source files to index" shows "3"
* Click "Updated files"
* Validate "source files to index" shows "1"
* Click Start
* Validate Project indexed without error
* Click "OK"
* Validate content of code and graph view changed and display calls from "main"
* Run "2_update.sh"
* Click "Refresh" button
* Validate "Updated files" is selected
* Validate "files to clear" shows "1"
* Validate "source files to index" shows "1"
* Click Start
* Validate a dialog appears that states that the project cannot be partially cleared
* Click "Fill Re-Index"
* Click "Full Re-Index"
* Validate Project indexed without error
* Click "OK"
* Click "Edit Project"
* In "Custom Command" replace "python" with "pyt"
* In "Custom Command" replace "%{SOURCE_FILE_PATH}" with "foo"
* Click "Save"
* Validate "Warning appears that %{SOURCE_FILE_PATH} is not defined in command"
* In "Custom Command" replace "foo" with "%{SOURCE_FILE_PATH}"
* Click "Save"
* Validate a project-file-was-changed-notification appears
* Click "Reindex"
* Click "Start"
* Validate "Log View appears showing errors that command execution failed".
* Close Sourcetrail
* Run "3_teardown.sh"
+15 -1
View File
@@ -1,33 +1,47 @@
* Run "1_setup.sh"
* Start up Sourcetrail
* Click "New Project"
* Enter a project name
* Set "./working_copy" as project location
* Click "Add Source Group"
* Select "C++" -> C/C++ from Code::Blocks"
* Click "Next"
* Pick "Test.cbp" at "Code::Blocks Project"
* Click "show source files" button
* Validate "Source Files" list contains 2 files: "src/main.cpp", "src/test.cpp"
* Click "OK"
* Validate "Header Files & Directories to Index" contains "src" entry
* Add "**/Foo.h" to "Excluded Files & Directories"
* Click "Next"
* Click "Create"
* Validate "All files" is the only option selectable
* Click "Start"
* Validate Project indexed without error
* Click "OK"
* Press "Refresh" button
* Validate "Updated files" is selected
* Validate "source files to index" shows "0"
* Click "Cancel"
* Run "2_update.sh"
* Press "Refresh" button
* Validate "Files to clear" shows "4"
* Validate "source files to index" shows "1"
* Click "Start"
* Validate Project indexed without error
* Click "OK"
* Close Sourcetrail
* Run "3_teardown.sh"
+16 -4
View File
@@ -1,39 +1,51 @@
* Run "1_setup.sh"
* Start up Sourcetrail
* Click "New Project"
* Enter a project name
* Set "./working_copy" as project location
* Click "Add Source Group"
* Select "C++" -> C/C++ from Compilation Database"
* Click "Next"
* Pick "compile_commands.json" at "Compilation Database"
* Click "show source files" button
* Validate "Source Files" list contains "src/main.cpp"
* Click "OK"
* Validate "Header Files & Directories to Index" contains "src" entry
* Add "**/Foo.h" to "Excluded Files & Directories"
* Click "Next"
* Pick any file at "Precompiled Header File"
* Click "Next"
* Validate dialog appears that asks NOT to specify PCH input file
* Click "OK"
* Click "Cancel"
* Clear "Precompiled Header File"
* Click "Next"
* Click "Create"
* Validate "All files" is the only option selectable
* Click "Start"
* Validate Project indexed without error
* Click "OK"
* Press "Refresh" button
* Validate "Updated files" is selected
* Validate "source files to index" shows "0"
* Click "Cancel"
* Run "2_update.sh"
* Press "Refresh" button
* Validate "Files to clear" shows "3"
* Validate "source files to index" shows "1"
* Click "Start"
* Validate Project indexed without error
* Click "OK"
* Close Sourcetrail
* Run "3_teardown.sh"
@@ -1,29 +1,40 @@
* Run "1_setup.sh"
* Start up Sourcetrail
* Click "New Project"
* Enter a project name
* Set "./working_copy" as project location
* Click "Add Source Group"
* Select "C++" -> C/C++ from Compilation Database"
* Click "Next"
* Pick "compile_commands.json" at "Compilation Database"
* Click "show source files" button
* Validate "Source Files" list contains "src/main.cpp"
* Click "OK"
* Validate "Header Files & Directories to Index" contains "src" entry
* Add "**/Foo.h" to "Excluded Files & Directories"
* Click "Next"
* Click "Next"
* Click "Create"
* Validate dialog appears that asks to specify PCH input file
* Click "Cancel"
* Add "./src/pch.h" to "Precompiled Header File"
* Click "Next"
* Add "-DCOMPILER_FLAG" to "Additional Compiler Flags"
* Add "./src/pch.h" to "Precompiled Header File"
* Add "-DPCH_FLAG" to "Precompiled Header Flags"
* Click "Create"
* Validate "All files" is the only option selectable
* Click "Start"
* Validate Project indexed without error
* Click "OK"
* Close Sourcetrail
* Run "2_teardown.sh"
+13 -4
View File
@@ -1,32 +1,41 @@
* Run "1_setup.sh"
* Start up Sourcetrail
* Click "New Project"
* Enter a project name
* Set "./working_copy" as project location
* Click "Add Source Group"
* Select "Java" -> Empty Java Source Group"
* Click "Next"
* Click "Next"
* Add "./src" to "Files & Directories to Index"
* Add "**/Foo.java" to "Excluded Files & Directories"
* Click "Next"
* Click "Next"
* Click "Create"
* Validate "All files" is the only option selectable
* Click "Start"
* Validate Project indexed without error
* Click "OK"
* Press "Refresh" button
* Validate "Updated files" is selected
* Validate "source files to index" shows "0"
* Click "Cancel"
* Run "2_update.sh"
* Press "Refresh" button
* Validate "Files to clear" shows "1"
* Validate "source files to index" shows "1"
* Click "Start"
* Validate Project indexed without error
* Click "OK"
* Close Sourcetrail
* Run "3_teardown.sh"
@@ -1,38 +1,51 @@
* Run "1_setup.sh"
* Start up Sourcetrail
* Click "New Project"
* Enter a project name
* Set "./working_copy" as project location
* Click "Add Source Group"
* Select "Java" -> Java Source Group from Gradle"
* Click "Next"
* Select "build.gradle" at "Gradle Project File"
* Click "show source files"
* Validate 2 files are listed
* Click "OK"
* Check "Should Index Tests"
* Click "show source files"
* Validate 3 files are listed
* Click "OK"
* Click "Next"
* Add "**/HelloWorld.java" to "Excluded Files & Directories"
* Click "Next"
* Click "Create"
* Validate "All files" is the only option selectable
* Validate 2 files are listed for indexing
* Click "Start"
* Validate Project indexed without error
* Click "OK"
* Press "Refresh" button
* Validate "Updated files" is selected
* Validate "source files to index" shows "0"
* Click "Cancel"
* Run "2_update.sh"
* Press "Refresh" button
* Validate "Files to clear" shows "1"
* Validate "source files to index" shows "1"
* Click "Start"
* Validate Project indexed without error
* Click "OK"
* Close Sourcetrail
* Run "3_teardown.sh"
+15 -2
View File
@@ -1,38 +1,51 @@
* Run "1_setup.sh"
* Start up Sourcetrail
* Click "New Project"
* Enter a project name
* Set "./working_copy" as project location
* Click "Add Source Group"
* Select "Java" -> Java Source Group from Maven"
* Click "Next"
* Select "my-app/pom.xml" at "Maven Project File"
* Click "show source files"
* Validate 4 files are listed
* Click "OK"
* Check "Should Index Tests"
* Click "show source files"
* Validate 5 files are listed
* Click "OK"
* Click "Next"
* Add "**/Foo.java" to "Excluded Files & Directories"
* Click "Next"
* Click "Create"
* Validate "All files" is the only option selectable
* Validate 4 files are listed for indexing
* Click "Start"
* Validate Project indexed without error
* Click "OK"
* Press "Refresh" button
* Validate "Updated files" is selected
* Validate "source files to index" shows "0"
* Click "Cancel"
* Run "2_update.sh"
* Press "Refresh" button
* Validate "Files to clear" shows "1"
* Validate "source files to index" shows "1"
* Click "Start"
* Validate Project indexed without error
* Click "OK"
* Close Sourcetrail
* Run "3_teardown.sh"
@@ -1,32 +1,47 @@
* Run "1_setup.sh"
* Start up Sourcetrail
* Click "New Project"
* Enter a project name
* Set "./working_copy" as project location
* Click "Add Source Group"
* Select "Python" -> Empty Python Source Group"
* Click "Next"
* Add "./src" to "Files & Directories to Index"
* Add "**/foo.py" to "Excluded Files & Directories"
* Click "Next"
* Click "show files" button
* Validate "Source Files" list contains "src/bar.py", "src/baz.py", "src/main.py"
* Click "Create"
* Validate "All files" is the only option selectable
* Click "Start"
* Validate Project indexed without error
* Click "OK"
* Press "Refresh" button
* Validate "Updated files" is selected
* Validate "source files to index" shows "0"
* Click "Cancel"
* Run "2_update.sh"
* Press "Refresh" button
* Validate "Files to clear" shows "1"
* Validate "source files to index" shows "1"
* Click "Start"
* Validate dialog shows up that informs that only full re-indexing is possible
* Click "Full Re-Index"
* Validate Project indexed without error
* Click "OK"
* Close Sourcetrail
* Run "3_teardown.sh"