ui: Added ui for compiler flags to project setup summary
bug id = 37
This commit is contained in:
@@ -51,7 +51,8 @@ bool ProjectSettings::operator==(const ProjectSettings& other) const
|
||||
getUseSourcePathsForHeaderSearch() == other.getUseSourcePathsForHeaderSearch() &&
|
||||
utility::isPermutation<FilePath>(getSourcePaths(), other.getSourcePaths()) &&
|
||||
utility::isPermutation<FilePath>(getHeaderSearchPaths(), other.getHeaderSearchPaths()) &&
|
||||
utility::isPermutation<FilePath>(getFrameworkSearchPaths(), other.getFrameworkSearchPaths());
|
||||
utility::isPermutation<FilePath>(getFrameworkSearchPaths(), other.getFrameworkSearchPaths()) &&
|
||||
utility::isPermutation<std::string>(getCompilerFlags(), other.getCompilerFlags());
|
||||
}
|
||||
|
||||
void ProjectSettings::save(const FilePath& filePath)
|
||||
@@ -122,6 +123,11 @@ std::vector<std::string> ProjectSettings::getCompilerFlags() const
|
||||
return getValues("source/compiler_flags/compiler_flag", defaultValues);
|
||||
}
|
||||
|
||||
bool ProjectSettings::setCompilerFlags(const std::vector<std::string>& compilerFlags)
|
||||
{
|
||||
return setValues("source/compiler_flags/compiler_flag", compilerFlags);
|
||||
}
|
||||
|
||||
std::vector<std::string> ProjectSettings::getHeaderExtensions() const
|
||||
{
|
||||
return getValues("source/extensions/header_extensions", getDefaultHeaderExtensions());
|
||||
|
||||
@@ -39,6 +39,7 @@ public:
|
||||
bool setFrameworkSearchPaths(const std::vector<FilePath>& frameworkSearchPaths);
|
||||
|
||||
std::vector<std::string> getCompilerFlags() const;
|
||||
bool setCompilerFlags(const std::vector<std::string>& compilerFlags);
|
||||
|
||||
std::vector<std::string> getHeaderExtensions() const;
|
||||
std::vector<std::string> getSourceExtensions() const;
|
||||
|
||||
@@ -112,6 +112,8 @@ add_files(
|
||||
qt/window/project_wizzard/QtProjectWizzardContentBuildFile.h
|
||||
qt/window/project_wizzard/QtProjectWizzardContentData.cpp
|
||||
qt/window/project_wizzard/QtProjectWizzardContentData.h
|
||||
qt/window/project_wizzard/QtProjectWizzardContentFlags.cpp
|
||||
qt/window/project_wizzard/QtProjectWizzardContentFlags.h
|
||||
qt/window/project_wizzard/QtProjectWizzardContentPaths.cpp
|
||||
qt/window/project_wizzard/QtProjectWizzardContentPaths.h
|
||||
qt/window/project_wizzard/QtProjectWizzardContentPreferences.cpp
|
||||
|
||||
@@ -33,6 +33,11 @@ QtListItemWidget::QtListItemWidget(QtDirectoryListBox* list, QListWidgetItem* it
|
||||
layout->addWidget(m_data);
|
||||
layout->addWidget(m_button);
|
||||
|
||||
if (list->isForStrings())
|
||||
{
|
||||
m_button->hide();
|
||||
}
|
||||
|
||||
setLayout(layout);
|
||||
|
||||
connect(m_button, SIGNAL(clicked()), this, SLOT(handleButtonPress()));
|
||||
@@ -96,8 +101,9 @@ void QtListItemWidget::handleFocus()
|
||||
}
|
||||
|
||||
|
||||
QtDirectoryListBox::QtDirectoryListBox(QWidget *parent)
|
||||
:QFrame(parent)
|
||||
QtDirectoryListBox::QtDirectoryListBox(QWidget *parent, bool forStrings)
|
||||
: QFrame(parent)
|
||||
, m_forStrings(forStrings)
|
||||
{
|
||||
QBoxLayout* layout = new QVBoxLayout();
|
||||
layout->setSpacing(0);
|
||||
@@ -132,12 +138,19 @@ QtDirectoryListBox::QtDirectoryListBox(QWidget *parent)
|
||||
m_removeButton->setObjectName("minusButton");
|
||||
innerLayout->addWidget(m_removeButton);
|
||||
|
||||
innerLayout->addStretch();
|
||||
|
||||
QLabel* dropInfoText = new QLabel("Drop Files & Folders");
|
||||
dropInfoText->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
dropInfoText->setObjectName("dropInfo");
|
||||
dropInfoText->setAlignment(Qt::AlignRight);
|
||||
innerLayout->addWidget(dropInfoText);
|
||||
|
||||
if (isForStrings())
|
||||
{
|
||||
dropInfoText->hide();
|
||||
}
|
||||
|
||||
layout->addStretch();
|
||||
|
||||
buttonContainer->setLayout(innerLayout);
|
||||
@@ -198,7 +211,28 @@ void QtDirectoryListBox::dropEvent(QDropEvent *event)
|
||||
|
||||
std::vector<FilePath> QtDirectoryListBox::getList()
|
||||
{
|
||||
std::vector<std::string> strList = getStringList();
|
||||
std::vector<FilePath> list;
|
||||
for (const std::string& str : strList)
|
||||
{
|
||||
list.push_back(str);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
void QtDirectoryListBox::setList(const std::vector<FilePath>& list)
|
||||
{
|
||||
std::vector<std::string> strList;
|
||||
for (const FilePath& path : list)
|
||||
{
|
||||
strList.push_back(path.str());
|
||||
}
|
||||
setStringList(strList);
|
||||
}
|
||||
|
||||
std::vector<std::string> QtDirectoryListBox::getStringList()
|
||||
{
|
||||
std::vector<std::string> list;
|
||||
for (int i = 0; i < m_list->count(); ++i)
|
||||
{
|
||||
QtListItemWidget* widget = dynamic_cast<QtListItemWidget*>(m_list->itemWidget(m_list->item(i)));
|
||||
@@ -207,14 +241,14 @@ std::vector<FilePath> QtDirectoryListBox::getList()
|
||||
return list;
|
||||
}
|
||||
|
||||
void QtDirectoryListBox::setList(const std::vector<FilePath>& list)
|
||||
void QtDirectoryListBox::setStringList(const std::vector<std::string>& list)
|
||||
{
|
||||
m_list->clear();
|
||||
|
||||
for (const FilePath& path : list)
|
||||
for (const std::string& str : list)
|
||||
{
|
||||
QtListItemWidget* widget = addListBoxItem();
|
||||
widget->setText(QString::fromStdString(path.str()));
|
||||
widget->setText(QString::fromStdString(str));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -228,6 +262,11 @@ void QtDirectoryListBox::selectItem(QListWidgetItem* item)
|
||||
item->setSelected(true);
|
||||
}
|
||||
|
||||
bool QtDirectoryListBox::isForStrings() const
|
||||
{
|
||||
return m_forStrings;
|
||||
}
|
||||
|
||||
void QtDirectoryListBox::resize()
|
||||
{
|
||||
int height = m_list->height() - m_list->viewport()->height();
|
||||
|
||||
@@ -46,7 +46,7 @@ class QtDirectoryListBox
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QtDirectoryListBox(QWidget *parent);
|
||||
QtDirectoryListBox(QWidget *parent, bool forStrings = false);
|
||||
|
||||
virtual QSize sizeHint() const override;
|
||||
|
||||
@@ -55,8 +55,13 @@ public:
|
||||
std::vector<FilePath> getList();
|
||||
void setList(const std::vector<FilePath>& list);
|
||||
|
||||
std::vector<std::string> getStringList();
|
||||
void setStringList(const std::vector<std::string>& list);
|
||||
|
||||
void selectItem(QListWidgetItem* item);
|
||||
|
||||
bool isForStrings() const;
|
||||
|
||||
protected:
|
||||
bool event(QEvent* event) override;
|
||||
|
||||
@@ -70,6 +75,8 @@ private:
|
||||
QPushButton* m_removeButton;
|
||||
QListWidget* m_list;
|
||||
|
||||
bool m_forStrings;
|
||||
|
||||
private slots:
|
||||
QtListItemWidget* addListBoxItem();
|
||||
void removeListBoxItem();
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
#include "qt/window/project_wizzard/QtProjectWizzardContentFlags.h"
|
||||
|
||||
#include <QFormLayout>
|
||||
|
||||
#include "qt/element/QtDirectoryListBox.h"
|
||||
|
||||
QtProjectWizzardContentFlags::QtProjectWizzardContentFlags(ProjectSettings* settings, QtProjectWizzardWindow* window)
|
||||
: QtProjectWizzardContent(settings, window)
|
||||
{
|
||||
}
|
||||
|
||||
void QtProjectWizzardContentFlags::populateForm(QGridLayout* layout, int& row)
|
||||
{
|
||||
QLabel* label = createFormLabel("Compiler Flags");
|
||||
label->setObjectName("label");
|
||||
layout->addWidget(label, row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignRight);
|
||||
|
||||
addHelpButton("Define compiler flags used during analysis including the dash e.g. -v", layout, row);
|
||||
|
||||
m_list = new QtDirectoryListBox(this, true);
|
||||
layout->addWidget(m_list, row, QtProjectWizzardWindow::BACK_COL);
|
||||
row++;
|
||||
}
|
||||
|
||||
void QtProjectWizzardContentFlags::load()
|
||||
{
|
||||
m_list->setStringList(m_settings->getCompilerFlags());
|
||||
}
|
||||
|
||||
void QtProjectWizzardContentFlags::save()
|
||||
{
|
||||
m_settings->setCompilerFlags(m_list->getStringList());
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
#ifndef QT_PROJECT_WIZZARD_CONTENT_FLAGS_H
|
||||
#define QT_PROJECT_WIZZARD_CONTENT_FLAGS_H
|
||||
|
||||
#include "qt/window/project_wizzard/QtProjectWizzardContent.h"
|
||||
|
||||
class QtDirectoryListBox;
|
||||
|
||||
class QtProjectWizzardContentFlags
|
||||
: public QtProjectWizzardContent
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QtProjectWizzardContentFlags(ProjectSettings* settings, QtProjectWizzardWindow* window);
|
||||
|
||||
// QtProjectWizzardContent implementation
|
||||
virtual void populateForm(QGridLayout* layout, int& row) override;
|
||||
|
||||
virtual void load() override;
|
||||
virtual void save() override;
|
||||
|
||||
private:
|
||||
QtDirectoryListBox* m_list;
|
||||
};
|
||||
|
||||
#endif // QT_PROJECT_WIZZARD_CONTENT_FLAGS_H
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
class QtDirectoryListBox;
|
||||
|
||||
|
||||
class QtProjectWizzardContentPaths
|
||||
: public QtProjectWizzardContent
|
||||
{
|
||||
|
||||
@@ -21,6 +21,8 @@ QtProjectWizzardContentSummary::QtProjectWizzardContentSummary(ProjectSettings*
|
||||
{
|
||||
m_frameworkSearch = new QtProjectWizzardContentPathsFrameworkSearch(settings, window);
|
||||
}
|
||||
|
||||
m_compilerFlags = new QtProjectWizzardContentFlags(settings, window);
|
||||
}
|
||||
|
||||
QtProjectWizzardContentBuildFile* QtProjectWizzardContentSummary::contentBuildFile()
|
||||
@@ -66,6 +68,25 @@ void QtProjectWizzardContentSummary::populateWindow(QGridLayout* layout)
|
||||
m_frameworkSearch->populateForm(layout, row);
|
||||
}
|
||||
|
||||
layout->setRowMinimumHeight(row, 15);
|
||||
row++;
|
||||
|
||||
QFrame* separator = new QFrame();
|
||||
separator->setFrameShape(QFrame::HLine);
|
||||
|
||||
QPalette palette = separator->palette();
|
||||
palette.setColor(QPalette::WindowText, Qt::lightGray);
|
||||
separator->setPalette(palette);
|
||||
|
||||
layout->addWidget(separator, row, 0, 1, -1);
|
||||
row++;
|
||||
|
||||
QLabel* advancedLabel = createFormLabel("ADVANCED");
|
||||
layout->addWidget(advancedLabel, row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignTop);
|
||||
row++;
|
||||
|
||||
m_compilerFlags->populateForm(layout, row);
|
||||
|
||||
layout->setRowMinimumHeight(row, 10);
|
||||
}
|
||||
|
||||
@@ -87,6 +108,8 @@ void QtProjectWizzardContentSummary::load()
|
||||
{
|
||||
m_frameworkSearch->load();
|
||||
}
|
||||
|
||||
m_compilerFlags->load();
|
||||
}
|
||||
|
||||
void QtProjectWizzardContentSummary::save()
|
||||
@@ -101,6 +124,8 @@ void QtProjectWizzardContentSummary::save()
|
||||
{
|
||||
m_frameworkSearch->save();
|
||||
}
|
||||
|
||||
m_compilerFlags->save();
|
||||
}
|
||||
|
||||
bool QtProjectWizzardContentSummary::check()
|
||||
@@ -111,7 +136,8 @@ bool QtProjectWizzardContentSummary::check()
|
||||
m_source->check() &&
|
||||
m_simple->check() &&
|
||||
m_headerSearch->check() &&
|
||||
(!m_frameworkSearch || m_frameworkSearch->check());
|
||||
(!m_frameworkSearch || m_frameworkSearch->check()) &&
|
||||
m_compilerFlags->check();
|
||||
}
|
||||
|
||||
bool QtProjectWizzardContentSummary::isScrollAble() const
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "qt/window/project_wizzard/QtProjectWizzardContent.h"
|
||||
#include "qt/window/project_wizzard/QtProjectWizzardContentBuildFile.h"
|
||||
#include "qt/window/project_wizzard/QtProjectWizzardContentData.h"
|
||||
#include "qt/window/project_wizzard/QtProjectWizzardContentFlags.h"
|
||||
#include "qt/window/project_wizzard/QtProjectWizzardContentSimple.h"
|
||||
#include "qt/window/project_wizzard/QtProjectWizzardContentPaths.h"
|
||||
|
||||
@@ -34,6 +35,7 @@ private:
|
||||
QtProjectWizzardContentSimple* m_simple;
|
||||
QtProjectWizzardContentPathsHeaderSearch* m_headerSearch;
|
||||
QtProjectWizzardContentPathsFrameworkSearch* m_frameworkSearch;
|
||||
QtProjectWizzardContentFlags* m_compilerFlags;
|
||||
};
|
||||
|
||||
#endif // QT_PROJECT_WIZZARD_CONTENT_SUMMARY_H
|
||||
|
||||
@@ -610,19 +610,28 @@
|
||||
<tr> <th>Setting</th> <th>Description</th> </tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr> <th scope="row">Name</th> <td>The name of the project. This will also be the name of the *.coatiproject file generated by Coati.</td> </tr>
|
||||
<tr> <th scope="row">Location</th> <td>Choose the location of the project file from the dialog.</td> </tr>
|
||||
<tr> <th scope="row">Language</th> <td>Select the language of your project. This setting is preselected according to your choice in the previous screen. (See <a href="#SupportedLanguages">Language Support</a>)</td> </tr>
|
||||
<tr> <th scope="row">Standard</th> <td>Select the language standard that should be used for analyzing your project. Usually the most recent language standard is preselected here. (See <a href="#SupportedLanguages">Language Support</a>)</td> </tr>
|
||||
<tr> <td scope="row">Name</td> <td>The name of the project. This will also be the name of the *.coatiproject file generated by Coati.</td> </tr>
|
||||
<tr> <td scope="row">Location</td> <td>Choose the location of the project file from the dialog.</td> </tr>
|
||||
<tr> <td scope="row">Language</td> <td>Select the language of your project. This setting is preselected according to your choice in the previous screen. (See <a href="#SupportedLanguages">Language Support</a>)</td> </tr>
|
||||
<tr> <td scope="row">Standard</td> <td>Select the language standard that should be used for analyzing your project. Usually the most recent language standard is preselected here. (See <a href="#SupportedLanguages">Language Support</a>)</td> </tr>
|
||||
|
||||
<tr> <th scope="row">Visual Studio Solution</th> <td>Only when using Setup from Visual Studio Solution. Provide the path to your Visual Studio Solution. Clicking the refresh arrow inside the text box will refresh the Project Paths and the Header Search Paths below.</td> </tr>
|
||||
<tr> <td scope="row">Visual Studio Solution</td> <td>Only when using Setup from Visual Studio Solution. Provide the path to your Visual Studio Solution. Clicking the refresh arrow inside the text box will refresh the Project Paths and the Header Search Paths below.</td> </tr>
|
||||
|
||||
<tr> <th scope="row">Project Paths</th> <td>Provide the paths that contain your project's files. Coati will analyze all the source and header files in the specified paths, including subdirectories.</td> </tr>
|
||||
<tr> <th scope="row">Simple Setup</th> <td>If this checkbox is checked Coati also looks into the analyzed paths (including subdirectories) when resolving <code>#include</code> directives.</td> </tr>
|
||||
<tr> <th scope="row">Header Search Paths</th> <td>Specify where Coati should be looking for included headers.</td> </tr>
|
||||
<tr> <th scope="row">Global Header Search Paths</th> <td>Same as Header Search Paths but these are used application wide for all of your Coati projects.</td> </tr>
|
||||
<tr> <th scope="row">Framework Search Paths</th> <td>Mac only. Define the search paths for <code>.framework</code> files for your project. (For instructions on how to add paths see <a href="#PathListBox">Path List Box</a>.)</td> </tr>
|
||||
<tr> <th scope="row">Global Framework Search Paths</th> <td>Same as Framework Search Paths but these are used application wide for all of your Coati projects.</td> </tr>
|
||||
<tr> <td scope="row">Project Paths</td> <td>Provide the paths that contain your project's files. Coati will analyze all the source and header files in the specified paths, including subdirectories.</td> </tr>
|
||||
<tr> <td scope="row">Simple Setup</td> <td>If this checkbox is checked Coati also looks into the analyzed paths (including subdirectories) when resolving <code>#include</code> directives.</td> </tr>
|
||||
<tr> <td scope="row">Header Search Paths</td> <td>Specify where Coati should be looking for included headers.</td> </tr>
|
||||
<tr> <td scope="row">Global Header Search Paths</td> <td>Same as Header Search Paths but these are used application wide for all of your Coati projects.</td> </tr>
|
||||
<tr> <td scope="row">Framework Search Paths</td> <td>Mac only. Define the search paths for <code>.framework</code> files for your project. (For instructions on how to add paths see <a href="#PathListBox">Path List Box</a>.)</td> </tr>
|
||||
<tr> <td scope="row">Global Framework Search Paths</td> <td>Mac only. Same as Framework Search Paths but these are used application wide for all of your Coati projects.</td> </tr>
|
||||
<tbody>
|
||||
</table>
|
||||
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr> <th>Advanced Setting</th> <th>Description</th> </tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr> <td scope="row">Compiler Flags</td> <td>Define compiler flags used during analysis e.g. <code>-v</code></td> </tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<strong>Interactions:</strong>
|
||||
|
||||
Reference in New Issue
Block a user