diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2020-01-23 12:25:44 +0100 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2020-02-06 13:50:57 +0000 |
commit | e4738904d9bc0a98321face1975abbc4e67d4a86 (patch) | |
tree | a830cc7ac2133be7c6ef36d7c645c81bad808f88 /src/plugins/projectexplorer/targetsetupwidget.cpp | |
parent | ec4e60e691dd140646be9c8d21b553fded1366a0 (diff) |
TargetSetupPage: Improve reporting on invalid kits
Give the reason for a kit being disabled in the tooltip.
E.g. for a CMake project you will now get
"Kit is invalid: No CMake tool set."
instead of a generic error message about the kit being invalid.
Change-Id: Ic776dc24149d65ebf27163b605ec2e52a3a504a7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/targetsetupwidget.cpp')
-rw-r--r-- | src/plugins/projectexplorer/targetsetupwidget.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/plugins/projectexplorer/targetsetupwidget.cpp b/src/plugins/projectexplorer/targetsetupwidget.cpp index 31b3f5d6af..281723dedd 100644 --- a/src/plugins/projectexplorer/targetsetupwidget.cpp +++ b/src/plugins/projectexplorer/targetsetupwidget.cpp @@ -224,24 +224,25 @@ void TargetSetupWidget::expandWidget() m_detailsWidget->setState(Utils::DetailsWidget::Expanded); } -void TargetSetupWidget::update(const Kit::Predicate &predicate) +void TargetSetupWidget::update(const TasksGenerator &generator) { + const Tasks tasks = generator(kit()); + m_detailsWidget->setSummaryText(kit()->displayName()); + m_detailsWidget->setIcon(kit()->isValid() ? kit()->icon() : Icons::CRITICAL.icon()); + + const Task errorTask = Utils::findOrDefault(tasks, Utils::equal(&Task::type, Task::Error)); - // Kits that we deem invalid get a warning icon, but users can still select them, - // e.g. in case we misdetected an ABI mismatch. - // Kits that don't fulfill the project predicate are not selectable, because we cannot + // Kits that where the taskGenarator reports an error are not selectable, because we cannot // guarantee that we can handle the project sensibly (e.g. qmake project without Qt). - if (predicate && !predicate(kit())) { + if (!errorTask.isNull()) { toggleEnabled(false); + m_detailsWidget->setToolTip(kit()->toHtml(tasks, "")); m_infoStore.clear(); - m_detailsWidget->setToolTip(tr("You cannot use this kit, because it does not fulfill " - "the project's prerequisites.")); return; } + toggleEnabled(true); - m_detailsWidget->setIcon(kit()->isValid() ? kit()->icon() : Icons::CRITICAL.icon()); - m_detailsWidget->setToolTip(m_kit->toHtml()); updateDefaultBuildDirectories(); } |