Add a disabled reason to the display of runconfigurations

Also distinguish between qt runconfigurations that are disabled
due to parsing and due to not being parseable

Change-Id: Ia8ce4eaa7b6bfcc2c5290b254bb288c6d4892170
Task-Nr: QTCREATORBUG-5103
Reviewed-on: http://codereview.qt.nokia.com/451
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
This commit is contained in:
dt_
2011-06-10 15:37:10 +02:00
committed by Daniel Teske
parent 9196921429
commit 2b31dbadcf
20 changed files with 238 additions and 175 deletions

View File

@@ -105,7 +105,8 @@ Qt4RunConfiguration::Qt4RunConfiguration(Qt4BaseTarget *parent, const QString &p
m_runMode(Gui), m_runMode(Gui),
m_isUsingDyldImageSuffix(false), m_isUsingDyldImageSuffix(false),
m_baseEnvironmentBase(Qt4RunConfiguration::BuildEnvironmentBase), m_baseEnvironmentBase(Qt4RunConfiguration::BuildEnvironmentBase),
m_parseSuccess(parent->qt4Project()->validParse(m_proFilePath)) m_parseSuccess(parent->qt4Project()->validParse(m_proFilePath)),
m_parseInProgress(parent->qt4Project()->parseInProgress(m_proFilePath))
{ {
ctor(); ctor();
} }
@@ -119,7 +120,8 @@ Qt4RunConfiguration::Qt4RunConfiguration(Qt4BaseTarget *parent, Qt4RunConfigurat
m_userWorkingDirectory(source->m_userWorkingDirectory), m_userWorkingDirectory(source->m_userWorkingDirectory),
m_userEnvironmentChanges(source->m_userEnvironmentChanges), m_userEnvironmentChanges(source->m_userEnvironmentChanges),
m_baseEnvironmentBase(source->m_baseEnvironmentBase), m_baseEnvironmentBase(source->m_baseEnvironmentBase),
m_parseSuccess(source->m_parseSuccess) m_parseSuccess(source->m_parseSuccess),
m_parseInProgress(source->m_parseInProgress)
{ {
ctor(); ctor();
} }
@@ -135,38 +137,33 @@ Qt4DesktopTarget *Qt4RunConfiguration::qt4Target() const
bool Qt4RunConfiguration::isEnabled() const bool Qt4RunConfiguration::isEnabled() const
{ {
return m_parseSuccess; return m_parseSuccess && !m_parseInProgress;
} }
QString Qt4RunConfiguration::disabledReason() const QString Qt4RunConfiguration::disabledReason() const
{ {
if (m_parseInProgress)
return tr("The .pro file is currently being parsed.");
if (!m_parseSuccess) if (!m_parseSuccess)
return tr("The .pro file could not be parsed"); return tr("The .pro file could not be parsed.");
return QString(); return QString();
} }
void Qt4RunConfiguration::handleParseState(bool success) void Qt4RunConfiguration::proFileUpdated(Qt4ProjectManager::Qt4ProFileNode *pro, bool success, bool parseInProgress)
{
bool enabled = isEnabled();
m_parseSuccess = success;
if (enabled != isEnabled())
emit isEnabledChanged(!enabled);
}
void Qt4RunConfiguration::proFileUpdated(Qt4ProjectManager::Qt4ProFileNode *pro, bool success)
{ {
if (m_proFilePath != pro->path()) if (m_proFilePath != pro->path())
return; return;
handleParseState(success);
bool enabled = isEnabled();
m_parseSuccess = success;
m_parseInProgress = parseInProgress;
if (enabled != isEnabled())
emit isEnabledChanged(!enabled);
if (!parseInProgress) {
emit effectiveTargetInformationChanged(); emit effectiveTargetInformationChanged();
emit baseEnvironmentChanged(); emit baseEnvironmentChanged();
} }
void Qt4RunConfiguration::proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode *pro)
{
if (pro->path() != m_proFilePath)
return;
handleParseState(false);
} }
void Qt4RunConfiguration::ctor() void Qt4RunConfiguration::ctor()
@@ -175,11 +172,8 @@ void Qt4RunConfiguration::ctor()
connect(qt4Target(), SIGNAL(environmentChanged()), connect(qt4Target(), SIGNAL(environmentChanged()),
this, SIGNAL(baseEnvironmentChanged())); this, SIGNAL(baseEnvironmentChanged()));
connect(qt4Target()->qt4Project(), SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool)), connect(qt4Target()->qt4Project(), SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)),
this, SLOT(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool))); this, SLOT(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)));
connect(qt4Target()->qt4Project(), SIGNAL(proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode*)),
this, SLOT(proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode*)));
} }
////// //////
@@ -196,6 +190,17 @@ Qt4RunConfigurationWidget::Qt4RunConfigurationWidget(Qt4RunConfiguration *qt4Run
QVBoxLayout *vboxTopLayout = new QVBoxLayout(this); QVBoxLayout *vboxTopLayout = new QVBoxLayout(this);
vboxTopLayout->setMargin(0); vboxTopLayout->setMargin(0);
QHBoxLayout *hl = new QHBoxLayout();
hl->addStretch();
m_disabledIcon = new QLabel(this);
m_disabledIcon->setPixmap(QPixmap(QString::fromUtf8(":/projectexplorer/images/compile_warning.png")));
hl->addWidget(m_disabledIcon);
m_disabledReason = new QLabel(this);
m_disabledReason->setVisible(false);
hl->addWidget(m_disabledReason);
hl->addStretch();
vboxTopLayout->addLayout(hl);
m_detailsContainer = new Utils::DetailsWidget(this); m_detailsContainer = new Utils::DetailsWidget(this);
m_detailsContainer->setState(Utils::DetailsWidget::NoSummary); m_detailsContainer->setState(Utils::DetailsWidget::NoSummary);
vboxTopLayout->addWidget(m_detailsContainer); vboxTopLayout->addWidget(m_detailsContainer);
@@ -285,7 +290,7 @@ Qt4RunConfigurationWidget::Qt4RunConfigurationWidget(Qt4RunConfiguration *qt4Run
m_environmentWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); m_environmentWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
vboxTopLayout->addWidget(m_environmentWidget); vboxTopLayout->addWidget(m_environmentWidget);
setEnabled(m_qt4RunConfiguration->isEnabled()); runConfigurationEnabledChange(m_qt4RunConfiguration->isEnabled());
connect(m_workingDirectoryEdit, SIGNAL(changed(QString)), connect(m_workingDirectoryEdit, SIGNAL(changed(QString)),
this, SLOT(workDirectoryEdited())); this, SLOT(workDirectoryEdited()));
@@ -387,7 +392,11 @@ void Qt4RunConfigurationWidget::userChangesEdited()
void Qt4RunConfigurationWidget::runConfigurationEnabledChange(bool enabled) void Qt4RunConfigurationWidget::runConfigurationEnabledChange(bool enabled)
{ {
setEnabled(enabled); m_detailsContainer->setEnabled(enabled);
m_environmentWidget->setEnabled(enabled);
m_disabledIcon->setVisible(!enabled);
m_disabledReason->setVisible(!enabled);
m_disabledReason->setText(m_qt4RunConfiguration->disabledReason());
} }
void Qt4RunConfigurationWidget::workDirectoryEdited() void Qt4RunConfigurationWidget::workDirectoryEdited()
@@ -510,6 +519,7 @@ bool Qt4RunConfiguration::fromMap(const QVariantMap &map)
m_baseEnvironmentBase = static_cast<BaseEnvironmentBase>(map.value(QLatin1String(BASE_ENVIRONMENT_BASE_KEY), static_cast<int>(Qt4RunConfiguration::BuildEnvironmentBase)).toInt()); m_baseEnvironmentBase = static_cast<BaseEnvironmentBase>(map.value(QLatin1String(BASE_ENVIRONMENT_BASE_KEY), static_cast<int>(Qt4RunConfiguration::BuildEnvironmentBase)).toInt());
m_parseSuccess = qt4Target()->qt4Project()->validParse(m_proFilePath); m_parseSuccess = qt4Target()->qt4Project()->validParse(m_proFilePath);
m_parseInProgress = qt4Target()->qt4Project()->parseInProgress(m_proFilePath);
return RunConfiguration::fromMap(map); return RunConfiguration::fromMap(map);
} }

