Commit e3d14f7c authored by Daniel Teske's avatar Daniel Teske Committed by hjk

Make Open Project wizard skippable

Task-Nr: QTCREATORBUG-6063

Change-Id: Ieace3e9e68b4e0342c35ac7c279f4b0b61076419
Reviewed-by: default avatarEike Ziller <eike.ziller@nokia.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent a309c26f
...@@ -1484,9 +1484,10 @@ void DebuggerPluginPrivate::onCurrentProjectChanged(Project *project) ...@@ -1484,9 +1484,10 @@ void DebuggerPluginPrivate::onCurrentProjectChanged(Project *project)
RunConfiguration *activeRc = 0; RunConfiguration *activeRc = 0;
if (project) { if (project) {
Target *target = project->activeTarget(); Target *target = project->activeTarget();
QTC_ASSERT(target, return); if (target)
activeRc = target->activeRunConfiguration(); activeRc = target->activeRunConfiguration();
QTC_CHECK(activeRc); if (!activeRc)
return;
} }
for (int i = 0, n = m_snapshotHandler->size(); i != n; ++i) { for (int i = 0, n = m_snapshotHandler->size(); i != n; ++i) {
// Run controls might be deleted during exit. // Run controls might be deleted during exit.
......
...@@ -314,7 +314,7 @@ bool BuildManager::tasksAvailable() const ...@@ -314,7 +314,7 @@ bool BuildManager::tasksAvailable() const
return count > 0; return count > 0;
} }
void BuildManager::startBuildQueue() void BuildManager::startBuildQueue(const QStringList &preambleMessage)
{ {
if (d->m_buildQueue.isEmpty()) { if (d->m_buildQueue.isEmpty()) {
emit buildQueueFinished(true); emit buildQueueFinished(true);
...@@ -326,6 +326,8 @@ void BuildManager::startBuildQueue() ...@@ -326,6 +326,8 @@ void BuildManager::startBuildQueue()
d->m_progressFutureInterface = new QFutureInterface<void>; d->m_progressFutureInterface = new QFutureInterface<void>;
d->m_progressWatcher.setFuture(d->m_progressFutureInterface->future()); d->m_progressWatcher.setFuture(d->m_progressFutureInterface->future());
d->m_outputWindow->clearContents(); d->m_outputWindow->clearContents();
foreach (const QString &str, preambleMessage)
addToOutputWindow(str, BuildStep::MessageOutput, BuildStep::DontAppendNewline);
d->m_taskHub->clearTasks(Core::Id(Constants::TASK_CATEGORY_COMPILE)); d->m_taskHub->clearTasks(Core::Id(Constants::TASK_CATEGORY_COMPILE));
d->m_taskHub->clearTasks(Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)); d->m_taskHub->clearTasks(Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM));
progressManager->setApplicationLabel(QString()); progressManager->setApplicationLabel(QString());
...@@ -537,7 +539,7 @@ bool BuildManager::buildList(BuildStepList *bsl, const QString &stepListName) ...@@ -537,7 +539,7 @@ bool BuildManager::buildList(BuildStepList *bsl, const QString &stepListName)
return buildLists(QList<BuildStepList *>() << bsl, QStringList() << stepListName); return buildLists(QList<BuildStepList *>() << bsl, QStringList() << stepListName);
} }
bool BuildManager::buildLists(QList<BuildStepList *> bsls, const QStringList &stepListNames) bool BuildManager::buildLists(QList<BuildStepList *> bsls, const QStringList &stepListNames, const QStringList &preambelMessage)
{ {
QList<BuildStep *> steps; QList<BuildStep *> steps;
foreach(BuildStepList *list, bsls) foreach(BuildStepList *list, bsls)
...@@ -559,7 +561,7 @@ bool BuildManager::buildLists(QList<BuildStepList *> bsls, const QStringList &st ...@@ -559,7 +561,7 @@ bool BuildManager::buildLists(QList<BuildStepList *> bsls, const QStringList &st
if (ProjectExplorerPlugin::instance()->projectExplorerSettings().showCompilerOutput) if (ProjectExplorerPlugin::instance()->projectExplorerSettings().showCompilerOutput)
d->m_outputWindow->popup(false); d->m_outputWindow->popup(false);
startBuildQueue(); startBuildQueue(preambelMessage);
return true; return true;
} }
......
...@@ -60,7 +60,8 @@ public: ...@@ -60,7 +60,8 @@ public:
bool tasksAvailable() const; bool tasksAvailable() const;
bool buildLists(QList<BuildStepList *> bsls, const QStringList &stepListNames); bool buildLists(QList<BuildStepList *> bsls, const QStringList &stepListNames,
const QStringList &preambelMessage = QStringList());
bool buildList(BuildStepList *bsl, const QString &stepListName); bool buildList(BuildStepList *bsl, const QString &stepListName);
bool isBuilding(Project *p); bool isBuilding(Project *p);
...@@ -103,7 +104,7 @@ private slots: ...@@ -103,7 +104,7 @@ private slots:
void finish(); void finish();
private: private:
void startBuildQueue(); void startBuildQueue(const QStringList &preambleMessage = QStringList());
void nextStep(); void nextStep();
void clearBuildQueue(); void clearBuildQueue();
bool buildQueueAppend(QList<BuildStep *> steps, QStringList names); bool buildQueueAppend(QList<BuildStep *> steps, QStringList names);
......
...@@ -73,6 +73,11 @@ QString BuildSettingsPanelFactory::displayName() const ...@@ -73,6 +73,11 @@ QString BuildSettingsPanelFactory::displayName() const
return QCoreApplication::translate("BuildSettingsPanelFactory", "Build Settings"); return QCoreApplication::translate("BuildSettingsPanelFactory", "Build Settings");
} }
int BuildSettingsPanelFactory::priority() const
{
return 10;
}
bool BuildSettingsPanelFactory::supports(Target *target) bool BuildSettingsPanelFactory::supports(Target *target)
{ {
return target->buildConfigurationFactory(); return target->buildConfigurationFactory();
......
...@@ -60,6 +60,7 @@ class BuildSettingsPanelFactory : public ITargetPanelFactory ...@@ -60,6 +60,7 @@ class BuildSettingsPanelFactory : public ITargetPanelFactory
public: public:
QString id() const; QString id() const;
QString displayName() const; QString displayName() const;
int priority() const;
bool supports(Target *target); bool supports(Target *target);
PropertiesPanel *createPanel(Target *target); PropertiesPanel *createPanel(Target *target);
......
...@@ -53,6 +53,11 @@ QString CodeStyleSettingsPanelFactory::displayName() const ...@@ -53,6 +53,11 @@ QString CodeStyleSettingsPanelFactory::displayName() const
return QCoreApplication::translate("CodeStyleSettingsPanelFactory", "Code Style Settings"); return QCoreApplication::translate("CodeStyleSettingsPanelFactory", "Code Style Settings");
} }
int CodeStyleSettingsPanelFactory::priority() const
{
return 40;
}
bool CodeStyleSettingsPanelFactory::supports(Project *project) bool CodeStyleSettingsPanelFactory::supports(Project *project)
{ {
Q_UNUSED(project); Q_UNUSED(project);
......
...@@ -49,6 +49,7 @@ class CodeStyleSettingsPanelFactory : public IProjectPanelFactory ...@@ -49,6 +49,7 @@ class CodeStyleSettingsPanelFactory : public IProjectPanelFactory
public: public:
QString id() const; QString id() const;
QString displayName() const; QString displayName() const;
int priority() const;
PropertiesPanel *createPanel(Project *project); PropertiesPanel *createPanel(Project *project);
bool supports(Project *project); bool supports(Project *project);
}; };
......
...@@ -275,6 +275,11 @@ QString DependenciesPanelFactory::displayName() const ...@@ -275,6 +275,11 @@ QString DependenciesPanelFactory::displayName() const
return QCoreApplication::translate("DependenciesPanelFactory", "Dependencies"); return QCoreApplication::translate("DependenciesPanelFactory", "Dependencies");
} }
int DependenciesPanelFactory::priority() const
{
return 50;
}
bool DependenciesPanelFactory::supports(Project *project) bool DependenciesPanelFactory::supports(Project *project)
{ {
Q_UNUSED(project); Q_UNUSED(project);
......
...@@ -61,6 +61,7 @@ public: ...@@ -61,6 +61,7 @@ public:
QString id() const; QString id() const;
QString displayName() const; QString displayName() const;
int priority() const;
bool supports(Project *project); bool supports(Project *project);
PropertiesPanel *createPanel(Project *project); PropertiesPanel *createPanel(Project *project);
private: private:
......
...@@ -49,6 +49,11 @@ QString EditorSettingsPanelFactory::displayName() const ...@@ -49,6 +49,11 @@ QString EditorSettingsPanelFactory::displayName() const
return QCoreApplication::translate("EditorSettingsPanelFactory", "Editor Settings"); return QCoreApplication::translate("EditorSettingsPanelFactory", "Editor Settings");
} }
int EditorSettingsPanelFactory::priority() const
{
return 30;
}
bool EditorSettingsPanelFactory::supports(Project *project) bool EditorSettingsPanelFactory::supports(Project *project)
{ {
Q_UNUSED(project); Q_UNUSED(project);
......
...@@ -49,6 +49,7 @@ class EditorSettingsPanelFactory : public IProjectPanelFactory ...@@ -49,6 +49,7 @@ class EditorSettingsPanelFactory : public IProjectPanelFactory
public: public:
QString id() const; QString id() const;
QString displayName() const; QString displayName() const;
int priority() const;
PropertiesPanel *createPanel(Project *project); PropertiesPanel *createPanel(Project *project);
bool supports(Project *project); bool supports(Project *project);
}; };
......
...@@ -75,6 +75,10 @@ class PROJECTEXPLORER_EXPORT IPanelFactory : public QObject ...@@ -75,6 +75,10 @@ class PROJECTEXPLORER_EXPORT IPanelFactory : public QObject
public: public:
virtual QString id() const = 0; virtual QString id() const = 0;
virtual QString displayName() const = 0; virtual QString displayName() const = 0;
virtual int priority() const = 0;
static bool prioritySort(IPanelFactory *a, IPanelFactory *b)
{ return (a->priority() == b->priority() && a->id() < b->id())
|| a->priority() < b->priority(); }
}; };
class PROJECTEXPLORER_EXPORT IProjectPanelFactory : public IPanelFactory class PROJECTEXPLORER_EXPORT IProjectPanelFactory : public IPanelFactory
...@@ -83,6 +87,8 @@ class PROJECTEXPLORER_EXPORT IProjectPanelFactory : public IPanelFactory ...@@ -83,6 +87,8 @@ class PROJECTEXPLORER_EXPORT IProjectPanelFactory : public IPanelFactory
public: public:
virtual bool supports(Project *project) = 0; virtual bool supports(Project *project) = 0;
virtual PropertiesPanel *createPanel(Project *project) = 0; virtual PropertiesPanel *createPanel(Project *project) = 0;
signals:
void projectUpdated(ProjectExplorer::Project *project);
}; };
class PROJECTEXPLORER_EXPORT ITargetPanelFactory : public IPanelFactory class PROJECTEXPLORER_EXPORT ITargetPanelFactory : public IPanelFactory
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include <coreplugin/ifile.h> #include <coreplugin/ifile.h>
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/coreconstants.h> #include <coreplugin/coreconstants.h>
#include <coreplugin/modemanager.h>
#include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorer.h>
#include <projectexplorer/session.h> #include <projectexplorer/session.h>
...@@ -487,6 +488,8 @@ MiniProjectTargetSelector::MiniProjectTargetSelector(QAction *targetSelectorActi ...@@ -487,6 +488,8 @@ MiniProjectTargetSelector::MiniProjectTargetSelector(QAction *targetSelectorActi
m_summaryLabel->setMargin(3); m_summaryLabel->setMargin(3);
m_summaryLabel->setAlignment(Qt::AlignLeft | Qt::AlignTop); m_summaryLabel->setAlignment(Qt::AlignLeft | Qt::AlignTop);
m_summaryLabel->setStyleSheet(QString::fromLatin1("background: #464646;")); m_summaryLabel->setStyleSheet(QString::fromLatin1("background: #464646;"));
m_summaryLabel->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
m_summaryLabel->setTextInteractionFlags(m_summaryLabel->textInteractionFlags() | Qt::LinksAccessibleByMouse);
grid->addWidget(m_summaryLabel, 0, 0, 1, 2 * LAST - 1); grid->addWidget(m_summaryLabel, 0, 0, 1, 2 * LAST - 1);
...@@ -519,6 +522,9 @@ MiniProjectTargetSelector::MiniProjectTargetSelector(QAction *targetSelectorActi ...@@ -519,6 +522,9 @@ MiniProjectTargetSelector::MiniProjectTargetSelector(QAction *targetSelectorActi
if (m_sessionManager->startupProject()) if (m_sessionManager->startupProject())
activeTargetChanged(m_sessionManager->startupProject()->activeTarget()); activeTargetChanged(m_sessionManager->startupProject()->activeTarget());
connect(m_summaryLabel, SIGNAL(linkActivated(QString)),
this, SLOT(switchToProjectsMode()));
connect(m_sessionManager, SIGNAL(startupProjectChanged(ProjectExplorer::Project*)), connect(m_sessionManager, SIGNAL(startupProjectChanged(ProjectExplorer::Project*)),
this, SLOT(changeStartupProject(ProjectExplorer::Project*))); this, SLOT(changeStartupProject(ProjectExplorer::Project*)));
...@@ -994,6 +1000,7 @@ QSize MiniProjectTargetSelector::sizeHint() const ...@@ -994,6 +1000,7 @@ QSize MiniProjectTargetSelector::sizeHint() const
static QWidget *actionBar = Core::ICore::mainWindow()->findChild<QWidget*>(QLatin1String("actionbar")); static QWidget *actionBar = Core::ICore::mainWindow()->findChild<QWidget*>(QLatin1String("actionbar"));
Q_ASSERT(actionBar); Q_ASSERT(actionBar);
// At least the size of the actionbar
int alignedWithActionHeight int alignedWithActionHeight
= actionBar->height() - statusBar->height(); = actionBar->height() - statusBar->height();
QSize s = QWidget::sizeHint(); QSize s = QWidget::sizeHint();
...@@ -1057,23 +1064,55 @@ void MiniProjectTargetSelector::updateActionAndSummary() ...@@ -1057,23 +1064,55 @@ void MiniProjectTargetSelector::updateActionAndSummary()
} }
} }
m_projectAction->setProperty("heading", projectName); m_projectAction->setProperty("heading", projectName);
m_projectAction->setProperty("subtitle", buildConfig); if (project && project->needsConfiguration()) {
m_projectAction->setProperty("subtitle", tr("Unconfigured"));
} else {
m_projectAction->setProperty("subtitle", buildConfig);
}
m_projectAction->setIcon(targetIcon); m_projectAction->setIcon(targetIcon);
QString targetTip = targetName.isEmpty() ? QLatin1String("") QStringList lines;
: tr("<b>Target:</b> %1<br/>").arg(targetName); lines << tr("<b>Project:</b> %1").arg(projectName);
QString buildTip = buildConfig.isEmpty() ? QLatin1String("") if (!targetName.isEmpty())
: tr("<b>Build:</b> %1<br/>").arg(buildConfig); lines << tr("<b>Target:</b> %1").arg(targetName);
QString deployTip = deployConfig.isEmpty() ? QLatin1String("") if (!buildConfig.isEmpty())
: tr("<b>Deploy:</b> %1<br/>").arg(deployConfig); lines << tr("<b>Build:</b> %1").arg(buildConfig);
QString targetToolTip = targetToolTipText.isEmpty() ? QLatin1String("") if (!deployConfig.isEmpty())
: tr("<br/>%1").arg(targetToolTipText); lines << tr("<b>Deploy:</b> %1").arg(deployConfig);
QString toolTip = tr("<html><nobr><b>Project:</b> %1<br/>%2%3%4<b>Run:</b> %5%6</html>"); if (!runConfig.isEmpty())
m_projectAction->setToolTip(toolTip.arg(projectName, targetTip, buildTip, deployTip, runConfig, targetToolTip)); lines << tr("<b>Run:</b> %1").arg(runConfig);
if (!targetToolTipText.isEmpty())
lines << tr("%1").arg(targetToolTipText);
QString toolTip = tr("<html><nobr>%1</html>")
.arg(lines.join(QLatin1String("<br/>")));
m_projectAction->setToolTip(toolTip);
updateSummary(); updateSummary();
} }
void MiniProjectTargetSelector::updateSummary() void MiniProjectTargetSelector::updateSummary()
{ {
// Count the number of lines
int visibleLineCount = m_projectListWidget->isVisibleTo(this) ? 0 : 1;
for (int i = TARGET; i < LAST; ++i)
visibleLineCount += m_listWidgets[i]->isVisibleTo(this) ? 0 : 1;
if (visibleLineCount == LAST) {
m_summaryLabel->setMinimumHeight(0);
m_summaryLabel->setMaximumHeight(800);
} else {
if (visibleLineCount < 3) {
foreach (Project *p, m_sessionManager->projects()) {
if (p->needsConfiguration()) {
visibleLineCount = 3;
break;
}
}
}
int height = visibleLineCount * QFontMetrics(m_summaryLabel->font()).height() + m_summaryLabel->margin() *2;
m_summaryLabel->setMinimumHeight(height);
m_summaryLabel->setMaximumHeight(height);
}
QString summary; QString summary;
if (Project *startupProject = m_sessionManager->startupProject()) { if (Project *startupProject = m_sessionManager->startupProject()) {
if (!m_projectListWidget->isVisibleTo(this)) if (!m_projectListWidget->isVisibleTo(this))
...@@ -1090,10 +1129,24 @@ void MiniProjectTargetSelector::updateSummary() ...@@ -1090,10 +1129,24 @@ void MiniProjectTargetSelector::updateSummary()
if (!m_listWidgets[RUN]->isVisibleTo(this) && activeTarget->activeRunConfiguration()) if (!m_listWidgets[RUN]->isVisibleTo(this) && activeTarget->activeRunConfiguration())
summary.append(tr("Run: <b>%1</b><br/>").arg( summary.append(tr("Run: <b>%1</b><br/>").arg(
activeTarget->activeRunConfiguration()->displayName())); activeTarget->activeRunConfiguration()->displayName()));
} else if (startupProject->needsConfiguration()) {
summary = tr("<style type=text/css>"
"a:link {color: rgb(128, 128, 255, 240);}</style>"
"The project <b>%1</b> is not yet configured<br/><br/>"
"You can configure it in the <a href=\"projectmode\">Projects mode</a><br/>")
.arg(startupProject->displayName());
} else {
if (!m_listWidgets[TARGET]->isVisibleTo(this))
summary.append("<br/>");
if (!m_listWidgets[BUILD]->isVisibleTo(this))
summary.append("<br/>");
if (!m_listWidgets[DEPLOY]->isVisibleTo(this))
summary.append("<br/>");
if (!m_listWidgets[RUN]->isVisibleTo(this))
summary.append("<br/>");
} }
} }
m_summaryLabel->setText(summary); m_summaryLabel->setText(summary);
} }
void MiniProjectTargetSelector::paintEvent(QPaintEvent *) void MiniProjectTargetSelector::paintEvent(QPaintEvent *)
...@@ -1107,3 +1160,9 @@ void MiniProjectTargetSelector::paintEvent(QPaintEvent *) ...@@ -1107,3 +1160,9 @@ void MiniProjectTargetSelector::paintEvent(QPaintEvent *)
static QImage image(QLatin1String(":/projectexplorer/images/targetpanel_bottom.png")); static QImage image(QLatin1String(":/projectexplorer/images/targetpanel_bottom.png"));
Utils::StyleHelper::drawCornerImage(image, &painter, bottomRect, 1, 1, 1, 1); Utils::StyleHelper::drawCornerImage(image, &painter, bottomRect, 1, 1, 1, 1);
} }
void MiniProjectTargetSelector::switchToProjectsMode()
{
Core::ICore::instance()->modeManager()->activateMode(Constants::MODE_SESSION);
hide();
}
...@@ -54,7 +54,6 @@ class SessionManager; ...@@ -54,7 +54,6 @@ class SessionManager;
namespace Internal { namespace Internal {
// helper classes // helper classes
class ListWidget : public QListWidget class ListWidget : public QListWidget
{ {
Q_OBJECT Q_OBJECT
...@@ -144,6 +143,7 @@ private slots: ...@@ -144,6 +143,7 @@ private slots:
void delayedHide(); void delayedHide();
void updateActionAndSummary(); void updateActionAndSummary();
void switchToProjectsMode();
private: private:
void updateProjectListVisible(); void updateProjectListVisible();
void updateTargetListVisible(); void updateTargetListVisible();
......
...@@ -383,4 +383,9 @@ void Project::setNamedSettings(const QString &name, QVariant &value) ...@@ -383,4 +383,9 @@ void Project::setNamedSettings(const QString &name, QVariant &value)
d->m_pluginSettings.insert(name, value); d->m_pluginSettings.insert(name, value);
} }
bool Project::needsConfiguration() const
{
return false;
}
} // namespace ProjectExplorer } // namespace ProjectExplorer
...@@ -117,6 +117,8 @@ public: ...@@ -117,6 +117,8 @@ public:
QVariant namedSettings(const QString &name) const; QVariant namedSettings(const QString &name) const;
void setNamedSettings(const QString &name, QVariant &value); void setNamedSettings(const QString &name, QVariant &value);
virtual bool needsConfiguration() const;
signals: signals:
void fileListChanged(); void fileListChanged();
......
...@@ -1340,8 +1340,21 @@ QList<Project *> ProjectExplorerPlugin::openProjects(const QStringList &fileName ...@@ -1340,8 +1340,21 @@ QList<Project *> ProjectExplorerPlugin::openProjects(const QStringList &fileName
} }
updateActions(); updateActions();
if (!openedPro.isEmpty()) bool switchToProjectsMode = false;
Core::ModeManager::activateMode(QLatin1String(Core::Constants::MODE_EDIT)); foreach (Project *p, openedPro) {
if (p->needsConfiguration()) {
switchToProjectsMode = true;
break;
}
}
if (!openedPro.isEmpty()) {
if (switchToProjectsMode)
Core::ModeManager::activateMode(QLatin1String(ProjectExplorer::Constants::MODE_SESSION));
else
Core::ModeManager::activateMode(QLatin1String(Core::Constants::MODE_EDIT));
Core::ModeManager::setFocusToCurrentMode();
}
return openedPro; return openedPro;
} }
...@@ -1812,6 +1825,12 @@ int ProjectExplorerPlugin::queue(QList<Project *> projects, QStringList stepIds) ...@@ -1812,6 +1825,12 @@ int ProjectExplorerPlugin::queue(QList<Project *> projects, QStringList stepIds)
QList<BuildStepList *> stepLists; QList<BuildStepList *> stepLists;
QStringList names; QStringList names;
QStringList preambleMessage;
foreach (Project *pro, projects)
if (pro && pro->needsConfiguration())
preambleMessage.append(tr("The project %1 is not configured, skipping it.\n")
.arg(pro->displayName()));
foreach (const QString id, stepIds) { foreach (const QString id, stepIds) {
foreach (Project *pro, projects) { foreach (Project *pro, projects) {
if (!pro || !pro->activeTarget()) if (!pro || !pro->activeTarget())
...@@ -1833,7 +1852,7 @@ int ProjectExplorerPlugin::queue(QList<Project *> projects, QStringList stepIds) ...@@ -1833,7 +1852,7 @@ int ProjectExplorerPlugin::queue(QList<Project *> projects, QStringList stepIds)
if (stepLists.isEmpty()) if (stepLists.isEmpty())
return 0; return 0;
if (!d->m_buildManager->buildLists(stepLists, names)) if (!d->m_buildManager->buildLists(stepLists, names, preambleMessage))
return -1; return -1;
return stepLists.count(); return stepLists.count();
} }
...@@ -1982,6 +2001,9 @@ QPair<bool, QString> ProjectExplorerPlugin::buildSettingsEnabled(Project *pro) ...@@ -1982,6 +2001,9 @@ QPair<bool, QString> ProjectExplorerPlugin::buildSettingsEnabled(Project *pro)
} else if (d->m_buildManager->isBuilding(pro)) { } else if (d->m_buildManager->isBuilding(pro)) {
result.first = false; result.first = false;
result.second = tr("Currently building the active project."); result.second = tr("Currently building the active project.");
} else if (pro->needsConfiguration()) {
result.first = false;
result.second = tr("The project %1 is not configured.").arg(pro->displayName());
} else if (!hasBuildSettings(pro)) { } else if (!hasBuildSettings(pro)) {
result.first = false; result.first = false;
result.second = tr("Project has no build settings."); result.second = tr("Project has no build settings.");
...@@ -2055,8 +2077,9 @@ bool ProjectExplorerPlugin::hasDeploySettings(Project *pro) ...@@ -2055,8 +2077,9 @@ bool ProjectExplorerPlugin::hasDeploySettings(Project *pro)
{ {
const QList<Project *> & projects = d->m_session->projectOrder(pro); const QList<Project *> & projects = d->m_session->projectOrder(pro);
foreach(Project *project, projects) foreach(Project *project, projects)
if (project->activeTarget()->activeDeployConfiguration() && if (project->activeTarget()
!project->activeTarget()->activeDeployConfiguration()->stepList()->isEmpty()) && project->activeTarget()->activeDeployConfiguration()
&& !project->activeTarget()->activeDeployConfiguration()->stepList()->isEmpty())
return true; return true;
return false; return false;
} }
...@@ -2066,7 +2089,9 @@ void ProjectExplorerPlugin::runProject(Project *pro, RunMode mode, const bool fo ...@@ -2066,7 +2089,9 @@ void ProjectExplorerPlugin::runProject(Project *pro, RunMode mode, const bool fo
if (!pro) if (!pro)
return; return;
runRunConfiguration(pro->activeTarget()->activeRunConfiguration(), mode, forceSkipDeploy); if (Target *target = pro->activeTarget())
if (RunConfiguration *rc = target->activeRunConfiguration())
runRunConfiguration(rc, mode, forceSkipDeploy);
} }
void ProjectExplorerPlugin::runRunConfiguration(ProjectExplorer::RunConfiguration *rc, void ProjectExplorerPlugin::runRunConfiguration(ProjectExplorer::RunConfiguration *rc,
...@@ -2285,6 +2310,9 @@ QString ProjectExplorerPlugin::cannotRunReason(Project *project, RunMode runMode ...@@ -2285,6 +2310,9 @@ QString ProjectExplorerPlugin::cannotRunReason(Project *project, RunMode runMode
if (!project) if (!project)
return tr("No active project.");