Commit 5a97436c authored by dt's avatar dt
Browse files

Add a argument line edit for the cmake runconfiguration.

Even works.
parent 60800bc3
......@@ -34,6 +34,8 @@
#include <projectexplorer/environment.h>
#include <utils/qtcassert.h>
#include <QtGui/QFormLayout>
#include <QtGui/QLineEdit>
using namespace CMakeProjectManager;
using namespace CMakeProjectManager::Internal;
......@@ -74,8 +76,7 @@ QString CMakeRunConfiguration::workingDirectory() const
QStringList CMakeRunConfiguration::commandLineArguments() const
{
// TODO
return QStringList();
return ProjectExplorer::Environment::parseCombinedArgString(m_arguments);
}
ProjectExplorer::Environment CMakeRunConfiguration::environment() const
......@@ -106,6 +107,7 @@ void CMakeRunConfiguration::save(ProjectExplorer::PersistentSettingsWriter &writ
writer.saveValue("CMakeRunConfiguration.WorkingDirectory", m_workingDirectory);
writer.saveValue("CMakeRunConfiguration.UseTerminal", m_runMode == Console);
writer.saveValue("CMakeRunConfiguation.Title", m_title);
writer.saveValue("CMakeRunConfiguration.Arguments", m_arguments);
}
void CMakeRunConfiguration::restore(const ProjectExplorer::PersistentSettingsReader &reader)
......@@ -115,12 +117,25 @@ void CMakeRunConfiguration::restore(const ProjectExplorer::PersistentSettingsRea
m_workingDirectory = reader.restoreValue("CMakeRunConfiguration.WorkingDirectory").toString();
m_runMode = reader.restoreValue("CMakeRunConfiguration.UseTerminal").toBool() ? Console : Gui;
m_title = reader.restoreValue("CMakeRunConfiguation.Title").toString();
m_arguments = reader.restoreValue("CMakeRunConfiguration.Arguments").toString();
}
QWidget *CMakeRunConfiguration::configurationWidget()
{
//TODO
return new QWidget();
QWidget *widget = new QWidget();
QFormLayout *fl = new QFormLayout();
widget->setLayout(fl);
QLineEdit *argumentsLineEdit = new QLineEdit(widget);
argumentsLineEdit->setText(m_arguments);
connect(argumentsLineEdit, SIGNAL(textChanged(QString)),
this, SLOT(setArguments(QString)));
fl->addRow(tr("Arguments:"), argumentsLineEdit);
return widget;
}
void CMakeRunConfiguration::setArguments(const QString &newText)
{
m_arguments = newText;
}
QString CMakeRunConfiguration::dumperLibrary() const
......
......@@ -41,6 +41,7 @@ class CMakeProject;
class CMakeRunConfiguration : public ProjectExplorer::ApplicationRunConfiguration
{
Q_OBJECT
public:
CMakeRunConfiguration(CMakeProject *pro, const QString &target, const QString &workingDirectory, const QString &title);
virtual ~CMakeRunConfiguration();
......@@ -60,11 +61,15 @@ public:
virtual void save(ProjectExplorer::PersistentSettingsWriter &writer) const;
virtual void restore(const ProjectExplorer::PersistentSettingsReader &reader);
virtual QString dumperLibrary() const;
private slots:
void setArguments(const QString &newText);
private:
RunMode m_runMode;
QString m_target;
QString m_workingDirectory;
QString m_title;
QString m_arguments;
};
/* The run configuration factory is used for restoring run configurations from
......
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