diff --git a/bin/app/data/gui/indexing_dialog/indexing_dialog.css b/bin/app/data/gui/indexing_dialog/indexing_dialog.css index ba7b5871..3fb7d019 100644 --- a/bin/app/data/gui/indexing_dialog/indexing_dialog.css +++ b/bin/app/data/gui/indexing_dialog/indexing_dialog.css @@ -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; } diff --git a/bin/app/data/gui/window/window.css b/bin/app/data/gui/window/window.css index af32cf41..77cb1cca 100644 --- a/bin/app/data/gui/window/window.css +++ b/bin/app/data/gui/window/window.css @@ -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; } diff --git a/src/lib/component/controller/ErrorController.cpp b/src/lib/component/controller/ErrorController.cpp index c70c47fe..a07abe62 100644 --- a/src/lib/component/controller/ErrorController.cpp +++ b/src/lib/component/controller/ErrorController.cpp @@ -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) diff --git a/src/lib_gui/CMakeLists.txt b/src/lib_gui/CMakeLists.txt index d19388af..d5c4cb03 100644 --- a/src/lib_gui/CMakeLists.txt +++ b/src/lib_gui/CMakeLists.txt @@ -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 diff --git a/src/lib_gui/qt/element/button/QtHelpButton.cpp b/src/lib_gui/qt/element/button/QtHelpButton.cpp index d7304540..cd98a44c 100644 --- a/src/lib_gui/qt/element/button/QtHelpButton.cpp +++ b/src/lib_gui/qt/element/button/QtHelpButton.cpp @@ -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); } diff --git a/src/lib_gui/qt/element/button/QtHelpButton.h b/src/lib_gui/qt/element/button/QtHelpButton.h index 2d81af2d..dd6013af 100644 --- a/src/lib_gui/qt/element/button/QtHelpButton.h +++ b/src/lib_gui/qt/element/button/QtHelpButton.h @@ -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 diff --git a/src/lib_gui/qt/project_wizard/QtProjectWizard.cpp b/src/lib_gui/qt/project_wizard/QtProjectWizard.cpp index 8e881e09..c3ae4f32 100644 --- a/src/lib_gui/qt/project_wizard/QtProjectWizard.cpp +++ b/src/lib_gui/qt/project_wizard/QtProjectWizard.cpp @@ -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 -std::vector> getSourceGroupWizardPages(); +void addSourceGroupContents( + QtProjectWizardContentGroup* group, std::shared_ptr settings, QtProjectWizardWindow* window); #if BUILD_CXX_LANGUAGE_PACKAGE template <> -std::vector> getSourceGroupWizardPages< - SourceGroupSettingsCEmpty>() +void addSourceGroupContents( + QtProjectWizardContentGroup* group, std::shared_ptr settings, QtProjectWizardWindow* window) { - std::vector> pages; - { - QtSourceGroupWizardPage page("Language Standard", 470, 460); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - pages.push_back(page); - } - { - QtSourceGroupWizardPage page("Indexed Paths"); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - pages.push_back(page); - } - { - QtSourceGroupWizardPage page("Include Paths"); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - page.addContentCreatorSimple( - 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 page("Framework Search Paths"); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - page.addContentCreatorSimple( - WIZARD_CONTENT_CONTEXT_ALL); - pages.push_back(page); - } - { - QtSourceGroupWizardPage page("Advanced (optional)"); - page.addContentCreatorWithSettings(WIZARD_CONTENT_CONTEXT_ALL); - page.addContentCreator( - WIZARD_CONTENT_CONTEXT_ALL, - [](std::shared_ptr settings, QtProjectWizardWindow* window) { - return new QtProjectWizardContentPathCxxPch(settings, settings, window); - }); - page.addContentCreatorWithSettings( - 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> getSourceGroupWizardPages< - SourceGroupSettingsCppEmpty>() +void addSourceGroupContents( + QtProjectWizardContentGroup* group, std::shared_ptr settings, QtProjectWizardWindow* window) { - std::vector> pages; - { - QtSourceGroupWizardPage page("Language Standard", 470, 460); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - pages.push_back(page); - } - { - QtSourceGroupWizardPage page("Indexed Paths"); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - pages.push_back(page); - } - { - QtSourceGroupWizardPage page("Include Paths"); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - page.addContentCreatorSimple( - 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 page("Framework Search Paths"); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - page.addContentCreatorSimple( - WIZARD_CONTENT_CONTEXT_ALL); - pages.push_back(page); - } - { - QtSourceGroupWizardPage page("Advanced (optional)"); - page.addContentCreatorWithSettings(WIZARD_CONTENT_CONTEXT_ALL); - page.addContentCreator( - WIZARD_CONTENT_CONTEXT_ALL, - [](std::shared_ptr settings, QtProjectWizardWindow* window) { - return new QtProjectWizardContentPathCxxPch(settings, settings, window); - }); - page.addContentCreatorWithSettings( - 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> getSourceGroupWizardPages< - SourceGroupSettingsCxxCdb>() +void addSourceGroupContents( + QtProjectWizardContentGroup* group, std::shared_ptr settings, QtProjectWizardWindow* window) { - std::vector> pages; - { - QtSourceGroupWizardPage page("Compilation Database Path"); - page.addContentCreatorWithSettings(WIZARD_CONTENT_CONTEXT_ALL); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL, "Compilation Database"); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - pages.push_back(page); - } - { - QtSourceGroupWizardPage page("Include Paths"); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_SUMMARY, true); - page.addContentCreatorSimple( - 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 page("Framework Search Paths"); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_SUMMARY, true); - page.addContentCreatorSimple( - WIZARD_CONTENT_CONTEXT_SUMMARY); - pages.push_back(page); - } - { - QtSourceGroupWizardPage page("Advanced (optional)"); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_SUMMARY, true); - page.addContentCreator( - WIZARD_CONTENT_CONTEXT_ALL, - [](std::shared_ptr settings, QtProjectWizardWindow* window) { - return new QtProjectWizardContentPathCxxPch(settings, settings, window); - }); - page.addContentCreatorWithSettings( - 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> getSourceGroupWizardPages< - SourceGroupSettingsCxxCodeblocks>() +void addSourceGroupContents( + QtProjectWizardContentGroup* group, std::shared_ptr settings, QtProjectWizardWindow* window) { - std::vector> pages; - { - QtSourceGroupWizardPage page("Code::Blocks Project Path"); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL, std::string("Code::Blocks Project")); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - pages.push_back(page); - } - { - QtSourceGroupWizardPage page("Include Paths"); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_SUMMARY, true); - page.addContentCreatorSimple( - 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 page("Framework Search Paths"); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_SUMMARY, true); - page.addContentCreatorSimple( - WIZARD_CONTENT_CONTEXT_SUMMARY); - pages.push_back(page); - } - { - QtSourceGroupWizardPage page("Advanced (optional)"); - page.addContentCreatorWithSettings( - 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> getSourceGroupWizardPages< - SourceGroupSettingsCxxCdbVs>() +void addSourceGroupContents( + QtProjectWizardContentGroup* group, std::shared_ptr settings, QtProjectWizardWindow* window) { - std::vector> pages; - { - QtSourceGroupWizardPage page("VS Solution"); - page.addContentCreatorSimple(WIZARD_CONTENT_CONTEXT_SETUP); - page.addContentCreatorWithSettings(WIZARD_CONTENT_CONTEXT_ALL); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL, std::string("Compilation Database")); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - pages.push_back(page); - } - { - QtSourceGroupWizardPage page("Include Paths"); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_SUMMARY, true); - page.addContentCreatorSimple( - 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 page("Framework Search Paths"); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_SUMMARY, true); - page.addContentCreatorSimple( - WIZARD_CONTENT_CONTEXT_SUMMARY); - pages.push_back(page); - } - { - QtSourceGroupWizardPage page("Advanced (optional)"); - page.addContentCreatorWithSettings( - 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> getSourceGroup #if BUILD_JAVA_LANGUAGE_PACKAGE template <> -std::vector> getSourceGroupWizardPages< - SourceGroupSettingsJavaEmpty>() +void addSourceGroupContents( + QtProjectWizardContentGroup* group, std::shared_ptr settings, QtProjectWizardWindow* window) { - std::vector> pages; - { - QtSourceGroupWizardPage page("Language Standard", 470, 230); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - pages.push_back(page); - } - { - QtSourceGroupWizardPage page("Indexed Paths", 750, 600); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - pages.push_back(page); - } - { - QtSourceGroupWizardPage page("Dependencies", 750, 600); - page.addContentCreatorWithSettings( - 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> getSourceGroupWizardPages< - SourceGroupSettingsJavaMaven>() +void addSourceGroupContents( + QtProjectWizardContentGroup* group, std::shared_ptr settings, QtProjectWizardWindow* window) { - std::vector> pages; - { - QtSourceGroupWizardPage page("Indexed Paths"); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - pages.push_back(page); - } - { - QtSourceGroupWizardPage page("Advanced (optional)"); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - page.addContentCreatorWithSettings( - 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> getSourceGroupWizardPages< - SourceGroupSettingsJavaGradle>() +void addSourceGroupContents( + QtProjectWizardContentGroup* group, std::shared_ptr settings, QtProjectWizardWindow* window) { - std::vector> pages; - { - QtSourceGroupWizardPage page("Indexed Paths"); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - pages.push_back(page); - } - { - QtSourceGroupWizardPage page("Advanced (optional)"); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - page.addContentCreatorWithSettings( - 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> getSourceGroupWizardPages< - SourceGroupSettingsPythonEmpty>() +void addSourceGroupContents( + QtProjectWizardContentGroup* group, std::shared_ptr settings, QtProjectWizardWindow* window) { - std::vector> pages; - { - QtSourceGroupWizardPage page("Indexed Paths", 750, 600); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - page.addContentCreatorWithSettings( - 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> getSourceGroupWizardPages< - SourceGroupSettingsCustomCommand>() +void addSourceGroupContents( + QtProjectWizardContentGroup* group, std::shared_ptr settings, QtProjectWizardWindow* window) { - std::vector> pages; - { - QtSourceGroupWizardPage page("Indexed Paths"); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - page.addContentCreatorWithSettings( - 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> getSourceGroupWizardPages< - SourceGroupSettingsUnloadable>() +void addSourceGroupContents( + QtProjectWizardContentGroup* group, std::shared_ptr settings, QtProjectWizardWindow* window) { - std::vector> pages; - { - QtSourceGroupWizardPage page(""); - page.addContentCreatorWithSettings( - WIZARD_CONTENT_CONTEXT_ALL); - pages.push_back(page); - } - return pages; -} - -template -void fillSummary( - QtProjectWizardContentGroup* summary, - std::shared_ptr settings, - QtProjectWizardWindow* window) -{ - const std::vector> pages = - getSourceGroupWizardPages(); - - for (const QtSourceGroupWizardPage& 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(sourceGroupSettings); + createSourceGroup(sourceGroupSettings); #endif // BUILD_CXX_LANGUAGE_PACKAGE } @@ -768,24 +560,6 @@ void QtProjectWizard::handlePrevious() QtWindow::handlePrevious(); } -template -void QtProjectWizard::executeSourceGroupSetup(std::shared_ptr settings) -{ - std::shared_ptr> wizard = - std::make_shared>( - settings, - std::bind(&QtProjectWizard::cancelSourceGroup, this), - std::bind(&QtProjectWizard::createSourceGroup, this, std::placeholders::_1)); - - for (const QtSourceGroupWizardPage& page: getSourceGroupWizardPages()) - { - wizard->addPage(page); - } - - m_sourceGroupWizard = wizard; - m_sourceGroupWizard->execute(m_windowStack); -} - QtProjectWizardWindow* QtProjectWizard::createWindowWithContent( std::function 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 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& 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 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 settings = std::dynamic_pointer_cast(group)) { - fillSummary(summary, settings, this); + addSourceGroupContents(summary, settings, this); } - if (std::shared_ptr settings = + else if (std::shared_ptr settings = std::dynamic_pointer_cast(group)) { - fillSummary(summary, settings, this); + addSourceGroupContents(summary, settings, this); } #if BUILD_CXX_LANGUAGE_PACKAGE else if ( std::shared_ptr settings = std::dynamic_pointer_cast(group)) { - fillSummary(summary, settings, this); + addSourceGroupContents(summary, settings, this); } else if ( std::shared_ptr settings = std::dynamic_pointer_cast(group)) { - fillSummary(summary, settings, this); + addSourceGroupContents(summary, settings, this); } else if ( std::shared_ptr settings = std::dynamic_pointer_cast(group)) { - fillSummary(summary, settings, this); + addSourceGroupContents(summary, settings, this); } else if ( std::shared_ptr settings = std::dynamic_pointer_cast(group)) { - fillSummary(summary, settings, this); + addSourceGroupContents(summary, settings, this); } else if ( std::shared_ptr settings = std::dynamic_pointer_cast(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 settings = std::dynamic_pointer_cast(group)) { - fillSummary(summary, settings, this); + addSourceGroupContents(summary, settings, this); } else if ( std::shared_ptr settings = std::dynamic_pointer_cast(group)) { - fillSummary(summary, settings, this); + addSourceGroupContents(summary, settings, this); } else if ( std::shared_ptr settings = std::dynamic_pointer_cast(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 settings = std::dynamic_pointer_cast(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 settings; switch (sourceGroupType) { #if BUILD_CXX_LANGUAGE_PACKAGE case SOURCE_GROUP_C_EMPTY: { - std::shared_ptr settings = + std::shared_ptr cxxSettings = std::make_shared(sourceGroupId, m_projectSettings.get()); - addMsvcCompatibilityFlagsOnDemand(settings); - executeSourceGroupSetup(settings); + addMsvcCompatibilityFlagsOnDemand(cxxSettings); + settings = cxxSettings; } break; case SOURCE_GROUP_CPP_EMPTY: { - std::shared_ptr settings = + std::shared_ptr cxxSettings = std::make_shared(sourceGroupId, m_projectSettings.get()); - addMsvcCompatibilityFlagsOnDemand(settings); - executeSourceGroupSetup(settings); + addMsvcCompatibilityFlagsOnDemand(cxxSettings); + settings = cxxSettings; } break; case SOURCE_GROUP_CXX_CDB: - { - std::shared_ptr settings = - std::make_shared(sourceGroupId, m_projectSettings.get()); - executeSourceGroupSetup(settings); - } - break; + settings = std::make_shared(sourceGroupId, m_projectSettings.get()); + break; case SOURCE_GROUP_CXX_CODEBLOCKS: { - std::shared_ptr settings = - std::make_shared( - sourceGroupId, m_projectSettings.get()); - addMsvcCompatibilityFlagsOnDemand(settings); - executeSourceGroupSetup(settings); + std::shared_ptr cxxSettings = + std::make_shared(sourceGroupId, m_projectSettings.get()); + addMsvcCompatibilityFlagsOnDemand(cxxSettings); + settings = cxxSettings; } break; case SOURCE_GROUP_CXX_VS: - { - std::shared_ptr settings = - std::make_shared(sourceGroupId, m_projectSettings.get()); - executeSourceGroupSetup(settings); - } - break; + settings = std::make_shared(sourceGroupId, m_projectSettings.get()); + break; #endif // BUILD_CXX_LANGUAGE_PACKAGE + #if BUILD_JAVA_LANGUAGE_PACKAGE case SOURCE_GROUP_JAVA_EMPTY: - { - std::shared_ptr settings = - std::make_shared(sourceGroupId, m_projectSettings.get()); - executeSourceGroupSetup(settings); - } - break; + settings = std::make_shared(sourceGroupId, m_projectSettings.get()); + break; case SOURCE_GROUP_JAVA_MAVEN: - { - std::shared_ptr settings = - std::make_shared(sourceGroupId, m_projectSettings.get()); - executeSourceGroupSetup(settings); - } - break; + settings = std::make_shared(sourceGroupId, m_projectSettings.get()); + break; case SOURCE_GROUP_JAVA_GRADLE: - { - std::shared_ptr settings = - std::make_shared(sourceGroupId, m_projectSettings.get()); - executeSourceGroupSetup(settings); - } - break; + settings = std::make_shared(sourceGroupId, m_projectSettings.get()); + break; #endif // BUILD_JAVA_LANGUAGE_PACKAGE + #if BUILD_PYTHON_LANGUAGE_PACKAGE case SOURCE_GROUP_PYTHON_EMPTY: - { - std::shared_ptr settings = - std::make_shared(sourceGroupId, m_projectSettings.get()); - executeSourceGroupSetup(settings); - } - break; + settings = std::make_shared(sourceGroupId, m_projectSettings.get()); + break; #endif // BUILD_PYTHON_LANGUAGE_PACKAGE + case SOURCE_GROUP_CUSTOM_COMMAND: - { - std::shared_ptr settings = - std::make_shared( - sourceGroupId, m_projectSettings.get()); - executeSourceGroupSetup(settings); - } - break; + settings = std::make_shared(sourceGroupId, m_projectSettings.get()); + break; case SOURCE_GROUP_UNKNOWN: break; } + + if (settings) + { + createSourceGroup(settings); + } } void QtProjectWizard::createSourceGroup(std::shared_ptr 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"

