2009-02-25 09:15:00 +01:00
|
|
|
/**************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
2010-03-05 11:25:49 +01:00
|
|
|
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2009-06-17 00:01:27 +10:00
|
|
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** Commercial Usage
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
|
|
|
|
** accordance with the Qt Commercial License Agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and Nokia.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** GNU Lesser General Public License Usage
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
|
|
|
** General Public License version 2.1 as published by the Free Software
|
|
|
|
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
|
|
|
** packaging of this file. Please review the following information to
|
|
|
|
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
|
|
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** If you are unsure which license is appropriate for your use, please
|
2009-08-14 09:30:56 +02:00
|
|
|
** contact the sales department at http://qt.nokia.com/contact.
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
**************************************************************************/
|
2008-12-02 16:19:05 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
#include "runsettingspropertiespage.h"
|
|
|
|
|
#include "runconfiguration.h"
|
2010-02-08 15:50:06 +01:00
|
|
|
#include "target.h"
|
2009-09-29 11:39:55 +02:00
|
|
|
#include "project.h"
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
#include "ui_runsettingspropertiespage.h"
|
|
|
|
|
|
2009-01-12 15:06:43 +01:00
|
|
|
#include <coreplugin/coreconstants.h>
|
2008-12-02 12:01:29 +01:00
|
|
|
#include <extensionsystem/pluginmanager.h>
|
2008-12-09 15:25:01 +01:00
|
|
|
#include <utils/qtcassert.h>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2008-12-09 15:25:01 +01:00
|
|
|
#include <QtCore/QDebug>
|
2008-12-02 12:01:29 +01:00
|
|
|
#include <QtCore/QPair>
|
2009-09-29 11:39:55 +02:00
|
|
|
#include <QtGui/QMenu>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
namespace ProjectExplorer {
|
|
|
|
|
namespace Internal {
|
2008-12-09 15:25:01 +01:00
|
|
|
|
2010-01-07 18:17:24 +01:00
|
|
|
struct FactoryAndId
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
ProjectExplorer::IRunConfigurationFactory *factory;
|
2010-01-07 18:17:24 +01:00
|
|
|
QString id;
|
2008-12-02 12:01:29 +01:00
|
|
|
};
|
2008-12-09 15:25:01 +01:00
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace ProjectExplorer
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-01-07 18:17:24 +01:00
|
|
|
Q_DECLARE_METATYPE(ProjectExplorer::Internal::FactoryAndId);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
namespace ProjectExplorer {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
/*! A model to represent the run configurations of a project. */
|
|
|
|
|
class RunConfigurationsModel : public QAbstractListModel
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
RunConfigurationsModel(QObject *parent = 0)
|
2010-02-01 15:12:38 +01:00
|
|
|
: QAbstractListModel(parent),
|
|
|
|
|
m_activeRunConfiguration(0)
|
2008-12-02 12:01:29 +01:00
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
|
|
|
|
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
|
|
|
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
|
|
|
|
|
2009-10-08 18:37:18 +02:00
|
|
|
void setRunConfigurations(const QList<RunConfiguration *> &runConfigurations);
|
|
|
|
|
QList<RunConfiguration *> runConfigurations() const { return m_runConfigurations; }
|
2010-01-07 18:17:24 +01:00
|
|
|
void displayNameChanged(RunConfiguration *rc);
|
2010-02-01 15:12:38 +01:00
|
|
|
void activeRunConfigurationChanged(RunConfiguration *rc);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
private:
|
2009-10-08 18:37:18 +02:00
|
|
|
QList<RunConfiguration *> m_runConfigurations;
|
2010-02-01 15:12:38 +01:00
|
|
|
RunConfiguration *m_activeRunConfiguration;
|
2008-12-02 12:01:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace ProjectExplorer
|
|
|
|
|
|
|
|
|
|
using namespace ProjectExplorer;
|
|
|
|
|
using namespace ProjectExplorer::Internal;
|
|
|
|
|
using ExtensionSystem::PluginManager;
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
|
/// RunSettingsPanelFactory
|
|
|
|
|
///
|
|
|
|
|
|
2010-02-08 15:50:06 +01:00
|
|
|
QString RunSettingsPanelFactory::id() const
|
|
|
|
|
{
|
|
|
|
|
return QLatin1String(RUNSETTINGS_PANEL_ID);
|
|
|
|
|
}
|
|
|
|
|
|
2010-01-21 13:46:19 +01:00
|
|
|
QString RunSettingsPanelFactory::displayName() const
|
|
|
|
|
{
|
2010-02-25 10:34:25 +01:00
|
|
|
return QCoreApplication::translate("RunSettingsPanelFactory", "Run Settings");
|
2010-01-21 13:46:19 +01:00
|
|
|
}
|
|
|
|
|
|
2010-02-08 15:50:06 +01:00
|
|
|
bool RunSettingsPanelFactory::supports(Project *project)
|
|
|
|
|
{
|
|
|
|
|
return project->targets().count() == 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool RunSettingsPanelFactory::supports(Target *target)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-02-08 15:50:06 +01:00
|
|
|
Q_UNUSED(target);
|
2008-12-02 12:01:29 +01:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2009-11-25 15:57:09 +01:00
|
|
|
IPropertiesPanel *RunSettingsPanelFactory::createPanel(Project *project)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-02-08 15:50:06 +01:00
|
|
|
Q_ASSERT(supports(project));
|
|
|
|
|
return new RunSettingsPanel(project->activeTarget());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IPropertiesPanel *RunSettingsPanelFactory::createPanel(Target *target)
|
|
|
|
|
{
|
|
|
|
|
return new RunSettingsPanel(target);
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
|
/// RunSettingsPanel
|
|
|
|
|
///
|
|
|
|
|
|
2010-02-08 15:50:06 +01:00
|
|
|
RunSettingsPanel::RunSettingsPanel(Target *target) :
|
|
|
|
|
m_widget(new RunSettingsWidget(target)),
|
2010-02-19 14:16:37 +01:00
|
|
|
m_icon(":/projectexplorer/images/RunSettings.png")
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RunSettingsPanel::~RunSettingsPanel()
|
|
|
|
|
{
|
2009-11-25 15:18:51 +01:00
|
|
|
delete m_widget;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-01-07 18:17:24 +01:00
|
|
|
QString RunSettingsPanel::displayName() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-02-24 16:34:22 +01:00
|
|
|
return QCoreApplication::translate("RunSettingsPanel", "Run Settings");
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2009-11-25 15:57:09 +01:00
|
|
|
QWidget *RunSettingsPanel::widget() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
return m_widget;
|
|
|
|
|
}
|
|
|
|
|
|
2009-11-25 15:57:09 +01:00
|
|
|
QIcon RunSettingsPanel::icon() const
|
|
|
|
|
{
|
|
|
|
|
return m_icon;
|
|
|
|
|
}
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
///
|
|
|
|
|
/// RunConfigurationsModel
|
|
|
|
|
///
|
|
|
|
|
|
|
|
|
|
int RunConfigurationsModel::rowCount(const QModelIndex &parent) const
|
|
|
|
|
{
|
|
|
|
|
return parent.isValid() ? 0 : m_runConfigurations.size();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int RunConfigurationsModel::columnCount(const QModelIndex &parent) const
|
|
|
|
|
{
|
|
|
|
|
return parent.isValid() ? 0 : 1;
|
|
|
|
|
}
|
|
|
|
|
|
2010-01-07 18:17:24 +01:00
|
|
|
void RunConfigurationsModel::displayNameChanged(RunConfiguration *rc)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
for (int i = 0; i<m_runConfigurations.size(); ++i) {
|
2009-10-08 18:37:18 +02:00
|
|
|
if (m_runConfigurations.at(i) == rc) {
|
2008-12-02 12:01:29 +01:00
|
|
|
emit dataChanged(index(i, 0), index(i,0));
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-02-01 15:12:38 +01:00
|
|
|
void RunConfigurationsModel::activeRunConfigurationChanged(RunConfiguration *rc)
|
|
|
|
|
{
|
|
|
|
|
m_activeRunConfiguration = rc;
|
|
|
|
|
emit dataChanged(index(0, 0), index(m_runConfigurations.size()-1, 0));
|
|
|
|
|
}
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
QVariant RunConfigurationsModel::data(const QModelIndex &index, int role) const
|
|
|
|
|
{
|
|
|
|
|
if (role == Qt::DisplayRole) {
|
|
|
|
|
const int row = index.row();
|
|
|
|
|
if (row < m_runConfigurations.size()) {
|
2010-02-01 15:12:38 +01:00
|
|
|
RunConfiguration *rc = m_runConfigurations.at(row);
|
|
|
|
|
if (rc == m_activeRunConfiguration)
|
2010-02-24 16:34:22 +01:00
|
|
|
return QCoreApplication::translate("RunConfigurationsModel", "%1 (Active)").arg(rc->displayName());
|
2010-02-01 15:12:38 +01:00
|
|
|
return rc->displayName();
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return QVariant();
|
|
|
|
|
}
|
|
|
|
|
|
2009-10-08 18:37:18 +02:00
|
|
|
void RunConfigurationsModel::setRunConfigurations(const QList<RunConfiguration *> &runConfigurations)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
m_runConfigurations = runConfigurations;
|
|
|
|
|
reset();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
|
/// RunSettingsWidget
|
|
|
|
|
///
|
|
|
|
|
|
2010-02-08 15:50:06 +01:00
|
|
|
RunSettingsWidget::RunSettingsWidget(Target *target)
|
|
|
|
|
: m_target(target),
|
2008-12-09 15:25:01 +01:00
|
|
|
m_runConfigurationsModel(new RunConfigurationsModel(this)),
|
|
|
|
|
m_runConfigurationWidget(0)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-02-08 15:50:06 +01:00
|
|
|
Q_ASSERT(m_target);
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
m_ui = new Ui::RunSettingsPropertiesPage;
|
|
|
|
|
m_ui->setupUi(this);
|
|
|
|
|
m_addMenu = new QMenu(m_ui->addToolButton);
|
|
|
|
|
m_ui->addToolButton->setMenu(m_addMenu);
|
2009-07-16 15:33:19 +02:00
|
|
|
m_ui->addToolButton->setText(tr("Add"));
|
|
|
|
|
m_ui->removeToolButton->setText(tr("Remove"));
|
2008-12-02 12:01:29 +01:00
|
|
|
m_ui->runConfigurationCombo->setModel(m_runConfigurationsModel);
|
|
|
|
|
|
|
|
|
|
connect(m_addMenu, SIGNAL(aboutToShow()),
|
|
|
|
|
this, SLOT(aboutToShowAddMenu()));
|
|
|
|
|
connect(m_ui->runConfigurationCombo, SIGNAL(currentIndexChanged(int)),
|
2010-02-12 15:15:57 +01:00
|
|
|
this, SLOT(currentRunConfigurationChanged(int)));
|
2008-12-02 12:01:29 +01:00
|
|
|
connect(m_ui->removeToolButton, SIGNAL(clicked(bool)),
|
|
|
|
|
this, SLOT(removeRunConfiguration()));
|
2010-02-12 15:15:57 +01:00
|
|
|
connect(m_ui->makeActiveButton, SIGNAL(clicked()),
|
|
|
|
|
this, SLOT(makeActive()));
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-02-08 15:50:06 +01:00
|
|
|
connect(m_target, SIGNAL(removedRunConfiguration(ProjectExplorer::RunConfiguration *)),
|
2009-06-24 17:27:32 +02:00
|
|
|
this, SLOT(initRunConfigurationComboBox()));
|
2010-02-08 15:50:06 +01:00
|
|
|
connect(m_target, SIGNAL(addedRunConfiguration(ProjectExplorer::RunConfiguration *)),
|
2009-06-23 14:14:29 +02:00
|
|
|
this, SLOT(initRunConfigurationComboBox()));
|
2010-02-08 15:50:06 +01:00
|
|
|
|
|
|
|
|
connect(m_target, SIGNAL(activeRunConfigurationChanged(ProjectExplorer::RunConfiguration*)),
|
2010-02-01 15:12:38 +01:00
|
|
|
this, SLOT(activeRunConfigurationChanged()));
|
2009-10-29 15:56:24 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
initRunConfigurationComboBox();
|
2010-02-08 15:50:06 +01:00
|
|
|
|
|
|
|
|
const QList<RunConfiguration *> runConfigurations = m_target->runConfigurations();
|
2008-12-02 12:01:29 +01:00
|
|
|
for (int i=0; i<runConfigurations.size(); ++i) {
|
2010-01-07 18:17:24 +01:00
|
|
|
connect(runConfigurations.at(i), SIGNAL(displayNameChanged()),
|
|
|
|
|
this, SLOT(displayNameChanged()));
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TODO: Add support for custom runner configuration widgets once we have some
|
|
|
|
|
/*
|
2009-09-25 11:35:44 +02:00
|
|
|
QList<IRunControlFactory *> runners = PluginManager::instance()->getObjects<IRunControlFactory>();
|
|
|
|
|
foreach (IRunControlFactory * runner, runners) {
|
2008-12-02 12:01:29 +01:00
|
|
|
if (runner->canRun(activeRunConfiguration))
|
|
|
|
|
m_ui->layout->addWidget(runner->configurationWidget(activeRunConfiguration));
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RunSettingsWidget::~RunSettingsWidget()
|
|
|
|
|
{
|
|
|
|
|
delete m_ui;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RunSettingsWidget::aboutToShowAddMenu()
|
|
|
|
|
{
|
|
|
|
|
m_addMenu->clear();
|
2008-12-09 15:25:01 +01:00
|
|
|
QList<IRunConfigurationFactory *> factories =
|
|
|
|
|
ExtensionSystem::PluginManager::instance()->getObjects<IRunConfigurationFactory>();
|
|
|
|
|
foreach (IRunConfigurationFactory *factory, factories) {
|
2010-02-08 15:50:06 +01:00
|
|
|
QStringList ids = factory->availableCreationIds(m_target);
|
2010-01-07 18:17:24 +01:00
|
|
|
foreach (const QString &id, ids) {
|
|
|
|
|
QAction *action = m_addMenu->addAction(factory->displayNameForId(id));;
|
|
|
|
|
FactoryAndId fai;
|
|
|
|
|
fai.factory = factory;
|
|
|
|
|
fai.id = id;
|
2008-12-02 12:01:29 +01:00
|
|
|
QVariant v;
|
2010-01-07 18:17:24 +01:00
|
|
|
v.setValue(fai);
|
2008-12-02 12:01:29 +01:00
|
|
|
action->setData(v);
|
|
|
|
|
connect(action, SIGNAL(triggered()),
|
|
|
|
|
this, SLOT(addRunConfiguration()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-02-12 15:15:57 +01:00
|
|
|
RunConfiguration *RunSettingsWidget::currentRunConfiguration() const
|
|
|
|
|
{
|
|
|
|
|
RunConfiguration *currentSelection = 0;
|
|
|
|
|
const int index = m_ui->runConfigurationCombo->currentIndex();
|
|
|
|
|
if (index >= 0)
|
|
|
|
|
currentSelection = m_runConfigurationsModel->runConfigurations().at(index);
|
|
|
|
|
return currentSelection;
|
|
|
|
|
}
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
void RunSettingsWidget::addRunConfiguration()
|
|
|
|
|
{
|
|
|
|
|
QAction *act = qobject_cast<QAction *>(sender());
|
|
|
|
|
if (!act)
|
|
|
|
|
return;
|
2010-01-07 18:17:24 +01:00
|
|
|
FactoryAndId fai = act->data().value<FactoryAndId>();
|
2010-02-08 15:50:06 +01:00
|
|
|
RunConfiguration *newRC = fai.factory->create(m_target, fai.id);
|
2008-12-02 12:01:29 +01:00
|
|
|
if (!newRC)
|
|
|
|
|
return;
|
2010-02-08 15:50:06 +01:00
|
|
|
m_target->addRunConfiguration(newRC);
|
2008-12-02 12:01:29 +01:00
|
|
|
initRunConfigurationComboBox();
|
2009-06-12 12:58:02 +02:00
|
|
|
m_ui->runConfigurationCombo->setCurrentIndex(
|
|
|
|
|
m_runConfigurationsModel->runConfigurations().indexOf(newRC));
|
2010-01-07 18:17:24 +01:00
|
|
|
connect(newRC, SIGNAL(displayNameChanged()), this, SLOT(displayNameChanged()));
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RunSettingsWidget::removeRunConfiguration()
|
|
|
|
|
{
|
2010-02-12 15:15:57 +01:00
|
|
|
RunConfiguration *rc = currentRunConfiguration();
|
2010-01-07 18:17:24 +01:00
|
|
|
disconnect(rc, SIGNAL(displayNameChanged()), this, SLOT(displayNameChanged()));
|
2010-02-08 15:50:06 +01:00
|
|
|
m_target->removeRunConfiguration(rc);
|
2008-12-02 12:01:29 +01:00
|
|
|
initRunConfigurationComboBox();
|
|
|
|
|
}
|
|
|
|
|
|
2010-02-12 15:15:57 +01:00
|
|
|
void RunSettingsWidget::makeActive()
|
|
|
|
|
{
|
|
|
|
|
m_target->setActiveRunConfiguration(currentRunConfiguration());
|
|
|
|
|
}
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
void RunSettingsWidget::initRunConfigurationComboBox()
|
|
|
|
|
{
|
2010-02-08 15:50:06 +01:00
|
|
|
const QList<RunConfiguration *> &runConfigurations = m_target->runConfigurations();
|
|
|
|
|
RunConfiguration *activeRunConfiguration = m_target->activeRunConfiguration();
|
2010-02-12 15:15:57 +01:00
|
|
|
RunConfiguration *currentSelection = currentRunConfiguration();
|
2009-10-08 18:37:18 +02:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
m_runConfigurationsModel->setRunConfigurations(runConfigurations);
|
2009-06-12 12:58:02 +02:00
|
|
|
if (runConfigurations.contains(currentSelection))
|
|
|
|
|
m_ui->runConfigurationCombo->setCurrentIndex(runConfigurations.indexOf(currentSelection));
|
|
|
|
|
else
|
|
|
|
|
m_ui->runConfigurationCombo->setCurrentIndex(runConfigurations.indexOf(activeRunConfiguration));
|
2008-12-02 12:01:29 +01:00
|
|
|
m_ui->removeToolButton->setEnabled(runConfigurations.size() > 1);
|
2010-02-01 15:12:38 +01:00
|
|
|
activeRunConfigurationChanged();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RunSettingsWidget::activeRunConfigurationChanged()
|
|
|
|
|
{
|
2010-02-08 15:50:06 +01:00
|
|
|
m_runConfigurationsModel->activeRunConfigurationChanged(m_target->activeRunConfiguration());
|
2010-02-12 15:15:57 +01:00
|
|
|
m_ui->makeActiveButton->setEnabled(currentRunConfiguration()
|
|
|
|
|
&& currentRunConfiguration() != m_target->activeRunConfiguration());
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2010-02-12 15:15:57 +01:00
|
|
|
void RunSettingsWidget::currentRunConfigurationChanged(int index)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-02-12 15:15:57 +01:00
|
|
|
m_ui->makeActiveButton->setEnabled(currentRunConfiguration()
|
|
|
|
|
&& currentRunConfiguration() != m_target->activeRunConfiguration());
|
|
|
|
|
|
2009-11-03 16:23:40 +01:00
|
|
|
if (index == -1) {
|
|
|
|
|
delete m_runConfigurationWidget;
|
|
|
|
|
m_runConfigurationWidget = 0;
|
|
|
|
|
return;
|
|
|
|
|
}
|
2009-10-08 18:37:18 +02:00
|
|
|
RunConfiguration *selectedRunConfiguration =
|
2009-06-12 12:58:02 +02:00
|
|
|
m_runConfigurationsModel->runConfigurations().at(index);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
// Update the run configuration configuration widget
|
|
|
|
|
delete m_runConfigurationWidget;
|
|
|
|
|
m_runConfigurationWidget = selectedRunConfiguration->configurationWidget();
|
2009-09-17 13:59:10 +02:00
|
|
|
layout()->addWidget(m_runConfigurationWidget);
|
2009-04-15 14:52:31 +02:00
|
|
|
}
|
|
|
|
|
|
2010-01-07 18:17:24 +01:00
|
|
|
void RunSettingsWidget::displayNameChanged()
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
RunConfiguration *rc = qobject_cast<RunConfiguration *>(sender());
|
2010-01-07 18:17:24 +01:00
|
|
|
m_runConfigurationsModel->displayNameChanged(rc);
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|