forked from qt-creator/qt-creator
RunConfiguration: added possibility to clone "Run" configuration
Active "Run" configuration can be clone together with arguments and "Run Environment" Change-Id: Iec1a4b0b0702957c30580098e916fe8e665f236e Reviewed-by: Daniel Teske <daniel.teske@digia.com> Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -97,7 +97,9 @@ LocalEnvironmentAspect::LocalEnvironmentAspect(RunConfiguration *parent) :
|
|||||||
|
|
||||||
LocalEnvironmentAspect *LocalEnvironmentAspect::create(RunConfiguration *parent) const
|
LocalEnvironmentAspect *LocalEnvironmentAspect::create(RunConfiguration *parent) const
|
||||||
{
|
{
|
||||||
return new LocalEnvironmentAspect(parent);
|
LocalEnvironmentAspect *result = new LocalEnvironmentAspect(parent);
|
||||||
|
result->setUserEnvironmentChanges(userEnvironmentChanges());
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
|||||||
@@ -282,6 +282,10 @@ static bool actionLessThan(const QAction *action1, const QAction *action2)
|
|||||||
void RunSettingsWidget::aboutToShowAddMenu()
|
void RunSettingsWidget::aboutToShowAddMenu()
|
||||||
{
|
{
|
||||||
m_addRunMenu->clear();
|
m_addRunMenu->clear();
|
||||||
|
if (m_target->activeRunConfiguration()) {
|
||||||
|
m_addRunMenu->addAction(tr("&Clone Selected"),
|
||||||
|
this, SLOT(cloneRunConfiguration()));
|
||||||
|
}
|
||||||
QList<IRunConfigurationFactory *> factories =
|
QList<IRunConfigurationFactory *> factories =
|
||||||
ExtensionSystem::PluginManager::getObjects<IRunConfigurationFactory>();
|
ExtensionSystem::PluginManager::getObjects<IRunConfigurationFactory>();
|
||||||
|
|
||||||
@@ -322,6 +326,23 @@ void RunSettingsWidget::addRunConfiguration()
|
|||||||
m_removeRunToolButton->setEnabled(m_target->runConfigurations().size() > 1);
|
m_removeRunToolButton->setEnabled(m_target->runConfigurations().size() > 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RunSettingsWidget::cloneRunConfiguration()
|
||||||
|
{
|
||||||
|
RunConfiguration* activeRunConfiguration = m_target->activeRunConfiguration();
|
||||||
|
IRunConfigurationFactory *factory = IRunConfigurationFactory::find(m_target,
|
||||||
|
activeRunConfiguration);
|
||||||
|
if (!factory)
|
||||||
|
return;
|
||||||
|
|
||||||
|
RunConfiguration *newRc = factory->clone(m_target, activeRunConfiguration);
|
||||||
|
if (!newRc)
|
||||||
|
return;
|
||||||
|
|
||||||
|
newRc->setDisplayName(activeRunConfiguration->displayName());
|
||||||
|
m_target->addRunConfiguration(newRc);
|
||||||
|
m_target->setActiveRunConfiguration(newRc);
|
||||||
|
}
|
||||||
|
|
||||||
void RunSettingsWidget::removeRunConfiguration()
|
void RunSettingsWidget::removeRunConfiguration()
|
||||||
{
|
{
|
||||||
RunConfiguration *rc = m_target->activeRunConfiguration();
|
RunConfiguration *rc = m_target->activeRunConfiguration();
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ private slots:
|
|||||||
void currentRunConfigurationChanged(int index);
|
void currentRunConfigurationChanged(int index);
|
||||||
void aboutToShowAddMenu();
|
void aboutToShowAddMenu();
|
||||||
void addRunConfiguration();
|
void addRunConfiguration();
|
||||||
|
void cloneRunConfiguration();
|
||||||
void removeRunConfiguration();
|
void removeRunConfiguration();
|
||||||
void activeRunConfigurationChanged();
|
void activeRunConfigurationChanged();
|
||||||
void renameRunConfiguration();
|
void renameRunConfiguration();
|
||||||
|
|||||||
Reference in New Issue
Block a user