aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/autotoolsprojectmanager
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2019-04-26 17:06:23 +0200
committerhjk <hjk@qt.io>2019-04-29 09:04:45 +0000
commit3941f0593b94f8003760c6d9cbe59f684ab30372 (patch)
tree212918c6eed28694c147bb87f32288e043f658e1 /src/plugins/autotoolsprojectmanager
parent6798cf0b9fa9c8f58d2eb9dbc25bf6638e02693d (diff)
AutoTools: Use the base BuildConfiguration config widget
Change-Id: I928b9bc7adc3424008ead27fe8457d345e1bcda5 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/autotoolsprojectmanager')
-rw-r--r--src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp26
-rw-r--r--src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.h1
-rw-r--r--src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.cpp81
-rw-r--r--src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.h64
-rw-r--r--src/plugins/autotoolsprojectmanager/autotoolsprojectmanager.pro2
-rw-r--r--src/plugins/autotoolsprojectmanager/autotoolsprojectmanager.qbs2
6 files changed, 15 insertions, 161 deletions
diff --git a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp
index 33ebf0f188..8ea2db675e 100644
--- a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp
+++ b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp
@@ -26,7 +26,6 @@
****************************************************************************/
#include "autotoolsbuildconfiguration.h"
-#include "autotoolsbuildsettingswidget.h"
#include "makestep.h"
#include "autotoolsproject.h"
#include "autotoolsprojectconstants.h"
@@ -44,15 +43,13 @@
#include <utils/mimetypes/mimedatabase.h>
#include <utils/qtcassert.h>
-#include <QFileInfo>
-#include <QInputDialog>
-
-using namespace AutotoolsProjectManager;
using namespace AutotoolsProjectManager::Constants;
-using namespace Internal;
using namespace ProjectExplorer;
using namespace ProjectExplorer::Constants;
+using namespace Utils;
+namespace AutotoolsProjectManager {
+namespace Internal {
// AutotoolsBuildConfiguration
@@ -62,6 +59,15 @@ AutotoolsBuildConfiguration::AutotoolsBuildConfiguration(Target *parent, Core::I
// /<foobar> is used so the un-changed check in setBuildDirectory() works correctly.
// The leading / is to avoid the relative the path expansion in BuildConfiguration::buildDirectory.
setBuildDirectory(Utils::FileName::fromString("/<foobar>"));
+ setConfigWidgetDisplayName(tr("Autotools Manager"));
+
+ BaseStringAspect *bd = buildDirectoryAspect();
+ bd->setLabelText(tr("Build directory:"));
+ bd->setDisplayStyle(BaseStringAspect::PathChooserDisplay);
+ bd->setExpectedKind(PathChooser::Directory);
+ bd->setBaseFileName(parent->project()->projectDirectory());
+ bd->setEnvironment(environment());
+ bd->setHistoryCompleter("AutoTools.BuildDir.History");
}
void AutotoolsBuildConfiguration::initialize(const BuildInfo &info)
@@ -97,11 +103,6 @@ void AutotoolsBuildConfiguration::initialize(const BuildInfo &info)
cleanSteps->appendStep(cleanMakeStep);
}
-NamedWidget *AutotoolsBuildConfiguration::createConfigWidget()
-{
- return new AutotoolsBuildSettingsWidget(this);
-}
-
// AutotoolsBuildConfiguration class
@@ -143,3 +144,6 @@ BuildConfiguration::BuildType AutotoolsBuildConfiguration::buildType() const
// TODO: Should I return something different from Unknown?
return Unknown;
}
+
+} // Internal
+} // AutotoolsProjectManager
diff --git a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.h b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.h
index 2cd784c235..b2f02cbd0e 100644
--- a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.h
+++ b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.h
@@ -42,7 +42,6 @@ class AutotoolsBuildConfiguration : public ProjectExplorer::BuildConfiguration
AutotoolsBuildConfiguration(ProjectExplorer::Target *parent, Core::Id id);
void initialize(const ProjectExplorer::BuildInfo &info) override;
- ProjectExplorer::NamedWidget *createConfigWidget() override;
BuildType buildType() const override;
};
diff --git a/src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.cpp b/src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.cpp
deleted file mode 100644
index 08eb39d7ee..0000000000
--- a/src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Openismus GmbH.
-** Author: Peter Penz (ppenz@openismus.com)
-** Author: Patricia Santana Cruz (patriciasantanacruz@gmail.com)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt Creator.
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-****************************************************************************/
-
-#include "autotoolsbuildsettingswidget.h"
-#include "autotoolsproject.h"
-#include "autotoolsbuildconfiguration.h"
-
-#include <projectexplorer/projectexplorer.h>
-#include <projectexplorer/target.h>
-
-#include <utils/pathchooser.h>
-
-#include <QGridLayout>
-#include <QLabel>
-#include <QLineEdit>
-#include <QFormLayout>
-#include <QComboBox>
-#include <QPointer>
-
-using namespace AutotoolsProjectManager;
-using namespace AutotoolsProjectManager::Internal;
-using namespace ProjectExplorer;
-
-AutotoolsBuildSettingsWidget::AutotoolsBuildSettingsWidget(AutotoolsBuildConfiguration *bc) :
- m_pathChooser(new Utils::PathChooser),
- m_buildConfiguration(bc)
-{
- auto fl = new QFormLayout(this);
- fl->setContentsMargins(0, 0, 0, 0);
- fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
-
- m_pathChooser->setEnabled(true);
- m_pathChooser->setExpectedKind(Utils::PathChooser::Directory);
- m_pathChooser->setBaseFileName(bc->target()->project()->projectDirectory());
- m_pathChooser->setEnvironment(bc->environment());
- m_pathChooser->setHistoryCompleter(QLatin1String("AutoTools.BuildDir.History"));
- fl->addRow(tr("Build directory:"), m_pathChooser);
- connect(m_pathChooser, &Utils::PathChooser::rawPathChanged,
- this, &AutotoolsBuildSettingsWidget::buildDirectoryChanged);
-
- m_pathChooser->setBaseFileName(bc->target()->project()->projectDirectory());
- m_pathChooser->setPath(m_buildConfiguration->rawBuildDirectory().toString());
- setDisplayName(tr("Autotools Manager"));
-
- connect(bc, &BuildConfiguration::environmentChanged,
- this, &AutotoolsBuildSettingsWidget::environmentHasChanged);
-}
-
-void AutotoolsBuildSettingsWidget::buildDirectoryChanged()
-{
- m_buildConfiguration->setBuildDirectory(Utils::FileName::fromString(m_pathChooser->rawPath()));
-}
-
-void AutotoolsBuildSettingsWidget::environmentHasChanged()
-{
- m_pathChooser->setEnvironment(m_buildConfiguration->environment());
-}
diff --git a/src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.h b/src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.h
deleted file mode 100644
index 8419a57962..0000000000
--- a/src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Openismus GmbH.
-** Author: Peter Penz (ppenz@openismus.com)
-** Author: Patricia Santana Cruz (patriciasantanacruz@gmail.com)
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt Creator.
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-****************************************************************************/
-
-#pragma once
-
-#include <projectexplorer/namedwidget.h>
-
-QT_BEGIN_NAMESPACE
-class QComboBox;
-QT_END_NAMESPACE
-
-namespace Utils { class PathChooser; }
-
-namespace AutotoolsProjectManager {
-namespace Internal {
-
-class AutotoolsBuildConfiguration;
-
-/**
- * @brief Implementation of ProjectExplorer::BuildConfigWidget interface.
- *
- * Provides an editor to configure the build directory and build steps.
- */
-class AutotoolsBuildSettingsWidget : public ProjectExplorer::NamedWidget
-{
- Q_OBJECT
-
-public:
- AutotoolsBuildSettingsWidget(AutotoolsBuildConfiguration *bc);
-
-private:
- void buildDirectoryChanged();
- void environmentHasChanged();
-
- Utils::PathChooser *m_pathChooser;
- AutotoolsBuildConfiguration *m_buildConfiguration;
-};
-
-} // namespace Internal
-} // namespace AutotoolsProjectManager
diff --git a/src/plugins/autotoolsprojectmanager/autotoolsprojectmanager.pro b/src/plugins/autotoolsprojectmanager/autotoolsprojectmanager.pro
index 8082c55c3f..92b6dd8e7d 100644
--- a/src/plugins/autotoolsprojectmanager/autotoolsprojectmanager.pro
+++ b/src/plugins/autotoolsprojectmanager/autotoolsprojectmanager.pro
@@ -3,7 +3,6 @@ include(../../qtcreatorplugin.pri)
HEADERS = autotoolsprojectplugin.h\
autotoolsopenprojectwizard.h\
autotoolsproject.h\
- autotoolsbuildsettingswidget.h\
autotoolsbuildconfiguration.h\
autotoolsprojectconstants.h\
makestep.h\
@@ -16,7 +15,6 @@ HEADERS = autotoolsprojectplugin.h\
SOURCES = autotoolsprojectplugin.cpp\
autotoolsopenprojectwizard.cpp\
autotoolsproject.cpp\
- autotoolsbuildsettingswidget.cpp\
autotoolsbuildconfiguration.cpp\
makestep.cpp\
autogenstep.cpp\
diff --git a/src/plugins/autotoolsprojectmanager/autotoolsprojectmanager.qbs b/src/plugins/autotoolsprojectmanager/autotoolsprojectmanager.qbs
index f2354d52db..a6e4a2721b 100644
--- a/src/plugins/autotoolsprojectmanager/autotoolsprojectmanager.qbs
+++ b/src/plugins/autotoolsprojectmanager/autotoolsprojectmanager.qbs
@@ -18,8 +18,6 @@ QtcPlugin {
"autoreconfstep.h",
"autotoolsbuildconfiguration.cpp",
"autotoolsbuildconfiguration.h",
- "autotoolsbuildsettingswidget.cpp",
- "autotoolsbuildsettingswidget.h",
"autotoolsopenprojectwizard.cpp",
"autotoolsopenprojectwizard.h",
"autotoolsproject.cpp",