Debugger: Move debugging helpers settings to Locals & Expressions

They're no longer GDB only.

Change-Id: I3aa00be50c85a90c8f81ab9c04c6bb0ec74b7785
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Orgad Shaneh
2017-05-12 17:03:34 +03:00
committed by Orgad Shaneh
parent b60c02bcc0
commit dfa7e492a1
2 changed files with 42 additions and 37 deletions

View File

@@ -30,9 +30,12 @@
#include "debuggercore.h"
#include <coreplugin/icore.h>
#include <coreplugin/variablechooser.h>
#include <utils/hostosinfo.h>
#include <utils/savedaction.h>
#include <utils/pathchooser.h>
#include <utils/qtcassert.h>
#include <utils/savedaction.h>
#include <QCheckBox>
#include <QCoreApplication>
@@ -40,6 +43,7 @@
#include <QHBoxLayout>
#include <QLabel>
#include <QSpinBox>
#include <QTextEdit>
#include <QTextStream>
using namespace Core;
@@ -307,6 +311,25 @@ QWidget *LocalsAndExpressionsOptionsPage::widget()
"std::map in the &quot;Locals and Expressions&quot; view. ")
+ QLatin1String("</p></body></html>"));
auto groupBoxCustomDumperCommands = new QGroupBox(debuggingHelperGroupBox);
groupBoxCustomDumperCommands->setTitle(tr("Debugging Helper Customization"));
groupBoxCustomDumperCommands->setToolTip(tr(
"<html><head/><body><p>Python commands entered here will be executed after Qt Creator's "
"debugging helpers have been loaded and fully initialized. You can load additional "
"debugging helpers or modify existing ones here.</p></body></html>"));
auto textEditCustomDumperCommands = new QTextEdit(groupBoxCustomDumperCommands);
textEditCustomDumperCommands->setAcceptRichText(false);
textEditCustomDumperCommands->setToolTip(groupBoxCustomDumperCommands->toolTip());
auto groupBoxExtraDumperFile = new QGroupBox(debuggingHelperGroupBox);
groupBoxExtraDumperFile->setTitle(tr("Extra Debugging Helpers"));
groupBoxExtraDumperFile->setToolTip(tr(
"Path to a Python file containing additional data dumpers."));
auto pathChooserExtraDumperFile = new Utils::PathChooser(groupBoxExtraDumperFile);
pathChooserExtraDumperFile->setExpectedKind(Utils::PathChooser::File);
auto checkBoxUseCodeModel = new QCheckBox(debuggingHelperGroupBox);
auto checkBoxShowThreadNames = new QCheckBox(debuggingHelperGroupBox);
auto checkBoxShowStdNamespace = new QCheckBox(m_widget);
@@ -325,10 +348,16 @@ QWidget *LocalsAndExpressionsOptionsPage::widget()
spinBoxDisplayStringLimit->setSingleStep(10);
spinBoxDisplayStringLimit->setValue(100);
auto verticalLayout = new QVBoxLayout(debuggingHelperGroupBox);
verticalLayout->addWidget(label);
verticalLayout->addWidget(checkBoxUseCodeModel);
verticalLayout->addWidget(checkBoxShowThreadNames);
auto chooser = new VariableChooser(m_widget);
chooser->addSupportedWidget(textEditCustomDumperCommands);
chooser->addSupportedWidget(pathChooserExtraDumperFile->lineEdit());
auto gridLayout = new QGridLayout(debuggingHelperGroupBox);
gridLayout->addWidget(label, 0, 0, 1, 1);
gridLayout->addWidget(checkBoxUseCodeModel, 1, 0, 1, 1);
gridLayout->addWidget(checkBoxShowThreadNames, 2, 0, 1, 1);
gridLayout->addWidget(groupBoxExtraDumperFile, 3, 0, 1, 1);
gridLayout->addWidget(groupBoxCustomDumperCommands, 0, 1, 4, 1);
auto layout1 = new QFormLayout;
layout1->addItem(new QSpacerItem(10, 10));
@@ -348,8 +377,16 @@ QWidget *LocalsAndExpressionsOptionsPage::widget()
layout->addLayout(lowerLayout);
layout->addStretch();
auto customDumperLayout = new QGridLayout(groupBoxCustomDumperCommands);
customDumperLayout->addWidget(textEditCustomDumperCommands, 0, 0, 1, 1);
auto extraDumperLayout = new QGridLayout(groupBoxExtraDumperFile);
extraDumperLayout->addWidget(pathChooserExtraDumperFile, 0, 0, 1, 1);
m_group.clear();
m_group.insert(action(UseDebuggingHelpers), debuggingHelperGroupBox);
m_group.insert(action(ExtraDumperFile), pathChooserExtraDumperFile);
m_group.insert(action(ExtraDumperCommands), textEditCustomDumperCommands);
m_group.insert(action(UseCodeModel), checkBoxUseCodeModel);
m_group.insert(action(ShowThreadNames), checkBoxShowThreadNames);
m_group.insert(action(ShowStdNamespace), checkBoxShowStdNamespace);