forked from qt-creator/qt-creator
Add "Run in terminal" option also to cmake runconfigurations
Task-Nr: QTCREATORBUG-4695
This commit is contained in:
@@ -53,6 +53,7 @@
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QComboBox>
|
||||
#include <QtGui/QToolButton>
|
||||
#include <QtGui/QCheckBox>
|
||||
|
||||
using namespace CMakeProjectManager;
|
||||
using namespace CMakeProjectManager::Internal;
|
||||
@@ -138,6 +139,11 @@ ProjectExplorer::LocalApplicationRunConfiguration::RunMode CMakeRunConfiguration
|
||||
return m_runMode;
|
||||
}
|
||||
|
||||
void CMakeRunConfiguration::setRunMode(RunMode runMode)
|
||||
{
|
||||
m_runMode = runMode;
|
||||
}
|
||||
|
||||
QString CMakeRunConfiguration::workingDirectory() const
|
||||
{
|
||||
return QDir::cleanPath(environment().expandVariables(
|
||||
@@ -347,6 +353,10 @@ CMakeRunConfigurationWidget::CMakeRunConfigurationWidget(CMakeRunConfiguration *
|
||||
|
||||
fl->addRow(tr("Working directory:"), boxlayout);
|
||||
|
||||
QCheckBox *runInTerminal = new QCheckBox;
|
||||
fl->addRow(tr("Run in Terminal"), runInTerminal);
|
||||
|
||||
|
||||
QWidget *debuggerLabelWidget = new QWidget(this);
|
||||
QVBoxLayout *debuggerLabelLayout = new QVBoxLayout(debuggerLabelWidget);
|
||||
debuggerLabelLayout->setMargin(0);
|
||||
@@ -411,6 +421,9 @@ CMakeRunConfigurationWidget::CMakeRunConfigurationWidget(CMakeRunConfiguration *
|
||||
connect(resetButton, SIGNAL(clicked()),
|
||||
this, SLOT(resetWorkingDirectory()));
|
||||
|
||||
connect(runInTerminal, SIGNAL(toggled(bool)),
|
||||
this, SLOT(runInTerminalToggled(bool)));
|
||||
|
||||
connect(m_debuggerLanguageChooser, SIGNAL(cppLanguageToggled(bool)),
|
||||
this, SLOT(useCppDebuggerToggled(bool)));
|
||||
connect(m_debuggerLanguageChooser, SIGNAL(qmlLanguageToggled(bool)),
|
||||
@@ -455,6 +468,12 @@ void CMakeRunConfigurationWidget::resetWorkingDirectory()
|
||||
m_cmakeRunConfiguration->setUserWorkingDirectory(QString());
|
||||
}
|
||||
|
||||
void CMakeRunConfigurationWidget::runInTerminalToggled(bool toggled)
|
||||
{
|
||||
m_cmakeRunConfiguration->setRunMode(toggled ? ProjectExplorer::LocalApplicationRunConfiguration::Console
|
||||
: ProjectExplorer::LocalApplicationRunConfiguration::Gui);
|
||||
}
|
||||
|
||||
void CMakeRunConfigurationWidget::useCppDebuggerToggled(bool toggled)
|
||||
{
|
||||
m_cmakeRunConfiguration->setUseCppDebugger(toggled);
|
||||
|
||||
@@ -72,6 +72,7 @@ public:
|
||||
|
||||
QString executable() const;
|
||||
RunMode runMode() const;
|
||||
void setRunMode(RunMode runMode);
|
||||
QString workingDirectory() const;
|
||||
QString commandLineArguments() const;
|
||||
Utils::Environment environment() const;
|
||||
@@ -145,11 +146,11 @@ private slots:
|
||||
void userChangesChanged();
|
||||
void setWorkingDirectory();
|
||||
void resetWorkingDirectory();
|
||||
void runInTerminalToggled(bool toggled);
|
||||
void useCppDebuggerToggled(bool toggled);
|
||||
void useQmlDebuggerToggled(bool toggled);
|
||||
void qmlDebugServerPortChanged(uint port);
|
||||
|
||||
private slots:
|
||||
void baseEnvironmentComboBoxChanged(int index);
|
||||
void workingDirectoryChanged(const QString &workingDirectory);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user