Commit d4aa0f2a authored by hjk's avatar hjk

Debugger: Streamline option page code

Change-Id: I4ce31031bda92864212e914257e4f5c1fafa2af6
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 40052046
......@@ -35,8 +35,13 @@
#include <coreplugin/icore.h>
#include <utils/hostosinfo.h>
#include <utils/savedaction.h>
#include <utils/qtcassert.h>
#include <QCheckBox>
#include <QCoreApplication>
#include <QHBoxLayout>
#include <QLabel>
#include <QSpinBox>
#include <QTextStream>
......@@ -47,9 +52,41 @@ using namespace ProjectExplorer;
namespace Debugger {
namespace Internal {
class CommonOptionsPageWidget : public QWidget
{
public:
explicit CommonOptionsPageWidget(const QSharedPointer<Utils::SavedActionSet> &group);
GlobalDebuggerOptions globalOptions() const;
void setGlobalOptions(const GlobalDebuggerOptions &go);
private:
QCheckBox *checkBoxUseAlternatingRowColors;
QCheckBox *checkBoxFontSizeFollowsEditor;
QCheckBox *checkBoxUseToolTipsInMainEditor;
QCheckBox *checkBoxListSourceFiles;
QCheckBox *checkBoxCloseBuffersOnExit;
QCheckBox *checkBoxSwitchModeOnExit;
QCheckBox *checkBoxBringToForegroundOnInterrrupt;
QCheckBox *checkBoxShowQmlObjectTree;
QCheckBox *checkBoxBreakpointsFullPath;
QCheckBox *checkBoxRegisterForPostMortem;
QCheckBox *checkBoxWarnOnReleaseBuilds;
QCheckBox *checkBoxKeepEditorStationaryWhileStepping;
QLabel *labelMaximalStackDepth;
QLabel *labelDisplayStringLimit;
QLabel *labelMaximalStringLength;
QSpinBox *spinBoxMaximalStackDepth;
QSpinBox *spinBoxMaximalStringLength;
QSpinBox *spinBoxDisplayStringLimit;
DebuggerSourcePathMappingWidget *sourcesMappingWidget;
const QSharedPointer<Utils::SavedActionSet> m_group;
};
CommonOptionsPageWidget::CommonOptionsPageWidget
(const QSharedPointer<Utils::SavedActionSet> &group, QWidget *parent)
: QWidget(parent), m_group(group)
(const QSharedPointer<Utils::SavedActionSet> &group)
: m_group(group)
{
QGroupBox *behaviorBox = new QGroupBox(this);
behaviorBox->setTitle(tr("Behavior"));
......@@ -309,6 +346,7 @@ QString CommonOptionsPage::msgSetBreakpointAtFunctionToolTip(const char *functio
return result;
}
///////////////////////////////////////////////////////////////////////
//
// LocalsAndExpressionsOptionsPage
......@@ -340,28 +378,62 @@ QWidget *LocalsAndExpressionsOptionsPage::widget()
{
if (!m_widget) {
m_widget = new QWidget;
m_ui.setupUi(m_widget);
m_group.clear();
DebuggerCore *dc = debuggerCore();
m_group.insert(dc->action(UseDebuggingHelpers),
m_ui.debuggingHelperGroupBox);
m_group.insert(dc->action(UseCodeModel),
m_ui.checkBoxUseCodeModel);
m_ui.checkBoxUseCodeModel->setToolTip(dc->action(UseCodeModel)->toolTip());
m_group.insert(dc->action(ShowThreadNames),
m_ui.checkBoxShowThreadNames);
m_group.insert(dc->action(ShowStdNamespace), m_ui.checkBoxShowStdNamespace);
m_group.insert(dc->action(ShowQtNamespace), m_ui.checkBoxShowQtNamespace);
QGroupBox *debuggingHelperGroupBox = new QGroupBox(m_widget);
debuggingHelperGroupBox->setTitle(tr("Use Debugging Helper"));
debuggingHelperGroupBox->setCheckable(true);
QLabel *label = new QLabel(debuggingHelperGroupBox);
label->setTextFormat(Qt::AutoText);
label->setWordWrap(true);
label->setText(QLatin1String("<html><head/><body>\n<p>")
+ tr("The debugging helper is only used to produce a nice "
"display of objects of certain types like QString or "
"std::map in the &quot;Locals and Expressions&quot; view. "
"It is not strictly necessary for debugging with Qt Creator.")
+ QLatin1String("</p></body></html>"));
QCheckBox *checkBoxUseCodeModel = new QCheckBox(debuggingHelperGroupBox);
checkBoxUseCodeModel->setText(tr("Use code model"));
checkBoxUseCodeModel->setToolTip(dc->action(UseCodeModel)->toolTip());
checkBoxUseCodeModel->setToolTip(tr("Makes use of Qt Creator's code model "
"to find out if a variable has already been assigned a "
"value at the point the debugger interrupts."));
QCheckBox *checkBoxShowThreadNames = new QCheckBox(debuggingHelperGroupBox);
checkBoxShowThreadNames->setToolTip(tr("Displays names of QThread based threads."));
checkBoxShowThreadNames->setText(tr("Display thread names"));
QCheckBox *checkBoxShowStdNamespace = new QCheckBox(m_widget);
checkBoxShowStdNamespace->setToolTip(tr("Shows 'std::' prefix for types from the standard library."));
checkBoxShowStdNamespace->setText(tr("Show \"std::\" namespace for types"));
QCheckBox *checkBoxShowQtNamespace = new QCheckBox(m_widget);
checkBoxShowQtNamespace->setToolTip(tr("Shows Qt namespace prefix for Qt types. This is only relevant if Qt was configured with '-qtnamespace'."));
checkBoxShowQtNamespace->setText(tr("Qt's namespace for types"));
QVBoxLayout *verticalLayout = new QVBoxLayout(debuggingHelperGroupBox);
verticalLayout->addWidget(label);
verticalLayout->addWidget(checkBoxUseCodeModel);
verticalLayout->addWidget(checkBoxShowThreadNames);
QVBoxLayout *layout = new QVBoxLayout(m_widget);
layout->addWidget(debuggingHelperGroupBox);
layout->addWidget(checkBoxShowStdNamespace);
layout->addWidget(checkBoxShowQtNamespace);
layout->addStretch();
m_group.clear();
m_group.insert(dc->action(UseDebuggingHelpers), debuggingHelperGroupBox);
m_group.insert(dc->action(UseCodeModel), checkBoxUseCodeModel);
m_group.insert(dc->action(ShowThreadNames), checkBoxShowThreadNames);
m_group.insert(dc->action(ShowStdNamespace), checkBoxShowStdNamespace);
m_group.insert(dc->action(ShowQtNamespace), checkBoxShowQtNamespace);
#ifndef QT_DEBUG
#if 0
cmd = am->registerAction(m_dumpLogAction,
DUMP_LOG, globalcontext);
cmd = am->registerAction(m_dumpLogAction, DUMP_LOG, globalcontext);
//cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+D,Ctrl+L")));
cmd->setDefaultKeySequence(QKeySequence(QCoreApplication::translate("Debugger", "Ctrl+Shift+F11")));
mdebug->addAction(cmd);
......
......@@ -31,7 +31,6 @@
#define DEBUGGER_COMMONOPTIONSPAGE_H
#include "debuggersourcepathmappingwidget.h"
#include "ui_localsandexpressionsoptionspage.h"
#include <coreplugin/dialogs/ioptionspage.h>
#include <utils/savedaction.h>
......@@ -47,6 +46,7 @@ namespace Debugger {
namespace Internal {
class GlobalDebuggerOptions;
class CommonOptionsPageWidget;
///////////////////////////////////////////////////////////////////////
//
......@@ -54,39 +54,6 @@ class GlobalDebuggerOptions;
//
///////////////////////////////////////////////////////////////////////
class CommonOptionsPageWidget : public QWidget
{
Q_OBJECT
public:
explicit CommonOptionsPageWidget(const QSharedPointer<Utils::SavedActionSet> &group, QWidget *parent = 0);
GlobalDebuggerOptions globalOptions() const;
void setGlobalOptions(const GlobalDebuggerOptions &go);
private:
QCheckBox *checkBoxUseAlternatingRowColors;
QCheckBox *checkBoxFontSizeFollowsEditor;
QCheckBox *checkBoxUseToolTipsInMainEditor;
QCheckBox *checkBoxListSourceFiles;
QCheckBox *checkBoxCloseBuffersOnExit;
QCheckBox *checkBoxSwitchModeOnExit;
QCheckBox *checkBoxBringToForegroundOnInterrrupt;
QCheckBox *checkBoxShowQmlObjectTree;
QCheckBox *checkBoxBreakpointsFullPath;
QCheckBox *checkBoxRegisterForPostMortem;
QCheckBox *checkBoxWarnOnReleaseBuilds;
QCheckBox *checkBoxKeepEditorStationaryWhileStepping;
QLabel *labelMaximalStackDepth;
QLabel *labelDisplayStringLimit;
QLabel *labelMaximalStringLength;
QSpinBox *spinBoxMaximalStackDepth;
QSpinBox *spinBoxMaximalStringLength;
QSpinBox *spinBoxDisplayStringLimit;
DebuggerSourcePathMappingWidget *sourcesMappingWidget;
const QSharedPointer<Utils::SavedActionSet> m_group;
};
class CommonOptionsPage : public Core::IOptionsPage
{
Q_OBJECT
......@@ -129,7 +96,6 @@ public:
private:
QPointer<QWidget> m_widget;
Ui::DebuggingHelperOptionPage m_ui;
Utils::SavedActionSet m_group;
};
......
......@@ -133,9 +133,6 @@ SOURCES += \
simplifytype.cpp \
unstartedappwatcherdialog.cpp
FORMS += \
localsandexpressionsoptionspage.ui
RESOURCES += debugger.qrc
false {
......
......@@ -63,7 +63,6 @@ QtcPlugin {
"disassemblerlines.cpp", "disassemblerlines.h",
"imageviewer.cpp", "imageviewer.h",
"loadcoredialog.cpp", "loadcoredialog.h",
"localsandexpressionsoptionspage.ui",
"localsandexpressionswindow.cpp", "localsandexpressionswindow.h",
"logwindow.cpp", "logwindow.h",
"memoryagent.cpp", "memoryagent.h",
......
......@@ -108,9 +108,12 @@
#include <utils/statuslabel.h>
#include <utils/winutils.h>
#include <QCheckBox>
#include <QComboBox>
#include <QDockWidget>
#include <QFileDialog>
#include <QHBoxLayout>
#include <QHeaderView>
#include <QInputDialog>
#include <QMessageBox>
#include <QTextBlock>
......
......@@ -35,9 +35,11 @@
#include <coreplugin/icore.h>
#include <QCheckBox>
#include <QCoreApplication>
#include <QDebug>
#include <QFormLayout>
#include <QLabel>
#include <QSpinBox>
#include <QTextEdit>
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Debugger::Internal::DebuggingHelperOptionPage</class>
<widget class="QWidget" name="Debugger::Internal::DebuggingHelperOptionPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>529</width>
<height>303</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QGroupBox" name="debuggingHelperGroupBox">
<property name="title">
<string>Use Debugging Helper</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;
&lt;p&gt;The debugging helper is only used to produce a nice display of objects of certain types like QString or std::map in the &amp;quot;Locals and Expressions&amp;quot; view. It is not strictly necessary for debugging with Qt Creator. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::AutoText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxUseCodeModel">
<property name="toolTip">
<string>Makes use of Qt Creator's code model to find out if a variable has already been assigned a value at the point the debugger interrupts.</string>
</property>
<property name="text">
<string>Use code model</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxShowThreadNames">
<property name="toolTip">
<string>Displays names of QThread based threads.</string>
</property>
<property name="text">
<string>Display thread names</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxShowStdNamespace">
<property name="toolTip">
<string>Shows 'std::' prefix for types from the standard library.</string>
</property>
<property name="text">
<string>Show &quot;std::&quot; namespace for types</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxShowQtNamespace">
<property name="toolTip">
<string>Shows Qt namespace prefix for Qt types. This is only relevant if Qt was configured with '-qtnamespace'.</string>
</property>
<property name="text">
<string>Show Qt's namespace for types</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
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