Handle non-qmake projects without kits

Make it possible to add kits again after all kits were removed
from a non qmake project.

Task-number: QTCREATORBUG-7814
Change-Id: I38967cd4c106b95288b7020fe325d8cfe2688a7c
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
Tobias Hunger
2012-09-06 16:19:14 +02:00
parent aa8a0cf0ed
commit e77bb8af04
6 changed files with 16 additions and 2 deletions

View File

@@ -439,6 +439,11 @@ void Project::configureAsExampleProject(const QStringList &platforms)
Q_UNUSED(platforms); Q_UNUSED(platforms);
} }
bool Project::supportsNoTargetPanel() const
{
return false;
}
void Project::onBuildDirectoryChanged() void Project::onBuildDirectoryChanged()
{ {
Target *target = qobject_cast<Target *>(sender()); Target *target = qobject_cast<Target *>(sender());

View File

@@ -124,6 +124,8 @@ public:
virtual bool needsConfiguration() const; virtual bool needsConfiguration() const;
virtual void configureAsExampleProject(const QStringList &platforms); virtual void configureAsExampleProject(const QStringList &platforms);
virtual bool supportsNoTargetPanel() const;
signals: signals:
void displayNameChanged(); void displayNameChanged();
void fileListChanged(); void fileListChanged();

View File

@@ -384,7 +384,7 @@ void ProjectWindow::showProperties(int index, int subIndex)
m_previousTargetSubIndex = previousPanelWidget->currentSubIndex(); m_previousTargetSubIndex = previousPanelWidget->currentSubIndex();
} }
if (m_hasTarget.value(project)) { if (m_hasTarget.value(project) || !project->supportsNoTargetPanel()) {
if (subIndex == 0) { if (subIndex == 0) {
// Targets page // Targets page
removeCurrentWidget(); removeCurrentWidget();

View File

@@ -115,7 +115,7 @@ void TargetSettingsPanelWidget::setupUi()
QVBoxLayout *noTargetLayout = new QVBoxLayout(m_noTargetLabel); QVBoxLayout *noTargetLayout = new QVBoxLayout(m_noTargetLabel);
noTargetLayout->setMargin(0); noTargetLayout->setMargin(0);
QLabel *label = new QLabel(m_noTargetLabel); QLabel *label = new QLabel(m_noTargetLabel);
label->setText(tr("No kit defined.")); label->setText(tr("No kit defined in this project."));
{ {
QFont f = label->font(); QFont f = label->font();
f.setPointSizeF(f.pointSizeF() * 1.4); f.setPointSizeF(f.pointSizeF() * 1.4);

View File

@@ -1367,6 +1367,11 @@ void Qt4Project::configureAsExampleProject(const QStringList &platforms)
ProjectExplorer::ProjectExplorerPlugin::instance()->requestProjectModeUpdate(this); ProjectExplorer::ProjectExplorerPlugin::instance()->requestProjectModeUpdate(this);
} }
bool Qt4Project::supportsNoTargetPanel() const
{
return true;
}
// All the Qt4 run configurations should share code. // All the Qt4 run configurations should share code.
// This is a rather suboptimal way to do that for disabledReason() // This is a rather suboptimal way to do that for disabledReason()
// but more pratical then duplicated the code everywhere // but more pratical then duplicated the code everywhere

View File

@@ -129,6 +129,8 @@ public:
void configureAsExampleProject(const QStringList &platforms); void configureAsExampleProject(const QStringList &platforms);
bool supportsNoTargetPanel() const;
/// \internal /// \internal
QString disabledReasonForRunConfiguration(const QString &proFilePath); QString disabledReasonForRunConfiguration(const QString &proFilePath);