2011-11-29 14:19:28 +01:00
|
|
|
/**************************************************************************
|
|
|
|
|
**
|
2014-01-07 13:27:11 +01:00
|
|
|
** Copyright (C) 2014 Openismus GmbH.
|
2012-10-02 09:12:39 +02:00
|
|
|
** Authors: Peter Penz (ppenz@openismus.com)
|
|
|
|
|
** Patricia Santana Cruz (patriciasantanacruz@gmail.com)
|
|
|
|
|
** Contact: http://www.qt-project.org/legal
|
2011-11-29 14:19:28 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2011-11-29 14:19:28 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and Digia. For licensing terms and
|
|
|
|
|
** conditions see http://qt.digia.com/licensing. For further information
|
|
|
|
|
** use the contact form at http://qt.digia.com/contact-us.
|
2011-11-29 14:19:28 +01:00
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
2012-10-02 09:12:39 +02: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.
|
|
|
|
|
**
|
|
|
|
|
** In addition, as a special exception, Digia gives you certain additional
|
|
|
|
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
2011-11-29 14:19:28 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2011-11-29 14:19:28 +01:00
|
|
|
|
|
|
|
|
#include "autotoolsbuildsettingswidget.h"
|
|
|
|
|
#include "autotoolsproject.h"
|
|
|
|
|
#include "autotoolsbuildconfiguration.h"
|
|
|
|
|
|
|
|
|
|
#include <projectexplorer/projectexplorer.h>
|
2012-04-24 15:49:09 +02:00
|
|
|
#include <projectexplorer/target.h>
|
2011-11-29 14:19:28 +01:00
|
|
|
|
2012-07-25 09:48:48 +02:00
|
|
|
#include <utils/pathchooser.h>
|
|
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QGridLayout>
|
|
|
|
|
#include <QLabel>
|
|
|
|
|
#include <QLineEdit>
|
|
|
|
|
#include <QFormLayout>
|
|
|
|
|
#include <QComboBox>
|
|
|
|
|
#include <QPointer>
|
2011-11-29 14:19:28 +01:00
|
|
|
|
|
|
|
|
using namespace AutotoolsProjectManager;
|
|
|
|
|
using namespace AutotoolsProjectManager::Internal;
|
|
|
|
|
using namespace ProjectExplorer;
|
|
|
|
|
|
2012-11-08 17:35:59 +01:00
|
|
|
AutotoolsBuildSettingsWidget::AutotoolsBuildSettingsWidget(AutotoolsBuildConfiguration *bc) :
|
2013-01-08 19:18:39 +04:00
|
|
|
m_buildConfiguration(bc)
|
2011-11-29 14:19:28 +01:00
|
|
|
{
|
|
|
|
|
QFormLayout *fl = new QFormLayout(this);
|
|
|
|
|
fl->setContentsMargins(0, 0, 0, 0);
|
|
|
|
|
fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
|
|
|
|
|
|
|
|
|
|
m_pathChooser = new Utils::PathChooser(this);
|
|
|
|
|
m_pathChooser->setEnabled(true);
|
|
|
|
|
m_pathChooser->setExpectedKind(Utils::PathChooser::Directory);
|
2013-08-16 17:45:16 +02:00
|
|
|
m_pathChooser->setBaseDirectory(bc->target()->project()->projectDirectory());
|
|
|
|
|
m_pathChooser->setEnvironment(bc->environment());
|
2013-11-25 14:31:31 +01:00
|
|
|
m_pathChooser->setHistoryCompleter(QLatin1String("AutoTools.BuildDir.History"));
|
2011-11-29 14:19:28 +01:00
|
|
|
fl->addRow(tr("Build directory:"), m_pathChooser);
|
|
|
|
|
connect(m_pathChooser, SIGNAL(changed(QString)), this, SLOT(buildDirectoryChanged()));
|
2012-11-08 17:35:59 +01:00
|
|
|
|
|
|
|
|
m_pathChooser->setBaseDirectory(bc->target()->project()->projectDirectory());
|
2013-08-16 17:45:16 +02:00
|
|
|
m_pathChooser->setPath(m_buildConfiguration->rawBuildDirectory().toString());
|
2012-11-08 17:46:42 +01:00
|
|
|
setDisplayName(tr("Autotools Manager"));
|
2013-08-16 17:45:16 +02:00
|
|
|
|
|
|
|
|
connect(bc, SIGNAL(environmentChanged()), this, SLOT(environmentHasChanged()));
|
2011-11-29 14:19:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AutotoolsBuildSettingsWidget::buildDirectoryChanged()
|
|
|
|
|
{
|
2013-08-16 17:45:16 +02:00
|
|
|
m_buildConfiguration->setBuildDirectory(Utils::FileName::fromString(m_pathChooser->rawPath()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AutotoolsBuildSettingsWidget::environmentHasChanged()
|
|
|
|
|
{
|
|
|
|
|
m_pathChooser->setEnvironment(m_buildConfiguration->environment());
|
2011-11-29 14:19:28 +01:00
|
|
|
}
|