2021-03-18 08:52:42 +01:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2022-07-04 11:09:11 +02:00
|
|
|
** Copyright (C) 2022 The Qt Company Ltd.
|
2021-03-18 08:52:42 +01:00
|
|
|
** 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 "dockersettings.h"
|
|
|
|
|
|
2022-07-04 11:09:11 +02:00
|
|
|
#include "dockerconstants.h"
|
|
|
|
|
|
2021-03-18 08:52:42 +01:00
|
|
|
#include <coreplugin/icore.h>
|
|
|
|
|
|
|
|
|
|
#include <projectexplorer/projectexplorerconstants.h>
|
|
|
|
|
|
2022-07-04 11:09:11 +02:00
|
|
|
#include <utils/filepath.h>
|
2021-03-18 08:52:42 +01:00
|
|
|
#include <utils/layoutbuilder.h>
|
|
|
|
|
|
|
|
|
|
using namespace Utils;
|
|
|
|
|
|
|
|
|
|
namespace Docker {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
DockerSettings::DockerSettings()
|
|
|
|
|
{
|
2022-07-04 11:09:11 +02:00
|
|
|
setSettingsGroup(Constants::DOCKER);
|
2021-03-18 08:52:42 +01:00
|
|
|
setAutoApply(false);
|
|
|
|
|
|
2022-07-04 11:09:11 +02:00
|
|
|
registerAspect(&dockerBinaryPath);
|
|
|
|
|
dockerBinaryPath.setDisplayStyle(StringAspect::PathChooserDisplay);
|
|
|
|
|
dockerBinaryPath.setExpectedKind(PathChooser::ExistingCommand);
|
2022-07-07 08:25:03 +02:00
|
|
|
dockerBinaryPath.setDefaultFilePath(FilePath::fromString("docker").searchInPath({"/usr/local/bin"}));
|
2022-07-04 11:09:11 +02:00
|
|
|
dockerBinaryPath.setDisplayName(tr("Docker CLI"));
|
|
|
|
|
dockerBinaryPath.setHistoryCompleter("Docker.Command.History");
|
|
|
|
|
dockerBinaryPath.setLabelText(tr("Command:"));
|
|
|
|
|
dockerBinaryPath.setSettingsKey("cli");
|
2021-03-18 08:52:42 +01:00
|
|
|
|
2022-07-04 11:09:11 +02:00
|
|
|
readSettings(Core::ICore::settings());
|
2021-03-18 08:52:42 +01:00
|
|
|
}
|
|
|
|
|
|
2022-07-04 11:09:11 +02:00
|
|
|
// DockerSettingsPage
|
2021-03-18 08:52:42 +01:00
|
|
|
|
2022-07-04 14:24:51 +02:00
|
|
|
DockerSettingsPage::DockerSettingsPage(DockerSettings *settings)
|
2021-03-18 08:52:42 +01:00
|
|
|
{
|
2022-07-04 11:09:11 +02:00
|
|
|
setId(Docker::Constants::DOCKER_SETTINGS_ID);
|
2021-03-31 17:28:24 +02:00
|
|
|
setDisplayName(DockerSettings::tr("Docker"));
|
2021-03-18 08:52:42 +01:00
|
|
|
setCategory(ProjectExplorer::Constants::DEVICE_SETTINGS_CATEGORY);
|
2022-07-04 14:24:51 +02:00
|
|
|
setSettings(settings);
|
2021-03-31 17:28:24 +02:00
|
|
|
|
2022-07-04 14:24:51 +02:00
|
|
|
setLayouter([settings](QWidget *widget) {
|
2021-03-31 17:28:24 +02:00
|
|
|
DockerSettings &s = *settings;
|
2022-07-04 11:09:11 +02:00
|
|
|
using namespace Layouting;
|
2021-03-31 17:28:24 +02:00
|
|
|
|
2022-07-04 11:09:11 +02:00
|
|
|
// clang-format off
|
2021-03-31 17:28:24 +02:00
|
|
|
Column {
|
|
|
|
|
Group {
|
2022-07-04 11:09:11 +02:00
|
|
|
Title(DockerSettings::tr("Configuration")),
|
|
|
|
|
Row { s.dockerBinaryPath }
|
2021-03-31 17:28:24 +02:00
|
|
|
},
|
|
|
|
|
Stretch()
|
|
|
|
|
}.attachTo(widget);
|
2022-07-04 11:09:11 +02:00
|
|
|
// clang-format on
|
2021-03-31 17:28:24 +02:00
|
|
|
});
|
2021-03-18 08:52:42 +01:00
|
|
|
}
|
|
|
|
|
|
2022-07-04 11:09:11 +02:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Docker
|