2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2010-12-10 19:02:19 +01:00
|
|
|
**
|
2013-01-28 17:12:19 +01:00
|
|
|
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
2012-10-02 09:12:39 +02:00
|
|
|
** Contact: http://www.qt-project.org/legal
|
2010-12-10 19:02:19 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2010-12-10 19:02:19 +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.
|
2010-12-10 19:02:19 +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-02-17 17:53:52 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2010-12-10 19:02:19 +01:00
|
|
|
|
2012-09-03 18:31:44 +02:00
|
|
|
#include "qmakekitconfigwidget.h"
|
2010-12-10 19:02:19 +01:00
|
|
|
|
2012-09-03 18:31:44 +02:00
|
|
|
#include "qmakekitinformation.h"
|
2010-12-10 19:02:19 +01:00
|
|
|
|
2013-03-25 17:13:18 +01:00
|
|
|
#include <utils/fileutils.h>
|
|
|
|
|
|
2012-04-24 15:49:09 +02:00
|
|
|
#include <QLineEdit>
|
2010-12-10 19:02:19 +01:00
|
|
|
|
2012-04-24 15:49:09 +02:00
|
|
|
namespace Qt4ProjectManager {
|
2010-12-10 19:02:19 +01:00
|
|
|
namespace Internal {
|
|
|
|
|
|
2013-05-06 17:11:33 +02:00
|
|
|
QmakeKitConfigWidget::QmakeKitConfigWidget(ProjectExplorer::Kit *k, bool sticky) :
|
|
|
|
|
ProjectExplorer::KitConfigWidget(k, sticky),
|
2013-01-21 15:44:59 +01:00
|
|
|
m_lineEdit(new QLineEdit),
|
|
|
|
|
m_ignoreChange(false)
|
2010-12-10 19:02:19 +01:00
|
|
|
{
|
2012-10-10 15:34:35 +02:00
|
|
|
refresh(); // set up everything according to kit
|
2013-06-20 15:40:55 +02:00
|
|
|
m_lineEdit->setToolTip(toolTip());
|
2012-10-10 15:34:35 +02:00
|
|
|
connect(m_lineEdit, SIGNAL(textEdited(QString)), this, SLOT(mkspecWasChanged(QString)));
|
2012-04-24 15:49:09 +02:00
|
|
|
}
|
2010-12-10 19:02:19 +01:00
|
|
|
|
2012-11-16 13:30:59 +01:00
|
|
|
QWidget *QmakeKitConfigWidget::mainWidget() const
|
|
|
|
|
{
|
|
|
|
|
return m_lineEdit;
|
|
|
|
|
}
|
|
|
|
|
|
2012-09-03 18:31:44 +02:00
|
|
|
QString QmakeKitConfigWidget::displayName() const
|
2012-04-24 15:49:09 +02:00
|
|
|
{
|
2012-06-22 14:02:16 +02:00
|
|
|
return tr("Qt mkspec:");
|
2012-04-24 15:49:09 +02:00
|
|
|
}
|
2010-12-10 19:02:19 +01:00
|
|
|
|
2012-11-16 13:30:59 +01:00
|
|
|
QString QmakeKitConfigWidget::toolTip() const
|
|
|
|
|
{
|
|
|
|
|
return tr("The mkspec to use when building the project with qmake.<br>"
|
|
|
|
|
"This setting is ignored when using other build systems.");
|
|
|
|
|
}
|
|
|
|
|
|
2012-09-03 18:31:44 +02:00
|
|
|
void QmakeKitConfigWidget::makeReadOnly()
|
2012-04-24 15:49:09 +02:00
|
|
|
{
|
|
|
|
|
m_lineEdit->setEnabled(false);
|
|
|
|
|
}
|
2010-12-10 19:02:19 +01:00
|
|
|
|
2012-10-10 15:34:35 +02:00
|
|
|
void QmakeKitConfigWidget::refresh()
|
2012-04-24 15:49:09 +02:00
|
|
|
{
|
2013-01-21 15:44:59 +01:00
|
|
|
if (!m_ignoreChange)
|
|
|
|
|
m_lineEdit->setText(QmakeKitInformation::mkspec(m_kit).toUserOutput());
|
2012-04-24 15:49:09 +02:00
|
|
|
}
|
|
|
|
|
|
2012-10-10 15:34:35 +02:00
|
|
|
void QmakeKitConfigWidget::mkspecWasChanged(const QString &text)
|
2012-04-24 15:49:09 +02:00
|
|
|
{
|
2013-01-21 15:44:59 +01:00
|
|
|
m_ignoreChange = true;
|
2012-10-10 15:34:35 +02:00
|
|
|
QmakeKitInformation::setMkspec(m_kit, Utils::FileName::fromString(text));
|
2013-01-21 15:44:59 +01:00
|
|
|
m_ignoreChange = false;
|
2012-04-24 15:49:09 +02:00
|
|
|
}
|
2010-12-10 19:02:19 +01:00
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Qt4ProjectManager
|