Commit 22e053b8 authored by Tobias Hunger's avatar Tobias Hunger

CMake: Show executable in Run Configuration

Task-number: QTCREATORBUG-18173
Change-Id: If512991873121151e18b56781729f6b841796549
Reviewed-by: Tim Jenssen's avatarTim Jenssen <tim.jenssen@qt.io>
parent b8e348c4
......@@ -37,6 +37,7 @@
#include <projectexplorer/target.h>
#include <utils/detailswidget.h>
#include <utils/fancylineedit.h>
#include <utils/pathchooser.h>
#include <utils/qtcassert.h>
#include <utils/qtcprocess.h>
......@@ -177,6 +178,14 @@ QString CMakeRunConfiguration::disabledReason() const
return QString();
}
static void updateExecutable(CMakeRunConfiguration *rc, Utils::FancyLineEdit *fle)
{
const Runnable runnable = rc->runnable();
fle->setText(runnable.is<StandardRunnable>()
? Utils::FileName::fromString(runnable.as<StandardRunnable>().executable).toUserOutput()
: QString());
}
// Configuration widget
CMakeRunConfigurationWidget::CMakeRunConfigurationWidget(CMakeRunConfiguration *cmakeRunConfiguration, QWidget *parent)
: QWidget(parent)
......@@ -185,6 +194,16 @@ CMakeRunConfigurationWidget::CMakeRunConfigurationWidget(CMakeRunConfiguration *
fl->setMargin(0);
fl->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
auto executableLabel = new QLabel(tr("Executable:"));
auto executable = new Utils::FancyLineEdit;
executable->setReadOnly(true);
executable->setPlaceholderText(tr("<unknown>"));
connect(cmakeRunConfiguration, &CMakeRunConfiguration::enabledChanged,
this, std::bind(updateExecutable, cmakeRunConfiguration, executable));
updateExecutable(cmakeRunConfiguration, executable);
fl->addRow(executableLabel, executable);
cmakeRunConfiguration->extraAspect<ArgumentsAspect>()->addToMainConfigurationWidget(this, fl);
cmakeRunConfiguration->extraAspect<WorkingDirectoryAspect>()->addToMainConfigurationWidget(this, fl);
cmakeRunConfiguration->extraAspect<TerminalAspect>()->addToMainConfigurationWidget(this, fl);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment