forked from qt-creator/qt-creator
dockerplugin: Solve UI fixme's for 8.0
Shortened some lines as requested. Change-Id: I5d145e8cd28ed1036915a5d1611f0257efd9b023 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
This commit is contained in:
@@ -92,20 +92,18 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device)
|
|||||||
data.useLocalUidGid = on;
|
data.useLocalUidGid = on;
|
||||||
});
|
});
|
||||||
|
|
||||||
m_pathsListLabel = new InfoLabel(tr("Paths to mount:"));
|
auto pathListLabel = new InfoLabel(tr("Paths to mount:"));
|
||||||
// FIXME: 8.0: use
|
pathListLabel->setAdditionalToolTip(tr("Source directory list should not be empty."));
|
||||||
//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->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);
|
||||||
|
|
||||||
auto markupMounts = [this] {
|
auto markupMounts = [this, pathListLabel] {
|
||||||
const bool isEmpty = m_pathsListEdit->pathList().isEmpty();
|
const bool isEmpty = m_pathsListEdit->pathList().isEmpty();
|
||||||
m_pathsListLabel->setType(isEmpty ? InfoLabel::Warning : InfoLabel::None);
|
pathListLabel->setType(isEmpty ? InfoLabel::Warning : InfoLabel::None);
|
||||||
};
|
};
|
||||||
markupMounts();
|
markupMounts();
|
||||||
|
|
||||||
@@ -127,8 +125,8 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device)
|
|||||||
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->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);
|
||||||
@@ -180,7 +178,7 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device)
|
|||||||
daemonStateLabel, m_daemonReset, m_daemonState, Break(),
|
daemonStateLabel, m_daemonReset, m_daemonState, Break(),
|
||||||
m_runAsOutsideUser, Break(),
|
m_runAsOutsideUser, Break(),
|
||||||
Column {
|
Column {
|
||||||
m_pathsListLabel,
|
pathListLabel,
|
||||||
m_pathsListEdit,
|
m_pathsListEdit,
|
||||||
}, Break(),
|
}, Break(),
|
||||||
Column {
|
Column {
|
||||||
|
@@ -55,9 +55,7 @@ private:
|
|||||||
QToolButton *m_daemonReset;
|
QToolButton *m_daemonReset;
|
||||||
QLabel *m_daemonState;
|
QLabel *m_daemonState;
|
||||||
QCheckBox *m_runAsOutsideUser;
|
QCheckBox *m_runAsOutsideUser;
|
||||||
Utils::InfoLabel *m_pathsListLabel;
|
|
||||||
Utils::PathListEditor *m_pathsListEdit;
|
Utils::PathListEditor *m_pathsListEdit;
|
||||||
|
|
||||||
KitDetector m_kitItemDetector;
|
KitDetector m_kitItemDetector;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -24,6 +24,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "kitdetector.h"
|
#include "kitdetector.h"
|
||||||
|
|
||||||
#include "dockerconstants.h"
|
#include "dockerconstants.h"
|
||||||
|
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
@@ -54,7 +55,8 @@ class KitDetectorPrivate
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
KitDetectorPrivate(KitDetector *parent, const IDevice::ConstPtr &device)
|
KitDetectorPrivate(KitDetector *parent, const IDevice::ConstPtr &device)
|
||||||
: q(parent), m_device(device)
|
: q(parent)
|
||||||
|
, m_device(device)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void autoDetect();
|
void autoDetect();
|
||||||
@@ -133,7 +135,7 @@ void KitDetectorPrivate::undoAutoDetect() const
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (QObject *cmakeManager = ExtensionSystem::PluginManager::getObjectByName("CMakeToolManager")) {
|
if (auto cmakeManager = ExtensionSystem::PluginManager::getObjectByName("CMakeToolManager")) {
|
||||||
QString logMessage;
|
QString logMessage;
|
||||||
const bool res = QMetaObject::invokeMethod(cmakeManager,
|
const bool res = QMetaObject::invokeMethod(cmakeManager,
|
||||||
"removeDetectedCMake",
|
"removeDetectedCMake",
|
||||||
@@ -143,7 +145,7 @@ void KitDetectorPrivate::undoAutoDetect() const
|
|||||||
emit q->logOutput('\n' + logMessage);
|
emit q->logOutput('\n' + logMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (QObject *debuggerPlugin = ExtensionSystem::PluginManager::getObjectByName("DebuggerPlugin")) {
|
if (auto debuggerPlugin = ExtensionSystem::PluginManager::getObjectByName("DebuggerPlugin")) {
|
||||||
QString logMessage;
|
QString logMessage;
|
||||||
const bool res = QMetaObject::invokeMethod(debuggerPlugin,
|
const bool res = QMetaObject::invokeMethod(debuggerPlugin,
|
||||||
"removeDetectedDebuggers",
|
"removeDetectedDebuggers",
|
||||||
@@ -164,21 +166,22 @@ void KitDetectorPrivate::listAutoDetected() const
|
|||||||
for (Kit *kit : KitManager::kits()) {
|
for (Kit *kit : KitManager::kits()) {
|
||||||
if (kit->autoDetectionSource() == m_sharedId)
|
if (kit->autoDetectionSource() == m_sharedId)
|
||||||
emit q->logOutput(kit->displayName());
|
emit q->logOutput(kit->displayName());
|
||||||
};
|
}
|
||||||
|
|
||||||
emit q->logOutput('\n' + tr("Qt versions:"));
|
emit q->logOutput('\n' + tr("Qt versions:"));
|
||||||
for (QtVersion *qtVersion : QtVersionManager::versions()) {
|
for (QtVersion *qtVersion : QtVersionManager::versions()) {
|
||||||
if (qtVersion->detectionSource() == m_sharedId)
|
if (qtVersion->detectionSource() == m_sharedId)
|
||||||
emit q->logOutput(qtVersion->displayName());
|
emit q->logOutput(qtVersion->displayName());
|
||||||
};
|
}
|
||||||
|
|
||||||
emit q->logOutput('\n' + tr("Toolchains:"));
|
emit q->logOutput('\n' + tr("Toolchains:"));
|
||||||
for (ToolChain *toolChain : ToolChainManager::toolchains()) {
|
for (ToolChain *toolChain : ToolChainManager::toolchains()) {
|
||||||
if (toolChain->detectionSource() == m_sharedId)
|
if (toolChain->detectionSource() == m_sharedId)
|
||||||
emit q->logOutput(toolChain->displayName());
|
emit q->logOutput(toolChain->displayName());
|
||||||
};
|
}
|
||||||
|
|
||||||
if (QObject *cmakeManager = ExtensionSystem::PluginManager::getObjectByName("CMakeToolManager")) {
|
if (QObject *cmakeManager = ExtensionSystem::PluginManager::getObjectByName(
|
||||||
|
"CMakeToolManager")) {
|
||||||
QString logMessage;
|
QString logMessage;
|
||||||
const bool res = QMetaObject::invokeMethod(cmakeManager,
|
const bool res = QMetaObject::invokeMethod(cmakeManager,
|
||||||
"listDetectedCMake",
|
"listDetectedCMake",
|
||||||
@@ -188,7 +191,8 @@ void KitDetectorPrivate::listAutoDetected() const
|
|||||||
emit q->logOutput('\n' + logMessage);
|
emit q->logOutput('\n' + logMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (QObject *debuggerPlugin = ExtensionSystem::PluginManager::getObjectByName("DebuggerPlugin")) {
|
if (QObject *debuggerPlugin = ExtensionSystem::PluginManager::getObjectByName(
|
||||||
|
"DebuggerPlugin")) {
|
||||||
QString logMessage;
|
QString logMessage;
|
||||||
const bool res = QMetaObject::invokeMethod(debuggerPlugin,
|
const bool res = QMetaObject::invokeMethod(debuggerPlugin,
|
||||||
"listDetectedDebuggers",
|
"listDetectedDebuggers",
|
||||||
@@ -208,7 +212,10 @@ QtVersions KitDetectorPrivate::autoDetectQtVersions() const
|
|||||||
QString error;
|
QString error;
|
||||||
|
|
||||||
const auto handleQmake = [this, &qtVersions, &error](const FilePath &qmake) {
|
const auto handleQmake = [this, &qtVersions, &error](const FilePath &qmake) {
|
||||||
if (QtVersion *qtVersion = QtVersionFactory::createQtVersionFromQMakePath(qmake, false, m_sharedId, &error)) {
|
if (QtVersion *qtVersion = QtVersionFactory::createQtVersionFromQMakePath(qmake,
|
||||||
|
false,
|
||||||
|
m_sharedId,
|
||||||
|
&error)) {
|
||||||
qtVersions.append(qtVersion);
|
qtVersions.append(qtVersion);
|
||||||
QtVersionManager::addVersion(qtVersion);
|
QtVersionManager::addVersion(qtVersion);
|
||||||
emit q->logOutput(tr("Found \"%1\"").arg(qtVersion->qmakeFilePath().toUserOutput()));
|
emit q->logOutput(tr("Found \"%1\"").arg(qtVersion->qmakeFilePath().toUserOutput()));
|
||||||
@@ -220,7 +227,9 @@ QtVersions KitDetectorPrivate::autoDetectQtVersions() const
|
|||||||
|
|
||||||
const QStringList candidates = {"qmake-qt6", "qmake-qt5", "qmake"};
|
const QStringList candidates = {"qmake-qt6", "qmake-qt5", "qmake"};
|
||||||
for (const FilePath &searchPath : m_searchPaths) {
|
for (const FilePath &searchPath : m_searchPaths) {
|
||||||
searchPath.iterateDirectory(handleQmake, {candidates, QDir::Files | QDir::Executable,
|
searchPath.iterateDirectory(handleQmake,
|
||||||
|
{candidates,
|
||||||
|
QDir::Files | QDir::Executable,
|
||||||
QDirIterator::Subdirectories});
|
QDirIterator::Subdirectories});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -335,5 +344,5 @@ void KitDetectorPrivate::autoDetect()
|
|||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // Internal
|
} // namespace Internal
|
||||||
} // Docker
|
} // namespace Docker
|
||||||
|
Reference in New Issue
Block a user