forked from qt-creator/qt-creator
Docker: Add a warning when the mount path list is empty
The common use case shares project sources between host and docker container, in that case, not sharing anything will not be useful. Change-Id: I44b12089579ead008023caf5134c613fc145b8c7 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -362,13 +362,26 @@ public:
|
|||||||
});
|
});
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
m_pathsListLabel = new InfoLabel(tr("Paths to mount:"));
|
||||||
|
// FIXME: 8.0: use
|
||||||
|
//m_pathsListLabel->setToolTip(tr("Source directory list should not be empty"));
|
||||||
|
|
||||||
m_pathsListEdit = new PathListEditor;
|
m_pathsListEdit = new PathListEditor;
|
||||||
|
// FIXME: 8.0: use
|
||||||
|
//m_pathsListEdit->setPlaceholderText(tr("Host directories to mount into the container"));
|
||||||
m_pathsListEdit->setToolTip(tr("Maps paths in this list one-to-one to the "
|
m_pathsListEdit->setToolTip(tr("Maps paths in this list one-to-one to the "
|
||||||
"docker container."));
|
"docker container."));
|
||||||
m_pathsListEdit->setPathList(data.mounts);
|
m_pathsListEdit->setPathList(data.mounts);
|
||||||
|
|
||||||
connect(m_pathsListEdit, &PathListEditor::changed, this, [dockerDevice, this]() {
|
auto markupMounts = [this] {
|
||||||
|
const bool isEmpty = m_pathsListEdit->pathList().isEmpty();
|
||||||
|
m_pathsListLabel->setType(isEmpty ? InfoLabel::Warning : InfoLabel::None);
|
||||||
|
};
|
||||||
|
markupMounts();
|
||||||
|
|
||||||
|
connect(m_pathsListEdit, &PathListEditor::changed, this, [dockerDevice, markupMounts, this] {
|
||||||
dockerDevice->setMounts(m_pathsListEdit->pathList());
|
dockerDevice->setMounts(m_pathsListEdit->pathList());
|
||||||
|
markupMounts();
|
||||||
});
|
});
|
||||||
|
|
||||||
auto logView = new QTextBrowser;
|
auto logView = new QTextBrowser;
|
||||||
@@ -384,6 +397,8 @@ public:
|
|||||||
searchDirsComboBox->addItem(tr("Search in Selected Directories"));
|
searchDirsComboBox->addItem(tr("Search in Selected Directories"));
|
||||||
|
|
||||||
auto searchDirsLineEdit = new FancyLineEdit;
|
auto searchDirsLineEdit = new FancyLineEdit;
|
||||||
|
// FIXME: 8.0: use
|
||||||
|
//searchDirsLineEdit->setPlaceholderText(tr("Semicolon-separated list of directories"));
|
||||||
searchDirsLineEdit->setToolTip(
|
searchDirsLineEdit->setToolTip(
|
||||||
tr("Select the paths in the docker image that should be scanned for kit entries."));
|
tr("Select the paths in the docker image that should be scanned for kit entries."));
|
||||||
searchDirsLineEdit->setHistoryCompleter("DockerMounts", true);
|
searchDirsLineEdit->setHistoryCompleter("DockerMounts", true);
|
||||||
@@ -438,7 +453,7 @@ public:
|
|||||||
m_usePathMapping, Break(),
|
m_usePathMapping, Break(),
|
||||||
#endif
|
#endif
|
||||||
Column {
|
Column {
|
||||||
new QLabel(tr("Paths to mount:")),
|
m_pathsListLabel,
|
||||||
m_pathsListEdit,
|
m_pathsListEdit,
|
||||||
}, Break(),
|
}, Break(),
|
||||||
Column {
|
Column {
|
||||||
@@ -481,7 +496,8 @@ private:
|
|||||||
#ifdef ALLOW_LOCAL_ACCESS
|
#ifdef ALLOW_LOCAL_ACCESS
|
||||||
QCheckBox *m_usePathMapping;
|
QCheckBox *m_usePathMapping;
|
||||||
#endif
|
#endif
|
||||||
Utils::PathListEditor *m_pathsListEdit;
|
InfoLabel *m_pathsListLabel;
|
||||||
|
PathListEditor *m_pathsListEdit;
|
||||||
|
|
||||||
KitDetector m_kitItemDetector;
|
KitDetector m_kitItemDetector;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user