Skip to content
Snippets Groups Projects
Commit 7f38e17e authored by dt's avatar dt
Browse files

Fixes: Custom Run Executable settings showing wrong errors

Task:     Found while testing the cmake plugin
Details:  Don't validate the working directoryl as it depends on the
magic $BUILDDIR variable, validate the executable as a command.
parent 80457082
No related branches found
No related tags found
No related merge requests found
......@@ -77,7 +77,7 @@ public:
// Returns the suggested label title when used in a form layout
static QString label();
bool validatePath(const QString &path, QString *errorMessage = 0);
virtual bool validatePath(const QString &path, QString *errorMessage = 0);
// Return the home directory, which needs some fixing under Windows.
static QString homePath();
......
......@@ -43,6 +43,19 @@
using namespace ProjectExplorer;
using namespace ProjectExplorer::Internal;
class CustomDirectoryPathChooser : public Core::Utils::PathChooser
{
public:
CustomDirectoryPathChooser(QWidget *parent)
: Core::Utils::PathChooser(parent)
{
}
virtual bool validatePath(const QString &path, QString *errorMessage = 0)
{
return true;
}
};
CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomExecutableRunConfiguration *rc)
: m_ignoreChange(false)
{
......@@ -55,14 +68,15 @@ CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomE
layout->addRow("Name:", m_userName);
m_executableChooser = new Core::Utils::PathChooser(this);
m_executableChooser->setExpectedKind(Core::Utils::PathChooser::File);
m_executableChooser->setExpectedKind(Core::Utils::PathChooser::Command);
layout->addRow("Executable:", m_executableChooser);
m_commandLineArgumentsLineEdit = new QLineEdit(this);
m_commandLineArgumentsLineEdit->setMinimumWidth(200); // this shouldn't be fixed here...
layout->addRow("Arguments:", m_commandLineArgumentsLineEdit);
m_workingDirectory = new Core::Utils::PathChooser(this);
m_workingDirectory = new CustomDirectoryPathChooser(this);
m_workingDirectory->setExpectedKind(Core::Utils::PathChooser::Directory);
layout->addRow("Working Directory:", m_workingDirectory);
m_useTerminalCheck = new QCheckBox(tr("Run in &Terminal"), this);
......@@ -71,7 +85,6 @@ CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomE
setLayout(layout);
changed();
connect(m_userName, SIGNAL(textEdited(QString)),
this, SLOT(setUserName(QString)));
connect(m_executableChooser, SIGNAL(changed()),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment