forked from qt-creator/qt-creator
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:
@@ -105,7 +105,8 @@ Qt4RunConfiguration::Qt4RunConfiguration(Qt4BaseTarget *parent, const QString &p
|
||||
m_runMode(Gui),
|
||||
m_isUsingDyldImageSuffix(false),
|
||||
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();
|
||||
}
|
||||
@@ -119,7 +120,8 @@ Qt4RunConfiguration::Qt4RunConfiguration(Qt4BaseTarget *parent, Qt4RunConfigurat
|
||||
m_userWorkingDirectory(source->m_userWorkingDirectory),
|
||||
m_userEnvironmentChanges(source->m_userEnvironmentChanges),
|
||||
m_baseEnvironmentBase(source->m_baseEnvironmentBase),
|
||||
m_parseSuccess(source->m_parseSuccess)
|
||||
m_parseSuccess(source->m_parseSuccess),
|
||||
m_parseInProgress(source->m_parseInProgress)
|
||||
{
|
||||
ctor();
|
||||
}
|
||||
@@ -135,38 +137,33 @@ Qt4DesktopTarget *Qt4RunConfiguration::qt4Target() const
|
||||
|
||||
bool Qt4RunConfiguration::isEnabled() const
|
||||
{
|
||||
return m_parseSuccess;
|
||||
return m_parseSuccess && !m_parseInProgress;
|
||||
}
|
||||
|
||||
QString Qt4RunConfiguration::disabledReason() const
|
||||
{
|
||||
if (m_parseInProgress)
|
||||
return tr("The .pro file is currently being parsed.");
|
||||
if (!m_parseSuccess)
|
||||
return tr("The .pro file could not be parsed");
|
||||
return tr("The .pro file could not be parsed.");
|
||||
return QString();
|
||||
}
|
||||
|
||||
void Qt4RunConfiguration::handleParseState(bool success)
|
||||
{
|
||||
bool enabled = isEnabled();
|
||||
m_parseSuccess = success;
|
||||
if (enabled != isEnabled())
|
||||
emit isEnabledChanged(!enabled);
|
||||
}
|
||||
|
||||
void Qt4RunConfiguration::proFileUpdated(Qt4ProjectManager::Qt4ProFileNode *pro, bool success)
|
||||
void Qt4RunConfiguration::proFileUpdated(Qt4ProjectManager::Qt4ProFileNode *pro, bool success, bool parseInProgress)
|
||||
{
|
||||
if (m_proFilePath != pro->path())
|
||||
return;
|
||||
handleParseState(success);
|
||||
emit effectiveTargetInformationChanged();
|
||||
emit baseEnvironmentChanged();
|
||||
}
|
||||
|
||||
void Qt4RunConfiguration::proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode *pro)
|
||||
{
|
||||
if (pro->path() != m_proFilePath)
|
||||
return;
|
||||
handleParseState(false);
|
||||
bool enabled = isEnabled();
|
||||
m_parseSuccess = success;
|
||||
m_parseInProgress = parseInProgress;
|
||||
if (enabled != isEnabled())
|
||||
emit isEnabledChanged(!enabled);
|
||||
|
||||
if (!parseInProgress) {
|
||||
emit effectiveTargetInformationChanged();
|
||||
emit baseEnvironmentChanged();
|
||||
}
|
||||
}
|
||||
|
||||
void Qt4RunConfiguration::ctor()
|
||||
@@ -175,11 +172,8 @@ void Qt4RunConfiguration::ctor()
|
||||
|
||||
connect(qt4Target(), SIGNAL(environmentChanged()),
|
||||
this, SIGNAL(baseEnvironmentChanged()));
|
||||
connect(qt4Target()->qt4Project(), SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool)),
|
||||
this, SLOT(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool)));
|
||||
|
||||
connect(qt4Target()->qt4Project(), SIGNAL(proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode*)),
|
||||
this, SLOT(proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode*)));
|
||||
connect(qt4Target()->qt4Project(), SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)),
|
||||
this, SLOT(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)));
|
||||
}
|
||||
|
||||
//////
|
||||
@@ -196,6 +190,17 @@ Qt4RunConfigurationWidget::Qt4RunConfigurationWidget(Qt4RunConfiguration *qt4Run
|
||||
QVBoxLayout *vboxTopLayout = new QVBoxLayout(this);
|
||||
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->setState(Utils::DetailsWidget::NoSummary);
|
||||
vboxTopLayout->addWidget(m_detailsContainer);
|
||||
@@ -285,7 +290,7 @@ Qt4RunConfigurationWidget::Qt4RunConfigurationWidget(Qt4RunConfiguration *qt4Run
|
||||
m_environmentWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
vboxTopLayout->addWidget(m_environmentWidget);
|
||||
|
||||
setEnabled(m_qt4RunConfiguration->isEnabled());
|
||||
runConfigurationEnabledChange(m_qt4RunConfiguration->isEnabled());
|
||||
|
||||
connect(m_workingDirectoryEdit, SIGNAL(changed(QString)),
|
||||
this, SLOT(workDirectoryEdited()));
|
||||
@@ -387,7 +392,11 @@ void Qt4RunConfigurationWidget::userChangesEdited()
|
||||
|
||||
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()
|
||||
@@ -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_parseSuccess = qt4Target()->qt4Project()->validParse(m_proFilePath);
|
||||
m_parseInProgress = qt4Target()->qt4Project()->parseInProgress(m_proFilePath);
|
||||
|
||||
return RunConfiguration::fromMap(map);
|
||||
}
|
||||
|
@@ -38,8 +38,9 @@
|
||||
#include <utils/environment.h>
|
||||
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtGui/QWidget>
|
||||
#include <QtCore/QMetaType>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QCheckBox;
|
||||
@@ -117,15 +118,13 @@ signals:
|
||||
void effectiveTargetInformationChanged();
|
||||
|
||||
private slots:
|
||||
void proFileUpdated(Qt4ProjectManager::Qt4ProFileNode *pro, bool success);
|
||||
void proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode *pro);
|
||||
void proFileUpdated(Qt4ProjectManager::Qt4ProFileNode *pro, bool success, bool parseInProgress);
|
||||
|
||||
protected:
|
||||
Qt4RunConfiguration(Qt4BaseTarget *parent, Qt4RunConfiguration *source);
|
||||
virtual bool fromMap(const QVariantMap &map);
|
||||
|
||||
private:
|
||||
void handleParseState(bool success);
|
||||
void setBaseWorkingDirectory(const QString &workingDirectory);
|
||||
QString baseWorkingDirectory() const;
|
||||
void setCommandLineArguments(const QString &argumentsString);
|
||||
@@ -156,6 +155,7 @@ private:
|
||||
QList<Utils::EnvironmentItem> m_userEnvironmentChanges;
|
||||
BaseEnvironmentBase m_baseEnvironmentBase;
|
||||
bool m_parseSuccess;
|
||||
bool m_parseInProgress;
|
||||
};
|
||||
|
||||
class Qt4RunConfigurationWidget : public QWidget
|
||||
@@ -195,6 +195,8 @@ private slots:
|
||||
private:
|
||||
Qt4RunConfiguration *m_qt4RunConfiguration;
|
||||
bool m_ignoreChange;
|
||||
QLabel *m_disabledIcon;
|
||||
QLabel *m_disabledReason;
|
||||
QLineEdit *m_executableLineEdit;
|
||||
Utils::PathChooser *m_workingDirectoryEdit;
|
||||
QLineEdit *m_argumentsLineEdit;
|
||||
|
@@ -113,10 +113,8 @@ void S60DeployConfiguration::ctor()
|
||||
setDefaultDisplayName(defaultDisplayName());
|
||||
// TODO disable S60 Deploy Configuration while parsing
|
||||
// requires keeping track of the parsing state of the project
|
||||
// connect(qt4Target()->qt4Project(), SIGNAL(proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode*)),
|
||||
// this, SLOT(targetInformationInvalidated()));
|
||||
connect(qt4Target()->qt4Project(), SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool)),
|
||||
this, SIGNAL(targetInformationChanged()));
|
||||
connect(qt4Target()->qt4Project(), SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool, bool)),
|
||||
this, SLOT(slotTargetInformationChanged(bool,bool)));
|
||||
connect(qt4Target(), SIGNAL(activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration*)),
|
||||
this, SLOT(updateActiveBuildConfiguration(ProjectExplorer::BuildConfiguration*)));
|
||||
connect(qt4Target(), SIGNAL(activeRunConfigurationChanged(ProjectExplorer::RunConfiguration*)),
|
||||
@@ -133,6 +131,13 @@ ProjectExplorer::DeployConfigurationWidget *S60DeployConfiguration::configuratio
|
||||
return new S60DeployConfigurationWidget();
|
||||
}
|
||||
|
||||
void S60DeployConfiguration::slotTargetInformationChanged(bool success, bool parseInProgress)
|
||||
{
|
||||
Q_UNUSED(success)
|
||||
if (!parseInProgress)
|
||||
emit targetInformationChanged();
|
||||
}
|
||||
|
||||
bool S60DeployConfiguration::isStaticLibrary(const Qt4ProFileNode &projectNode) const
|
||||
{
|
||||
if (projectNode.projectType() == LibraryTemplate) {
|
||||
|
@@ -115,6 +115,7 @@ signals:
|
||||
void installationDriveChanged();
|
||||
|
||||
private slots:
|
||||
void slotTargetInformationChanged(bool success, bool parseInProgress);
|
||||
void updateActiveBuildConfiguration(ProjectExplorer::BuildConfiguration *buildConfiguration);
|
||||
void updateActiveRunConfiguration(ProjectExplorer::RunConfiguration *runConfiguration);
|
||||
|
||||
|
@@ -73,7 +73,8 @@ QString pathFromId(const QString &id)
|
||||
S60DeviceRunConfiguration::S60DeviceRunConfiguration(Qt4BaseTarget *parent, const QString &proFilePath) :
|
||||
RunConfiguration(parent, QLatin1String(S60_DEVICE_RC_ID)),
|
||||
m_proFilePath(proFilePath),
|
||||
m_validParse(parent->qt4Project()->validParse(proFilePath))
|
||||
m_validParse(parent->qt4Project()->validParse(proFilePath)),
|
||||
m_parseInProgress(parent->qt4Project()->parseInProgress(proFilePath))
|
||||
{
|
||||
ctor();
|
||||
}
|
||||
@@ -82,7 +83,8 @@ S60DeviceRunConfiguration::S60DeviceRunConfiguration(Qt4BaseTarget *target, S60D
|
||||
RunConfiguration(target, source),
|
||||
m_proFilePath(source->m_proFilePath),
|
||||
m_commandLineArguments(source->m_commandLineArguments),
|
||||
m_validParse(source->m_validParse)
|
||||
m_validParse(source->m_validParse),
|
||||
m_parseInProgress(source->m_parseInProgress)
|
||||
{
|
||||
ctor();
|
||||
}
|
||||
@@ -97,33 +99,21 @@ void S60DeviceRunConfiguration::ctor()
|
||||
setDefaultDisplayName(tr("Run on Symbian device"));
|
||||
|
||||
Qt4Project *pro = qt4Target()->qt4Project();
|
||||
connect(pro, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool)),
|
||||
this, SLOT(proFileUpdate(Qt4ProjectManager::Qt4ProFileNode*,bool)));
|
||||
connect(pro, SIGNAL(proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode *)),
|
||||
this, SLOT(proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode *)));
|
||||
connect(pro, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)),
|
||||
this, SLOT(proFileUpdate(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)));
|
||||
}
|
||||
|
||||
void S60DeviceRunConfiguration::handleParserState(bool success)
|
||||
void S60DeviceRunConfiguration::proFileUpdate(Qt4ProjectManager::Qt4ProFileNode *pro, bool success, bool parseInProgress)
|
||||
{
|
||||
if (m_proFilePath != pro->path())
|
||||
return;
|
||||
bool enabled = isEnabled();
|
||||
m_validParse = success;
|
||||
m_parseInProgress = parseInProgress;
|
||||
if (enabled != isEnabled())
|
||||
emit isEnabledChanged(!enabled);
|
||||
}
|
||||
|
||||
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();
|
||||
if (!parseInProgress)
|
||||
emit targetInformationChanged();
|
||||
}
|
||||
|
||||
S60DeviceRunConfiguration::~S60DeviceRunConfiguration()
|
||||
@@ -137,13 +127,15 @@ Qt4SymbianTarget *S60DeviceRunConfiguration::qt4Target() const
|
||||
|
||||
bool S60DeviceRunConfiguration::isEnabled() const
|
||||
{
|
||||
return m_validParse;
|
||||
return m_validParse && !m_parseInProgress;
|
||||
}
|
||||
|
||||
QString S60DeviceRunConfiguration::disabledReason() const
|
||||
{
|
||||
if (m_parseInProgress)
|
||||
return tr("The .pro file is currently being parsed.");
|
||||
if (!m_validParse)
|
||||
return tr("The .pro file could not be parsed");
|
||||
return tr("The .pro file could not be parsed.");
|
||||
return QString();
|
||||
}
|
||||
|
||||
@@ -181,6 +173,7 @@ bool S60DeviceRunConfiguration::fromMap(const QVariantMap &map)
|
||||
return false;
|
||||
|
||||
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()));
|
||||
|
||||
|
@@ -94,18 +94,17 @@ protected:
|
||||
virtual bool fromMap(const QVariantMap &map);
|
||||
|
||||
private slots:
|
||||
void proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode *pro);
|
||||
void proFileUpdate(Qt4ProjectManager::Qt4ProFileNode *pro, bool success);
|
||||
void proFileUpdate(Qt4ProjectManager::Qt4ProFileNode *pro, bool success, bool parseInProgress);
|
||||
|
||||
private:
|
||||
void ctor();
|
||||
void handleParserState(bool success);
|
||||
Internal::Qt4SymbianTarget *qt4Target() const;
|
||||
Internal::SymbianQtVersion *qtVersion() const;
|
||||
|
||||
QString m_proFilePath;
|
||||
QString m_commandLineArguments;
|
||||
bool m_validParse;
|
||||
bool m_parseInProgress;
|
||||
};
|
||||
|
||||
class S60DeviceRunConfigurationFactory : public ProjectExplorer::IRunConfigurationFactory
|
||||
|
@@ -56,6 +56,18 @@ S60DeviceRunConfigurationWidget::S60DeviceRunConfigurationWidget(
|
||||
m_detailsWidget->setState(Utils::DetailsWidget::NoSummary);
|
||||
QVBoxLayout *mainBoxLayout = new QVBoxLayout();
|
||||
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);
|
||||
mainBoxLayout->addWidget(m_detailsWidget);
|
||||
QWidget *detailsContainer = new QWidget;
|
||||
@@ -93,7 +105,7 @@ S60DeviceRunConfigurationWidget::S60DeviceRunConfigurationWidget(
|
||||
connect(m_debuggerLanguageChooser, SIGNAL(qmlDebugServerPortChanged(uint)),
|
||||
this, SLOT(qmlDebugServerPortChanged(uint)));
|
||||
|
||||
setEnabled(m_runConfiguration->isEnabled());
|
||||
runConfigurationEnabledChange(m_runConfiguration->isEnabled());
|
||||
}
|
||||
|
||||
void S60DeviceRunConfigurationWidget::argumentsEdited(const QString &text)
|
||||
@@ -103,7 +115,10 @@ void S60DeviceRunConfigurationWidget::argumentsEdited(const QString &text)
|
||||
|
||||
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)
|
||||
|
@@ -34,6 +34,7 @@
|
||||
#define S60DEVICERUNCONFIGURATIONWIDGET_H
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
#include <QtGui/QLabel>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QLineEdit;
|
||||
@@ -65,6 +66,8 @@ private slots:
|
||||
|
||||
private:
|
||||
S60DeviceRunConfiguration *m_runConfiguration;
|
||||
QLabel *m_disabledIcon;
|
||||
QLabel *m_disabledReason;
|
||||
Utils::DetailsWidget *m_detailsWidget;
|
||||
Utils::DebuggerLanguageChooser *m_debuggerLanguageChooser;
|
||||
QLineEdit *m_argumentsLineEdit;
|
||||
|
@@ -73,7 +73,8 @@ QString pathFromId(const QString &id)
|
||||
S60EmulatorRunConfiguration::S60EmulatorRunConfiguration(Qt4BaseTarget *parent, const QString &proFilePath) :
|
||||
RunConfiguration(parent, QLatin1String(S60_EMULATOR_RC_ID)),
|
||||
m_proFilePath(proFilePath),
|
||||
m_validParse(parent->qt4Project()->validParse(proFilePath))
|
||||
m_validParse(parent->qt4Project()->validParse(proFilePath)),
|
||||
m_parseInProgress(parent->qt4Project()->parseInProgress(proFilePath))
|
||||
{
|
||||
ctor();
|
||||
}
|
||||
@@ -81,7 +82,8 @@ S60EmulatorRunConfiguration::S60EmulatorRunConfiguration(Qt4BaseTarget *parent,
|
||||
S60EmulatorRunConfiguration::S60EmulatorRunConfiguration(Qt4BaseTarget *parent, S60EmulatorRunConfiguration *source) :
|
||||
RunConfiguration(parent, source),
|
||||
m_proFilePath(source->m_proFilePath),
|
||||
m_validParse(source->m_validParse)
|
||||
m_validParse(source->m_validParse),
|
||||
m_parseInProgress(source->m_parseInProgress)
|
||||
{
|
||||
ctor();
|
||||
}
|
||||
@@ -95,10 +97,8 @@ void S60EmulatorRunConfiguration::ctor()
|
||||
//: S60 emulator run configuration default display name (no pro-file name)
|
||||
setDefaultDisplayName(tr("Run on Symbian Emulator"));
|
||||
Qt4Project *pro = qt4Target()->qt4Project();
|
||||
connect(pro, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool)),
|
||||
this, SLOT(proFileUpdate(Qt4ProjectManager::Qt4ProFileNode*,bool)));
|
||||
connect(pro, SIGNAL(proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode *)),
|
||||
this, SLOT(proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode *)));
|
||||
connect(pro, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)),
|
||||
this, SLOT(proFileUpdate(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)));
|
||||
}
|
||||
|
||||
|
||||
@@ -106,28 +106,18 @@ 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();
|
||||
m_validParse = success;
|
||||
m_parseInProgress = parseInProgress;
|
||||
if (enabled != isEnabled()) {
|
||||
emit isEnabledChanged(!enabled);
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
if (parseInProgress)
|
||||
emit targetInformationChanged();
|
||||
}
|
||||
|
||||
Qt4SymbianTarget *S60EmulatorRunConfiguration::qt4Target() const
|
||||
@@ -137,13 +127,15 @@ Qt4SymbianTarget *S60EmulatorRunConfiguration::qt4Target() const
|
||||
|
||||
bool S60EmulatorRunConfiguration::isEnabled() const
|
||||
{
|
||||
return m_validParse;
|
||||
return m_validParse && !m_parseInProgress;
|
||||
}
|
||||
|
||||
QString S60EmulatorRunConfiguration::disabledReason() const
|
||||
{
|
||||
if (m_parseInProgress)
|
||||
return tr("The .pro file is currently being parsed.");
|
||||
if (!m_validParse)
|
||||
return tr("The .pro file could not be parsed");
|
||||
return tr("The .pro file could not be parsed.");
|
||||
return QString();
|
||||
}
|
||||
|
||||
@@ -174,6 +166,7 @@ bool S60EmulatorRunConfiguration::fromMap(const QVariantMap &map)
|
||||
return false;
|
||||
|
||||
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
|
||||
setDefaultDisplayName(tr("%1 in Symbian Emulator").arg(QFileInfo(m_proFilePath).completeBaseName()));
|
||||
@@ -217,6 +210,18 @@ S60EmulatorRunConfigurationWidget::S60EmulatorRunConfigurationWidget(S60Emulator
|
||||
m_detailsWidget->setState(Utils::DetailsWidget::NoSummary);
|
||||
QVBoxLayout *mainBoxLayout = new QVBoxLayout();
|
||||
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);
|
||||
mainBoxLayout->addWidget(m_detailsWidget);
|
||||
QWidget *detailsContainer = new QWidget;
|
||||
@@ -234,7 +239,7 @@ S60EmulatorRunConfigurationWidget::S60EmulatorRunConfigurationWidget(S60Emulator
|
||||
connect(m_runConfiguration, SIGNAL(isEnabledChanged(bool)),
|
||||
this, SLOT(runConfigurationEnabledChange(bool)));
|
||||
|
||||
setEnabled(m_runConfiguration->isEnabled());
|
||||
runConfigurationEnabledChange(m_runConfiguration->isEnabled());
|
||||
}
|
||||
|
||||
void S60EmulatorRunConfigurationWidget::updateTargetInformation()
|
||||
@@ -244,7 +249,10 @@ void S60EmulatorRunConfigurationWidget::updateTargetInformation()
|
||||
|
||||
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
|
||||
|
@@ -84,8 +84,7 @@ signals:
|
||||
void targetInformationChanged();
|
||||
|
||||
private slots:
|
||||
void proFileUpdate(Qt4ProjectManager::Qt4ProFileNode *pro, bool success);
|
||||
void proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode *pro);
|
||||
void proFileUpdate(Qt4ProjectManager::Qt4ProFileNode *pro, bool success, bool parseInProgress);
|
||||
|
||||
protected:
|
||||
S60EmulatorRunConfiguration(Qt4ProjectManager::Qt4BaseTarget *parent, S60EmulatorRunConfiguration *source);
|
||||
@@ -93,11 +92,11 @@ protected:
|
||||
|
||||
private:
|
||||
void ctor();
|
||||
void handleParserState(bool success);
|
||||
void updateTarget();
|
||||
|
||||
QString m_proFilePath;
|
||||
bool m_validParse;
|
||||
bool m_parseInProgress;
|
||||
};
|
||||
|
||||
class S60EmulatorRunConfigurationWidget : public QWidget
|
||||
@@ -113,6 +112,8 @@ private slots:
|
||||
|
||||
private:
|
||||
S60EmulatorRunConfiguration *m_runConfiguration;
|
||||
QLabel *m_disabledIcon;
|
||||
QLabel *m_disabledReason;
|
||||
Utils::DetailsWidget *m_detailsWidget;
|
||||
QLabel *m_executableLabel;
|
||||
};
|
||||
|
@@ -1374,6 +1374,7 @@ Qt4ProFileNode::Qt4ProFileNode(Qt4Project *project,
|
||||
: Qt4PriFileNode(project, this, filePath),
|
||||
m_projectType(InvalidProject),
|
||||
m_validParse(false),
|
||||
m_parseInProgress(false),
|
||||
m_readerExact(0),
|
||||
m_readerCumulative(0)
|
||||
{
|
||||
@@ -1447,7 +1448,7 @@ void Qt4ProFileNode::emitProFileUpdated()
|
||||
{
|
||||
foreach (ProjectExplorer::NodesWatcher *watcher, watchers())
|
||||
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()) {
|
||||
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
|
||||
{
|
||||
return m_validParse;
|
||||
}
|
||||
|
||||
bool Qt4ProFileNode::parseInProgress() const
|
||||
{
|
||||
return m_parseInProgress;
|
||||
}
|
||||
|
||||
void Qt4ProFileNode::scheduleUpdate()
|
||||
{
|
||||
if (m_validParse) {
|
||||
m_validParse = false;
|
||||
emitProFileInvalidated();
|
||||
}
|
||||
m_parseInProgress = true;
|
||||
emitProFileUpdated();
|
||||
m_project->scheduleAsyncUpdate(this);
|
||||
}
|
||||
|
||||
@@ -1494,12 +1485,10 @@ void Qt4ProFileNode::asyncUpdate()
|
||||
|
||||
void Qt4ProFileNode::update()
|
||||
{
|
||||
if (m_validParse) {
|
||||
m_validParse = false;
|
||||
foreach (ProjectExplorer::NodesWatcher *watcher, watchers())
|
||||
if (Internal::Qt4NodesWatcher *qt4Watcher = qobject_cast<Internal::Qt4NodesWatcher*>(watcher))
|
||||
emit qt4Watcher->proFileInvalidated(this);
|
||||
}
|
||||
m_parseInProgress = true;
|
||||
foreach (ProjectExplorer::NodesWatcher *watcher, watchers())
|
||||
if (Internal::Qt4NodesWatcher *qt4Watcher = qobject_cast<Internal::Qt4NodesWatcher*>(watcher))
|
||||
emit qt4Watcher->proFileUpdated(this, m_validParse, m_parseInProgress);
|
||||
|
||||
setupReader();
|
||||
EvalResult evalResult = evaluate();
|
||||
@@ -1558,7 +1547,7 @@ void Qt4ProFileNode::applyEvaluate(EvalResult evalResult, bool async)
|
||||
}
|
||||
foreach (ProjectExplorer::NodesWatcher *watcher, watchers())
|
||||
if (Internal::Qt4NodesWatcher *qt4Watcher = qobject_cast<Internal::Qt4NodesWatcher*>(watcher))
|
||||
emit qt4Watcher->proFileUpdated(this, false);
|
||||
emit qt4Watcher->proFileUpdated(this, false, false);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1751,7 +1740,8 @@ void Qt4ProFileNode::applyEvaluate(EvalResult evalResult, bool async)
|
||||
|
||||
Qt4PriFileNode::update(fileForCurrentProjectExact, m_readerExact, fileForCurrentProjectCumlative, m_readerCumulative);
|
||||
|
||||
if (evalResult == EvalOk) {
|
||||
m_validParse = (evalResult == EvalOk);
|
||||
if (m_validParse) {
|
||||
|
||||
// update TargetInformation
|
||||
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))
|
||||
emit qt4Watcher->variablesChanged(this, oldValues, m_varValues);
|
||||
}
|
||||
|
||||
} // evalResult == EvalOk
|
||||
|
||||
m_parseInProgress = false;
|
||||
|
||||
createUiCodeModelSupport();
|
||||
updateUiFiles();
|
||||
|
||||
m_validParse = true;
|
||||
|
||||
foreach (ProjectExplorer::NodesWatcher *watcher, watchers())
|
||||
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_readerCumulative);
|
||||
|
@@ -242,8 +242,7 @@ signals:
|
||||
const QHash<Qt4Variable, QStringList> &oldValues,
|
||||
const QHash<Qt4Variable, QStringList> &newValues);
|
||||
|
||||
void proFileUpdated(Qt4ProjectManager::Qt4ProFileNode *projectNode, bool success);
|
||||
void proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode *projectNode);
|
||||
void proFileUpdated(Qt4ProjectManager::Qt4ProFileNode *projectNode, bool success, bool parseInProgress);
|
||||
|
||||
private:
|
||||
// let them emit signals
|
||||
@@ -347,10 +346,10 @@ public:
|
||||
void update();
|
||||
void scheduleUpdate();
|
||||
|
||||
void emitProFileInvalidated();
|
||||
void emitProFileUpdated();
|
||||
|
||||
bool validParse() const;
|
||||
bool parseInProgress() const;
|
||||
|
||||
bool hasBuildTargets(Qt4ProjectType projectType) const;
|
||||
|
||||
@@ -396,6 +395,7 @@ private:
|
||||
friend class Qt4NodeHierarchy;
|
||||
|
||||
bool m_validParse;
|
||||
bool m_parseInProgress;
|
||||
|
||||
// Async stuff
|
||||
QFutureWatcher<EvalResult> m_parseFutureWatcher;
|
||||
|
@@ -339,11 +339,8 @@ bool Qt4Project::fromMap(const QVariantMap &map)
|
||||
foreach (Target *t, targets())
|
||||
onAddedTarget(t);
|
||||
|
||||
connect(m_nodesWatcher, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool)),
|
||||
this, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode *,bool)));
|
||||
|
||||
connect(m_nodesWatcher, SIGNAL(proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode*)),
|
||||
this, SIGNAL(proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode*)));
|
||||
connect(m_nodesWatcher, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)),
|
||||
this, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode *,bool,bool)));
|
||||
|
||||
// Now we emit update once :)
|
||||
m_rootProjectNode->emitProFileUpdated();
|
||||
@@ -676,7 +673,7 @@ void Qt4Project::scheduleAsyncUpdate()
|
||||
m_cancelEvaluate = true;
|
||||
m_asyncUpdateState = AsyncFullUpdatePending;
|
||||
activeTarget()->activeBuildConfiguration()->setEnabled(false);
|
||||
m_rootProjectNode->emitProFileInvalidated();
|
||||
m_rootProjectNode->emitProFileUpdated();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -684,7 +681,7 @@ void Qt4Project::scheduleAsyncUpdate()
|
||||
qDebug()<<" starting timer for full update, setting state to full update pending";
|
||||
m_partialEvaluate.clear();
|
||||
activeTarget()->activeBuildConfiguration()->setEnabled(false);
|
||||
m_rootProjectNode->emitProFileInvalidated();
|
||||
m_rootProjectNode->emitProFileUpdated();
|
||||
m_asyncUpdateState = AsyncFullUpdatePending;
|
||||
m_asyncUpdateTimer.start();
|
||||
|
||||
@@ -938,6 +935,14 @@ bool Qt4Project::validParse(const QString &proFilePath) const
|
||||
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*> subWidgets;
|
||||
|
@@ -155,6 +155,7 @@ public:
|
||||
|
||||
Qt4ProFileNode *rootProjectNode() const;
|
||||
bool validParse(const QString &proFilePath) const;
|
||||
bool parseInProgress(const QString &proFilePath) const;
|
||||
|
||||
virtual QStringList files(FilesMode fileMode) const;
|
||||
virtual QString generatedUiHeader(const QString &formFile) const;
|
||||
@@ -188,8 +189,7 @@ public:
|
||||
void updateFileList();
|
||||
|
||||
signals:
|
||||
void proFileUpdated(Qt4ProjectManager::Qt4ProFileNode *node, bool);
|
||||
void proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode *node);
|
||||
void proFileUpdated(Qt4ProjectManager::Qt4ProFileNode *node, bool, bool);
|
||||
void buildDirectoryInitialized();
|
||||
void fromMapFinished();
|
||||
|
||||
|
@@ -59,14 +59,21 @@ MaemoDeployables::~MaemoDeployables() {}
|
||||
void MaemoDeployables::init()
|
||||
{
|
||||
Qt4Project * const pro = m_target->qt4Project();
|
||||
connect(pro, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool)),
|
||||
m_updateTimer, SLOT(start()));
|
||||
connect(pro, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)),
|
||||
this, SLOT(startTimer(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)));
|
||||
|
||||
// TODO do we want to disable the view
|
||||
|
||||
createModels();
|
||||
}
|
||||
|
||||
void MaemoDeployables::startTimer(Qt4ProjectManager::Qt4ProFileNode*, bool success, bool parseInProgress)
|
||||
{
|
||||
Q_UNUSED(success)
|
||||
if (!parseInProgress)
|
||||
m_updateTimer->start();
|
||||
}
|
||||
|
||||
void MaemoDeployables::createModels()
|
||||
{
|
||||
if (m_target->project()->activeTarget() != m_target)
|
||||
@@ -77,8 +84,8 @@ void MaemoDeployables::createModels()
|
||||
return;
|
||||
m_updateTimer->stop();
|
||||
disconnect(m_target->qt4Project(),
|
||||
SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool)),
|
||||
m_updateTimer, SLOT(start()));
|
||||
SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)),
|
||||
this, SLOT(startTimer(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)));
|
||||
beginResetModel();
|
||||
qDeleteAll(m_listModels);
|
||||
m_listModels.clear();
|
||||
@@ -109,8 +116,8 @@ void MaemoDeployables::createModels()
|
||||
|
||||
endResetModel();
|
||||
connect(m_target->qt4Project(),
|
||||
SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool)),
|
||||
m_updateTimer, SLOT(start()));
|
||||
SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)),
|
||||
this, SLOT(startTimer(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)));
|
||||
}
|
||||
|
||||
void MaemoDeployables::createModels(const Qt4ProFileNode *proFileNode)
|
||||
|
@@ -64,6 +64,9 @@ public:
|
||||
int modelCount() const { return m_listModels.count(); }
|
||||
MaemoDeployableListModel *modelAt(int i) const { return m_listModels.at(i); }
|
||||
|
||||
private slots:
|
||||
void startTimer(Qt4ProjectManager::Qt4ProFileNode *, bool success, bool parseInProgress);
|
||||
|
||||
private:
|
||||
typedef QHash<QString, MaemoDeployableListModel::ProFileUpdateSetting> UpdateSettingsMap;
|
||||
|
||||
|
@@ -81,8 +81,14 @@ MaemoRunConfigurationWidget::MaemoRunConfigurationWidget(
|
||||
m_deviceEnvReader(new MaemoDeviceEnvReader(this, runConfiguration)),
|
||||
m_deployablesConnected(false)
|
||||
{
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||
setLayout(mainLayout);
|
||||
QVBoxLayout *topLayout = new QVBoxLayout(this);
|
||||
topLayout->setMargin(0);
|
||||
addDisabledLabel(topLayout);
|
||||
|
||||
topWidget = new QWidget;
|
||||
topLayout->addWidget(topWidget);
|
||||
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout(topWidget);
|
||||
addGenericWidgets(mainLayout);
|
||||
mainLayout->addSpacing(20);
|
||||
addDebuggingWidgets(mainLayout);
|
||||
@@ -109,12 +115,29 @@ MaemoRunConfigurationWidget::MaemoRunConfigurationWidget(
|
||||
m_debugQmlOnlyButton->setVisible(qmlDebuggingAvailable);
|
||||
m_debugCppAndQmlButton->setVisible(qmlDebuggingAvailable);
|
||||
|
||||
setEnabled(m_runConfiguration->isEnabled());
|
||||
runConfigurationEnabledChange(m_runConfiguration->isEnabled());
|
||||
}
|
||||
|
||||
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)
|
||||
|
@@ -97,12 +97,16 @@ private slots:
|
||||
void handleDeploySpecsChanged();
|
||||
|
||||
private:
|
||||
void addDisabledLabel(QVBoxLayout *topLayout);
|
||||
void addGenericWidgets(QVBoxLayout *mainLayout);
|
||||
void addDebuggingWidgets(QVBoxLayout *mainLayout);
|
||||
void addMountWidgets(QVBoxLayout *mainLayout);
|
||||
void addEnvironmentWidgets(QVBoxLayout *mainLayout);
|
||||
void updateMountWarning();
|
||||
|
||||
QWidget *topWidget;
|
||||
QLabel *m_disabledIcon;
|
||||
QLabel *m_disabledReason;
|
||||
QLineEdit *m_argsLineEdit;
|
||||
QLabel *m_localExecutableLabel;
|
||||
QLabel *m_remoteExecutableLabel;
|
||||
|
@@ -78,7 +78,8 @@ public:
|
||||
RemoteLinuxRunConfigurationPrivate(const QString &proFilePath, const Qt4BaseTarget *target)
|
||||
: proFilePath(proFilePath), useRemoteGdb(DefaultUseRemoteGdbValue),
|
||||
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),
|
||||
useRemoteGdb(other->useRemoteGdb), baseEnvironmentType(other->baseEnvironmentType),
|
||||
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;
|
||||
QList<Utils::EnvironmentItem> userEnvironmentChanges;
|
||||
bool validParse;
|
||||
bool parseInProgress;
|
||||
QString disabledReason;
|
||||
};
|
||||
} // namespace Internal
|
||||
@@ -134,10 +138,8 @@ void RemoteLinuxRunConfiguration::init()
|
||||
handleDeployConfigChanged();
|
||||
|
||||
Qt4Project *pro = qt4Target()->qt4Project();
|
||||
connect(pro, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool)),
|
||||
this, SLOT(proFileUpdate(Qt4ProjectManager::Qt4ProFileNode*,bool)));
|
||||
connect(pro, SIGNAL(proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode *)),
|
||||
this, SLOT(proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode*)));
|
||||
connect(pro, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)),
|
||||
this, SLOT(proFileUpdate(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)));
|
||||
connect(this, SIGNAL(debuggersChanged()), SLOT(updateEnabledState()));
|
||||
connect(m_d->remoteMounts, SIGNAL(rowsInserted(QModelIndex, int, int)), this,
|
||||
SLOT(handleRemoteMountsChanged()));
|
||||
@@ -166,8 +168,12 @@ Qt4BuildConfiguration *RemoteLinuxRunConfiguration::activeQt4BuildConfiguration(
|
||||
|
||||
bool RemoteLinuxRunConfiguration::isEnabled() const
|
||||
{
|
||||
if (m_d->parseInProgress) {
|
||||
m_d->disabledReason = tr("The .pro file is being parsed.");
|
||||
return false;
|
||||
}
|
||||
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;
|
||||
}
|
||||
if (!deviceConfig()) {
|
||||
@@ -205,26 +211,16 @@ Utils::OutputFormatter *RemoteLinuxRunConfiguration::createOutputFormatter() con
|
||||
return new QtSupport::QtOutputFormatter(qt4Target()->qt4Project());
|
||||
}
|
||||
|
||||
void RemoteLinuxRunConfiguration::handleParseState(bool success)
|
||||
{
|
||||
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)
|
||||
void RemoteLinuxRunConfiguration::proFileUpdate(Qt4ProjectManager::Qt4ProFileNode *pro, bool success, bool parseInProgress)
|
||||
{
|
||||
if (m_d->proFilePath == pro->path()) {
|
||||
handleParseState(success);
|
||||
emit targetInformationChanged();
|
||||
bool enabled = isEnabled();
|
||||
m_d->validParse = success;
|
||||
m_d->parseInProgress = parseInProgress;
|
||||
if (enabled != isEnabled())
|
||||
updateEnabledState();
|
||||
if (!parseInProgress)
|
||||
emit targetInformationChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,6 +255,7 @@ bool RemoteLinuxRunConfiguration::fromMap(const QVariantMap &map)
|
||||
m_d->remoteMounts->fromMap(map);
|
||||
|
||||
m_d->validParse = qt4Target()->qt4Project()->validParse(m_d->proFilePath);
|
||||
m_d->parseInProgress = qt4Target()->qt4Project()->parseInProgress(m_d->proFilePath);
|
||||
|
||||
setDefaultDisplayName(defaultDisplayName());
|
||||
|
||||
|
@@ -137,8 +137,7 @@ protected:
|
||||
QString defaultDisplayName();
|
||||
|
||||
private slots:
|
||||
void proFileUpdate(Qt4ProjectManager::Qt4ProFileNode *pro, bool success);
|
||||
void proFileInvalidated(Qt4ProjectManager::Qt4ProFileNode *pro);
|
||||
void proFileUpdate(Qt4ProjectManager::Qt4ProFileNode *pro, bool success, bool parseInProgress);
|
||||
void updateDeviceConfigurations();
|
||||
void handleDeployConfigChanged();
|
||||
void handleDeployablesUpdated();
|
||||
@@ -147,7 +146,6 @@ private slots:
|
||||
|
||||
private:
|
||||
void init();
|
||||
void handleParseState(bool success);
|
||||
Internal::AbstractLinuxDeviceDeployStep *deployStep() const;
|
||||
|
||||
void setArguments(const QString &args);
|
||||
|
Reference in New Issue
Block a user