View File

@@ -38,8 +38,9 @@
#include <utils/environment.h> #include <utils/environment.h>
#include <QtCore/QStringList> #include <QtCore/QStringList>
#include <QtGui/QWidget>
#include <QtCore/QMetaType> #include <QtCore/QMetaType>
#include <QtGui/QLabel>
#include <QtGui/QWidget>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QCheckBox; class QCheckBox;
@@ -117,15 +118,13 @@ signals:
void effectiveTargetInformationChanged(); void effectiveTargetInformationChanged();
private slots: private slots:
void proFileUpdated(Qt4ProjectManager::Qt4ProFileNode *pro, bool success); void proFileUpdated(Qt4ProjectManager::Qt4ProFileNode *pro, bool success, bool parseInProgress);
void proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode *pro);
protected: protected:
Qt4RunConfiguration(Qt4BaseTarget *parent, Qt4RunConfiguration *source); Qt4RunConfiguration(Qt4BaseTarget *parent, Qt4RunConfiguration *source);
virtual bool fromMap(const QVariantMap &map); virtual bool fromMap(const QVariantMap &map);
private: private:
void handleParseState(bool success);
void setBaseWorkingDirectory(const QString &workingDirectory); void setBaseWorkingDirectory(const QString &workingDirectory);
QString baseWorkingDirectory() const; QString baseWorkingDirectory() const;
void setCommandLineArguments(const QString &argumentsString); void setCommandLineArguments(const QString &argumentsString);
@@ -156,6 +155,7 @@ private:
QList<Utils::EnvironmentItem> m_userEnvironmentChanges; QList<Utils::EnvironmentItem> m_userEnvironmentChanges;
BaseEnvironmentBase m_baseEnvironmentBase; BaseEnvironmentBase m_baseEnvironmentBase;
bool m_parseSuccess; bool m_parseSuccess;
bool m_parseInProgress;
}; };
class Qt4RunConfigurationWidget : public QWidget class Qt4RunConfigurationWidget : public QWidget
@@ -195,6 +195,8 @@ private slots:
private: private:
Qt4RunConfiguration *m_qt4RunConfiguration; Qt4RunConfiguration *m_qt4RunConfiguration;
bool m_ignoreChange; bool m_ignoreChange;
QLabel *m_disabledIcon;
QLabel *m_disabledReason;
QLineEdit *m_executableLineEdit; QLineEdit *m_executableLineEdit;
Utils::PathChooser *m_workingDirectoryEdit; Utils::PathChooser *m_workingDirectoryEdit;
QLineEdit *m_argumentsLineEdit; QLineEdit *m_argumentsLineEdit;

View File

