ui: revised project setup descriptions
* revised texts in project setup ui * fixed crash during project setup when CDB file is empty * fixed row height of project location in CDB project setup
This commit is contained in:
@@ -16,11 +16,14 @@ std::vector<FilePath> TaskParseCxx::getSourceFilesFromCDB(const FilePath& compil
|
||||
std::shared_ptr<clang::tooling::JSONCompilationDatabase> cdb = std::shared_ptr<clang::tooling::JSONCompilationDatabase>
|
||||
(clang::tooling::JSONCompilationDatabase::loadFromFile(compilationDatabasePath.str(), error));
|
||||
|
||||
std::vector<std::string> files = cdb->getAllFiles();
|
||||
std::vector<FilePath> filePaths;
|
||||
for (const std::string& file : files)
|
||||
if (cdb)
|
||||
{
|
||||
filePaths.push_back(FilePath(file));
|
||||
std::vector<std::string> files = cdb->getAllFiles();
|
||||
for (const std::string& file : files)
|
||||
{
|
||||
filePaths.push_back(FilePath(file));
|
||||
}
|
||||
}
|
||||
return filePaths;
|
||||
}
|
||||
|
||||
@@ -30,10 +30,10 @@ QtWindow::QtWindow(QWidget* parent)
|
||||
|
||||
std::string frameStyle =
|
||||
"#window {"
|
||||
"font-size: 17pt; "
|
||||
"border: 1px solid lightgray;"
|
||||
"border-radius: 15px; "
|
||||
"background: white; "
|
||||
" font-size: 17pt;"
|
||||
" border: 1px solid lightgray;"
|
||||
" border-radius: 15px;"
|
||||
" background: white;"
|
||||
"}";
|
||||
m_window->setStyleSheet(frameStyle.c_str());
|
||||
m_window->setObjectName("window");
|
||||
@@ -57,12 +57,13 @@ QtWindow::QtWindow(QWidget* parent)
|
||||
|
||||
QHBoxLayout* gripLayout = new QHBoxLayout();
|
||||
QSizeGrip* sizeGrip = new QSizeGrip(m_window);
|
||||
sizeGrip->setStyleSheet(
|
||||
QString::fromStdString("QSizeGrip {"
|
||||
"max-height: 12px; max-width: 12px;"
|
||||
"border-image: url(" + ResourcePaths::getGuiPath() + "window/size_grip.png);"
|
||||
"}")
|
||||
);
|
||||
sizeGrip->setStyleSheet(QString::fromStdString(
|
||||
"QSizeGrip {"
|
||||
" max-height: 12px;"
|
||||
" max-width: 12px;"
|
||||
" border-image: url(" + ResourcePaths::getGuiPath() + "window/size_grip.png);"
|
||||
"}"
|
||||
));
|
||||
gripLayout->addWidget(new QWidget());
|
||||
gripLayout->addWidget(sizeGrip);
|
||||
layout->addLayout(gripLayout);
|
||||
@@ -82,7 +83,7 @@ QSize QtWindow::sizeHint() const
|
||||
|
||||
void QtWindow::setup()
|
||||
{
|
||||
setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath() + "window/window.css").c_str());
|
||||
m_content->setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath() + "window/window.css").c_str());
|
||||
|
||||
QVBoxLayout* layout = new QVBoxLayout();
|
||||
layout->setContentsMargins(25, 30, 25, 0);
|
||||
|
||||
@@ -21,7 +21,7 @@ void QtProjectWizzardContentData::populate(QGridLayout* layout, int& row)
|
||||
{
|
||||
if (!isInForm())
|
||||
{
|
||||
layout->setRowMinimumHeight(0, 15);
|
||||
layout->setRowMinimumHeight(row, 15);
|
||||
row++;
|
||||
}
|
||||
|
||||
@@ -138,6 +138,7 @@ void QtProjectWizzardContentData::addNameAndLocation(QGridLayout* layout, int& r
|
||||
|
||||
layout->addWidget(locationLabel, row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignRight);
|
||||
layout->addWidget(m_projectFileLocation, row, QtProjectWizzardWindow::BACK_COL);
|
||||
layout->setRowMinimumHeight(row, 50);
|
||||
row++;
|
||||
}
|
||||
|
||||
@@ -188,7 +189,7 @@ void QtProjectWizzardContentDataCDB::populate(QGridLayout* layout, int& row)
|
||||
{
|
||||
if (!isInForm())
|
||||
{
|
||||
layout->setRowMinimumHeight(0, 15);
|
||||
layout->setRowMinimumHeight(row, 15);
|
||||
row++;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ void QtProjectWizzardContentFlags::populate(QGridLayout* layout, int& row)
|
||||
label->setObjectName("label");
|
||||
layout->addWidget(label, row, QtProjectWizzardWindow::FRONT_COL, Qt::AlignRight);
|
||||
|
||||
addHelpButton("Define compiler flags used during indexing including the dash e.g. -v", layout, row);
|
||||
addHelpButton("Define compiler flags used during indexing including the dash (e.g. use \"-D RELEASE\" to add a #define for \"RELEASE\").", layout, row);
|
||||
|
||||
m_list = new QtDirectoryListBox(this, label->text(), true);
|
||||
layout->addWidget(m_list, row, QtProjectWizzardWindow::BACK_COL);
|
||||
|
||||
@@ -138,7 +138,7 @@ QtProjectWizzardContentPathsSource::QtProjectWizzardContentPathsSource(
|
||||
setTitleString("Project Paths");
|
||||
setHelpString(
|
||||
"Project Paths define the files and directories that will be indexed by Coati. Provide a directory to recursively "
|
||||
"add all contained files.\n\nProject Paths are usually the source and header files of your project or a subset of them."
|
||||
"add all contained source and header files."
|
||||
);
|
||||
}
|
||||
|
||||
@@ -209,7 +209,9 @@ QtProjectWizzardContentPathsSourceJava::QtProjectWizzardContentPathsSourceJava(
|
||||
{
|
||||
setHelpString(
|
||||
"Project Paths define the files and directories that will be indexed by Coati. Provide a directory to recursively "
|
||||
"add all contained files. Adding the root source directory of your project is usually sufficient.\n\n"
|
||||
"add all contained files. To make sure that type names are resolved correctly, <b>please add the root source directory "
|
||||
"of your project</b> (the one where all your package names are relative to).<br />"
|
||||
"<br />"
|
||||
"If your project's source code resides in one location, but generated source files are kept at a different location, "
|
||||
"you will also need to add that directory."
|
||||
);
|
||||
@@ -225,9 +227,11 @@ QtProjectWizzardContentPathsCDBHeader::QtProjectWizzardContentPathsCDBHeader(
|
||||
setTitleString("Indexed Header Paths");
|
||||
setHelpString(
|
||||
"Define which header files should be indexed by Coati. Provide a directory to recursively add all contained files. "
|
||||
"Every time an included header is encountered, Coati will check if the file is located in one of these paths to "
|
||||
"decide whether or not to index it.\n\n"
|
||||
"This is necessary since the Compilation Database only specifies the source files of your project."
|
||||
"Every time an included header is encountered, Coati will check if the file is part of the indexed headers to "
|
||||
"decide whether or not to index it.<br />"
|
||||
"<br />"
|
||||
"So just enter the root path of your project if you want Coati to index all contained headers it encounters. "
|
||||
"This way you prevent Coati from indexing files you may not be interested in."
|
||||
);
|
||||
}
|
||||
|
||||
@@ -259,12 +263,15 @@ QtProjectWizzardContentPathsHeaderSearch::QtProjectWizzardContentPathsHeaderSear
|
||||
{
|
||||
setTitleString(isCDB ? "Additional Include Paths" : "Include Paths");
|
||||
setHelpString(
|
||||
((isCDB ? "<b>Note</b>: Use the Additional Include Paths to add paths that are missin in the CDB.<br /><br />" : "") + std::string(
|
||||
"Include Paths are used for resolving #include directives in the indexed source and header files. These paths are "
|
||||
"usually passed to the compiler with the '-I' or '-iquote' flags.\n\n"
|
||||
"Add all the paths the #include directives throughout your project are relative to. If all #include directives are "
|
||||
"specified relative to the project's root directory, please add that.\n\n"
|
||||
"usually passed to the compiler with the '-I' or '-iquote' flags.<br />"
|
||||
"<br />"
|
||||
"Add all the paths the #include directives throughout your project are relative to. So if all #include directives are "
|
||||
"specified relative to the project's root directory, please add that one.<br />"
|
||||
"<br />"
|
||||
"If your project also includes files from external libraries (e.g. boost), please add these directories as well "
|
||||
"(e.g. add '<boost_home>/include')."
|
||||
"(e.g. add '<boost_home>/include').")).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -299,7 +306,8 @@ QtProjectWizzardContentPathsHeaderSearchGlobal::QtProjectWizzardContentPathsHead
|
||||
setTitleString("Global Include Paths");
|
||||
setHelpString(
|
||||
"The Global Include Paths will be used in all your projects - in addition to the project specific Include Paths. "
|
||||
"These paths are usually passed to the compiler with the '-isystem' flag.\n\n"
|
||||
"These paths are usually passed to the compiler with the '-isystem' flag.<br />"
|
||||
"<br />"
|
||||
"Use them to add system header paths (See <a href=\"https://coati.io/documentation/#FindingSystemHeaderLocations\">"
|
||||
"Finding System Header Locations</a> or use the auto detection below)."
|
||||
);
|
||||
@@ -372,7 +380,9 @@ QtProjectWizzardContentPathsFrameworkSearchGlobal::QtProjectWizzardContentPathsF
|
||||
setTitleString("Global Framework Search Paths");
|
||||
setHelpString(
|
||||
"The Global Framework Search Paths will be used in all your projects - in addition to the project specific "
|
||||
"Framework Search Paths.\n\nThey define where MacOS framework containers (.framework) are found "
|
||||
"Framework Search Paths.<br />"
|
||||
"<br />"
|
||||
"They define where MacOS framework containers (.framework) are found "
|
||||
"(See <a href=\"https://coati.io/documentation/#FindingSystemHeaderLocations\">"
|
||||
"Finding System Header Locations</a> or use the auto detection below)."
|
||||
);
|
||||
@@ -401,7 +411,8 @@ QtProjectWizzardContentPathsClassJava::QtProjectWizzardContentPathsClassJava(
|
||||
{
|
||||
setTitleString("Class Path");
|
||||
setHelpString(
|
||||
"Enter the paths to .jar files and root directories of .class files your project depends on."
|
||||
"Enter all the .jar files your project depends on. If your project depends on uncompiled java code that should "
|
||||
"not be indexed, please add the root directory of those .java files here."
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -63,13 +63,17 @@ void QtProjectWizzardContentSelect::populate(QGridLayout* layout, int& row)
|
||||
m_buttons->setExclusive(true);
|
||||
|
||||
m_window->setNextEnabled(false);
|
||||
m_title->setText("Project Types - " + m_languages->checkedButton()->text());
|
||||
m_title->setText(
|
||||
"Project Types - " + m_languages->checkedButton()->text()
|
||||
+ (m_languages->checkedButton()->text() == "Java" ? " (beta)" : "")
|
||||
);
|
||||
m_description->setText("");
|
||||
}
|
||||
);
|
||||
|
||||
QVBoxLayout* vlayout = new QVBoxLayout();
|
||||
vlayout->setContentsMargins(0, 30, 0, 0);
|
||||
vlayout->setSpacing(10);
|
||||
|
||||
vlayout->addWidget(d);
|
||||
vlayout->addWidget(e);
|
||||
|
||||
@@ -20,9 +20,11 @@ void QtProjectWizzardContentSimple::populate(QGridLayout* layout, int& row)
|
||||
layout->addWidget(m_checkBox, row, QtProjectWizzardWindow::BACK_COL);
|
||||
|
||||
addHelpButton(
|
||||
"If enabled Coati also uses the project paths and their subdirectories when resolving #include directives.\n\n"
|
||||
"If enabled Coati also uses the project paths and their subdirectories when resolving #include directives.<br />"
|
||||
"<br />"
|
||||
"Use this option when you know that the project is self contained but don't know which paths to "
|
||||
"specify as include paths.\n\n"
|
||||
"specify as include paths.<br />"
|
||||
"<br />"
|
||||
"<b>Warning</b>: This slows down indexing speed.", layout, row);
|
||||
|
||||
row++;
|
||||
|
||||
Reference in New Issue
Block a user