ui: Revised project setup to customer feedback
* Support environment variables in compilation database path * Moved advanced option (compiler flags & exclude paths) to separate dialog * Allow environment variables that contain multiple paths * Renamed 'Project Name' to 'Coati Project Name' * Renamed 'Project File Location' to 'Coati Project Location' * Renamed 'Project Paths' to 'Indexed Paths' * Make all paths chosen by path picker relative to the project location * Disabled name and location changing in project editing and removed project moving * Added sub-titles to project setup dialogs * Warn user when no Indexed Header Paths were set * Deprecated lazy include search: It's only useable and visible to projects holding the key * Split default file extensions for C++ and C bug ids = 234 254 283 293 312 335
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "qt/element/QtLocationPicker.h"
|
||||
|
||||
#include <QEvent>
|
||||
#include <QFileDialog>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
@@ -72,6 +73,19 @@ void QtLocationPicker::setFileFilter(const QString& fileFilter)
|
||||
m_fileFilter = fileFilter;
|
||||
}
|
||||
|
||||
void QtLocationPicker::setRelativeRootDirectory(const FilePath& dir)
|
||||
{
|
||||
m_relativeRootDirectory = dir;
|
||||
}
|
||||
|
||||
void QtLocationPicker::changeEvent(QEvent *event)
|
||||
{
|
||||
if (event->type() == QEvent::EnabledChange)
|
||||
{
|
||||
m_button->setVisible(isEnabled());
|
||||
}
|
||||
}
|
||||
|
||||
void QtLocationPicker::handleButtonPress()
|
||||
{
|
||||
QString fileName;
|
||||
@@ -86,6 +100,16 @@ void QtLocationPicker::handleButtonPress()
|
||||
|
||||
if (!fileName.isEmpty())
|
||||
{
|
||||
if (!m_relativeRootDirectory.empty())
|
||||
{
|
||||
FilePath path(fileName.toStdString());
|
||||
FilePath relPath(path.relativeTo(m_relativeRootDirectory));
|
||||
if (relPath.str().size() < path.str().size())
|
||||
{
|
||||
fileName = QString::fromStdString(relPath.str());
|
||||
}
|
||||
}
|
||||
|
||||
m_data->setText(fileName);
|
||||
emit locationPicked();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user