Commit 8ae109b8 authored by hjk's avatar hjk
Browse files

debugger: make "clever" behaviour on debugger exit optional

It hurts me.

Reviewed-by: Alessandro Portale
Task-number: QTCREATORBUG-808
parent 903eaf34
......@@ -51,7 +51,27 @@
</property>
</widget>
</item>
<item row="4" column="0">
<item row="4" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxCloseBuffersOnExit">
<property name="toolTip">
<string>Close temporary buffers on debugger exit.</string>
</property>
<property name="text">
<string>Close temporary buffers on debugger exit</string>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxSwitchModeOnExit">
<property name="toolTip">
<string>Switch to previous mode on debugger exit.</string>
</property>
<property name="text">
<string>Switch to previous mode on debugger exit.</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="labelMaximalStackDepth">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
......@@ -64,7 +84,7 @@
</property>
</widget>
</item>
<item row="4" column="1">
<item row="6" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QSpinBox" name="spinBoxMaximalStackDepth">
......
......@@ -369,6 +369,18 @@ DebuggerSettings *DebuggerSettings::instance()
item->setDefaultValue(QString());
instance->insertItem(GdbScriptFile, item);
item = new SavedAction(instance);
item->setSettingsKey(debugModeGroup, QLatin1String("CloseBuffersOnExit"));
item->setCheckable(true);
item->setDefaultValue(false);
instance->insertItem(CloseBuffersOnExit, item);
item = new SavedAction(instance);
item->setSettingsKey(debugModeGroup, QLatin1String("SwitchModeOnExit"));
item->setCheckable(true);
item->setDefaultValue(false);
instance->insertItem(SwitchModeOnExit, item);
item = new SavedAction(instance);
item->setSettingsKey(debugModeGroup, QLatin1String("AutoQuit"));
item->setText(tr("Automatically Quit Debugger"));
......
......@@ -92,7 +92,8 @@ enum DebuggerActionCode
LogTimeStamps,
VerboseLog,
OperateByInstruction,
AutoDerefPointers,
CloseBuffersOnExit,
SwitchModeOnExit,
UseDebuggingHelpers,
UseCustomDebuggingHelperLocation,
......@@ -125,6 +126,7 @@ enum DebuggerActionCode
ShowStdNamespace,
ShowQtNamespace,
SortStructMembers,
AutoDerefPointers,
// Source List
ListSourceFiles,
......
......@@ -561,6 +561,10 @@ QWidget *CommonOptionsPage::createPage(QWidget *parent)
m_ui.checkBoxUseAlternatingRowColors);
m_group.insert(theDebuggerAction(UseToolTipsInMainEditor),
m_ui.checkBoxUseToolTipsInMainEditor);
m_group.insert(theDebuggerAction(CloseBuffersOnExit),
m_ui.checkBoxCloseBuffersOnExit);
m_group.insert(theDebuggerAction(SwitchModeOnExit),
m_ui.checkBoxSwitchModeOnExit);
m_group.insert(theDebuggerAction(AutoDerefPointers), 0);
m_group.insert(theDebuggerAction(UseToolTipsInLocalsView), 0);
m_group.insert(theDebuggerAction(UseToolTipsInBreakpointsView), 0);
......@@ -2127,12 +2131,14 @@ void DebuggerPluginPrivate::cleanupViews()
//if (d->m_engine)
// d->m_engine->cleanup();
if (EditorManager *editorManager = EditorManager::instance()) {
QList<IEditor *> toClose;
foreach (IEditor *editor, editorManager->openedEditors())
if (editor->property("OpenedByDebugger").toBool())
toClose.append(editor);
editorManager->closeEditors(toClose);
if (theDebuggerBoolSetting(CloseBuffersOnExit)) {
if (EditorManager *editorManager = EditorManager::instance()) {
QList<IEditor *> toClose;
foreach (IEditor *editor, editorManager->openedEditors())
if (editor->property("OpenedByDebugger").toBool())
toClose.append(editor);
editorManager->closeEditors(toClose);
}
}
}
......@@ -2834,8 +2840,9 @@ void DebuggerPlugin::runControlFinished(DebuggerRunControl *runControl)
Q_UNUSED(runControl);
d->m_snapshotHandler->removeSnapshot(runControl);
d->disconnectEngine();
if (d->m_snapshotHandler->size() == 0)
d->activatePreviousMode();
if (theDebuggerBoolSetting(SwitchModeOnExit))
if (d->m_snapshotHandler->size() == 0)
d->activatePreviousMode();
}
DebuggerLanguages DebuggerPlugin::activeLanguages() const
......
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