diff --git a/src/plugins/docker/CMakeLists.txt b/src/plugins/docker/CMakeLists.txt index 095d7b41c77..e89c5b5ee23 100644 --- a/src/plugins/docker/CMakeLists.txt +++ b/src/plugins/docker/CMakeLists.txt @@ -4,12 +4,7 @@ add_qtc_plugin(Docker docker_global.h dockerbuildstep.cpp dockerbuildstep.h dockerconstants.h - dockerdevice.cpp - dockerdevice.h - dockerplugin.cpp - dockerplugin.h - dockerrunconfiguration.cpp - dockerrunconfiguration.h - dockersettings.cpp - dockersettings.h + dockerdevice.cpp dockerdevice.h + dockerplugin.cpp dockerplugin.h + dockersettings.cpp dockersettings.h ) diff --git a/src/plugins/docker/docker.pro b/src/plugins/docker/docker.pro index ac012006b73..49ddfcd9a02 100644 --- a/src/plugins/docker/docker.pro +++ b/src/plugins/docker/docker.pro @@ -6,7 +6,6 @@ SOURCES += \ dockerbuildstep.cpp \ dockerdevice.cpp \ dockerplugin.cpp \ - dockerrunconfiguration.cpp \ dockersettings.cpp HEADERS += \ @@ -15,5 +14,4 @@ HEADERS += \ dockerconstants.h \ dockerdevice.h \ dockerplugin.h \ - dockerrunconfiguration.h \ dockersettings.h diff --git a/src/plugins/docker/docker.qbs b/src/plugins/docker/docker.qbs index 93ea8a84bae..60c31290630 100644 --- a/src/plugins/docker/docker.qbs +++ b/src/plugins/docker/docker.qbs @@ -19,8 +19,6 @@ QtcPlugin { "dockerdevice.cpp", "dockerplugin.h", "dockerplugin.cpp", - "dockerrunconfiguration.h", - "dockerrunconfiguration.cpp", "dockersettings.h", "dockersettings.cpp" ] diff --git a/src/plugins/docker/dockerplugin.cpp b/src/plugins/docker/dockerplugin.cpp index b1fea6e45e7..d195c81d6b3 100644 --- a/src/plugins/docker/dockerplugin.cpp +++ b/src/plugins/docker/dockerplugin.cpp @@ -29,11 +29,9 @@ #include "dockerbuildstep.h" #include "dockerdevice.h" -#include "dockerrunconfiguration.h" #include "dockersettings.h" #include -#include using namespace Core; using namespace ProjectExplorer; @@ -49,13 +47,6 @@ public: // DockerOptionsPage optionsPage{&settings}; DockerDeviceFactory deviceFactory; -// DockerContainerRunConfigurationFactory containerRunConfigFactory; - -// RunWorkerFactory containerRunWorkerFactory{ -// RunWorkerFactory::make(), -// {ProjectExplorer::Constants::NORMAL_RUN_MODE}, -// {containerRunConfigFactory.runConfigurationId()} -// }; // DockerBuildStepFactory buildStepFactory; Utils::optional daemonRunning; diff --git a/src/plugins/docker/dockerrunconfiguration.cpp b/src/plugins/docker/dockerrunconfiguration.cpp deleted file mode 100644 index c9018ae84b1..00000000000 --- a/src/plugins/docker/dockerrunconfiguration.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** 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 "dockerrunconfiguration.h" - -#include "dockerconstants.h" -#include "dockerdevice.h" - -#include -#include -#include -#include -#include - -#include - -using namespace ProjectExplorer; -using namespace Utils; - -namespace Docker { -namespace Internal { - -class DockerContainerRunConfiguration : public RunConfiguration -{ - Q_DECLARE_TR_FUNCTIONS(Docker::Internal::DockerRunConfiguration) - -public: - DockerContainerRunConfiguration(Target *target, Id id) - : RunConfiguration(target, id) - { - auto rmOption = addAspect(); - rmOption->setSettingsKey("Docker.RunConfiguration.RmOption"); - rmOption->setDefaultValue(true); - rmOption->setLabelText(tr("Automatically remove the container when it exits")); - - auto ttyOption = addAspect(); - ttyOption->setSettingsKey("Docker.RunConfiguration.TtyOption"); - ttyOption->setLabelText(tr("Allocate a pseudo-TTY")); - ttyOption->setVisible(false); // Not yet. - - auto interactiveOption = addAspect(); - interactiveOption->setSettingsKey("Docker.RunConfiguration.InteractiveOption"); - interactiveOption->setLabelText(tr("Keep STDIN open even if not attached")); - interactiveOption->setVisible(false); // Not yet. - - auto effectiveCommand = addAspect(); - effectiveCommand->setLabelText(tr("Effective command call:")); - effectiveCommand->setDisplayStyle(StringAspect::TextEditDisplay); - effectiveCommand->setReadOnly(true); - - setUpdater([this, effectiveCommand] { - IDevice::ConstPtr device = DeviceKitAspect::device(kit()); - QTC_ASSERT(device, return); - DockerDevice::ConstPtr dockerDevice = qSharedPointerCast(device); - QTC_ASSERT(dockerDevice, return); - const DockerDeviceData &data = dockerDevice->data(); - - const Runnable r = runnable(); - const QStringList dockerRunFlags = r.extraData[Constants::DOCKER_RUN_FLAGS].toStringList(); - - CommandLine cmd("docker"); - cmd.addArg("run"); - cmd.addArgs(dockerRunFlags); - cmd.addArg(data.imageId); - - // FIXME: the global one above is apparently not sufficient. - effectiveCommand->setReadOnly(true); - effectiveCommand->setValue(cmd.toUserOutput()); - }); - - setRunnableModifier([rmOption, interactiveOption, ttyOption](Runnable &runnable) { - QStringList runArgs; - if (!rmOption->value()) - runArgs.append("--rm=false"); - if (interactiveOption->value()) - runArgs.append("--interactive"); - if (ttyOption->value()) - runArgs.append("--tty"); - runnable.extraData[Constants::DOCKER_RUN_FLAGS].toStringList(); - }); - - setCommandLineGetter([] { - return CommandLine(); - }); - - update(); - connect(rmOption, &BaseAspect::changed, this, &RunConfiguration::update); - } - -private: - bool isEnabled() const override { return true; } -}; - - -DockerContainerRunConfigurationFactory::DockerContainerRunConfigurationFactory() : - FixedRunConfigurationFactory(DockerContainerRunConfiguration::tr("Docker Container")) -{ - registerRunConfiguration - ("Docker.DockerContainerRunConfiguration"); - addSupportedTargetDeviceType(Constants::DOCKER_DEVICE_TYPE); -} - -} // Internal -} // Docker diff --git a/src/plugins/docker/dockerrunconfiguration.h b/src/plugins/docker/dockerrunconfiguration.h deleted file mode 100644 index 37eef9ba6c9..00000000000 --- a/src/plugins/docker/dockerrunconfiguration.h +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** 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 - -namespace Docker { -namespace Internal { - -class DockerContainerRunConfigurationFactory - : public ProjectExplorer::FixedRunConfigurationFactory -{ -public: - DockerContainerRunConfigurationFactory(); -}; - -} // Internal -} // Docker