Debugger: Add 'Run in terminal' to Start External dialog.

This commit is contained in:
Friedemann Kleint
2011-05-04 09:21:18 +02:00
parent 65426a69ce
commit c318383ee1
4 changed files with 46 additions and 23 deletions

View File

@@ -594,6 +594,16 @@ bool StartExternalDialog::breakAtMain() const
return m_ui->checkBoxBreakAtMain->isChecked(); return m_ui->checkBoxBreakAtMain->isChecked();
} }
bool StartExternalDialog::runInTerminal() const
{
return m_ui->checkBoxRunInTerminal->isChecked();
}
void StartExternalDialog::setRunInTerminal(bool v)
{
m_ui->checkBoxRunInTerminal->setChecked(v);
}
ProjectExplorer::Abi StartExternalDialog::abi() const ProjectExplorer::Abi StartExternalDialog::abi() const
{ {
return m_ui->toolChainComboBox->abi(); return m_ui->toolChainComboBox->abi();

View File

@@ -158,6 +158,9 @@ public:
bool breakAtMain() const; bool breakAtMain() const;
bool runInTerminal() const;
void setRunInTerminal(bool v);
bool isValid() const; bool isValid() const;
private slots: private slots:

View File

@@ -1363,6 +1363,8 @@ void DebuggerPluginPrivate::startExternalApplication()
configValue(_("LastExternalExecutableFile")).toString()); configValue(_("LastExternalExecutableFile")).toString());
dlg.setExecutableArguments( dlg.setExecutableArguments(
configValue(_("LastExternalExecutableArguments")).toString()); configValue(_("LastExternalExecutableArguments")).toString());
dlg.setRunInTerminal(
configValue(_("LastExternalRunInTerminal")).toBool());
dlg.setWorkingDirectory( dlg.setWorkingDirectory(
configValue(_("LastExternalWorkingDirectory")).toString()); configValue(_("LastExternalWorkingDirectory")).toString());
dlg.setAbiIndex(configValue(_("LastExternalAbiIndex")).toInt()); dlg.setAbiIndex(configValue(_("LastExternalAbiIndex")).toInt());
@@ -1376,6 +1378,8 @@ void DebuggerPluginPrivate::startExternalApplication()
dlg.executableArguments()); dlg.executableArguments());
setConfigValue(_("LastExternalWorkingDirectory"), setConfigValue(_("LastExternalWorkingDirectory"),
dlg.workingDirectory()); dlg.workingDirectory());
setConfigValue(_("LastExternalRunInTerminal"),
dlg.runInTerminal());
setConfigValue(_("LastExternalAbiIndex"), QVariant(dlg.abiIndex())); setConfigValue(_("LastExternalAbiIndex"), QVariant(dlg.abiIndex()));
sp.executable = dlg.executableFile(); sp.executable = dlg.executableFile();
@@ -1384,6 +1388,7 @@ void DebuggerPluginPrivate::startExternalApplication()
sp.debuggerCommand = dlg.debuggerCommand(); sp.debuggerCommand = dlg.debuggerCommand();
sp.workingDirectory = dlg.workingDirectory(); sp.workingDirectory = dlg.workingDirectory();
sp.displayName = sp.executable; sp.displayName = sp.executable;
sp.useTerminal = dlg.runInTerminal();
if (!dlg.executableArguments().isEmpty()) if (!dlg.executableArguments().isEmpty())
sp.processArgs = dlg.executableArguments(); sp.processArgs = dlg.executableArguments();
// Fixme: 1 of 3 testing hacks. // Fixme: 1 of 3 testing hacks.

View File

@@ -2,14 +2,6 @@
<ui version="4.0"> <ui version="4.0">
<class>StartExternalDialog</class> <class>StartExternalDialog</class>
<widget class="QDialog" name="StartExternalDialog"> <widget class="QDialog" name="StartExternalDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>443</width>
<height>213</height>
</rect>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>Start Debugger</string> <string>Start Debugger</string>
</property> </property>
@@ -52,6 +44,19 @@
<widget class="QLineEdit" name="argsEdit"/> <widget class="QLineEdit" name="argsEdit"/>
</item> </item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QLabel" name="labelRunInTerminal">
<property name="text">
<string>Run in &amp;terminal:</string>
</property>
<property name="buddy">
<cstring>checkBoxRunInTerminal</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="checkBoxRunInTerminal"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="workingDirectoryLabel"> <widget class="QLabel" name="workingDirectoryLabel">
<property name="text"> <property name="text">
<string>&amp;Working directory:</string> <string>&amp;Working directory:</string>
@@ -61,10 +66,23 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="3" column="1">
<widget class="Utils::PathChooser" name="workingDirectory"/> <widget class="Utils::PathChooser" name="workingDirectory"/>
</item> </item>
<item row="4" column="0"> <item row="4" column="0">
<widget class="QLabel" name="toolChainLabel">
<property name="text">
<string>&amp;Tool chain:</string>
</property>
<property name="buddy">
<cstring>toolChainComboBox</cstring>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="Debugger::Internal::DebuggerToolChainComboBox" name="toolChainComboBox"/>
</item>
<item row="5" column="0">
<widget class="QLabel" name="labelBreakAtMain"> <widget class="QLabel" name="labelBreakAtMain">
<property name="text"> <property name="text">
<string>Break at '&amp;main':</string> <string>Break at '&amp;main':</string>
@@ -74,26 +92,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1"> <item row="5" column="1">
<widget class="QCheckBox" name="checkBoxBreakAtMain"> <widget class="QCheckBox" name="checkBoxBreakAtMain">
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1">
<widget class="Debugger::Internal::DebuggerToolChainComboBox" name="toolChainComboBox"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="toolChainLabel">
<property name="text">
<string>&amp;Tool chain:</string>
</property>
<property name="buddy">
<cstring>toolChainComboBox</cstring>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
<item> <item>