@@ -113,10 +113,8 @@ void S60DeployConfiguration::ctor()
setDefaultDisplayName(defaultDisplayName()); setDefaultDisplayName(defaultDisplayName());
// TODO disable S60 Deploy Configuration while parsing // TODO disable S60 Deploy Configuration while parsing
// requires keeping track of the parsing state of the project // requires keeping track of the parsing state of the project
// connect(qt4Target()->qt4Project(), SIGNAL(proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode*)), connect(qt4Target()->qt4Project(), SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool, bool)),
// this, SLOT(targetInformationInvalidated())); this, SLOT(slotTargetInformationChanged(bool,bool)));
connect(qt4Target()->qt4Project(), SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool)),
this, SIGNAL(targetInformationChanged()));
connect(qt4Target(), SIGNAL(activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration*)), connect(qt4Target(), SIGNAL(activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration*)),
this, SLOT(updateActiveBuildConfiguration(ProjectExplorer::BuildConfiguration*))); this, SLOT(updateActiveBuildConfiguration(ProjectExplorer::BuildConfiguration*)));
connect(qt4Target(), SIGNAL(activeRunConfigurationChanged(ProjectExplorer::RunConfiguration*)), connect(qt4Target(), SIGNAL(activeRunConfigurationChanged(ProjectExplorer::RunConfiguration*)),
@@ -133,6 +131,13 @@ ProjectExplorer::DeployConfigurationWidget *S60DeployConfiguration::configuratio
return new S60DeployConfigurationWidget(); return new S60DeployConfigurationWidget();
} }
void S60DeployConfiguration::slotTargetInformationChanged(bool success, bool parseInProgress)
{
Q_UNUSED(success)
if (!parseInProgress)
emit targetInformationChanged();
}
bool S60DeployConfiguration::isStaticLibrary(const Qt4ProFileNode &projectNode) const bool S60DeployConfiguration::isStaticLibrary(const Qt4ProFileNode &projectNode) const
{ {
if (projectNode.projectType() == LibraryTemplate) { if (projectNode.projectType() == LibraryTemplate) {

View File

@@ -115,6 +115,7 @@ signals:
void installationDriveChanged(); void installationDriveChanged();
private slots: private slots:
void slotTargetInformationChanged(bool success, bool parseInProgress);
void updateActiveBuildConfiguration(ProjectExplorer::BuildConfiguration *buildConfiguration); void updateActiveBuildConfiguration(ProjectExplorer::BuildConfiguration *buildConfiguration);
void updateActiveRunConfiguration(ProjectExplorer::RunConfiguration *runConfiguration); void updateActiveRunConfiguration(ProjectExplorer::RunConfiguration *runConfiguration);

View File

@@ -73,7 +73,8 @@ QString pathFromId(const QString &id)
S60DeviceRunConfiguration::S60DeviceRunConfiguration(Qt4BaseTarget *parent, const QString &proFilePath) : S60DeviceRunConfiguration::S60DeviceRunConfiguration(Qt4BaseTarget *parent, const QString &proFilePath) :
RunConfiguration(parent, QLatin1String(S60_DEVICE_RC_ID)), RunConfiguration(parent, QLatin1String(S60_DEVICE_RC_ID)),
m_proFilePath(proFilePath), m_proFilePath(proFilePath),
m_validParse(parent->qt4Project()->validParse(proFilePath)) m_validParse(parent->qt4Project()->validParse(proFilePath)),
m_parseInProgress(parent->qt4Project()->parseInProgress(proFilePath))
{ {
ctor(); ctor();
} }
@@ -82,7 +83,8 @@ S60DeviceRunConfiguration::S60DeviceRunConfiguration(Qt4BaseTarget *target, S60D
RunConfiguration(target, source), RunConfiguration(target, source),
m_proFilePath(source->m_proFilePath), m_proFilePath(source->m_proFilePath),
m_commandLineArguments(source->m_commandLineArguments), m_commandLineArguments(source->m_commandLineArguments),
m_validParse(source->m_validParse) m_validParse(source->m_validParse),
m_parseInProgress(source->m_parseInProgress)
{ {
ctor(); ctor();
} }
@@ -97,32 +99,20 @@ void S60DeviceRunConfiguration::ctor()
setDefaultDisplayName(tr("Run on Symbian device")); setDefaultDisplayName(tr("Run on Symbian device"));
Qt4Project *pro = qt4Target()->qt4Project(); Qt4Project *pro = qt4Target()->qt4Project();
connect(pro, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool)), connect(pro, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)),
this, SLOT(proFileUpdate(Qt4ProjectManager::Qt4ProFileNode*,bool))); this, SLOT(proFileUpdate(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)));
connect(pro, SIGNAL(proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode *)),
this, SLOT(proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode *)));
} }
void S60DeviceRunConfiguration::handleParserState(bool success) void S60DeviceRunConfiguration::proFileUpdate(Qt4ProjectManager::Qt4ProFileNode *pro, bool success, bool parseInProgress)
{ {
if (m_proFilePath != pro->path())
return;
bool enabled = isEnabled(); bool enabled = isEnabled();
m_validParse = success; m_validParse = success;
m_parseInProgress = parseInProgress;
if (enabled != isEnabled()) if (enabled != isEnabled())
emit isEnabledChanged(!enabled); emit isEnabledChanged(!enabled);
} if (!parseInProgress)
void S60DeviceRunConfiguration::proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode *pro)
{
if (m_proFilePath != pro->path())
return;
handleParserState(false);
}
void S60DeviceRunConfiguration::proFileUpdate(Qt4ProjectManager::Qt4ProFileNode *pro, bool success)
{
if (m_proFilePath != pro->path())
return;
handleParserState(success);
emit targetInformationChanged(); emit targetInformationChanged();
} }
@@ -137,13 +127,15 @@ Qt4SymbianTarget *S60DeviceRunConfiguration::qt4Target() const
bool S60DeviceRunConfiguration::isEnabled() const bool S60DeviceRunConfiguration::isEnabled() const
{ {
return m_validParse; return m_validParse && !m_parseInProgress;
} }
QString S60DeviceRunConfiguration::disabledReason() const QString S60DeviceRunConfiguration::disabledReason() const
{ {
if (m_parseInProgress)
return tr("The .pro file is currently being parsed.");
if (!m_validParse) if (!m_validParse)
return tr("The .pro file could not be parsed"); return tr("The .pro file could not be parsed.");
return QString(); return QString();
} }
@@ -181,6 +173,7 @@ bool S60DeviceRunConfiguration::fromMap(const QVariantMap &map)
return false; return false;
m_validParse = qt4Target()->qt4Project()->validParse(m_proFilePath); m_validParse = qt4Target()->qt4Project()->validParse(m_proFilePath);
m_parseInProgress = qt4Target()->qt4Project()->parseInProgress(m_proFilePath);
setDefaultDisplayName(tr("%1 on Symbian Device").arg(QFileInfo(m_proFilePath).completeBaseName())); setDefaultDisplayName(tr("%1 on Symbian Device").arg(QFileInfo(m_proFilePath).completeBaseName()));

View File

@@ -94,18 +94,17 @@ protected:
virtual bool fromMap(const QVariantMap &map); virtual bool fromMap(const QVariantMap &map);
private slots: private slots:
void proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode *pro); void proFileUpdate(Qt4ProjectManager::Qt4ProFileNode *pro, bool success, bool parseInProgress);
void proFileUpdate(Qt4ProjectManager::Qt4ProFileNode *pro, bool success);
private: private:
void ctor(); void ctor();
void handleParserState(bool success);
Internal::Qt4SymbianTarget *qt4Target() const; Internal::Qt4SymbianTarget *qt4Target() const;
Internal::SymbianQtVersion *qtVersion() const; Internal::SymbianQtVersion *qtVersion() const;
QString m_proFilePath; QString m_proFilePath;
QString m_commandLineArguments; QString m_commandLineArguments;
bool m_validParse; bool m_validParse;
bool m_parseInProgress;
}; };
class S60DeviceRunConfigurationFactory : public ProjectExplorer::IRunConfigurationFactory class S60DeviceRunConfigurationFactory : public ProjectExplorer::IRunConfigurationFactory

View File

@@ -56,6 +56,18 @@ S60DeviceRunConfigurationWidget::S60DeviceRunConfigurationWidget(
m_detailsWidget->setState(Utils::DetailsWidget::NoSummary); m_detailsWidget->setState(Utils::DetailsWidget::NoSummary);
QVBoxLayout *mainBoxLayout = new QVBoxLayout(); QVBoxLayout *mainBoxLayout = new QVBoxLayout();
mainBoxLayout->setMargin(0); mainBoxLayout->setMargin(0);
QHBoxLayout *hl = new QHBoxLayout();
hl->addStretch();
m_disabledIcon = new QLabel(this);
m_disabledIcon->setPixmap(QPixmap(QString::fromUtf8(":/projectexplorer/images/compile_warning.png")));
hl->addWidget(m_disabledIcon);
m_disabledReason = new QLabel(this);
m_disabledReason->setVisible(false);
hl->addWidget(m_disabledReason);
hl->addStretch();
mainBoxLayout->addLayout(hl);
setLayout(mainBoxLayout); setLayout(mainBoxLayout);
mainBoxLayout->addWidget(m_detailsWidget); mainBoxLayout->addWidget(m_detailsWidget);
QWidget *detailsContainer = new QWidget; QWidget *detailsContainer = new QWidget;
@@ -93,7 +105,7 @@ S60DeviceRunConfigurationWidget::S60DeviceRunConfigurationWidget(
connect(m_debuggerLanguageChooser, SIGNAL(qmlDebugServerPortChanged(uint)), connect(m_debuggerLanguageChooser, SIGNAL(qmlDebugServerPortChanged(uint)),
this, SLOT(qmlDebugServerPortChanged(uint))); this, SLOT(qmlDebugServerPortChanged(uint)));
setEnabled(m_runConfiguration->isEnabled()); runConfigurationEnabledChange(m_runConfiguration->isEnabled());
} }
void S60DeviceRunConfigurationWidget::argumentsEdited(const QString &text) void S60DeviceRunConfigurationWidget::argumentsEdited(const QString &text)
@@ -103,7 +115,10 @@ void S60DeviceRunConfigurationWidget::argumentsEdited(const QString &text)
void S60DeviceRunConfigurationWidget::runConfigurationEnabledChange(bool enabled) void S60DeviceRunConfigurationWidget::runConfigurationEnabledChange(bool enabled)
{ {
setEnabled(enabled); m_detailsWidget->setEnabled(enabled);
m_disabledIcon->setVisible(!enabled);
m_disabledReason->setVisible(!enabled);
m_disabledReason->setText(m_runConfiguration->disabledReason());
} }
void S60DeviceRunConfigurationWidget::useCppDebuggerToggled(bool enabled) void S60DeviceRunConfigurationWidget::useCppDebuggerToggled(bool enabled)