Sourcetrail was unable to save the project to the specified path. Please pick a " diff --git a/src/lib_gui/qt/project_wizard/QtProjectWizard.h b/src/lib_gui/qt/project_wizard/QtProjectWizard.h index 9e0e93a8..386ca2db 100644 --- a/src/lib_gui/qt/project_wizard/QtProjectWizard.h +++ b/src/lib_gui/qt/project_wizard/QtProjectWizard.h @@ -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 - void executeSourceGroupSetup(std::shared_ptr settings); - QtProjectWizardWindow* createWindowWithContent( std::function func); - QtProjectWizardWindow* createWindowWithContentGroup( - std::function func); - void updateSourceGroupList(); bool canExitContent(); @@ -56,7 +49,6 @@ private: std::shared_ptr m_projectSettings; std::vector> m_allSourceGroupSettings; - std::shared_ptr m_sourceGroupWizard; ApplicationSettings m_appSettings; bool m_editing; diff --git a/src/lib_gui/qt/project_wizard/QtSourceGroupWizard.h b/src/lib_gui/qt/project_wizard/QtSourceGroupWizard.h deleted file mode 100644 index 58794409..00000000 --- a/src/lib_gui/qt/project_wizard/QtSourceGroupWizard.h +++ /dev/null @@ -1,156 +0,0 @@ -#ifndef QT_SOURCE_GROUP_WIZARD_H -#define QT_SOURCE_GROUP_WIZARD_H - -#include -#include -#include - -#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 settings) = 0; -}; - -template -class QtSourceGroupWizard: public QtSourceGroupWizardBase -{ -public: - QtSourceGroupWizard( - std::shared_ptr settings, - std::function onCancelClicked, - std::function)> onFinishedWizard); - - void addPage(const QtSourceGroupWizardPage& page); - void execute(QtWindowStack& windowStack) override; - bool canProcessSettings(std::shared_ptr settings) override; - -private: - void createWindowForPage(const size_t pageId, QtWindowStack& windowStack); - int mapToPageIdWithContentForContext(size_t pageId, WizardContentContextType contextType) const; - - std::shared_ptr m_settings; - std::function m_onCancelClicked; - std::function)> m_onFinishedWizard; - std::vector> m_pages; -}; - -template -QtSourceGroupWizard::QtSourceGroupWizard( - std::shared_ptr settings, - std::function onCancelClicked, - std::function)> onFinishedWizard) - : m_settings(settings), m_onCancelClicked(onCancelClicked), m_onFinishedWizard(onFinishedWizard) -{ -} - -template -void QtSourceGroupWizard::addPage(const QtSourceGroupWizardPage& page) -{ - m_pages.push_back(page); -} - -template -void QtSourceGroupWizard::execute(QtWindowStack& windowStack) -{ - if (!m_pages.empty()) - { - createWindowForPage( - mapToPageIdWithContentForContext(0, WIZARD_CONTENT_CONTEXT_SETUP), windowStack); - } -} - -template -bool QtSourceGroupWizard::canProcessSettings( - std::shared_ptr settings) -{ - if (std::dynamic_pointer_cast(settings)) - { - return true; - } - return false; -} - -template -void QtSourceGroupWizard::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& 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 -int QtSourceGroupWizard::mapToPageIdWithContentForContext( - size_t pageId, WizardContentContextType contextType) const -{ - while (pageId < m_pages.size()) - { - const QtSourceGroupWizardPage& page = m_pages.at(pageId); - if (page.hasContentForContext(contextType)) - { - return pageId; - } - pageId++; - } - return -1; -} - -#endif // QT_SOURCE_GROUP_WIZARD_H diff --git a/src/lib_gui/qt/project_wizard/QtSourceGroupWizardPage.h b/src/lib_gui/qt/project_wizard/QtSourceGroupWizardPage.h deleted file mode 100644 index 61e20816..00000000 --- a/src/lib_gui/qt/project_wizard/QtSourceGroupWizardPage.h +++ /dev/null @@ -1,159 +0,0 @@ -#ifndef QT_SOURCE_GROUP_WIZARD_PAGE_H -#define QT_SOURCE_GROUP_WIZARD_PAGE_H - -#include -#include -#include - -class QtProjectWizardWindow; - -enum WizardContentContextType -{ - WIZARD_CONTENT_CONTEXT_SETUP = 1, - WIZARD_CONTENT_CONTEXT_SUMMARY = 2, - WIZARD_CONTENT_CONTEXT_ALL = 3 -}; - -template -class QtSourceGroupWizardPage -{ -public: - typedef std::function settings, QtProjectWizardWindow* window)> - ContentCreator; - - QtSourceGroupWizardPage( - const std::string& title, int preferredWidth = 750, int preferredHeight = 600); - - void addContentCreator(WizardContentContextType contextType, ContentCreator contentCreator); - - template - void addContentCreatorSimple(WizardContentContextType contextType); - - template - void addContentCreatorWithSettings(WizardContentContextType contextType); - - template - 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 settings, - QtProjectWizardWindow* window) const; - -private: - const std::string m_title; - const int m_preferredWidth; - const int m_preferredHeight; - std::vector> m_contentCreators; -}; - -template -QtSourceGroupWizardPage::QtSourceGroupWizardPage( - const std::string& title, int preferredWidth, int preferredHeight) - : m_title(title), m_preferredWidth(preferredWidth), m_preferredHeight(preferredHeight) -{ -} - -template -void QtSourceGroupWizardPage::addContentCreator( - WizardContentContextType contextType, ContentCreator contentCreator) -{ - m_contentCreators.push_back(std::make_pair(contextType, contentCreator)); -} - -template -template -void QtSourceGroupWizardPage::addContentCreatorSimple(WizardContentContextType contextType) -{ - addContentCreator( - contextType, [](std::shared_ptr settings, QtProjectWizardWindow* window) { - return new ContentType(window); - }); -} - -template -template -void QtSourceGroupWizardPage::addContentCreatorWithSettings( - WizardContentContextType contextType) -{ - addContentCreator( - contextType, [](std::shared_ptr settings, QtProjectWizardWindow* window) { - return new ContentType(settings, window); - }); -} - -template -template -void QtSourceGroupWizardPage::addContentCreatorWithSettings( - WizardContentContextType contextType, ParamTypes... params) -{ - addContentCreator( - contextType, [=](std::shared_ptr settings, QtProjectWizardWindow* window) { - return new ContentType(settings, window, params...); - }); -} - -template -std::string QtSourceGroupWizardPage::getTitle() const -{ - return m_title; -} - -template -int QtSourceGroupWizardPage::getPreferredWidth() const -{ - return m_preferredWidth; -} - -template -int QtSourceGroupWizardPage::getPreferredHeight() const -{ - return m_preferredHeight; -} - -template -bool QtSourceGroupWizardPage::hasContentForContext(WizardContentContextType contextType) const -{ - for (const std::pair& contentCreator: m_contentCreators) - { - if (contentCreator.first & contextType) - { - return true; - } - } - return false; -} - -template -QtProjectWizardContentGroup* QtSourceGroupWizardPage::createContentGroup( - WizardContentContextType contextType, - std::shared_ptr settings, - QtProjectWizardWindow* window) const -{ - QtProjectWizardContentGroup* contentGroup = new QtProjectWizardContentGroup(window); - - bool firstContentAdded = false; - for (const std::pair& 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 diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContent.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContent.cpp index ea7e7311..0311cb77 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContent.cpp +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContent.cpp @@ -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 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 filePaths = getFilePaths(); diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContent.h b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContent.h index 6197f720..c2fcd4b0 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContent.h +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContent.h @@ -27,15 +27,10 @@ public: virtual void save(); virtual bool check(); - virtual bool isScrollAble() const; - virtual std::vector 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& filePaths); - bool m_isInForm; QtThreadedFunctor&> m_showFilesFunctor; }; diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCrossCompilationOptions.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCrossCompilationOptions.cpp index cbbb633e..05bfb8d5 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCrossCompilationOptions.cpp +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCrossCompilationOptions.cpp @@ -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() diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCustomCommand.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCustomCommand.cpp index b92e6102..d1611742 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCustomCommand.cpp +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCustomCommand.cpp @@ -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; diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCxxPchFlags.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCxxPchFlags.cpp index 71cd3f0d..e29c76b7 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCxxPchFlags.cpp +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCxxPchFlags.cpp @@ -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; diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentFlags.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentFlags.cpp index a353eabf..66df69da 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentFlags.cpp +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentFlags.cpp @@ -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; diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentGroup.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentGroup.cpp index 971ee63d..4362e694 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentGroup.cpp +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentGroup.cpp @@ -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; -} diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentGroup.h b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentGroup.h index f42122e5..7a65f1dd 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentGroup.h +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentGroup.h @@ -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 m_contents; bool m_isForm; diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentProjectData.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentProjectData.cpp index 3d59ea60..c2fa8368 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentProjectData.cpp +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentProjectData.cpp @@ -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); diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSelect.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSelect.cpp index 12640f35..4e9e0e20 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSelect.cpp +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSelect.cpp @@ -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; -} diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSelect.h b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSelect.h index 02094538..634b7c22 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSelect.h +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSelect.h @@ -21,8 +21,6 @@ public: void save() override; bool check() override; - bool isScrollAble() const override; - signals: void selected(SourceGroupType); diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSourceGroupData.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSourceGroupData.cpp index e800b696..1f57660e 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSourceGroupData.cpp +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSourceGroupData.cpp @@ -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; diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentUnloadable.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentUnloadable.cpp index 3762255a..d5123267 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentUnloadable.cpp +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentUnloadable.cpp @@ -1,14 +1,6 @@ #include "QtProjectWizardContentUnloadable.h" -#include -#include -#include -#include - -#include "FileSystem.h" -#include "ProjectSettings.h" #include "SourceGroupSettingsUnloadable.h" -#include "SqliteIndexStorage.h" QtProjectWizardContentUnloadable::QtProjectWizardContentUnloadable( std::shared_ptr settings, QtProjectWizardWindow* window) diff --git a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPath.cpp b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPath.cpp index 69129a65..43f5bc7c 100644 --- a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPath.cpp +++ b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPath.cpp @@ -75,7 +75,7 @@ bool QtProjectWizardContentPath::check() if (!error.isEmpty()) { - QMessageBox msgBox; + QMessageBox msgBox(m_window); msgBox.setText(error); msgBox.exec(); return false; diff --git a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCxxPch.cpp b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCxxPch.cpp index 58eb61b4..dcb07845 100644 --- a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCxxPch.cpp +++ b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCxxPch.cpp @@ -57,7 +57,7 @@ bool QtProjectWizardContentPathCxxPch::check() std::shared_ptr 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 " diff --git a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathSettingsMaven.cpp b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathSettingsMaven.cpp index 260d3058..15d00431 100644 --- a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathSettingsMaven.cpp +++ b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathSettingsMaven.cpp @@ -2,17 +2,7 @@ #include -//#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 settings, QtProjectWizardWindow* window) diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPaths.cpp b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPaths.cpp index a7cb923b..3c7ee5eb 100644 --- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPaths.cpp +++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPaths.cpp @@ -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)); diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPaths.h b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPaths.h index d0ead048..4c5f7d9c 100644 --- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPaths.h +++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPaths.h @@ -22,7 +22,7 @@ public: std::shared_ptr settings, QtProjectWizardWindow* window, QtPathListBox::SelectionPolicyType selectionPolicy, - bool checkMissingPaths = true); + bool checkMissingPaths); // QtSettingsWindow implementation virtual void populate(QGridLayout* layout, int& row) override; diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsClassJava.cpp b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsClassJava.cpp index a7aa8dcf..6d4803e2 100644 --- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsClassJava.cpp +++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsClassJava.cpp @@ -8,7 +8,7 @@ QtProjectWizardContentPathsClassJava::QtProjectWizardContentPathsClassJava( std::shared_ptr 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( diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearch.cpp b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearch.cpp index 381f3ca4..d9df98b2 100644 --- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearch.cpp +++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearch.cpp @@ -7,7 +7,7 @@ QtProjectWizardContentPathsFrameworkSearch::QtProjectWizardContentPathsFramework std::shared_ptr 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; -} diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearch.h b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearch.h index b278132b..2cc05b43 100644 --- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearch.h +++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearch.h @@ -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 diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearchGlobal.cpp b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearchGlobal.cpp index 122ebe77..a1db3871 100644 --- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearchGlobal.cpp +++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearchGlobal.cpp @@ -8,7 +8,8 @@ QtProjectWizardContentPathsFrameworkSearchGlobal::QtProjectWizardContentPathsFra : QtProjectWizardContentPaths( std::shared_ptr(), window, - QtPathListBox::SELECTION_POLICY_DIRECTORIES_ONLY) + QtPathListBox::SELECTION_POLICY_DIRECTORIES_ONLY, + true) { setTitleString("Global Framework Search Paths"); setHelpString( diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearch.cpp b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearch.cpp index e654b40c..d90408db 100644 --- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearch.cpp +++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearch.cpp @@ -25,7 +25,7 @@ QtProjectWizardContentPathsHeaderSearch::QtProjectWizardContentPathsHeaderSearch std::shared_ptr 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( "

