forked from qt-creator/qt-creator
Added a way to refresh the project.
This commit is contained in:
@@ -50,6 +50,7 @@
|
||||
#include <QtGui/QComboBox>
|
||||
#include <QtGui/QStringListModel>
|
||||
#include <QtGui/QListWidget>
|
||||
#include <QtGui/QPushButton>
|
||||
|
||||
using namespace GenericProjectManager;
|
||||
using namespace GenericProjectManager::Internal;
|
||||
@@ -198,6 +199,9 @@ void GenericProject::setIncludePaths(const QStringList &includePaths)
|
||||
QStringList GenericProject::defines() const
|
||||
{ return _defines; }
|
||||
|
||||
void GenericProject::setDefines(const QStringList &defines)
|
||||
{ _defines = defines; }
|
||||
|
||||
void GenericProject::setToolChainId(const QString &toolChainId)
|
||||
{
|
||||
using namespace ProjectExplorer;
|
||||
@@ -446,6 +450,15 @@ GenericBuildSettingsWidget::GenericBuildSettingsWidget(GenericProject *project)
|
||||
_definesModel->setStringList(_project->defines());
|
||||
definesView->setModel(_definesModel);
|
||||
fl->addRow(tr("Defines:"), definesView);
|
||||
|
||||
_applyButton = new QPushButton(tr("Apply"));
|
||||
_applyButton->setEnabled(false);
|
||||
fl->addRow(QString(), _applyButton);
|
||||
connect(_applyButton, SIGNAL(clicked()), this, SLOT(applyChanges()));
|
||||
connect(_includePathsModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
|
||||
this, SLOT(markDirty()));
|
||||
connect(_definesModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
|
||||
this, SLOT(markDirty()));
|
||||
}
|
||||
|
||||
GenericBuildSettingsWidget::~GenericBuildSettingsWidget()
|
||||
@@ -469,6 +482,19 @@ void GenericBuildSettingsWidget::buildDirectoryChanged()
|
||||
_project->setValue(_buildConfiguration, "buildDirectory", _pathChooser->path());
|
||||
}
|
||||
|
||||
void GenericBuildSettingsWidget::markDirty()
|
||||
{
|
||||
_applyButton->setEnabled(true);
|
||||
}
|
||||
|
||||
void GenericBuildSettingsWidget::applyChanges()
|
||||
{
|
||||
_project->setIncludePaths(_includePathsModel->stringList());
|
||||
_project->setDefines(_definesModel->stringList());
|
||||
|
||||
_project->refresh();
|
||||
_applyButton->setEnabled(false);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
// GenericProjectFile
|
||||
|
Reference in New Issue
Block a user