View File

@@ -34,6 +34,7 @@
#define S60DEVICERUNCONFIGURATIONWIDGET_H #define S60DEVICERUNCONFIGURATIONWIDGET_H
#include <QtGui/QWidget> #include <QtGui/QWidget>
#include <QtGui/QLabel>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QLineEdit; class QLineEdit;
@@ -65,6 +66,8 @@ private slots:
private: private:
S60DeviceRunConfiguration *m_runConfiguration; S60DeviceRunConfiguration *m_runConfiguration;
QLabel *m_disabledIcon;
QLabel *m_disabledReason;
Utils::DetailsWidget *m_detailsWidget; Utils::DetailsWidget *m_detailsWidget;
Utils::DebuggerLanguageChooser *m_debuggerLanguageChooser; Utils::DebuggerLanguageChooser *m_debuggerLanguageChooser;
QLineEdit *m_argumentsLineEdit; QLineEdit *m_argumentsLineEdit;

View File

@@ -73,7 +73,8 @@ QString pathFromId(const QString &id)
S60EmulatorRunConfiguration::S60EmulatorRunConfiguration(Qt4BaseTarget *parent, const QString &proFilePath) : S60EmulatorRunConfiguration::S60EmulatorRunConfiguration(Qt4BaseTarget *parent, const QString &proFilePath) :
RunConfiguration(parent, QLatin1String(S60_EMULATOR_RC_ID)), RunConfiguration(parent, QLatin1String(S60_EMULATOR_RC_ID)),
m_proFilePath(proFilePath), m_proFilePath(proFilePath),
m_validParse(parent->qt4Project()->validParse(proFilePath)) m_validParse(parent->qt4Project()->validParse(proFilePath)),
m_parseInProgress(parent->qt4Project()->parseInProgress(proFilePath))
{ {
ctor(); ctor();
} }
@@ -81,7 +82,8 @@ S60EmulatorRunConfiguration::S60EmulatorRunConfiguration(Qt4BaseTarget *parent,
S60EmulatorRunConfiguration::S60EmulatorRunConfiguration(Qt4BaseTarget *parent, S60EmulatorRunConfiguration *source) : S60EmulatorRunConfiguration::S60EmulatorRunConfiguration(Qt4BaseTarget *parent, S60EmulatorRunConfiguration *source) :
RunConfiguration(parent, source), RunConfiguration(parent, source),
m_proFilePath(source->m_proFilePath), m_proFilePath(source->m_proFilePath),
m_validParse(source->m_validParse) m_validParse(source->m_validParse),
m_parseInProgress(source->m_parseInProgress)
{ {
ctor(); ctor();
} }
@@ -95,10 +97,8 @@ void S60EmulatorRunConfiguration::ctor()
//: S60 emulator run configuration default display name (no pro-file name) //: S60 emulator run configuration default display name (no pro-file name)
setDefaultDisplayName(tr("Run on Symbian Emulator")); setDefaultDisplayName(tr("Run on Symbian Emulator"));
Qt4Project *pro = qt4Target()->qt4Project(); Qt4Project *pro = qt4Target()->qt4Project();
connect(pro, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool)), connect(pro, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)),
this, SLOT(proFileUpdate(Qt4ProjectManager::Qt4ProFileNode*,bool))); this, SLOT(proFileUpdate(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)));
connect(pro, SIGNAL(proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode *)),
this, SLOT(proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode *)));
} }
@@ -106,27 +106,17 @@ S60EmulatorRunConfiguration::~S60EmulatorRunConfiguration()
{ {
} }
void S60EmulatorRunConfiguration::handleParserState(bool success) void S60EmulatorRunConfiguration::proFileUpdate(Qt4ProjectManager::Qt4ProFileNode *pro, bool success, bool parseInProgress)
{ {
if (m_proFilePath != pro->path())
return;
bool enabled = isEnabled(); bool enabled = isEnabled();
m_validParse = success; m_validParse = success;
m_parseInProgress = parseInProgress;
if (enabled != isEnabled()) { if (enabled != isEnabled()) {
emit isEnabledChanged(!enabled); emit isEnabledChanged(!enabled);
} }
} if (parseInProgress)
void S60EmulatorRunConfiguration::proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode *pro)
{
if (m_proFilePath != pro->path())
return;
handleParserState(false);
}
void S60EmulatorRunConfiguration::proFileUpdate(Qt4ProjectManager::Qt4ProFileNode *pro, bool success)
{
if (m_proFilePath != pro->path())
return;
handleParserState(success);
emit targetInformationChanged(); emit targetInformationChanged();
} }
@@ -137,13 +127,15 @@ Qt4SymbianTarget *S60EmulatorRunConfiguration::qt4Target() const
bool S60EmulatorRunConfiguration::isEnabled() const bool S60EmulatorRunConfiguration::isEnabled() const
{ {
return m_validParse; return m_validParse && !m_parseInProgress;
} }
QString S60EmulatorRunConfiguration::disabledReason() const QString S60EmulatorRunConfiguration::disabledReason() const
{ {
if (m_parseInProgress)
return tr("The .pro file is currently being parsed.");
if (!m_validParse) if (!m_validParse)
return tr("The .pro file could not be parsed"); return tr("The .pro file could not be parsed.");
return QString(); return QString();
} }
@@ -174,6 +166,7 @@ bool S60EmulatorRunConfiguration::fromMap(const QVariantMap &map)
return false; return false;
m_validParse = qt4Target()->qt4Project()->validParse(m_proFilePath); m_validParse = qt4Target()->qt4Project()->validParse(m_proFilePath);
m_parseInProgress = qt4Target()->qt4Project()->parseInProgress(m_proFilePath);
//: S60 emulator run configuration default display name, %1 is base pro-File name //: S60 emulator run configuration default display name, %1 is base pro-File name
setDefaultDisplayName(tr("%1 in Symbian Emulator").arg(QFileInfo(m_proFilePath).completeBaseName())); setDefaultDisplayName(tr("%1 in Symbian Emulator").arg(QFileInfo(m_proFilePath).completeBaseName()));
@@ -217,6 +210,18 @@ S60EmulatorRunConfigurationWidget::S60EmulatorRunConfigurationWidget(S60Emulator
m_detailsWidget->setState(Utils::DetailsWidget::NoSummary); m_detailsWidget->setState(Utils::DetailsWidget::NoSummary);
QVBoxLayout *mainBoxLayout = new QVBoxLayout(); QVBoxLayout *mainBoxLayout = new QVBoxLayout();
mainBoxLayout->setMargin(0); mainBoxLayout->setMargin(0);
QHBoxLayout *hl = new QHBoxLayout();
hl->addStretch();
m_disabledIcon = new QLabel(this);
m_disabledIcon->setPixmap(QPixmap(QString::fromUtf8(":/projectexplorer/images/compile_warning.png")));
hl->addWidget(m_disabledIcon);
m_disabledReason = new QLabel(this);
m_disabledReason->setVisible(false);
hl->addWidget(m_disabledReason);
hl->addStretch();
mainBoxLayout->addLayout(hl);
setLayout(mainBoxLayout); setLayout(mainBoxLayout);
mainBoxLayout->addWidget(m_detailsWidget); mainBoxLayout->addWidget(m_detailsWidget);
QWidget *detailsContainer = new QWidget; QWidget *detailsContainer = new QWidget;
@@ -234,7 +239,7 @@ S60EmulatorRunConfigurationWidget::S60EmulatorRunConfigurationWidget(S60Emulator
connect(m_runConfiguration, SIGNAL(isEnabledChanged(bool)), connect(m_runConfiguration, SIGNAL(isEnabledChanged(bool)),
this, SLOT(runConfigurationEnabledChange(bool))); this, SLOT(runConfigurationEnabledChange(bool)));
setEnabled(m_runConfiguration->isEnabled()); runConfigurationEnabledChange(m_runConfiguration->isEnabled());
} }
void S60EmulatorRunConfigurationWidget::updateTargetInformation() void S60EmulatorRunConfigurationWidget::updateTargetInformation()
@@ -244,7 +249,10 @@ void S60EmulatorRunConfigurationWidget::updateTargetInformation()
void S60EmulatorRunConfigurationWidget::runConfigurationEnabledChange(bool enabled) void S60EmulatorRunConfigurationWidget::runConfigurationEnabledChange(bool enabled)
{ {
setEnabled(enabled); m_detailsWidget->setEnabled(enabled);
m_disabledIcon->setVisible(!enabled);
m_disabledReason->setVisible(!enabled);
m_disabledReason->setText(m_runConfiguration->disabledReason());
} }
// ======== S60EmulatorRunConfigurationFactory // ======== S60EmulatorRunConfigurationFactory

