Update the makesteps the summary on build directory changes

Also ensure that Qt4ProjectConfigWidget does not emit any signals from
it's init method.
This commit is contained in:
dt
2009-10-29 12:24:25 +01:00
parent 6594ddbfb7
commit 7fc6a0ecc8
5 changed files with 70 additions and 27 deletions

View File

@@ -144,6 +144,7 @@ public:
static QString makeUnique(const QString &preferedName, const QStringList &usedNames);
signals:
void fileListChanged();
void buildDirectoryChanged();
// TODO clean up signal names
// might be better to also have

View File

@@ -174,6 +174,9 @@ MakeStepConfigWidget::MakeStepConfigWidget(MakeStep *makeStep)
connect(makeStep, SIGNAL(changed()),
this, SLOT(update()));
connect(makeStep->project(), SIGNAL(buildDirectoryChanged()),
this, SLOT(updateDetails()));
connect(ProjectExplorer::ProjectExplorerPlugin::instance(), SIGNAL(settingsChanged()),
this, SLOT(updateMakeOverrideLabel()));
connect(ProjectExplorer::ProjectExplorerPlugin::instance(), SIGNAL(settingsChanged()),
@@ -189,7 +192,6 @@ void MakeStepConfigWidget::updateMakeOverrideLabel()
void MakeStepConfigWidget::updateDetails()
{
// TODO reduce heavy code duplication
Qt4Project *pro = static_cast<Qt4Project *>(m_makeStep->project());
ProjectExplorer::BuildConfiguration *bc = pro->buildConfiguration(m_buildConfiguration);
QString workingDirectory = pro->buildDirectory(bc);

View File

@@ -1004,7 +1004,7 @@ void Qt4Project::updateActiveRunConfiguration()
}
}
emit runConfigurationsEnabledStateChanged();
emit invalidateCachedTargetInformation();
emit targetInformationChanged();
}
ProjectExplorer::ToolChain::ToolChainType Qt4Project::toolChainType(BuildConfiguration *configuration) const
@@ -1207,6 +1207,11 @@ void Qt4Project::invalidateCachedTargetInformation()
emit targetInformationChanged();
}
void Qt4Project::emitBuildDirectoryChanged()
{
emit buildDirectoryChanged();
}
// We match -spec and -platfrom separetly
// We ignore -cache, because qmake contained a bug that it didn't
// mention the -cache in the Makefile

View File

@@ -72,6 +72,7 @@ namespace Internal {
class Qt4RunConfiguration;
class GCCPreprocessor;
struct Qt4ProjectFiles;
class Qt4ProjectConfigWidget;
class CodeModelInfo
{
@@ -266,6 +267,10 @@ private:
static void findProFile(const QString& fileName, Internal::Qt4ProFileNode *root, QList<Internal::Qt4ProFileNode *> &list);
static bool hasSubNode(Internal::Qt4PriFileNode *root, const QString &path);
// called by Qt4ProjectConfigWidget
// TODO remove once there's a setBuildDirectory call
void emitBuildDirectoryChanged();
QList<Internal::Qt4ProFileNode *> m_applicationProFileChange;
ProjectExplorer::ProjectExplorerPlugin *projectExplorer() const;
@@ -296,6 +301,7 @@ private:
mutable ProjectExplorer::ToolChain *m_toolChain;
friend class Qt4ProjectFile;
friend class Internal::Qt4ProjectConfigWidget;
};
} // namespace Qt4ProjectManager

View File

