2009-02-25 09:15:00 +01:00
|
|
|
/**************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** Copyright (c) 2009 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-06-17 00:01:27 +10:00
|
|
|
** contact the sales department at http://www.qtsoftware.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 "qt4buildenvironmentwidget.h"
|
|
|
|
|
#include "qt4project.h"
|
2008-12-02 16:19:05 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
#include <projectexplorer/environmenteditmodel.h>
|
|
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
bool debug = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
using namespace Qt4ProjectManager;
|
|
|
|
|
using namespace Qt4ProjectManager::Internal;
|
|
|
|
|
|
|
|
|
|
Qt4BuildEnvironmentWidget::Qt4BuildEnvironmentWidget(Qt4Project *project)
|
|
|
|
|
: BuildStepConfigWidget(), m_pro(project)
|
|
|
|
|
{
|
2009-05-26 14:02:16 +02:00
|
|
|
QVBoxLayout *vbox = new QVBoxLayout(this);
|
2009-07-22 16:33:59 +02:00
|
|
|
vbox->setMargin(0);
|
2009-05-26 17:21:02 +02:00
|
|
|
|
|
|
|
|
m_clearSystemEnvironmentCheckBox = new QCheckBox(this);
|
|
|
|
|
m_clearSystemEnvironmentCheckBox->setText("Clear system environment");
|
|
|
|
|
vbox->addWidget(m_clearSystemEnvironmentCheckBox);
|
2009-07-20 15:46:11 +02:00
|
|
|
m_clearSystemEnvironmentCheckBox->setVisible(false);
|
2009-05-26 17:21:02 +02:00
|
|
|
|
2009-05-26 14:02:16 +02:00
|
|
|
m_buildEnvironmentWidget = new ProjectExplorer::EnvironmentWidget(this);
|
|
|
|
|
vbox->addWidget(m_buildEnvironmentWidget);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2009-05-26 14:02:16 +02:00
|
|
|
connect(m_buildEnvironmentWidget, SIGNAL(userChangesUpdated()),
|
2008-12-02 12:01:29 +01:00
|
|
|
this, SLOT(environmentModelUserChangesUpdated()));
|
2009-07-20 15:46:11 +02:00
|
|
|
|
|
|
|
|
connect(m_buildEnvironmentWidget, SIGNAL(switchedToDetails()),
|
|
|
|
|
m_clearSystemEnvironmentCheckBox, SLOT(show()));
|
|
|
|
|
|
|
|
|
|
connect(m_buildEnvironmentWidget, SIGNAL(switchedToSummary()),
|
|
|
|
|
m_clearSystemEnvironmentCheckBox, SLOT(hide()));
|
|
|
|
|
|
2009-05-26 17:21:02 +02:00
|
|
|
connect(m_clearSystemEnvironmentCheckBox, SIGNAL(toggled(bool)),
|
2008-12-02 12:01:29 +01:00
|
|
|
this, SLOT(clearSystemEnvironmentCheckBoxClicked(bool)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString Qt4BuildEnvironmentWidget::displayName() const
|
|
|
|
|
{
|
|
|
|
|
return tr("Build Environment");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Qt4BuildEnvironmentWidget::init(const QString &buildConfiguration)
|
|
|
|
|
{
|
|
|
|
|
if (debug)
|
|
|
|
|
qDebug() << "Qt4BuildConfigWidget::init()";
|
|
|
|
|
|
|
|
|
|
m_buildConfiguration = buildConfiguration;
|
|
|
|
|
|
2009-05-26 17:21:02 +02:00
|
|
|
m_clearSystemEnvironmentCheckBox->setChecked(!m_pro->useSystemEnvironment(buildConfiguration));
|
2009-05-26 14:02:16 +02:00
|
|
|
m_buildEnvironmentWidget->setBaseEnvironment(m_pro->baseEnvironment(buildConfiguration));
|
|
|
|
|
m_buildEnvironmentWidget->setUserChanges(m_pro->userEnvironmentChanges(buildConfiguration));
|
|
|
|
|
m_buildEnvironmentWidget->updateButtons();
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2009-05-26 14:02:16 +02:00
|
|
|
void Qt4BuildEnvironmentWidget::environmentModelUserChangesUpdated()
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-05-26 14:02:16 +02:00
|
|
|
m_pro->setUserEnvironmentChanges(m_buildConfiguration, m_buildEnvironmentWidget->userChanges());
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Qt4BuildEnvironmentWidget::clearSystemEnvironmentCheckBoxClicked(bool checked)
|
|
|
|
|
{
|
|
|
|
|
m_pro->setUseSystemEnvironment(m_buildConfiguration, !checked);
|
2009-05-26 14:02:16 +02:00
|
|
|
m_buildEnvironmentWidget->setBaseEnvironment(m_pro->baseEnvironment(m_buildConfiguration));
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|