View File

@@ -84,8 +84,7 @@ signals:
void targetInformationChanged(); void targetInformationChanged();
private slots: private slots:
void proFileUpdate(Qt4ProjectManager::Qt4ProFileNode *pro, bool success); void proFileUpdate(Qt4ProjectManager::Qt4ProFileNode *pro, bool success, bool parseInProgress);
void proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode *pro);
protected: protected:
S60EmulatorRunConfiguration(Qt4ProjectManager::Qt4BaseTarget *parent, S60EmulatorRunConfiguration *source); S60EmulatorRunConfiguration(Qt4ProjectManager::Qt4BaseTarget *parent, S60EmulatorRunConfiguration *source);
@@ -93,11 +92,11 @@ protected:
private: private:
void ctor(); void ctor();
void handleParserState(bool success);
void updateTarget(); void updateTarget();
QString m_proFilePath; QString m_proFilePath;
bool m_validParse; bool m_validParse;
bool m_parseInProgress;
}; };
class S60EmulatorRunConfigurationWidget : public QWidget class S60EmulatorRunConfigurationWidget : public QWidget
@@ -113,6 +112,8 @@ private slots:
private: private:
S60EmulatorRunConfiguration *m_runConfiguration; S60EmulatorRunConfiguration *m_runConfiguration;
QLabel *m_disabledIcon;
QLabel *m_disabledReason;
Utils::DetailsWidget *m_detailsWidget; Utils::DetailsWidget *m_detailsWidget;
QLabel *m_executableLabel; QLabel *m_executableLabel;
}; };

View File