No additional include paths have been detected while searching the provided " "paths.

"); @@ -395,7 +390,7 @@ void QtProjectWizardContentPathsHeaderSearch::showValidationResult( { if (unresolvedIncludes.empty()) { - QMessageBox msgBox; + QMessageBox msgBox(m_window); msgBox.setText( "

All include directives throughout the indexed files have been resolved.

"); msgBox.exec(); diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearch.h b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearch.h index 7e11da03..749e6709 100644 --- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearch.h +++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearch.h @@ -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(); diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearchGlobal.cpp b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearchGlobal.cpp index e5e029c4..92ac0d0f 100644 --- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearchGlobal.cpp +++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearchGlobal.cpp @@ -12,7 +12,8 @@ QtProjectWizardContentPathsHeaderSearchGlobal::QtProjectWizardContentPathsHeader : QtProjectWizardContentPaths( std::shared_ptr(), 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& paths) { + // check data change to avoid UI update that messes with the scroll position + { + std::vector 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); diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsIndexedHeaders.cpp b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsIndexedHeaders.cpp index e8ac261f..1960a63e 100644 --- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsIndexedHeaders.cpp +++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsIndexedHeaders.cpp @@ -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(); diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsSource.cpp b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsSource.cpp index 00705c49..6302245a 100644 --- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsSource.cpp +++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsSource.cpp @@ -1,5 +1,7 @@ #include "QtProjectWizardContentPathsSource.h" +#include + #include "language_packages.h" #include "SourceGroupCustomCommand.h" @@ -26,7 +28,7 @@ QtProjectWizardContentPathsSource::QtProjectWizardContentPathsSource( std::shared_ptr 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 QtProjectWizardContentPathsSource::getFilePaths() const { std::set allSourceFilePaths; diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsSource.h b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsSource.h index b5d86263..e81e38ec 100644 --- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsSource.h +++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsSource.h @@ -14,6 +14,8 @@ public: virtual void load() override; virtual void save() override; + virtual bool check() override; + virtual std::vector getFilePaths() const override; virtual QString getFileNamesTitle() const override; virtual QString getFileNamesDescription() const override; diff --git a/src/lib_gui/qt/utility/QtHelpButtonInfo.cpp b/src/lib_gui/qt/utility/QtHelpButtonInfo.cpp index d582ec44..d4f6e966 100644 --- a/src/lib_gui/qt/utility/QtHelpButtonInfo.cpp +++ b/src/lib_gui/qt/utility/QtHelpButtonInfo.cpp @@ -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("" + m_title + ""); diff --git a/src/lib_gui/qt/utility/QtHelpButtonInfo.h b/src/lib_gui/qt/utility/QtHelpButtonInfo.h index e81426b2..94be708a 100644 --- a/src/lib_gui/qt/utility/QtHelpButtonInfo.h +++ b/src/lib_gui/qt/utility/QtHelpButtonInfo.h @@ -3,12 +3,14 @@ #include +class QWidget; + class QtHelpButtonInfo { public: QtHelpButtonInfo(const QString& helpTitle, const QString& helpText); - void displayMessage(); + void displayMessage(QWidget* messageBoxParent); private: QString m_title; diff --git a/src/lib_gui/qt/window/QtPreferencesWindow.cpp b/src/lib_gui/qt/window/QtPreferencesWindow.cpp index c1bb89fc..56afc283 100644 --- a/src/lib_gui/qt/window/QtPreferencesWindow.cpp +++ b/src/lib_gui/qt/window/QtPreferencesWindow.cpp @@ -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() {} diff --git a/testing/project_setup/cpp_empty/checklist.txt b/testing/project_setup/cpp_empty/checklist.txt index 0058e7eb..cff60802 100644 --- a/testing/project_setup/cpp_empty/checklist.txt +++ b/testing/project_setup/cpp_empty/checklist.txt @@ -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" - \ No newline at end of file diff --git a/testing/project_setup/cpp_empty_pch/checklist.txt b/testing/project_setup/cpp_empty_pch/checklist.txt index e0768a51..7df53115 100644 --- a/testing/project_setup/cpp_empty_pch/checklist.txt +++ b/testing/project_setup/cpp_empty_pch/checklist.txt @@ -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" diff --git a/testing/project_setup/custom_command_python/checklist.txt b/testing/project_setup/custom_command_python/checklist.txt index f379c002..3da8f9a0 100644 --- a/testing/project_setup/custom_command_python/checklist.txt +++ b/testing/project_setup/custom_command_python/checklist.txt @@ -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 /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" diff --git a/testing/project_setup/cxx_cbp/checklist.txt b/testing/project_setup/cxx_cbp/checklist.txt index bbcc7e34..727898d7 100644 --- a/testing/project_setup/cxx_cbp/checklist.txt +++ b/testing/project_setup/cxx_cbp/checklist.txt @@ -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" diff --git a/testing/project_setup/cxx_cdb/checklist.txt b/testing/project_setup/cxx_cdb/checklist.txt index 433fe2b5..cdcbff2f 100644 --- a/testing/project_setup/cxx_cdb/checklist.txt +++ b/testing/project_setup/cxx_cdb/checklist.txt @@ -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" diff --git a/testing/project_setup/cxx_cdb_pch/checklist.txt b/testing/project_setup/cxx_cdb_pch/checklist.txt index 7775c28e..9d34d32b 100644 --- a/testing/project_setup/cxx_cdb_pch/checklist.txt +++ b/testing/project_setup/cxx_cdb_pch/checklist.txt @@ -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" diff --git a/testing/project_setup/java_empty/checklist.txt b/testing/project_setup/java_empty/checklist.txt index 6ee7d315..b40b0101 100644 --- a/testing/project_setup/java_empty/checklist.txt +++ b/testing/project_setup/java_empty/checklist.txt @@ -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" - \ No newline at end of file diff --git a/testing/project_setup/java_gradle/checklist.txt b/testing/project_setup/java_gradle/checklist.txt index 0b291466..3a9f1992 100644 --- a/testing/project_setup/java_gradle/checklist.txt +++ b/testing/project_setup/java_gradle/checklist.txt @@ -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" diff --git a/testing/project_setup/java_maven/checklist.txt b/testing/project_setup/java_maven/checklist.txt index b16eb55a..6655631f 100644 --- a/testing/project_setup/java_maven/checklist.txt +++ b/testing/project_setup/java_maven/checklist.txt @@ -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" diff --git a/testing/project_setup/python_empty/checklist.txt b/testing/project_setup/python_empty/checklist.txt index 59951bb0..3c3a225b 100644 --- a/testing/project_setup/python_empty/checklist.txt +++ b/testing/project_setup/python_empty/checklist.txt @@ -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" - \ No newline at end of file