forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/master' into work
Change-Id: I2235a55a599aaeca5d2b5377300a044b66c17da9
This commit is contained in:
@@ -14,11 +14,14 @@
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/messagemanager.h>
|
||||
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <projectexplorer/devicesupport/devicemanager.h>
|
||||
#include <projectexplorer/devicesupport/idevicewidget.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/kitmanager.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/runcontrol.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <projectexplorer/toolchain.h>
|
||||
#include <projectexplorer/toolchainmanager.h>
|
||||
|
||||
@@ -145,6 +148,8 @@ public:
|
||||
|
||||
CommandLine withDockerExecCmd(const CommandLine &cmd, bool interactive = false);
|
||||
|
||||
bool prepareForBuild(const Target *target);
|
||||
|
||||
private:
|
||||
bool createContainer();
|
||||
void startContainer();
|
||||
@@ -445,6 +450,14 @@ static QString getLocalIPv4Address()
|
||||
return QString();
|
||||
}
|
||||
|
||||
bool DockerDevicePrivate::prepareForBuild(const Target *target)
|
||||
{
|
||||
QTC_ASSERT(QThread::currentThread() == thread(), return false);
|
||||
|
||||
return ensureReachable(target->project()->projectDirectory())
|
||||
&& ensureReachable(target->activeBuildConfiguration()->buildDirectory());
|
||||
}
|
||||
|
||||
bool DockerDevicePrivate::createContainer()
|
||||
{
|
||||
if (!m_settings)
|
||||
@@ -1357,4 +1370,9 @@ void DockerDevicePrivate::setData(const DockerDeviceData &data)
|
||||
}
|
||||
}
|
||||
|
||||
bool DockerDevice::prepareForBuild(const Target *target)
|
||||
{
|
||||
return d->prepareForBuild(target);
|
||||
}
|
||||
|
||||
} // namespace Docker::Internal
|
||||
|
||||
@@ -122,6 +122,8 @@ public:
|
||||
void updateContainerAccess() const;
|
||||
void setMounts(const QStringList &mounts) const;
|
||||
|
||||
bool prepareForBuild(const ProjectExplorer::Target *target) override;
|
||||
|
||||
protected:
|
||||
void fromMap(const QVariantMap &map) final;
|
||||
QVariantMap toMap() const final;
|
||||
|
||||
@@ -122,6 +122,7 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device)
|
||||
auto searchDirsComboBox = new QComboBox;
|
||||
searchDirsComboBox->addItem(Tr::tr("Search in PATH"));
|
||||
searchDirsComboBox->addItem(Tr::tr("Search in Selected Directories"));
|
||||
searchDirsComboBox->addItem(Tr::tr("Search in PATH and Additional Directories"));
|
||||
|
||||
auto searchDirsLineEdit = new FancyLineEdit;
|
||||
|
||||
@@ -132,9 +133,10 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device)
|
||||
|
||||
auto searchPaths = [searchDirsComboBox, searchDirsLineEdit, dockerDevice] {
|
||||
FilePaths paths;
|
||||
if (searchDirsComboBox->currentIndex() == 0) {
|
||||
paths = dockerDevice->systemEnvironment().path();
|
||||
} else {
|
||||
const int idx = searchDirsComboBox->currentIndex();
|
||||
if (idx == 0 || idx == 2)
|
||||
paths += dockerDevice->systemEnvironment().path();
|
||||
if (idx == 1 || idx == 2) {
|
||||
for (const QString &path : searchDirsLineEdit->text().split(';'))
|
||||
paths.append(FilePath::fromString(path.trimmed()));
|
||||
}
|
||||
@@ -184,6 +186,7 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device)
|
||||
Column {
|
||||
Space(20),
|
||||
Row {
|
||||
Tr::tr("Search Locations:"),
|
||||
searchDirsComboBox,
|
||||
searchDirsLineEdit
|
||||
},
|
||||
@@ -200,8 +203,8 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device)
|
||||
|
||||
searchDirsLineEdit->setVisible(false);
|
||||
auto updateDirectoriesLineEdit = [searchDirsLineEdit](int index) {
|
||||
searchDirsLineEdit->setVisible(index == 1);
|
||||
if (index == 1)
|
||||
searchDirsLineEdit->setVisible(index == 1 || index == 2);
|
||||
if (index == 1 || index == 2)
|
||||
searchDirsLineEdit->setFocus();
|
||||
};
|
||||
QObject::connect(searchDirsComboBox, &QComboBox::activated, this, updateDirectoriesLineEdit);
|
||||
|
||||
Reference in New Issue
Block a user