@@ -72,30 +72,6 @@ Qt4ProjectConfigWidget::Qt4ProjectConfigWidget(Qt4Project *project)
m_ui->shadowBuildDirEdit->setExpectedKind(Utils::PathChooser::Directory);
m_ui->invalidQtWarningLabel->setVisible(false);
connect(m_ui->nameLineEdit, SIGNAL(textEdited(QString)),
this, SLOT(changeConfigName(QString)));
connect(m_ui->shadowBuildCheckBox, SIGNAL(clicked(bool)),
this, SLOT(shadowBuildCheckBoxClicked(bool)));
connect(m_ui->shadowBuildDirEdit, SIGNAL(beforeBrowsing()),
this, SLOT(onBeforeBeforeShadowBuildDirBrowsed()));
connect(m_ui->shadowBuildDirEdit, SIGNAL(changed(QString)),
this, SLOT(shadowBuildLineEditTextChanged()));
connect(m_ui->qtVersionComboBox, SIGNAL(currentIndexChanged(QString)),
this, SLOT(qtVersionComboBoxCurrentIndexChanged(QString)));
connect(m_ui->toolChainComboBox, SIGNAL(activated(int)),
this, SLOT(selectToolChain(int)));
connect(m_ui->importLabel, SIGNAL(linkActivated(QString)),
this, SLOT(importLabelClicked()));
connect(m_ui->manageQtVersionPushButtons, SIGNAL(clicked()),
this, SLOT(manageQtVersions()));
QtVersionManager *vm = QtVersionManager::instance();
connect(vm, SIGNAL(qtVersionsChanged()),
@@ -147,6 +123,31 @@ void Qt4ProjectConfigWidget::init(const QString &buildConfiguration)
if (debug)
qDebug() << "Qt4ProjectConfigWidget::init() for"<<buildConfiguration;
disconnect(m_ui->nameLineEdit, SIGNAL(textEdited(QString)),
this, SLOT(changeConfigName(QString)));
disconnect(m_ui->shadowBuildCheckBox, SIGNAL(clicked(bool)),
this, SLOT(shadowBuildCheckBoxClicked(bool)));
disconnect(m_ui->shadowBuildDirEdit, SIGNAL(beforeBrowsing()),
this, SLOT(onBeforeBeforeShadowBuildDirBrowsed()));
disconnect(m_ui->shadowBuildDirEdit, SIGNAL(changed(QString)),
this, SLOT(shadowBuildLineEditTextChanged()));
disconnect(m_ui->qtVersionComboBox, SIGNAL(currentIndexChanged(QString)),
this, SLOT(qtVersionComboBoxCurrentIndexChanged(QString)));
disconnect(m_ui->toolChainComboBox, SIGNAL(activated(int)),
this, SLOT(selectToolChain(int)));
disconnect(m_ui->importLabel, SIGNAL(linkActivated(QString)),
this, SLOT(importLabelClicked()));
disconnect(m_ui->manageQtVersionPushButtons, SIGNAL(clicked()),
this, SLOT(manageQtVersions()));
m_buildConfiguration = buildConfiguration;
ProjectExplorer::BuildConfiguration *bc = m_pro->buildConfiguration(buildConfiguration);
m_ui->nameLineEdit->setText(bc->displayName());
@@ -161,6 +162,31 @@ void Qt4ProjectConfigWidget::init(const QString &buildConfiguration)
updateImportLabel();
updateToolChainCombo();
updateDetails();
connect(m_ui->nameLineEdit, SIGNAL(textEdited(QString)),
this, SLOT(changeConfigName(QString)));
connect(m_ui->shadowBuildCheckBox, SIGNAL(clicked(bool)),
this, SLOT(shadowBuildCheckBoxClicked(bool)));
connect(m_ui->shadowBuildDirEdit, SIGNAL(beforeBrowsing()),
this, SLOT(onBeforeBeforeShadowBuildDirBrowsed()));
connect(m_ui->shadowBuildDirEdit, SIGNAL(changed(QString)),
this, SLOT(shadowBuildLineEditTextChanged()));
connect(m_ui->qtVersionComboBox, SIGNAL(currentIndexChanged(QString)),
this, SLOT(qtVersionComboBoxCurrentIndexChanged(QString)));
connect(m_ui->toolChainComboBox, SIGNAL(activated(int)),
this, SLOT(selectToolChain(int)));
connect(m_ui->importLabel, SIGNAL(linkActivated(QString)),
this, SLOT(importLabelClicked()));
connect(m_ui->manageQtVersionPushButtons, SIGNAL(clicked()),
this, SLOT(manageQtVersions()));
}
void Qt4ProjectConfigWidget::changeConfigName(const QString &newName)
@@ -222,6 +248,7 @@ void Qt4ProjectConfigWidget::shadowBuildCheckBoxClicked(bool checked)
bc->setValue("buildDirectory", m_ui->shadowBuildDirEdit->path());
else
bc->setValue("buildDirectory", QVariant(QString::null));
m_pro->buildDirectoryChanged();
updateDetails();
updateImportLabel();
}
@@ -262,9 +289,11 @@ void Qt4ProjectConfigWidget::shadowBuildLineEditTextChanged()
// if the directory already exists
// check if we have a build in there and
// offer to import it
updateImportLabel();
m_pro->buildDirectoryChanged();
m_pro->invalidateCachedTargetInformation();
updateImportLabel();
updateDetails();
}