@@ -1374,6 +1374,7 @@ Qt4ProFileNode::Qt4ProFileNode(Qt4Project *project,
: Qt4PriFileNode(project, this, filePath), : Qt4PriFileNode(project, this, filePath),
m_projectType(InvalidProject), m_projectType(InvalidProject),
m_validParse(false), m_validParse(false),
m_parseInProgress(false),
m_readerExact(0), m_readerExact(0),
m_readerCumulative(0) m_readerCumulative(0)
{ {
@@ -1447,7 +1448,7 @@ void Qt4ProFileNode::emitProFileUpdated()
{ {
foreach (ProjectExplorer::NodesWatcher *watcher, watchers()) foreach (ProjectExplorer::NodesWatcher *watcher, watchers())
if (Internal::Qt4NodesWatcher *qt4Watcher = qobject_cast<Internal::Qt4NodesWatcher*>(watcher)) if (Internal::Qt4NodesWatcher *qt4Watcher = qobject_cast<Internal::Qt4NodesWatcher*>(watcher))
emit qt4Watcher->proFileUpdated(this, m_validParse); emit qt4Watcher->proFileUpdated(this, m_validParse, m_parseInProgress);
foreach (ProjectNode *subNode, subProjectNodes()) { foreach (ProjectNode *subNode, subProjectNodes()) {
if (Qt4ProFileNode *node = qobject_cast<Qt4ProFileNode *>(subNode)) { if (Qt4ProFileNode *node = qobject_cast<Qt4ProFileNode *>(subNode)) {
@@ -1456,30 +1457,20 @@ void Qt4ProFileNode::emitProFileUpdated()
} }
} }
void Qt4ProFileNode::emitProFileInvalidated()
{
foreach (ProjectExplorer::NodesWatcher *watcher, watchers())
if (Internal::Qt4NodesWatcher *qt4Watcher = qobject_cast<Internal::Qt4NodesWatcher*>(watcher))
emit qt4Watcher->proFileInvalidated(this);
foreach (ProjectNode *subNode, subProjectNodes()) {
if (Qt4ProFileNode *node = qobject_cast<Qt4ProFileNode *>(subNode)) {
node->emitProFileInvalidated();
}
}
}
bool Qt4ProFileNode::validParse() const bool Qt4ProFileNode::validParse() const
{ {
return m_validParse; return m_validParse;
} }
bool Qt4ProFileNode::parseInProgress() const
{
return m_parseInProgress;
}
void Qt4ProFileNode::scheduleUpdate() void Qt4ProFileNode::scheduleUpdate()
{ {
if (m_validParse) { m_parseInProgress = true;
m_validParse = false; emitProFileUpdated();
emitProFileInvalidated();
}
m_project->scheduleAsyncUpdate(this); m_project->scheduleAsyncUpdate(this);
} }
@@ -1494,12 +1485,10 @@ void Qt4ProFileNode::asyncUpdate()
void Qt4ProFileNode::update() void Qt4ProFileNode::update()
{ {
if (m_validParse) { m_parseInProgress = true;
m_validParse = false;
foreach (ProjectExplorer::NodesWatcher *watcher, watchers()) foreach (ProjectExplorer::NodesWatcher *watcher, watchers())
if (Internal::Qt4NodesWatcher *qt4Watcher = qobject_cast<Internal::Qt4NodesWatcher*>(watcher)) if (Internal::Qt4NodesWatcher *qt4Watcher = qobject_cast<Internal::Qt4NodesWatcher*>(watcher))
emit qt4Watcher->proFileInvalidated(this); emit qt4Watcher->proFileUpdated(this, m_validParse, m_parseInProgress);
}
setupReader(); setupReader();
EvalResult evalResult = evaluate(); EvalResult evalResult = evaluate();
@@ -1558,7 +1547,7 @@ void Qt4ProFileNode::applyEvaluate(EvalResult evalResult, bool async)
} }
foreach (ProjectExplorer::NodesWatcher *watcher, watchers()) foreach (ProjectExplorer::NodesWatcher *watcher, watchers())
if (Internal::Qt4NodesWatcher *qt4Watcher = qobject_cast<Internal::Qt4NodesWatcher*>(watcher)) if (Internal::Qt4NodesWatcher *qt4Watcher = qobject_cast<Internal::Qt4NodesWatcher*>(watcher))
emit qt4Watcher->proFileUpdated(this, false); emit qt4Watcher->proFileUpdated(this, false, false);
return; return;
} }
@@ -1751,7 +1740,8 @@ void Qt4ProFileNode::applyEvaluate(EvalResult evalResult, bool async)
Qt4PriFileNode::update(fileForCurrentProjectExact, m_readerExact, fileForCurrentProjectCumlative, m_readerCumulative); Qt4PriFileNode::update(fileForCurrentProjectExact, m_readerExact, fileForCurrentProjectCumlative, m_readerCumulative);
if (evalResult == EvalOk) { m_validParse = (evalResult == EvalOk);
if (m_validParse) {
// update TargetInformation // update TargetInformation
m_qt4targetInformation = targetInformation(m_readerExact); m_qt4targetInformation = targetInformation(m_readerExact);
@@ -1799,17 +1789,16 @@ void Qt4ProFileNode::applyEvaluate(EvalResult evalResult, bool async)
if (Internal::Qt4NodesWatcher *qt4Watcher = qobject_cast<Internal::Qt4NodesWatcher*>(watcher)) if (Internal::Qt4NodesWatcher *qt4Watcher = qobject_cast<Internal::Qt4NodesWatcher*>(watcher))
emit qt4Watcher->variablesChanged(this, oldValues, m_varValues); emit qt4Watcher->variablesChanged(this, oldValues, m_varValues);
} }
} // evalResult == EvalOk } // evalResult == EvalOk
m_parseInProgress = false;
createUiCodeModelSupport(); createUiCodeModelSupport();
updateUiFiles(); updateUiFiles();
m_validParse = true;
foreach (ProjectExplorer::NodesWatcher *watcher, watchers()) foreach (ProjectExplorer::NodesWatcher *watcher, watchers())
if (Internal::Qt4NodesWatcher *qt4Watcher = qobject_cast<Internal::Qt4NodesWatcher*>(watcher)) if (Internal::Qt4NodesWatcher *qt4Watcher = qobject_cast<Internal::Qt4NodesWatcher*>(watcher))
emit qt4Watcher->proFileUpdated(this, true); emit qt4Watcher->proFileUpdated(this, true, false);
m_project->destroyProFileReader(m_readerExact); m_project->destroyProFileReader(m_readerExact);
m_project->destroyProFileReader(m_readerCumulative); m_project->destroyProFileReader(m_readerCumulative);

View File

@@ -242,8 +242,7 @@ signals:
const QHash<Qt4Variable, QStringList> &oldValues, const QHash<Qt4Variable, QStringList> &oldValues,
const QHash<Qt4Variable, QStringList> &newValues); const QHash<Qt4Variable, QStringList> &newValues);
void proFileUpdated(Qt4ProjectManager::Qt4ProFileNode *projectNode, bool success); void proFileUpdated(Qt4ProjectManager::Qt4ProFileNode *projectNode, bool success, bool parseInProgress);
void proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode *projectNode);
private: private:
// let them emit signals // let them emit signals
@@ -347,10 +346,10 @@ public:
void update(); void update();
void scheduleUpdate(); void scheduleUpdate();
void emitProFileInvalidated();
void emitProFileUpdated(); void emitProFileUpdated();
bool validParse() const; bool validParse() const;
bool parseInProgress() const;
bool hasBuildTargets(Qt4ProjectType projectType) const; bool hasBuildTargets(Qt4ProjectType projectType) const;
@@ -396,6 +395,7 @@ private:
friend class Qt4NodeHierarchy; friend class Qt4NodeHierarchy;
bool m_validParse; bool m_validParse;
bool m_parseInProgress;
// Async stuff // Async stuff
QFutureWatcher<EvalResult> m_parseFutureWatcher; QFutureWatcher<EvalResult> m_parseFutureWatcher;

View File

