forked from qt-creator/qt-creator
Docker: Use PagedSettings
More compact. Change-Id: Ic21c6ea9e7faf67e5f507f336f18e1134b371a97 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -28,7 +28,6 @@ public:
|
||||
|
||||
DockerSettings m_settings;
|
||||
DockerDeviceFactory m_deviceFactory{&m_settings};
|
||||
DockerSettingsPage m_settingPage{&m_settings};
|
||||
DockerApi m_dockerApi{&m_settings};
|
||||
};
|
||||
|
||||
|
||||
@@ -23,6 +23,25 @@ DockerSettings::DockerSettings()
|
||||
setSettingsGroup(Constants::DOCKER);
|
||||
setAutoApply(false);
|
||||
|
||||
setId(Docker::Constants::DOCKER_SETTINGS_ID);
|
||||
setDisplayName(Tr::tr("Docker"));
|
||||
setCategory(ProjectExplorer::Constants::DEVICE_SETTINGS_CATEGORY);
|
||||
setSettings(this);
|
||||
|
||||
setLayouter([this](QWidget *widget) {
|
||||
using namespace Layouting;
|
||||
|
||||
// clang-format off
|
||||
Column {
|
||||
Group {
|
||||
title(Tr::tr("Configuration")),
|
||||
Row { dockerBinaryPath }
|
||||
},
|
||||
st
|
||||
}.attachTo(widget);
|
||||
// clang-format on
|
||||
});
|
||||
|
||||
FilePaths additionalPaths;
|
||||
if (HostOsInfo::isWindowsHost())
|
||||
additionalPaths.append("C:/Program Files/Docker/Docker/resources/bin");
|
||||
@@ -42,29 +61,4 @@ DockerSettings::DockerSettings()
|
||||
readSettings(Core::ICore::settings());
|
||||
}
|
||||
|
||||
// DockerSettingsPage
|
||||
|
||||
DockerSettingsPage::DockerSettingsPage(DockerSettings *settings)
|
||||
{
|
||||
setId(Docker::Constants::DOCKER_SETTINGS_ID);
|
||||
setDisplayName(Tr::tr("Docker"));
|
||||
setCategory(ProjectExplorer::Constants::DEVICE_SETTINGS_CATEGORY);
|
||||
setSettings(settings);
|
||||
|
||||
setLayouter([settings](QWidget *widget) {
|
||||
DockerSettings &s = *settings;
|
||||
using namespace Layouting;
|
||||
|
||||
// clang-format off
|
||||
Column {
|
||||
Group {
|
||||
title(Tr::tr("Configuration")),
|
||||
Row { s.dockerBinaryPath }
|
||||
},
|
||||
st
|
||||
}.attachTo(widget);
|
||||
// clang-format on
|
||||
});
|
||||
}
|
||||
|
||||
} // Docker::Internal
|
||||
|
||||
@@ -5,11 +5,9 @@
|
||||
|
||||
#include <coreplugin/dialogs/ioptionspage.h>
|
||||
|
||||
#include <utils/aspects.h>
|
||||
|
||||
namespace Docker::Internal {
|
||||
|
||||
class DockerSettings final : public Utils::AspectContainer
|
||||
class DockerSettings final : public Core::PagedSettings
|
||||
{
|
||||
public:
|
||||
DockerSettings();
|
||||
@@ -17,10 +15,4 @@ public:
|
||||
Utils::StringAspect dockerBinaryPath;
|
||||
};
|
||||
|
||||
class DockerSettingsPage final : public Core::IOptionsPage
|
||||
{
|
||||
public:
|
||||
explicit DockerSettingsPage(DockerSettings *settings);
|
||||
};
|
||||
|
||||
} // Docker::Internal
|
||||
|
||||
Reference in New Issue
Block a user