forked from qt-creator/qt-creator
Make setDisplayName easier and break displayName signals
Fix for that will come later
This commit is contained in:
@@ -80,7 +80,10 @@ QString BuildConfiguration::displayName() const
|
|||||||
|
|
||||||
void BuildConfiguration::setDisplayName(const QString &name)
|
void BuildConfiguration::setDisplayName(const QString &name)
|
||||||
{
|
{
|
||||||
|
if (value("ProjectExplorer.BuildConfiguration.DisplayName").toString() == name)
|
||||||
|
return;
|
||||||
setValue("ProjectExplorer.BuildConfiguration.DisplayName", name);
|
setValue("ProjectExplorer.BuildConfiguration.DisplayName", name);
|
||||||
|
emit displayNameChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant BuildConfiguration::value(const QString & key) const
|
QVariant BuildConfiguration::value(const QString & key) const
|
||||||
|
@@ -82,6 +82,7 @@ public:
|
|||||||
signals:
|
signals:
|
||||||
void environmentChanged();
|
void environmentChanged();
|
||||||
void buildDirectoryChanged();
|
void buildDirectoryChanged();
|
||||||
|
void displayNameChanged();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
BuildConfiguration(Project * project);
|
BuildConfiguration(Project * project);
|
||||||
|
@@ -200,8 +200,7 @@ BuildSettingsWidget::BuildSettingsWidget(Project *project)
|
|||||||
connect(m_removeButton, SIGNAL(clicked()),
|
connect(m_removeButton, SIGNAL(clicked()),
|
||||||
this, SLOT(deleteConfiguration()));
|
this, SLOT(deleteConfiguration()));
|
||||||
|
|
||||||
connect(m_project, SIGNAL(buildConfigurationDisplayNameChanged(ProjectExplorer::BuildConfiguration *)),
|
// TODO update on displayNameChange
|
||||||
this, SLOT(buildConfigurationDisplayNameChanged(ProjectExplorer::BuildConfiguration *)));
|
|
||||||
|
|
||||||
connect(m_project, SIGNAL(activeBuildConfigurationChanged()),
|
connect(m_project, SIGNAL(activeBuildConfigurationChanged()),
|
||||||
this, SLOT(checkMakeActiveLabel()));
|
this, SLOT(checkMakeActiveLabel()));
|
||||||
@@ -231,17 +230,6 @@ void BuildSettingsWidget::updateAddButtonMenu()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BuildSettingsWidget::buildConfigurationDisplayNameChanged(BuildConfiguration *bc)
|
|
||||||
{
|
|
||||||
for (int i=0; i<m_buildConfigurationComboBox->count(); ++i) {
|
|
||||||
if (m_buildConfigurationComboBox->itemData(i).value<BuildConfiguration *>() == bc) {
|
|
||||||
m_buildConfigurationComboBox->setItemText(i, bc->displayName());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void BuildSettingsWidget::updateBuildSettings()
|
void BuildSettingsWidget::updateBuildSettings()
|
||||||
{
|
{
|
||||||
// TODO save position, entry from combbox
|
// TODO save position, entry from combbox
|
||||||
@@ -350,7 +338,7 @@ void BuildSettingsWidget::cloneConfiguration(BuildConfiguration *sourceConfigura
|
|||||||
newDisplayName = Project::makeUnique(newDisplayName, buildConfigurationDisplayNames);
|
newDisplayName = Project::makeUnique(newDisplayName, buildConfigurationDisplayNames);
|
||||||
|
|
||||||
m_buildConfiguration = m_project->buildConfigurationFactory()->clone(sourceConfiguration);
|
m_buildConfiguration = m_project->buildConfigurationFactory()->clone(sourceConfiguration);
|
||||||
m_project->setDisplayNameFor(m_buildConfiguration, newDisplayName);
|
m_buildConfiguration->setDisplayName(newDisplayName);
|
||||||
|
|
||||||
updateBuildSettings();
|
updateBuildSettings();
|
||||||
}
|
}
|
||||||
|
@@ -94,7 +94,6 @@ public:
|
|||||||
~BuildSettingsWidget();
|
~BuildSettingsWidget();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void buildConfigurationDisplayNameChanged(ProjectExplorer::BuildConfiguration *bc);
|
|
||||||
void updateBuildSettings();
|
void updateBuildSettings();
|
||||||
void currentIndexChanged(int index);
|
void currentIndexChanged(int index);
|
||||||
void activeBuildConfigurationChanged();
|
void activeBuildConfigurationChanged();
|
||||||
|
@@ -49,6 +49,7 @@ BuildStepsPage::BuildStepsPage(Project *project, bool clean) :
|
|||||||
BuildConfigWidget(),
|
BuildConfigWidget(),
|
||||||
m_clean(clean)
|
m_clean(clean)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(project)
|
||||||
m_vbox = new QVBoxLayout(this);
|
m_vbox = new QVBoxLayout(this);
|
||||||
m_vbox->setContentsMargins(0, 0, 0, 0);
|
m_vbox->setContentsMargins(0, 0, 0, 0);
|
||||||
m_vbox->setSpacing(0);
|
m_vbox->setSpacing(0);
|
||||||
|
@@ -463,23 +463,6 @@ EditorConfiguration *Project::editorConfiguration() const
|
|||||||
return m_editorConfiguration;
|
return m_editorConfiguration;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Project::setDisplayNameFor(BuildConfiguration *configuration, const QString &displayName)
|
|
||||||
{
|
|
||||||
if (configuration->displayName() == displayName)
|
|
||||||
return;
|
|
||||||
QString dn = displayName;
|
|
||||||
QStringList displayNames;
|
|
||||||
foreach (BuildConfiguration *bc, m_buildConfigurationValues) {
|
|
||||||
if (bc != configuration)
|
|
||||||
displayNames << bc->displayName();
|
|
||||||
}
|
|
||||||
dn = makeUnique(displayName, displayNames);
|
|
||||||
|
|
||||||
configuration->setDisplayName(displayName);
|
|
||||||
|
|
||||||
emit buildConfigurationDisplayNameChanged(configuration);
|
|
||||||
}
|
|
||||||
|
|
||||||
QByteArray Project::predefinedMacros(const QString &) const
|
QByteArray Project::predefinedMacros(const QString &) const
|
||||||
{
|
{
|
||||||
return QByteArray();
|
return QByteArray();
|
||||||
|
@@ -88,10 +88,6 @@ public:
|
|||||||
void removeBuildConfiguration(BuildConfiguration *configuration);
|
void removeBuildConfiguration(BuildConfiguration *configuration);
|
||||||
|
|
||||||
QList<BuildConfiguration *> buildConfigurations() const;
|
QList<BuildConfiguration *> buildConfigurations() const;
|
||||||
|
|
||||||
// remove and add "QString uniqueConfigurationDisplayName(const QString &proposedName) const" instead
|
|
||||||
// move into BuildConfiguration *
|
|
||||||
void setDisplayNameFor(BuildConfiguration *configuration, const QString &displayName);
|
|
||||||
BuildConfiguration *activeBuildConfiguration() const;
|
BuildConfiguration *activeBuildConfiguration() const;
|
||||||
void setActiveBuildConfiguration(BuildConfiguration *configuration);
|
void setActiveBuildConfiguration(BuildConfiguration *configuration);
|
||||||
|
|
||||||
@@ -146,10 +142,6 @@ signals:
|
|||||||
void removedBuildConfiguration(ProjectExplorer::Project *p, BuildConfiguration *bc);
|
void removedBuildConfiguration(ProjectExplorer::Project *p, BuildConfiguration *bc);
|
||||||
void addedBuildConfiguration(ProjectExplorer::Project *p, BuildConfiguration *bc);
|
void addedBuildConfiguration(ProjectExplorer::Project *p, BuildConfiguration *bc);
|
||||||
|
|
||||||
// This signal is jut there for updating the tree list in the buildsettings wizard
|
|
||||||
void buildConfigurationDisplayNameChanged(BuildConfiguration *bc);
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/* This method is called when the project .user file is saved. Simply call
|
/* This method is called when the project .user file is saved. Simply call
|
||||||
* writer.saveValue() for each value you want to save. Make sure to always
|
* writer.saveValue() for each value you want to save. Make sure to always
|
||||||
|
@@ -343,7 +343,7 @@ Qt4BuildConfiguration *Qt4Project::activeQt4BuildConfiguration() const
|
|||||||
|
|
||||||
void Qt4Project::defaultQtVersionChanged()
|
void Qt4Project::defaultQtVersionChanged()
|
||||||
{
|
{
|
||||||
if (static_cast<Qt4BuildConfiguration *>(activeBuildConfiguration())->qtVersionId() == 0)
|
if (activeQt4BuildConfiguration()->qtVersionId() == 0)
|
||||||
m_rootProjectNode->update();
|
m_rootProjectNode->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -165,7 +165,7 @@ void Qt4ProjectConfigWidget::init(ProjectExplorer::BuildConfiguration *bc)
|
|||||||
|
|
||||||
void Qt4ProjectConfigWidget::changeConfigName(const QString &newName)
|
void Qt4ProjectConfigWidget::changeConfigName(const QString &newName)
|
||||||
{
|
{
|
||||||
m_buildConfiguration->project()->setDisplayNameFor(m_buildConfiguration, newName);
|
m_buildConfiguration->setDisplayName(newName);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Qt4ProjectConfigWidget::setupQtVersionsComboBox()
|
void Qt4ProjectConfigWidget::setupQtVersionsComboBox()
|
||||||
|
Reference in New Issue
Block a user