@@ -339,11 +339,8 @@ bool Qt4Project::fromMap(const QVariantMap &map)
foreach (Target *t, targets()) foreach (Target *t, targets())
onAddedTarget(t); onAddedTarget(t);
connect(m_nodesWatcher, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool)), connect(m_nodesWatcher, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)),
this, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode *,bool))); this, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode *,bool,bool)));
connect(m_nodesWatcher, SIGNAL(proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode*)),
this, SIGNAL(proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode*)));
// Now we emit update once :) // Now we emit update once :)
m_rootProjectNode->emitProFileUpdated(); m_rootProjectNode->emitProFileUpdated();
@@ -676,7 +673,7 @@ void Qt4Project::scheduleAsyncUpdate()
m_cancelEvaluate = true; m_cancelEvaluate = true;
m_asyncUpdateState = AsyncFullUpdatePending; m_asyncUpdateState = AsyncFullUpdatePending;
activeTarget()->activeBuildConfiguration()->setEnabled(false); activeTarget()->activeBuildConfiguration()->setEnabled(false);
m_rootProjectNode->emitProFileInvalidated(); m_rootProjectNode->emitProFileUpdated();
return; return;
} }
@@ -684,7 +681,7 @@ void Qt4Project::scheduleAsyncUpdate()
qDebug()<<" starting timer for full update, setting state to full update pending"; qDebug()<<" starting timer for full update, setting state to full update pending";
m_partialEvaluate.clear(); m_partialEvaluate.clear();
activeTarget()->activeBuildConfiguration()->setEnabled(false); activeTarget()->activeBuildConfiguration()->setEnabled(false);
m_rootProjectNode->emitProFileInvalidated(); m_rootProjectNode->emitProFileUpdated();
m_asyncUpdateState = AsyncFullUpdatePending; m_asyncUpdateState = AsyncFullUpdatePending;
m_asyncUpdateTimer.start(); m_asyncUpdateTimer.start();
@@ -938,6 +935,14 @@ bool Qt4Project::validParse(const QString &proFilePath) const
return node && node->validParse(); return node && node->validParse();
} }
bool Qt4Project::parseInProgress(const QString &proFilePath) const
{
if (!m_rootProjectNode)
return false;
const Qt4ProFileNode *node = m_rootProjectNode->findProFileFor(proFilePath);
return node && node->parseInProgress();
}
QList<BuildConfigWidget*> Qt4Project::subConfigWidgets() QList<BuildConfigWidget*> Qt4Project::subConfigWidgets()
{ {
QList<BuildConfigWidget*> subWidgets; QList<BuildConfigWidget*> subWidgets;

View File

@@ -155,6 +155,7 @@ public:
Qt4ProFileNode *rootProjectNode() const; Qt4ProFileNode *rootProjectNode() const;
bool validParse(const QString &proFilePath) const; bool validParse(const QString &proFilePath) const;
bool parseInProgress(const QString &proFilePath) const;
virtual QStringList files(FilesMode fileMode) const; virtual QStringList files(FilesMode fileMode) const;
virtual QString generatedUiHeader(const QString &formFile) const; virtual QString generatedUiHeader(const QString &formFile) const;
@@ -188,8 +189,7 @@ public:
void updateFileList(); void updateFileList();
signals: signals:
void proFileUpdated(Qt4ProjectManager::Qt4ProFileNode *node, bool); void proFileUpdated(Qt4ProjectManager::Qt4ProFileNode *node, bool, bool);
void proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode *node);
void buildDirectoryInitialized(); void buildDirectoryInitialized();
void fromMapFinished(); void fromMapFinished();

View File

@@ -59,14 +59,21 @@ MaemoDeployables::~MaemoDeployables() {}
void MaemoDeployables::init() void MaemoDeployables::init()
{ {
Qt4Project * const pro = m_target->qt4Project(); Qt4Project * const pro = m_target->qt4Project();
connect(pro, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool)), connect(pro, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)),
m_updateTimer, SLOT(start())); this, SLOT(startTimer(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)));
// TODO do we want to disable the view // TODO do we want to disable the view
createModels(); createModels();
} }
void MaemoDeployables::startTimer(Qt4ProjectManager::Qt4ProFileNode*, bool success, bool parseInProgress)
{
Q_UNUSED(success)
if (!parseInProgress)
m_updateTimer->start();
}
void MaemoDeployables::createModels() void MaemoDeployables::createModels()
{ {
if (m_target->project()->activeTarget() != m_target) if (m_target->project()->activeTarget() != m_target)
@@ -77,8 +84,8 @@ void MaemoDeployables::createModels()
return; return;
m_updateTimer->stop(); m_updateTimer->stop();
disconnect(m_target->qt4Project(), disconnect(m_target->qt4Project(),
SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool)), SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)),
m_updateTimer, SLOT(start())); this, SLOT(startTimer(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)));
beginResetModel(); beginResetModel();
qDeleteAll(m_listModels); qDeleteAll(m_listModels);
m_listModels.clear(); m_listModels.clear();
@@ -109,8 +116,8 @@ void MaemoDeployables::createModels()
endResetModel(); endResetModel();
connect(m_target->qt4Project(), connect(m_target->qt4Project(),
SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool)), SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)),
m_updateTimer, SLOT(start())); this, SLOT(startTimer(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)));
} }
void MaemoDeployables::createModels(const Qt4ProFileNode *proFileNode) void MaemoDeployables::createModels(const Qt4ProFileNode *proFileNode)

View File

@@ -64,6 +64,9 @@ public:
int modelCount() const { return m_listModels.count(); } int modelCount() const { return m_listModels.count(); }
MaemoDeployableListModel *modelAt(int i) const { return m_listModels.at(i); } MaemoDeployableListModel *modelAt(int i) const { return m_listModels.at(i); }
private slots:
void startTimer(Qt4ProjectManager::Qt4ProFileNode *, bool success, bool parseInProgress);
private: private:
typedef QHash<QString, MaemoDeployableListModel::ProFileUpdateSetting> UpdateSettingsMap; typedef QHash<QString, MaemoDeployableListModel::ProFileUpdateSetting> UpdateSettingsMap;

View File

