forked from qt-creator/qt-creator
Disable Run Configurations while parsing .pro files
Initial patch and idea by hunger. Reviewed-By: hunger
This commit is contained in:
@@ -67,9 +67,12 @@ MaemoDeployables::~MaemoDeployables() {}
|
|||||||
|
|
||||||
void MaemoDeployables::init()
|
void MaemoDeployables::init()
|
||||||
{
|
{
|
||||||
connect(qt4BuildConfiguration()->qt4Target()->qt4Project(),
|
Qt4Project *pro = qt4BuildConfiguration()->qt4Target()->qt4Project();
|
||||||
SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
connect(pro, SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*,bool)),
|
||||||
m_updateTimer, SLOT(start()));
|
m_updateTimer, SLOT(start()));
|
||||||
|
|
||||||
|
// TODO do we want to disable the view
|
||||||
|
|
||||||
createModels();
|
createModels();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,7 +88,7 @@ void MaemoDeployables::createModels()
|
|||||||
return;
|
return;
|
||||||
m_updateTimer->stop();
|
m_updateTimer->stop();
|
||||||
disconnect(qt4BuildConfiguration()->qt4Target()->qt4Project(),
|
disconnect(qt4BuildConfiguration()->qt4Target()->qt4Project(),
|
||||||
SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*,bool)),
|
||||||
m_updateTimer, SLOT(start()));
|
m_updateTimer, SLOT(start()));
|
||||||
beginResetModel();
|
beginResetModel();
|
||||||
qDeleteAll(m_listModels);
|
qDeleteAll(m_listModels);
|
||||||
@@ -116,8 +119,7 @@ void MaemoDeployables::createModels()
|
|||||||
}
|
}
|
||||||
|
|
||||||
endResetModel();
|
endResetModel();
|
||||||
connect(qt4BuildConfiguration()->qt4Target()->qt4Project(),
|
connect(pro, SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*,bool)),
|
||||||
SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
|
||||||
m_updateTimer, SLOT(start()));
|
m_updateTimer, SLOT(start()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ MaemoRunConfiguration::MaemoRunConfiguration(Qt4Target *parent,
|
|||||||
, m_proFilePath(proFilePath)
|
, m_proFilePath(proFilePath)
|
||||||
, m_useRemoteGdb(DefaultUseRemoteGdbValue)
|
, m_useRemoteGdb(DefaultUseRemoteGdbValue)
|
||||||
, m_baseEnvironmentBase(SystemEnvironmentBase)
|
, m_baseEnvironmentBase(SystemEnvironmentBase)
|
||||||
|
, m_validParse(parent->qt4Project()->validParse(m_proFilePath))
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
@@ -81,6 +82,7 @@ MaemoRunConfiguration::MaemoRunConfiguration(Qt4Target *parent,
|
|||||||
, m_baseEnvironmentBase(source->m_baseEnvironmentBase)
|
, m_baseEnvironmentBase(source->m_baseEnvironmentBase)
|
||||||
, m_systemEnvironment(source->m_systemEnvironment)
|
, m_systemEnvironment(source->m_systemEnvironment)
|
||||||
, m_userEnvironmentChanges(source->m_userEnvironmentChanges)
|
, m_userEnvironmentChanges(source->m_userEnvironmentChanges)
|
||||||
|
, m_validParse(source->m_validParse)
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
@@ -97,9 +99,11 @@ void MaemoRunConfiguration::init()
|
|||||||
this, SLOT(handleDeployConfigChanged()));
|
this, SLOT(handleDeployConfigChanged()));
|
||||||
handleDeployConfigChanged();
|
handleDeployConfigChanged();
|
||||||
|
|
||||||
connect(qt4Target()->qt4Project(),
|
Qt4Project *pro = qt4Target()->qt4Project();
|
||||||
SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
connect(pro, SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*,bool)),
|
||||||
this, SLOT(proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode*)));
|
this, SLOT(proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode*,bool)));
|
||||||
|
connect(pro, SIGNAL(profFileInvalidated(Qt4ProjectManager::Internal::Qt4ProFileNode *)),
|
||||||
|
this, SLOT(proFileInvalidated(Qt4ProjectManager::Internal::Qt4ProFileNode*)));
|
||||||
}
|
}
|
||||||
|
|
||||||
MaemoRunConfiguration::~MaemoRunConfiguration()
|
MaemoRunConfiguration::~MaemoRunConfiguration()
|
||||||
@@ -118,6 +122,8 @@ Qt4BuildConfiguration *MaemoRunConfiguration::activeQt4BuildConfiguration() cons
|
|||||||
|
|
||||||
bool MaemoRunConfiguration::isEnabled(ProjectExplorer::BuildConfiguration *config) const
|
bool MaemoRunConfiguration::isEnabled(ProjectExplorer::BuildConfiguration *config) const
|
||||||
{
|
{
|
||||||
|
if (!m_validParse)
|
||||||
|
return false;
|
||||||
Qt4BuildConfiguration *qt4bc = qobject_cast<Qt4BuildConfiguration*>(config);
|
Qt4BuildConfiguration *qt4bc = qobject_cast<Qt4BuildConfiguration*>(config);
|
||||||
QTC_ASSERT(qt4bc, return false);
|
QTC_ASSERT(qt4bc, return false);
|
||||||
ToolChain::ToolChainType type = qt4bc->toolChainType();
|
ToolChain::ToolChainType type = qt4bc->toolChainType();
|
||||||
@@ -134,10 +140,30 @@ ProjectExplorer::OutputFormatter *MaemoRunConfiguration::createOutputFormatter()
|
|||||||
return new QtOutputFormatter(qt4Target()->qt4Project());
|
return new QtOutputFormatter(qt4Target()->qt4Project());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaemoRunConfiguration::proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro)
|
void MaemoRunConfiguration::handleParseState(bool success)
|
||||||
{
|
{
|
||||||
if (m_proFilePath == pro->path())
|
bool enabled = isEnabled();
|
||||||
|
m_validParse = success;
|
||||||
|
if (enabled != isEnabled()) {
|
||||||
|
qDebug()<<"Emitting isEnabledChanged()"<<!enabled;
|
||||||
|
emit isEnabledChanged(!enabled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MaemoRunConfiguration::proFileInvalidated(Qt4ProjectManager::Internal::Qt4ProFileNode *pro)
|
||||||
|
{
|
||||||
|
if (m_proFilePath != pro->path())
|
||||||
|
return;
|
||||||
|
qDebug()<<"proFileInvalidated";
|
||||||
|
handleParseState(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MaemoRunConfiguration::proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro, bool success)
|
||||||
|
{
|
||||||
|
if (m_proFilePath == pro->path()) {
|
||||||
|
handleParseState(success);
|
||||||
emit targetInformationChanged();
|
emit targetInformationChanged();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariantMap MaemoRunConfiguration::toMap() const
|
QVariantMap MaemoRunConfiguration::toMap() const
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ public:
|
|||||||
MaemoRunConfiguration(Qt4Target *parent, const QString &proFilePath);
|
MaemoRunConfiguration(Qt4Target *parent, const QString &proFilePath);
|
||||||
virtual ~MaemoRunConfiguration();
|
virtual ~MaemoRunConfiguration();
|
||||||
|
|
||||||
|
using ProjectExplorer::RunConfiguration::isEnabled;
|
||||||
bool isEnabled(ProjectExplorer::BuildConfiguration *config) const;
|
bool isEnabled(ProjectExplorer::BuildConfiguration *config) const;
|
||||||
QWidget *createConfigurationWidget();
|
QWidget *createConfigurationWidget();
|
||||||
ProjectExplorer::OutputFormatter *createOutputFormatter() const;
|
ProjectExplorer::OutputFormatter *createOutputFormatter() const;
|
||||||
@@ -135,14 +136,15 @@ protected:
|
|||||||
QString defaultDisplayName();
|
QString defaultDisplayName();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro);
|
void proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro, bool success);
|
||||||
|
void proFileInvalidated(Qt4ProjectManager::Internal::Qt4ProFileNode *pro);
|
||||||
void updateDeviceConfigurations();
|
void updateDeviceConfigurations();
|
||||||
void handleDeployConfigChanged();
|
void handleDeployConfigChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void init();
|
void init();
|
||||||
|
void handleParseState(bool success);
|
||||||
|
|
||||||
private:
|
|
||||||
QString m_proFilePath;
|
QString m_proFilePath;
|
||||||
mutable QString m_gdbPath;
|
mutable QString m_gdbPath;
|
||||||
MaemoRemoteMountsModel *m_remoteMounts;
|
MaemoRemoteMountsModel *m_remoteMounts;
|
||||||
@@ -152,6 +154,7 @@ private:
|
|||||||
BaseEnvironmentBase m_baseEnvironmentBase;
|
BaseEnvironmentBase m_baseEnvironmentBase;
|
||||||
Utils::Environment m_systemEnvironment;
|
Utils::Environment m_systemEnvironment;
|
||||||
QList<Utils::EnvironmentItem> m_userEnvironmentChanges;
|
QList<Utils::EnvironmentItem> m_userEnvironmentChanges;
|
||||||
|
bool m_validParse;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -96,9 +96,18 @@ MaemoRunConfigurationWidget::MaemoRunConfigurationWidget(
|
|||||||
connect(m_runConfiguration->qt4Target(),
|
connect(m_runConfiguration->qt4Target(),
|
||||||
SIGNAL(activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration*)),
|
SIGNAL(activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration*)),
|
||||||
this, SLOT(handleBuildConfigChanged()));
|
this, SLOT(handleBuildConfigChanged()));
|
||||||
|
|
||||||
|
connect(m_runConfiguration, SIGNAL(isEnabledChanged(bool)),
|
||||||
|
this, SLOT(runConfigurationEnabledChange(bool)));
|
||||||
|
|
||||||
handleBuildConfigChanged();
|
handleBuildConfigChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MaemoRunConfigurationWidget::runConfigurationEnabledChange(bool enabled)
|
||||||
|
{
|
||||||
|
setEnabled(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
void MaemoRunConfigurationWidget::addGenericWidgets(QVBoxLayout *mainLayout)
|
void MaemoRunConfigurationWidget::addGenericWidgets(QVBoxLayout *mainLayout)
|
||||||
{
|
{
|
||||||
QFormLayout *formLayout = new QFormLayout;
|
QFormLayout *formLayout = new QFormLayout;
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ public:
|
|||||||
QWidget *parent = 0);
|
QWidget *parent = 0);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void runConfigurationEnabledChange(bool enabled);
|
||||||
void argumentsEdited(const QString &args);
|
void argumentsEdited(const QString &args);
|
||||||
void showSettingsDialog(const QString &link);
|
void showSettingsDialog(const QString &link);
|
||||||
void updateTargetInformation();
|
void updateTargetInformation();
|
||||||
|
|||||||
@@ -110,6 +110,10 @@ S60DeployConfiguration::S60DeployConfiguration(Target *target, S60DeployConfigur
|
|||||||
void S60DeployConfiguration::ctor()
|
void S60DeployConfiguration::ctor()
|
||||||
{
|
{
|
||||||
setDefaultDisplayName(defaultDisplayName());
|
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::Internal::Qt4ProFileNode*)),
|
||||||
|
// this, SLOT(targetInformationInvalidated()));
|
||||||
connect(qt4Target()->qt4Project(), SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
connect(qt4Target()->qt4Project(), SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
||||||
this, SIGNAL(targetInformationChanged()));
|
this, SIGNAL(targetInformationChanged()));
|
||||||
connect(qt4Target(), SIGNAL(activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration*)),
|
connect(qt4Target(), SIGNAL(activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration*)),
|
||||||
|
|||||||
@@ -107,17 +107,19 @@ QString pathToId(const QString &path)
|
|||||||
|
|
||||||
// ======== S60DeviceRunConfiguration
|
// ======== S60DeviceRunConfiguration
|
||||||
|
|
||||||
S60DeviceRunConfiguration::S60DeviceRunConfiguration(Target *parent, const QString &proFilePath) :
|
S60DeviceRunConfiguration::S60DeviceRunConfiguration(Qt4Target *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))
|
||||||
{
|
{
|
||||||
ctor();
|
ctor();
|
||||||
}
|
}
|
||||||
|
|
||||||
S60DeviceRunConfiguration::S60DeviceRunConfiguration(Target *target, S60DeviceRunConfiguration *source) :
|
S60DeviceRunConfiguration::S60DeviceRunConfiguration(Qt4Target *target, S60DeviceRunConfiguration *source) :
|
||||||
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)
|
||||||
{
|
{
|
||||||
ctor();
|
ctor();
|
||||||
}
|
}
|
||||||
@@ -130,11 +132,34 @@ void S60DeviceRunConfiguration::ctor()
|
|||||||
else
|
else
|
||||||
//: S60 device runconfiguration default display name (no profile set)
|
//: S60 device runconfiguration default display name (no profile set)
|
||||||
setDefaultDisplayName(tr("Run on Symbian device"));
|
setDefaultDisplayName(tr("Run on Symbian device"));
|
||||||
|
|
||||||
|
Qt4Project *pro = qt4Target()->qt4Project();
|
||||||
|
connect(pro, SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*,bool)),
|
||||||
|
this, SLOT(proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode*,bool)));
|
||||||
|
connect(pro, SIGNAL(proFileInvalidated(Qt4ProjectManager::Internal::Qt4ProFileNode *)),
|
||||||
|
this, SLOT(proFileInvalidated(Qt4ProjectManager::Internal::Qt4ProFileNode *)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void S60DeviceRunConfiguration::proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro)
|
void S60DeviceRunConfiguration::handleParserState(bool success)
|
||||||
{
|
{
|
||||||
if (m_proFilePath == pro->path())
|
bool enabled = isEnabled();
|
||||||
|
m_validParse = success;
|
||||||
|
if (enabled != isEnabled())
|
||||||
|
emit isEnabledChanged(!enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
void S60DeviceRunConfiguration::proFileInvalidated(Qt4ProjectManager::Internal::Qt4ProFileNode *pro)
|
||||||
|
{
|
||||||
|
if (m_proFilePath != pro->path())
|
||||||
|
return;
|
||||||
|
handleParserState(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void S60DeviceRunConfiguration::proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro, bool success)
|
||||||
|
{
|
||||||
|
if (m_proFilePath != pro->path())
|
||||||
|
return;
|
||||||
|
handleParserState(success);
|
||||||
emit targetInformationChanged();
|
emit targetInformationChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -164,6 +189,8 @@ ProjectExplorer::ToolChain::ToolChainType S60DeviceRunConfiguration::toolChainTy
|
|||||||
|
|
||||||
bool S60DeviceRunConfiguration::isEnabled(ProjectExplorer::BuildConfiguration *configuration) const
|
bool S60DeviceRunConfiguration::isEnabled(ProjectExplorer::BuildConfiguration *configuration) const
|
||||||
{
|
{
|
||||||
|
if (!m_validParse)
|
||||||
|
return false;
|
||||||
const Qt4BuildConfiguration *qt4bc = static_cast<const Qt4BuildConfiguration *>(configuration);
|
const Qt4BuildConfiguration *qt4bc = static_cast<const Qt4BuildConfiguration *>(configuration);
|
||||||
switch (qt4bc->toolChainType()) {
|
switch (qt4bc->toolChainType()) {
|
||||||
case ToolChain::GCCE:
|
case ToolChain::GCCE:
|
||||||
|
|||||||
@@ -69,12 +69,13 @@ class S60DeviceRunConfiguration : public ProjectExplorer::RunConfiguration
|
|||||||
friend class S60DeviceRunConfigurationFactory;
|
friend class S60DeviceRunConfigurationFactory;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
S60DeviceRunConfiguration(ProjectExplorer::Target *parent, const QString &proFilePath);
|
S60DeviceRunConfiguration(Qt4ProjectManager::Internal::Qt4Target *parent, const QString &proFilePath);
|
||||||
virtual ~S60DeviceRunConfiguration();
|
virtual ~S60DeviceRunConfiguration();
|
||||||
|
|
||||||
Qt4Target *qt4Target() const;
|
Qt4Target *qt4Target() const;
|
||||||
const QtVersion *qtVersion() const;
|
const QtVersion *qtVersion() const;
|
||||||
|
|
||||||
|
using ProjectExplorer::RunConfiguration::isEnabled;
|
||||||
bool isEnabled(ProjectExplorer::BuildConfiguration *configuration) const;
|
bool isEnabled(ProjectExplorer::BuildConfiguration *configuration) const;
|
||||||
QWidget *createConfigurationWidget();
|
QWidget *createConfigurationWidget();
|
||||||
|
|
||||||
@@ -97,22 +98,26 @@ public:
|
|||||||
|
|
||||||
QVariantMap toMap() const;
|
QVariantMap toMap() const;
|
||||||
|
|
||||||
void proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro);
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void targetInformationChanged();
|
void targetInformationChanged();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
S60DeviceRunConfiguration(ProjectExplorer::Target *parent, S60DeviceRunConfiguration *source);
|
S60DeviceRunConfiguration(Qt4ProjectManager::Internal::Qt4Target *parent, S60DeviceRunConfiguration *source);
|
||||||
QString defaultDisplayName() const;
|
QString defaultDisplayName() const;
|
||||||
virtual bool fromMap(const QVariantMap &map);
|
virtual bool fromMap(const QVariantMap &map);
|
||||||
|
private slots:
|
||||||
|
void proFileInvalidated(Qt4ProjectManager::Internal::Qt4ProFileNode *pro);
|
||||||
|
void proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro, bool success);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ProjectExplorer::ToolChain::ToolChainType toolChainType(ProjectExplorer::BuildConfiguration *configuration) const;
|
ProjectExplorer::ToolChain::ToolChainType toolChainType(ProjectExplorer::BuildConfiguration *configuration) const;
|
||||||
void ctor();
|
void ctor();
|
||||||
|
void handleParserState(bool sucess);
|
||||||
|
|
||||||
QString m_proFilePath;
|
QString m_proFilePath;
|
||||||
QStringList m_commandLineArguments;
|
QStringList m_commandLineArguments;
|
||||||
|
bool m_validParse;
|
||||||
};
|
};
|
||||||
|
|
||||||
class S60DeviceRunConfigurationFactory : public ProjectExplorer::IRunConfigurationFactory
|
class S60DeviceRunConfigurationFactory : public ProjectExplorer::IRunConfigurationFactory
|
||||||
|
|||||||
@@ -73,6 +73,9 @@ S60DeviceRunConfigurationWidget::S60DeviceRunConfigurationWidget(
|
|||||||
|
|
||||||
connect(m_argumentsLineEdit, SIGNAL(textEdited(QString)),
|
connect(m_argumentsLineEdit, SIGNAL(textEdited(QString)),
|
||||||
this, SLOT(argumentsEdited(QString)));
|
this, SLOT(argumentsEdited(QString)));
|
||||||
|
|
||||||
|
connect(m_runConfiguration, SIGNAL(isEnabledChanged(bool)),
|
||||||
|
this, SLOT(runConfigurationEnabledChange(bool)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void S60DeviceRunConfigurationWidget::argumentsEdited(const QString &text)
|
void S60DeviceRunConfigurationWidget::argumentsEdited(const QString &text)
|
||||||
@@ -86,5 +89,10 @@ void S60DeviceRunConfigurationWidget::argumentsEdited(const QString &text)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void S60DeviceRunConfigurationWidget::runConfigurationEnabledChange(bool enabled)
|
||||||
|
{
|
||||||
|
setEnabled(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
|
|||||||
@@ -51,9 +51,9 @@ class S60DeviceRunConfigurationWidget : public QWidget
|
|||||||
public:
|
public:
|
||||||
explicit S60DeviceRunConfigurationWidget(S60DeviceRunConfiguration *runConfiguration,
|
explicit S60DeviceRunConfigurationWidget(S60DeviceRunConfiguration *runConfiguration,
|
||||||
QWidget *parent = 0);
|
QWidget *parent = 0);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void argumentsEdited(const QString &text);
|
void argumentsEdited(const QString &text);
|
||||||
|
void runConfigurationEnabledChange(bool enabled);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
S60DeviceRunConfiguration *m_runConfiguration;
|
S60DeviceRunConfiguration *m_runConfiguration;
|
||||||
|
|||||||
@@ -78,16 +78,18 @@ QString pathToId(const QString &path)
|
|||||||
|
|
||||||
// ======== S60EmulatorRunConfiguration
|
// ======== S60EmulatorRunConfiguration
|
||||||
|
|
||||||
S60EmulatorRunConfiguration::S60EmulatorRunConfiguration(Target *parent, const QString &proFilePath) :
|
S60EmulatorRunConfiguration::S60EmulatorRunConfiguration(Qt4Target *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))
|
||||||
{
|
{
|
||||||
ctor();
|
ctor();
|
||||||
}
|
}
|
||||||
|
|
||||||
S60EmulatorRunConfiguration::S60EmulatorRunConfiguration(Target *parent, S60EmulatorRunConfiguration *source) :
|
S60EmulatorRunConfiguration::S60EmulatorRunConfiguration(Qt4Target *parent, S60EmulatorRunConfiguration *source) :
|
||||||
RunConfiguration(parent, source),
|
RunConfiguration(parent, source),
|
||||||
m_proFilePath(source->m_proFilePath)
|
m_proFilePath(source->m_proFilePath),
|
||||||
|
m_validParse(source->m_validParse)
|
||||||
{
|
{
|
||||||
ctor();
|
ctor();
|
||||||
}
|
}
|
||||||
@@ -100,8 +102,11 @@ void S60EmulatorRunConfiguration::ctor()
|
|||||||
else
|
else
|
||||||
//: 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"));
|
||||||
connect(qt4Target()->qt4Project(), SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
Qt4Project *pro = qt4Target()->qt4Project();
|
||||||
this, SLOT(proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode*)));
|
connect(pro, SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*,bool)),
|
||||||
|
this, SLOT(proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode*,bool)));
|
||||||
|
connect(pro, SIGNAL(proFileInvalidated(Qt4ProjectManager::Internal::Qt4ProFileNode *)),
|
||||||
|
this, SLOT(proFileInvalidated(Qt4ProjectManager::Internal::Qt4ProFileNode *)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -109,9 +114,28 @@ S60EmulatorRunConfiguration::~S60EmulatorRunConfiguration()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void S60EmulatorRunConfiguration::proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro)
|
void S60EmulatorRunConfiguration::handleParserState(bool success)
|
||||||
{
|
{
|
||||||
if (m_proFilePath == pro->path())
|
bool enabled = isEnabled();
|
||||||
|
m_validParse = success;
|
||||||
|
if (enabled != isEnabled()) {
|
||||||
|
qDebug()<<"Emitting isEnabledChanged()"<<!enabled;
|
||||||
|
emit isEnabledChanged(!enabled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void S60EmulatorRunConfiguration::proFileInvalidated(Qt4ProjectManager::Internal::Qt4ProFileNode *pro)
|
||||||
|
{
|
||||||
|
if (m_proFilePath != pro->path())
|
||||||
|
return;
|
||||||
|
handleParserState(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void S60EmulatorRunConfiguration::proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro, bool success)
|
||||||
|
{
|
||||||
|
if (m_proFilePath != pro->path())
|
||||||
|
return;
|
||||||
|
handleParserState(success);
|
||||||
emit targetInformationChanged();
|
emit targetInformationChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,6 +146,8 @@ Qt4Target *S60EmulatorRunConfiguration::qt4Target() const
|
|||||||
|
|
||||||
bool S60EmulatorRunConfiguration::isEnabled(ProjectExplorer::BuildConfiguration *configuration) const
|
bool S60EmulatorRunConfiguration::isEnabled(ProjectExplorer::BuildConfiguration *configuration) const
|
||||||
{
|
{
|
||||||
|
if (!m_validParse)
|
||||||
|
return false;
|
||||||
Qt4BuildConfiguration *qt4bc = qobject_cast<Qt4BuildConfiguration *>(configuration);
|
Qt4BuildConfiguration *qt4bc = qobject_cast<Qt4BuildConfiguration *>(configuration);
|
||||||
QTC_ASSERT(qt4bc, return false);
|
QTC_ASSERT(qt4bc, return false);
|
||||||
ToolChain::ToolChainType type = qt4bc->toolChainType();
|
ToolChain::ToolChainType type = qt4bc->toolChainType();
|
||||||
@@ -203,6 +229,9 @@ S60EmulatorRunConfigurationWidget::S60EmulatorRunConfigurationWidget(S60Emulator
|
|||||||
|
|
||||||
connect(m_runConfiguration, SIGNAL(targetInformationChanged()),
|
connect(m_runConfiguration, SIGNAL(targetInformationChanged()),
|
||||||
this, SLOT(updateTargetInformation()));
|
this, SLOT(updateTargetInformation()));
|
||||||
|
|
||||||
|
connect(m_runConfiguration, SIGNAL(isEnabledChanged(bool)),
|
||||||
|
this, SLOT(runConfigurationEnabledChange(bool)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void S60EmulatorRunConfigurationWidget::updateTargetInformation()
|
void S60EmulatorRunConfigurationWidget::updateTargetInformation()
|
||||||
@@ -210,6 +239,11 @@ void S60EmulatorRunConfigurationWidget::updateTargetInformation()
|
|||||||
m_executableLabel->setText(m_runConfiguration->executable());
|
m_executableLabel->setText(m_runConfiguration->executable());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void S60EmulatorRunConfigurationWidget::runConfigurationEnabledChange(bool enabled)
|
||||||
|
{
|
||||||
|
setEnabled(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
// ======== S60EmulatorRunConfigurationFactory
|
// ======== S60EmulatorRunConfigurationFactory
|
||||||
|
|
||||||
S60EmulatorRunConfigurationFactory::S60EmulatorRunConfigurationFactory(QObject *parent)
|
S60EmulatorRunConfigurationFactory::S60EmulatorRunConfigurationFactory(QObject *parent)
|
||||||
|
|||||||
@@ -59,11 +59,12 @@ class S60EmulatorRunConfiguration : public ProjectExplorer::RunConfiguration
|
|||||||
friend class S60EmulatorRunConfigurationFactory;
|
friend class S60EmulatorRunConfigurationFactory;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
S60EmulatorRunConfiguration(ProjectExplorer::Target *parent, const QString &proFilePath);
|
S60EmulatorRunConfiguration(Qt4ProjectManager::Internal::Qt4Target *parent, const QString &proFilePath);
|
||||||
virtual ~S60EmulatorRunConfiguration();
|
virtual ~S60EmulatorRunConfiguration();
|
||||||
|
|
||||||
Qt4Target *qt4Target() const;
|
Qt4Target *qt4Target() const;
|
||||||
|
|
||||||
|
using ProjectExplorer::RunConfiguration::isEnabled;
|
||||||
bool isEnabled(ProjectExplorer::BuildConfiguration *configuration) const;
|
bool isEnabled(ProjectExplorer::BuildConfiguration *configuration) const;
|
||||||
QWidget *createConfigurationWidget();
|
QWidget *createConfigurationWidget();
|
||||||
|
|
||||||
@@ -77,17 +78,20 @@ signals:
|
|||||||
void targetInformationChanged();
|
void targetInformationChanged();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro);
|
void proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro, bool success);
|
||||||
|
void proFileInvalidated(Qt4ProjectManager::Internal::Qt4ProFileNode *pro);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
S60EmulatorRunConfiguration(ProjectExplorer::Target *parent, S60EmulatorRunConfiguration *source);
|
S60EmulatorRunConfiguration(Qt4ProjectManager::Internal::Qt4Target *parent, S60EmulatorRunConfiguration *source);
|
||||||
virtual bool fromMap(const QVariantMap &map);
|
virtual bool fromMap(const QVariantMap &map);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ctor();
|
void ctor();
|
||||||
|
void handleParserState(bool sucess);
|
||||||
void updateTarget();
|
void updateTarget();
|
||||||
|
|
||||||
QString m_proFilePath;
|
QString m_proFilePath;
|
||||||
|
bool m_validParse;
|
||||||
};
|
};
|
||||||
|
|
||||||
class S60EmulatorRunConfigurationWidget : public QWidget
|
class S60EmulatorRunConfigurationWidget : public QWidget
|
||||||
@@ -99,6 +103,7 @@ public:
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void updateTargetInformation();
|
void updateTargetInformation();
|
||||||
|
void runConfigurationEnabledChange(bool enabled);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
S60EmulatorRunConfiguration *m_runConfiguration;
|
S60EmulatorRunConfiguration *m_runConfiguration;
|
||||||
|
|||||||
@@ -1243,6 +1243,7 @@ Qt4ProFileNode::Qt4ProFileNode(Qt4Project *project,
|
|||||||
QObject *parent)
|
QObject *parent)
|
||||||
: Qt4PriFileNode(project, this, filePath),
|
: Qt4PriFileNode(project, this, filePath),
|
||||||
m_projectType(InvalidProject),
|
m_projectType(InvalidProject),
|
||||||
|
m_validParse(false),
|
||||||
m_readerExact(0),
|
m_readerExact(0),
|
||||||
m_readerCumulative(0)
|
m_readerCumulative(0)
|
||||||
{
|
{
|
||||||
@@ -1307,8 +1308,30 @@ QStringList Qt4ProFileNode::variableValue(const Qt4Variable var) const
|
|||||||
return m_varValues.value(var);
|
return m_varValues.value(var);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Qt4ProFileNode::emitProFileInvalidated()
|
||||||
|
{
|
||||||
|
foreach (NodesWatcher *watcher, watchers())
|
||||||
|
if (Qt4NodesWatcher *qt4Watcher = qobject_cast<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;
|
||||||
|
}
|
||||||
|
|
||||||
void Qt4ProFileNode::scheduleUpdate()
|
void Qt4ProFileNode::scheduleUpdate()
|
||||||
{
|
{
|
||||||
|
if (m_validParse) {
|
||||||
|
m_validParse = false;
|
||||||
|
emitProFileInvalidated();
|
||||||
|
}
|
||||||
m_project->scheduleAsyncUpdate(this);
|
m_project->scheduleAsyncUpdate(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1323,6 +1346,13 @@ void Qt4ProFileNode::asyncUpdate()
|
|||||||
|
|
||||||
void Qt4ProFileNode::update()
|
void Qt4ProFileNode::update()
|
||||||
{
|
{
|
||||||
|
if (m_validParse) {
|
||||||
|
m_validParse = false;
|
||||||
|
foreach (NodesWatcher *watcher, watchers())
|
||||||
|
if (Qt4NodesWatcher *qt4Watcher = qobject_cast<Qt4NodesWatcher*>(watcher))
|
||||||
|
emit qt4Watcher->proFileInvalidated(this);
|
||||||
|
}
|
||||||
|
|
||||||
setupReader();
|
setupReader();
|
||||||
bool parserError = evaluate();
|
bool parserError = evaluate();
|
||||||
applyEvaluate(!parserError, false);
|
applyEvaluate(!parserError, false);
|
||||||
@@ -1405,6 +1435,9 @@ void Qt4ProFileNode::applyEvaluate(bool parseResult, bool async)
|
|||||||
m_project->proFileParseError(tr("Error while parsing file %1. Giving up.").arg(m_projectFilePath));
|
m_project->proFileParseError(tr("Error while parsing file %1. Giving up.").arg(m_projectFilePath));
|
||||||
invalidate();
|
invalidate();
|
||||||
}
|
}
|
||||||
|
foreach (NodesWatcher *watcher, watchers())
|
||||||
|
if (Qt4NodesWatcher *qt4Watcher = qobject_cast<Qt4NodesWatcher*>(watcher))
|
||||||
|
emit qt4Watcher->proFileUpdated(this, false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1634,9 +1667,11 @@ void Qt4ProFileNode::applyEvaluate(bool parseResult, bool async)
|
|||||||
createUiCodeModelSupport();
|
createUiCodeModelSupport();
|
||||||
updateUiFiles();
|
updateUiFiles();
|
||||||
|
|
||||||
|
m_validParse = true;
|
||||||
|
|
||||||
foreach (NodesWatcher *watcher, watchers())
|
foreach (NodesWatcher *watcher, watchers())
|
||||||
if (Qt4NodesWatcher *qt4Watcher = qobject_cast<Qt4NodesWatcher*>(watcher))
|
if (Qt4NodesWatcher *qt4Watcher = qobject_cast<Qt4NodesWatcher*>(watcher))
|
||||||
emit qt4Watcher->proFileUpdated(this);
|
emit qt4Watcher->proFileUpdated(this, parseResult);
|
||||||
|
|
||||||
m_project->destroyProFileReader(m_readerExact);
|
m_project->destroyProFileReader(m_readerExact);
|
||||||
if (m_readerCumulative)
|
if (m_readerCumulative)
|
||||||
|
|||||||
@@ -298,6 +298,10 @@ public:
|
|||||||
void update();
|
void update();
|
||||||
void scheduleUpdate();
|
void scheduleUpdate();
|
||||||
|
|
||||||
|
void emitProFileInvalidated();
|
||||||
|
|
||||||
|
bool validParse() const;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void asyncUpdate();
|
void asyncUpdate();
|
||||||
|
|
||||||
@@ -335,6 +339,8 @@ private:
|
|||||||
InstallsList m_installsList;
|
InstallsList m_installsList;
|
||||||
friend class Qt4NodeHierarchy;
|
friend class Qt4NodeHierarchy;
|
||||||
|
|
||||||
|
bool m_validParse;
|
||||||
|
|
||||||
// Async stuff
|
// Async stuff
|
||||||
QFutureWatcher<bool> m_parseFutureWatcher;
|
QFutureWatcher<bool> m_parseFutureWatcher;
|
||||||
ProFileReader *m_readerExact;
|
ProFileReader *m_readerExact;
|
||||||
@@ -357,7 +363,8 @@ signals:
|
|||||||
const QHash<Qt4Variable, QStringList> &oldValues,
|
const QHash<Qt4Variable, QStringList> &oldValues,
|
||||||
const QHash<Qt4Variable, QStringList> &newValues);
|
const QHash<Qt4Variable, QStringList> &newValues);
|
||||||
|
|
||||||
void proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode *projectNode);
|
void proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode *projectNode, bool success);
|
||||||
|
void proFileInvalidated(Qt4ProjectManager::Internal::Qt4ProFileNode *projectNode);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// let them emit signals
|
// let them emit signals
|
||||||
|
|||||||
@@ -337,8 +337,11 @@ bool Qt4Project::fromMap(const QVariantMap &map)
|
|||||||
connect(QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>)),
|
connect(QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>)),
|
||||||
this, SLOT(qtVersionsChanged()));
|
this, SLOT(qtVersionsChanged()));
|
||||||
|
|
||||||
connect(m_nodesWatcher, SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode *)),
|
connect(m_nodesWatcher, SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*,bool)),
|
||||||
this, SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode *)));
|
this, SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode *,bool)));
|
||||||
|
|
||||||
|
connect(m_nodesWatcher, SIGNAL(proFileInvalidated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
||||||
|
this, SIGNAL(proFileInvalidated(Qt4ProjectManager::Internal::Qt4ProFileNode*)));
|
||||||
|
|
||||||
connect(this, SIGNAL(activeTargetChanged(ProjectExplorer::Target*)),
|
connect(this, SIGNAL(activeTargetChanged(ProjectExplorer::Target*)),
|
||||||
this, SLOT(activeTargetWasChanged()));
|
this, SLOT(activeTargetWasChanged()));
|
||||||
@@ -618,6 +621,7 @@ void Qt4Project::update()
|
|||||||
if (debug)
|
if (debug)
|
||||||
qDebug()<<"Doing sync update";
|
qDebug()<<"Doing sync update";
|
||||||
m_rootProjectNode->update();
|
m_rootProjectNode->update();
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug()<<"State is now Base";
|
qDebug()<<"State is now Base";
|
||||||
m_asyncUpdateState = Base;
|
m_asyncUpdateState = Base;
|
||||||
@@ -627,6 +631,7 @@ void Qt4Project::scheduleAsyncUpdate(Qt4ProFileNode *node)
|
|||||||
{
|
{
|
||||||
if (m_asyncUpdateState == ShuttingDown)
|
if (m_asyncUpdateState == ShuttingDown)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug()<<"schduleAsyncUpdate (node)";
|
qDebug()<<"schduleAsyncUpdate (node)";
|
||||||
Q_ASSERT(m_asyncUpdateState != NoState);
|
Q_ASSERT(m_asyncUpdateState != NoState);
|
||||||
@@ -695,6 +700,7 @@ void Qt4Project::scheduleAsyncUpdate()
|
|||||||
qDebug()<<"scheduleAsyncUpdate";
|
qDebug()<<"scheduleAsyncUpdate";
|
||||||
if (m_asyncUpdateState == ShuttingDown)
|
if (m_asyncUpdateState == ShuttingDown)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Q_ASSERT(m_asyncUpdateState != NoState);
|
Q_ASSERT(m_asyncUpdateState != NoState);
|
||||||
if (m_cancelEvaluate) { // we are in progress of canceling
|
if (m_cancelEvaluate) { // we are in progress of canceling
|
||||||
// and will start the evaluation after that
|
// and will start the evaluation after that
|
||||||
@@ -707,12 +713,14 @@ void Qt4Project::scheduleAsyncUpdate()
|
|||||||
qDebug()<<" update in progress, canceling and setting state to full update pending";
|
qDebug()<<" update in progress, canceling and setting state to full update pending";
|
||||||
m_cancelEvaluate = true;
|
m_cancelEvaluate = true;
|
||||||
m_asyncUpdateState = AsyncFullUpdatePending;
|
m_asyncUpdateState = AsyncFullUpdatePending;
|
||||||
|
m_rootProjectNode->emitProFileInvalidated();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
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();
|
||||||
|
m_rootProjectNode->emitProFileInvalidated();
|
||||||
m_asyncUpdateState = AsyncFullUpdatePending;
|
m_asyncUpdateState = AsyncFullUpdatePending;
|
||||||
m_asyncUpdateTimer.start();
|
m_asyncUpdateTimer.start();
|
||||||
|
|
||||||
@@ -950,6 +958,12 @@ Qt4ProFileNode *Qt4Project::rootProjectNode() const
|
|||||||
return m_rootProjectNode;
|
return m_rootProjectNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Qt4Project::validParse(const QString &proFilePath) const
|
||||||
|
{
|
||||||
|
const Qt4ProFileNode *node = m_rootProjectNode->findProFileFor(proFilePath);
|
||||||
|
return node && node->validParse();
|
||||||
|
}
|
||||||
|
|
||||||
BuildConfigWidget *Qt4Project::createConfigWidget()
|
BuildConfigWidget *Qt4Project::createConfigWidget()
|
||||||
{
|
{
|
||||||
return new Qt4ProjectConfigWidget(this);
|
return new Qt4ProjectConfigWidget(this);
|
||||||
|
|||||||
@@ -159,6 +159,7 @@ public:
|
|||||||
QList<ProjectExplorer::Project *>dependsOn();
|
QList<ProjectExplorer::Project *>dependsOn();
|
||||||
|
|
||||||
Internal::Qt4ProFileNode *rootProjectNode() const;
|
Internal::Qt4ProFileNode *rootProjectNode() const;
|
||||||
|
bool validParse(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;
|
||||||
@@ -192,9 +193,10 @@ public:
|
|||||||
|
|
||||||
Internal::CentralizedFolderWatcher *centralizedFolderWatcher();
|
Internal::CentralizedFolderWatcher *centralizedFolderWatcher();
|
||||||
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
/// emitted after parse
|
void proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode *node, bool);
|
||||||
void proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode *node);
|
void proFileInvalidated(Qt4ProjectManager::Internal::Qt4ProFileNode *node);
|
||||||
void buildDirectoryInitialized();
|
void buildDirectoryInitialized();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|||||||
@@ -102,7 +102,8 @@ Qt4RunConfiguration::Qt4RunConfiguration(Qt4Target *parent, const QString &proFi
|
|||||||
m_runMode(Gui),
|
m_runMode(Gui),
|
||||||
m_isUsingDyldImageSuffix(false),
|
m_isUsingDyldImageSuffix(false),
|
||||||
m_userSetWokingDirectory(false),
|
m_userSetWokingDirectory(false),
|
||||||
m_baseEnvironmentBase(Qt4RunConfiguration::BuildEnvironmentBase)
|
m_baseEnvironmentBase(Qt4RunConfiguration::BuildEnvironmentBase),
|
||||||
|
m_parseSuccess(true)
|
||||||
{
|
{
|
||||||
ctor();
|
ctor();
|
||||||
}
|
}
|
||||||
@@ -116,7 +117,8 @@ Qt4RunConfiguration::Qt4RunConfiguration(Qt4Target *parent, Qt4RunConfiguration
|
|||||||
m_userSetWokingDirectory(source->m_userSetWokingDirectory),
|
m_userSetWokingDirectory(source->m_userSetWokingDirectory),
|
||||||
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)
|
||||||
{
|
{
|
||||||
ctor();
|
ctor();
|
||||||
}
|
}
|
||||||
@@ -132,6 +134,8 @@ Qt4Target *Qt4RunConfiguration::qt4Target() const
|
|||||||
|
|
||||||
bool Qt4RunConfiguration::isEnabled(ProjectExplorer::BuildConfiguration *configuration) const
|
bool Qt4RunConfiguration::isEnabled(ProjectExplorer::BuildConfiguration *configuration) const
|
||||||
{
|
{
|
||||||
|
if (!m_parseSuccess)
|
||||||
|
return false;
|
||||||
Qt4BuildConfiguration *qt4bc = qobject_cast<Qt4BuildConfiguration *>(configuration);
|
Qt4BuildConfiguration *qt4bc = qobject_cast<Qt4BuildConfiguration *>(configuration);
|
||||||
QTC_ASSERT(qt4bc, return false);
|
QTC_ASSERT(qt4bc, return false);
|
||||||
|
|
||||||
@@ -156,21 +160,39 @@ bool Qt4RunConfiguration::isEnabled(ProjectExplorer::BuildConfiguration *configu
|
|||||||
return enabled;
|
return enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Qt4RunConfiguration::proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro)
|
void Qt4RunConfiguration::handleParseState(bool success)
|
||||||
{
|
{
|
||||||
if (m_proFilePath == pro->path())
|
bool enabled = isEnabled();
|
||||||
|
m_parseSuccess = success;
|
||||||
|
if (enabled != isEnabled())
|
||||||
|
emit isEnabledChanged(!enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Qt4RunConfiguration::proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode *pro, bool success)
|
||||||
|
{
|
||||||
|
if (m_proFilePath != pro->path())
|
||||||
|
return;
|
||||||
|
qDebug()<<"proFileUpdated"<<success;
|
||||||
|
handleParseState(success);
|
||||||
emit effectiveTargetInformationChanged();
|
emit effectiveTargetInformationChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Qt4RunConfiguration::proFileInvalidated(Qt4ProjectManager::Internal::Qt4ProFileNode *pro)
|
||||||
|
{
|
||||||
|
handleParseState(false);
|
||||||
|
}
|
||||||
|
|
||||||
void Qt4RunConfiguration::ctor()
|
void Qt4RunConfiguration::ctor()
|
||||||
{
|
{
|
||||||
setDefaultDisplayName(defaultDisplayName());
|
setDefaultDisplayName(defaultDisplayName());
|
||||||
|
|
||||||
connect(qt4Target(), SIGNAL(environmentChanged()),
|
connect(qt4Target(), SIGNAL(environmentChanged()),
|
||||||
this, SIGNAL(baseEnvironmentChanged()));
|
this, SIGNAL(baseEnvironmentChanged()));
|
||||||
|
connect(qt4Target()->qt4Project(), SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*,bool)),
|
||||||
|
this, SLOT(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*,bool)));
|
||||||
|
|
||||||
connect(qt4Target()->qt4Project(), SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
connect(qt4Target()->qt4Project(), SIGNAL(proFileInvalidated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
||||||
this, SLOT(proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode*)));
|
this, SLOT(proFileInvalidated(Qt4ProjectManager::Internal::Qt4ProFileNode*)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//////
|
//////
|
||||||
@@ -281,6 +303,8 @@ 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());
|
||||||
|
|
||||||
connect(m_workingDirectoryEdit, SIGNAL(changed(QString)),
|
connect(m_workingDirectoryEdit, SIGNAL(changed(QString)),
|
||||||
this, SLOT(workDirectoryEdited()));
|
this, SLOT(workDirectoryEdited()));
|
||||||
|
|
||||||
@@ -319,6 +343,9 @@ Qt4RunConfigurationWidget::Qt4RunConfigurationWidget(Qt4RunConfiguration *qt4Run
|
|||||||
|
|
||||||
connect(qt4RunConfiguration, SIGNAL(baseEnvironmentChanged()),
|
connect(qt4RunConfiguration, SIGNAL(baseEnvironmentChanged()),
|
||||||
this, SLOT(baseEnvironmentChanged()));
|
this, SLOT(baseEnvironmentChanged()));
|
||||||
|
|
||||||
|
connect(qt4RunConfiguration, SIGNAL(isEnabledChanged(bool)),
|
||||||
|
this, SLOT(runConfigurationEnabledChange(bool)));
|
||||||
}
|
}
|
||||||
|
|
||||||
Qt4RunConfigurationWidget::~Qt4RunConfigurationWidget()
|
Qt4RunConfigurationWidget::~Qt4RunConfigurationWidget()
|
||||||
@@ -374,6 +401,11 @@ void Qt4RunConfigurationWidget::userChangesEdited()
|
|||||||
m_ignoreChange = false;
|
m_ignoreChange = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Qt4RunConfigurationWidget::runConfigurationEnabledChange(bool enabled)
|
||||||
|
{
|
||||||
|
setEnabled(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
void Qt4RunConfigurationWidget::workDirectoryEdited()
|
void Qt4RunConfigurationWidget::workDirectoryEdited()
|
||||||
{
|
{
|
||||||
if (m_ignoreChange)
|
if (m_ignoreChange)
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ public:
|
|||||||
Qt4Target *qt4Target() const;
|
Qt4Target *qt4Target() const;
|
||||||
|
|
||||||
virtual bool isEnabled(ProjectExplorer::BuildConfiguration *configuration) const;
|
virtual bool isEnabled(ProjectExplorer::BuildConfiguration *configuration) const;
|
||||||
|
using ProjectExplorer::LocalApplicationRunConfiguration::isEnabled;
|
||||||
virtual QWidget *createConfigurationWidget();
|
virtual QWidget *createConfigurationWidget();
|
||||||
|
|
||||||
virtual QString executable() const;
|
virtual QString executable() const;
|
||||||
@@ -108,13 +109,15 @@ signals:
|
|||||||
void effectiveTargetInformationChanged();
|
void effectiveTargetInformationChanged();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro);
|
void proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode *pro, bool success);
|
||||||
|
void proFileInvalidated(Qt4ProjectManager::Internal::Qt4ProFileNode *pro);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Qt4RunConfiguration(Qt4Target *parent, Qt4RunConfiguration *source);
|
Qt4RunConfiguration(Qt4Target *parent, Qt4RunConfiguration *source);
|
||||||
virtual bool fromMap(const QVariantMap &map);
|
virtual bool fromMap(const QVariantMap &map);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void handleParseState(bool success);
|
||||||
void setRunMode(RunMode runMode);
|
void setRunMode(RunMode runMode);
|
||||||
void setBaseWorkingDirectory(const QString &workingDirectory);
|
void setBaseWorkingDirectory(const QString &workingDirectory);
|
||||||
QString baseWorkingDirectory() const;
|
QString baseWorkingDirectory() const;
|
||||||
@@ -146,6 +149,7 @@ private:
|
|||||||
QString m_userWorkingDirectory;
|
QString m_userWorkingDirectory;
|
||||||
QList<Utils::EnvironmentItem> m_userEnvironmentChanges;
|
QList<Utils::EnvironmentItem> m_userEnvironmentChanges;
|
||||||
BaseEnvironmentBase m_baseEnvironmentBase;
|
BaseEnvironmentBase m_baseEnvironmentBase;
|
||||||
|
bool m_parseSuccess;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Qt4RunConfigurationWidget : public QWidget
|
class Qt4RunConfigurationWidget : public QWidget
|
||||||
@@ -159,7 +163,9 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
void showEvent(QShowEvent *event);
|
void showEvent(QShowEvent *event);
|
||||||
void hideEvent(QHideEvent *event);
|
void hideEvent(QHideEvent *event);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void runConfigurationEnabledChange(bool);
|
||||||
void workDirectoryEdited();
|
void workDirectoryEdited();
|
||||||
void workingDirectoryReseted();
|
void workingDirectoryReseted();
|
||||||
void argumentsEdited(const QString &arguments);
|
void argumentsEdited(const QString &arguments);
|
||||||
|
|||||||
Reference in New Issue
Block a user