@@ -81,8 +81,14 @@ MaemoRunConfigurationWidget::MaemoRunConfigurationWidget(
m_deviceEnvReader(new MaemoDeviceEnvReader(this, runConfiguration)), m_deviceEnvReader(new MaemoDeviceEnvReader(this, runConfiguration)),
m_deployablesConnected(false) m_deployablesConnected(false)
{ {
QVBoxLayout *mainLayout = new QVBoxLayout; QVBoxLayout *topLayout = new QVBoxLayout(this);
setLayout(mainLayout); topLayout->setMargin(0);
addDisabledLabel(topLayout);
topWidget = new QWidget;
topLayout->addWidget(topWidget);
QVBoxLayout *mainLayout = new QVBoxLayout(topWidget);
addGenericWidgets(mainLayout); addGenericWidgets(mainLayout);
mainLayout->addSpacing(20); mainLayout->addSpacing(20);
addDebuggingWidgets(mainLayout); addDebuggingWidgets(mainLayout);
@@ -109,12 +115,29 @@ MaemoRunConfigurationWidget::MaemoRunConfigurationWidget(
m_debugQmlOnlyButton->setVisible(qmlDebuggingAvailable); m_debugQmlOnlyButton->setVisible(qmlDebuggingAvailable);
m_debugCppAndQmlButton->setVisible(qmlDebuggingAvailable); m_debugCppAndQmlButton->setVisible(qmlDebuggingAvailable);
setEnabled(m_runConfiguration->isEnabled()); runConfigurationEnabledChange(m_runConfiguration->isEnabled());
} }
void MaemoRunConfigurationWidget::runConfigurationEnabledChange(bool enabled) void MaemoRunConfigurationWidget::runConfigurationEnabledChange(bool enabled)
{ {
setEnabled(enabled); topWidget->setEnabled(enabled);
m_disabledIcon->setVisible(!enabled);
m_disabledReason->setVisible(!enabled);
m_disabledReason->setText(m_runConfiguration->disabledReason());
}
void MaemoRunConfigurationWidget::addDisabledLabel(QVBoxLayout *topLayout)
{
QHBoxLayout *hl = new QHBoxLayout();
hl->addStretch();
m_disabledIcon = new QLabel(this);
m_disabledIcon->setPixmap(QPixmap(QString::fromUtf8(":/projectexplorer/images/compile_warning.png")));
hl->addWidget(m_disabledIcon);
m_disabledReason = new QLabel(this);
m_disabledReason->setVisible(false);
hl->addWidget(m_disabledReason);
hl->addStretch();
topLayout->addLayout(hl);
} }
void MaemoRunConfigurationWidget::addGenericWidgets(QVBoxLayout *mainLayout) void MaemoRunConfigurationWidget::addGenericWidgets(QVBoxLayout *mainLayout)

View File

@@ -97,12 +97,16 @@ private slots:
void handleDeploySpecsChanged(); void handleDeploySpecsChanged();
private: private:
void addDisabledLabel(QVBoxLayout *topLayout);
void addGenericWidgets(QVBoxLayout *mainLayout); void addGenericWidgets(QVBoxLayout *mainLayout);
void addDebuggingWidgets(QVBoxLayout *mainLayout); void addDebuggingWidgets(QVBoxLayout *mainLayout);
void addMountWidgets(QVBoxLayout *mainLayout); void addMountWidgets(QVBoxLayout *mainLayout);
void addEnvironmentWidgets(QVBoxLayout *mainLayout); void addEnvironmentWidgets(QVBoxLayout *mainLayout);
void updateMountWarning(); void updateMountWarning();
QWidget *topWidget;
QLabel *m_disabledIcon;
QLabel *m_disabledReason;
QLineEdit *m_argsLineEdit; QLineEdit *m_argsLineEdit;
QLabel *m_localExecutableLabel; QLabel *m_localExecutableLabel;
QLabel *m_remoteExecutableLabel; QLabel *m_remoteExecutableLabel;

View File

@@ -78,7 +78,8 @@ public:
RemoteLinuxRunConfigurationPrivate(const QString &proFilePath, const Qt4BaseTarget *target) RemoteLinuxRunConfigurationPrivate(const QString &proFilePath, const Qt4BaseTarget *target)
: proFilePath(proFilePath), useRemoteGdb(DefaultUseRemoteGdbValue), : proFilePath(proFilePath), useRemoteGdb(DefaultUseRemoteGdbValue),
baseEnvironmentType(RemoteLinuxRunConfiguration::SystemBaseEnvironment), baseEnvironmentType(RemoteLinuxRunConfiguration::SystemBaseEnvironment),
validParse(target->qt4Project()->validParse(proFilePath)) validParse(target->qt4Project()->validParse(proFilePath)),
parseInProgress(target->qt4Project()->parseInProgress(proFilePath))
{ {
} }
@@ -86,7 +87,9 @@ public:
: proFilePath(other->proFilePath), gdbPath(other->gdbPath), arguments(other->arguments), : proFilePath(other->proFilePath), gdbPath(other->gdbPath), arguments(other->arguments),
useRemoteGdb(other->useRemoteGdb), baseEnvironmentType(other->baseEnvironmentType), useRemoteGdb(other->useRemoteGdb), baseEnvironmentType(other->baseEnvironmentType),
systemEnvironment(other->systemEnvironment), systemEnvironment(other->systemEnvironment),
userEnvironmentChanges(other->userEnvironmentChanges), validParse(other->validParse) userEnvironmentChanges(other->userEnvironmentChanges),
validParse(other->validParse),
parseInProgress(other->parseInProgress)
{ {
} }
@@ -99,6 +102,7 @@ public:
Utils::Environment systemEnvironment; Utils::Environment systemEnvironment;
QList<Utils::EnvironmentItem> userEnvironmentChanges; QList<Utils::EnvironmentItem> userEnvironmentChanges;
bool validParse; bool validParse;
bool parseInProgress;
QString disabledReason; QString disabledReason;
}; };
} // namespace Internal } // namespace Internal
@@ -134,10 +138,8 @@ void RemoteLinuxRunConfiguration::init()
handleDeployConfigChanged(); handleDeployConfigChanged();
Qt4Project *pro = qt4Target()->qt4Project(); Qt4Project *pro = qt4Target()->qt4Project();
connect(pro, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool)), connect(pro, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)),
this, SLOT(proFileUpdate(Qt4ProjectManager::Qt4ProFileNode*,bool))); this, SLOT(proFileUpdate(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)));
connect(pro, SIGNAL(proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode *)),
this, SLOT(proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode*)));
connect(this, SIGNAL(debuggersChanged()), SLOT(updateEnabledState())); connect(this, SIGNAL(debuggersChanged()), SLOT(updateEnabledState()));
connect(m_d->remoteMounts, SIGNAL(rowsInserted(QModelIndex, int, int)), this, connect(m_d->remoteMounts, SIGNAL(rowsInserted(QModelIndex, int, int)), this,
SLOT(handleRemoteMountsChanged())); SLOT(handleRemoteMountsChanged()));
@@ -166,8 +168,12 @@ Qt4BuildConfiguration *RemoteLinuxRunConfiguration::activeQt4BuildConfiguration(
bool RemoteLinuxRunConfiguration::isEnabled() const bool RemoteLinuxRunConfiguration::isEnabled() const
{ {
if (m_d->parseInProgress) {
m_d->disabledReason = tr("The .pro file is being parsed.");
return false;
}
if (!m_d->validParse) { if (!m_d->validParse) {
m_d->disabledReason = tr("The .pro file could not be parsed/"); m_d->disabledReason = tr("The .pro file could not be parsed.");
return false; return false;
} }
if (!deviceConfig()) { if (!deviceConfig()) {
@@ -205,25 +211,15 @@ Utils::OutputFormatter *RemoteLinuxRunConfiguration::createOutputFormatter() con
return new QtSupport::QtOutputFormatter(qt4Target()->qt4Project()); return new QtSupport::QtOutputFormatter(qt4Target()->qt4Project());
} }
void RemoteLinuxRunConfiguration::handleParseState(bool success) void RemoteLinuxRunConfiguration::proFileUpdate(Qt4ProjectManager::Qt4ProFileNode *pro, bool success, bool parseInProgress)
{
bool enabled = isEnabled();
m_d->validParse = success;
if (enabled != isEnabled())
updateEnabledState();
}
void RemoteLinuxRunConfiguration::proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode *pro)
{
if (m_d->proFilePath != pro->path())
return;
handleParseState(false);
}
void RemoteLinuxRunConfiguration::proFileUpdate(Qt4ProjectManager::Qt4ProFileNode *pro, bool success)
{ {
if (m_d->proFilePath == pro->path()) { if (m_d->proFilePath == pro->path()) {
handleParseState(success); bool enabled = isEnabled();
m_d->validParse = success;
m_d->parseInProgress = parseInProgress;
if (enabled != isEnabled())
updateEnabledState();
if (!parseInProgress)
emit targetInformationChanged(); emit targetInformationChanged();
} }
} }
@@ -259,6 +255,7 @@ bool RemoteLinuxRunConfiguration::fromMap(const QVariantMap &map)
m_d->remoteMounts->fromMap(map); m_d->remoteMounts->fromMap(map);
m_d->validParse = qt4Target()->qt4Project()->validParse(m_d->proFilePath); m_d->validParse = qt4Target()->qt4Project()->validParse(m_d->proFilePath);
m_d->parseInProgress = qt4Target()->qt4Project()->parseInProgress(m_d->proFilePath);
setDefaultDisplayName(defaultDisplayName()); setDefaultDisplayName(defaultDisplayName());

View File

@@ -137,8 +137,7 @@ protected:
QString defaultDisplayName(); QString defaultDisplayName();
private slots: private slots:
void proFileUpdate(Qt4ProjectManager::Qt4ProFileNode *pro, bool success); void proFileUpdate(Qt4ProjectManager::Qt4ProFileNode *pro, bool success, bool parseInProgress);
void proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode *pro);
void updateDeviceConfigurations(); void updateDeviceConfigurations();
void handleDeployConfigChanged(); void handleDeployConfigChanged();
void handleDeployablesUpdated(); void handleDeployablesUpdated();
@@ -147,7 +146,6 @@ private slots:
private: private:
void init(); void init();
void handleParseState(bool success);
Internal::AbstractLinuxDeviceDeployStep *deployStep() const; Internal::AbstractLinuxDeviceDeployStep *deployStep() const;
void setArguments(const QString &args); void setArguments(const QString &args);