2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2011-02-22 12:58:32 +01:00
|
|
|
**
|
2014-01-07 13:27:11 +01:00
|
|
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
2012-10-02 09:12:39 +02:00
|
|
|
** Contact: http://www.qt-project.org/legal
|
2011-02-22 12:58:32 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2011-02-22 12:58:32 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and Digia. For licensing terms and
|
|
|
|
|
** conditions see http://qt.digia.com/licensing. For further information
|
|
|
|
|
** use the contact form at http://qt.digia.com/contact-us.
|
2011-02-22 12:58:32 +01:00
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
2012-10-02 09:12:39 +02:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
|
|
|
** General Public License version 2.1 as published by the Free Software
|
|
|
|
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
|
|
|
** packaging of this file. Please review the following information to
|
|
|
|
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
|
|
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
|
|
|
**
|
|
|
|
|
** In addition, as a special exception, Digia gives you certain additional
|
|
|
|
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
2011-02-22 12:58:32 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2011-02-22 12:58:32 +01:00
|
|
|
|
|
|
|
|
#include "commonoptionspage.h"
|
|
|
|
|
|
|
|
|
|
#include "debuggeractions.h"
|
2011-04-21 15:52:51 +02:00
|
|
|
#include "debuggerinternalconstants.h"
|
2011-02-22 12:58:32 +01:00
|
|
|
#include "debuggercore.h"
|
|
|
|
|
|
|
|
|
|
#include <coreplugin/icore.h>
|
2012-08-23 15:53:58 +02:00
|
|
|
#include <utils/hostosinfo.h>
|
2014-05-16 17:32:07 +02:00
|
|
|
#include <utils/savedaction.h>
|
2011-03-04 16:21:57 +01:00
|
|
|
#include <utils/qtcassert.h>
|
2011-02-22 12:58:32 +01:00
|
|
|
|
2014-05-16 17:32:07 +02:00
|
|
|
#include <QCheckBox>
|
|
|
|
|
#include <QCoreApplication>
|
2014-07-08 14:11:48 +02:00
|
|
|
#include <QFormLayout>
|
2014-05-16 17:32:07 +02:00
|
|
|
#include <QHBoxLayout>
|
|
|
|
|
#include <QLabel>
|
2013-03-21 17:10:19 +01:00
|
|
|
#include <QSpinBox>
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QTextStream>
|
2011-02-22 12:58:32 +01:00
|
|
|
|
|
|
|
|
using namespace Core;
|
|
|
|
|
using namespace Debugger::Constants;
|
|
|
|
|
using namespace ProjectExplorer;
|
|
|
|
|
|
|
|
|
|
namespace Debugger {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2014-05-16 17:32:07 +02:00
|
|
|
class CommonOptionsPageWidget : public QWidget
|
|
|
|
|
{
|
2014-07-31 13:59:09 +02:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
2014-05-16 17:32:07 +02:00
|
|
|
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;
|
|
|
|
|
QSpinBox *spinBoxMaximalStackDepth;
|
|
|
|
|
|
|
|
|
|
DebuggerSourcePathMappingWidget *sourcesMappingWidget;
|
|
|
|
|
const QSharedPointer<Utils::SavedActionSet> m_group;
|
|
|
|
|
};
|
|
|
|
|
|
2011-03-16 18:48:14 +01:00
|
|
|
CommonOptionsPageWidget::CommonOptionsPageWidget
|
2014-05-16 17:32:07 +02:00
|
|
|
(const QSharedPointer<Utils::SavedActionSet> &group)
|
|
|
|
|
: m_group(group)
|
2011-03-04 16:21:57 +01:00
|
|
|
{
|
2012-11-10 23:29:43 +01:00
|
|
|
QGroupBox *behaviorBox = new QGroupBox(this);
|
|
|
|
|
behaviorBox->setTitle(tr("Behavior"));
|
|
|
|
|
|
|
|
|
|
checkBoxUseAlternatingRowColors = new QCheckBox(behaviorBox);
|
|
|
|
|
checkBoxUseAlternatingRowColors->setText(tr("Use alternating row colors in debug views"));
|
|
|
|
|
|
|
|
|
|
checkBoxFontSizeFollowsEditor = new QCheckBox(behaviorBox);
|
2014-03-13 09:55:53 +01:00
|
|
|
checkBoxFontSizeFollowsEditor->setToolTip(tr("Changes the font size in the debugger views when the font size in the main editor changes."));
|
2012-11-10 23:29:43 +01:00
|
|
|
checkBoxFontSizeFollowsEditor->setText(tr("Debugger font size follows main editor"));
|
|
|
|
|
|
|
|
|
|
checkBoxUseToolTipsInMainEditor = new QCheckBox(behaviorBox);
|
|
|
|
|
checkBoxUseToolTipsInMainEditor->setText(tr("Use tooltips in main editor while debugging"));
|
|
|
|
|
|
|
|
|
|
checkBoxListSourceFiles = new QCheckBox(behaviorBox);
|
2014-03-13 09:55:53 +01:00
|
|
|
checkBoxListSourceFiles->setToolTip(tr("Populates the source file view automatically. This might slow down debugger startup considerably."));
|
2012-11-10 23:29:43 +01:00
|
|
|
checkBoxListSourceFiles->setText(tr("Populate source file view automatically"));
|
|
|
|
|
|
|
|
|
|
checkBoxCloseBuffersOnExit = new QCheckBox(behaviorBox);
|
2013-06-03 13:31:49 +02:00
|
|
|
checkBoxCloseBuffersOnExit->setText(tr("Close temporary views on debugger exit"));
|
2013-06-06 10:47:21 +02:00
|
|
|
checkBoxCloseBuffersOnExit->setToolTip(tr("Stopping and stepping in the debugger "
|
2013-06-03 13:31:49 +02:00
|
|
|
"will automatically open source or disassembler views associated with the "
|
|
|
|
|
"current location. Select this option to automatically close them when "
|
|
|
|
|
"the debugger exits."));
|
2012-11-10 23:29:43 +01:00
|
|
|
|
|
|
|
|
checkBoxSwitchModeOnExit = new QCheckBox(behaviorBox);
|
|
|
|
|
checkBoxSwitchModeOnExit->setText(tr("Switch to previous mode on debugger exit"));
|
|
|
|
|
|
|
|
|
|
checkBoxBringToForegroundOnInterrrupt = new QCheckBox(behaviorBox);
|
|
|
|
|
checkBoxBringToForegroundOnInterrrupt->setText(tr("Bring Qt Creator to foreground when application interrupts"));
|
|
|
|
|
|
|
|
|
|
checkBoxShowQmlObjectTree = new QCheckBox(behaviorBox);
|
2014-03-13 09:55:53 +01:00
|
|
|
checkBoxShowQmlObjectTree->setToolTip(tr("Shows QML object tree in Locals & Expressions when connected and not stepping."));
|
2012-11-10 23:29:43 +01:00
|
|
|
checkBoxShowQmlObjectTree->setText(tr("Show QML object tree"));
|
|
|
|
|
|
|
|
|
|
checkBoxBreakpointsFullPath = new QCheckBox(behaviorBox);
|
2014-03-13 09:55:53 +01:00
|
|
|
checkBoxBreakpointsFullPath->setToolTip(tr("Enables a full file path in breakpoints by default also for GDB."));
|
2013-02-12 12:30:10 +01:00
|
|
|
checkBoxBreakpointsFullPath->setText(tr("Set breakpoints using a full absolute path"));
|
2012-11-10 23:29:43 +01:00
|
|
|
|
|
|
|
|
checkBoxRegisterForPostMortem = new QCheckBox(behaviorBox);
|
2014-03-13 09:55:53 +01:00
|
|
|
checkBoxRegisterForPostMortem->setToolTip(tr("Registers Qt Creator for debugging crashed applications."));
|
2012-11-10 23:29:43 +01:00
|
|
|
checkBoxRegisterForPostMortem->setText(tr("Use Qt Creator for post-mortem debugging"));
|
|
|
|
|
|
2013-03-04 00:42:36 -08:00
|
|
|
checkBoxWarnOnReleaseBuilds = new QCheckBox(behaviorBox);
|
|
|
|
|
checkBoxWarnOnReleaseBuilds->setText(tr("Warn when debugging \"Release\" builds"));
|
2014-03-13 09:55:53 +01:00
|
|
|
checkBoxWarnOnReleaseBuilds->setToolTip(tr("Shows a warning when starting the debugger "
|
2013-03-04 00:42:36 -08:00
|
|
|
"on a binary with insufficient debug information."));
|
|
|
|
|
|
2014-05-02 12:08:44 +02:00
|
|
|
checkBoxKeepEditorStationaryWhileStepping = new QCheckBox(behaviorBox);
|
|
|
|
|
checkBoxKeepEditorStationaryWhileStepping->setText(tr("Keep editor stationary when stepping"));
|
|
|
|
|
checkBoxKeepEditorStationaryWhileStepping->setToolTip(tr("Scrolls the editor only when it is necessary "
|
|
|
|
|
"to keep the current line in view, "
|
|
|
|
|
"instead of keeping the next statement centered at "
|
|
|
|
|
"all times."));
|
|
|
|
|
|
2012-11-11 00:32:33 +01:00
|
|
|
labelMaximalStackDepth = new QLabel(tr("Maximum stack depth:"), behaviorBox);
|
2012-11-10 23:29:43 +01:00
|
|
|
|
|
|
|
|
spinBoxMaximalStackDepth = new QSpinBox(behaviorBox);
|
|
|
|
|
spinBoxMaximalStackDepth->setSpecialValueText(tr("<unlimited>"));
|
|
|
|
|
spinBoxMaximalStackDepth->setMaximum(999);
|
|
|
|
|
spinBoxMaximalStackDepth->setSingleStep(5);
|
|
|
|
|
spinBoxMaximalStackDepth->setValue(10);
|
|
|
|
|
|
|
|
|
|
sourcesMappingWidget = new DebuggerSourcePathMappingWidget(this);
|
|
|
|
|
|
|
|
|
|
QHBoxLayout *horizontalLayout = new QHBoxLayout();
|
|
|
|
|
horizontalLayout->addWidget(labelMaximalStackDepth);
|
|
|
|
|
horizontalLayout->addWidget(spinBoxMaximalStackDepth);
|
|
|
|
|
horizontalLayout->addStretch();
|
|
|
|
|
|
|
|
|
|
QGridLayout *gridLayout = new QGridLayout(behaviorBox);
|
|
|
|
|
gridLayout->addWidget(checkBoxUseAlternatingRowColors, 0, 0, 1, 1);
|
|
|
|
|
gridLayout->addWidget(checkBoxUseToolTipsInMainEditor, 1, 0, 1, 1);
|
|
|
|
|
gridLayout->addWidget(checkBoxCloseBuffersOnExit, 2, 0, 1, 1);
|
|
|
|
|
gridLayout->addWidget(checkBoxBringToForegroundOnInterrrupt, 3, 0, 1, 1);
|
|
|
|
|
gridLayout->addWidget(checkBoxBreakpointsFullPath, 4, 0, 1, 1);
|
2013-03-04 00:42:36 -08:00
|
|
|
gridLayout->addWidget(checkBoxWarnOnReleaseBuilds, 5, 0, 1, 1);
|
2012-11-11 00:32:33 +01:00
|
|
|
gridLayout->addLayout(horizontalLayout, 6, 0, 1, 2);
|
2012-11-10 23:29:43 +01:00
|
|
|
|
|
|
|
|
gridLayout->addWidget(checkBoxFontSizeFollowsEditor, 0, 1, 1, 1);
|
|
|
|
|
gridLayout->addWidget(checkBoxListSourceFiles, 1, 1, 1, 1);
|
|
|
|
|
gridLayout->addWidget(checkBoxSwitchModeOnExit, 2, 1, 1, 1);
|
|
|
|
|
gridLayout->addWidget(checkBoxShowQmlObjectTree, 3, 1, 1, 1);
|
2014-05-02 12:08:44 +02:00
|
|
|
gridLayout->addWidget(checkBoxKeepEditorStationaryWhileStepping, 4, 1, 1, 1);
|
|
|
|
|
gridLayout->addWidget(checkBoxRegisterForPostMortem, 5, 1, 1, 1);
|
2012-11-10 23:29:43 +01:00
|
|
|
|
|
|
|
|
QVBoxLayout *verticalLayout = new QVBoxLayout(this);
|
|
|
|
|
verticalLayout->addWidget(behaviorBox);
|
|
|
|
|
verticalLayout->addWidget(sourcesMappingWidget);
|
|
|
|
|
verticalLayout->addStretch();
|
2011-03-16 18:48:14 +01:00
|
|
|
|
|
|
|
|
DebuggerCore *dc = debuggerCore();
|
2011-03-04 16:21:57 +01:00
|
|
|
m_group->clear();
|
|
|
|
|
|
2011-03-16 18:48:14 +01:00
|
|
|
m_group->insert(dc->action(ListSourceFiles),
|
2012-11-10 23:29:43 +01:00
|
|
|
checkBoxListSourceFiles);
|
2011-03-16 18:48:14 +01:00
|
|
|
m_group->insert(dc->action(UseAlternatingRowColors),
|
2012-11-10 23:29:43 +01:00
|
|
|
checkBoxUseAlternatingRowColors);
|
2011-03-16 18:48:14 +01:00
|
|
|
m_group->insert(dc->action(UseToolTipsInMainEditor),
|
2012-11-10 23:29:43 +01:00
|
|
|
checkBoxUseToolTipsInMainEditor);
|
2011-03-16 18:48:14 +01:00
|
|
|
m_group->insert(dc->action(CloseBuffersOnExit),
|
2012-11-10 23:29:43 +01:00
|
|
|
checkBoxCloseBuffersOnExit);
|
2011-03-16 18:48:14 +01:00
|
|
|
m_group->insert(dc->action(SwitchModeOnExit),
|
2012-11-10 23:29:43 +01:00
|
|
|
checkBoxSwitchModeOnExit);
|
2012-06-10 01:20:30 +04:00
|
|
|
m_group->insert(dc->action(BreakpointsFullPathByDefault),
|
2012-11-10 23:29:43 +01:00
|
|
|
checkBoxBreakpointsFullPath);
|
2012-03-13 13:50:05 +01:00
|
|
|
m_group->insert(dc->action(RaiseOnInterrupt),
|
2012-11-10 23:29:43 +01:00
|
|
|
checkBoxBringToForegroundOnInterrrupt);
|
2012-04-18 14:20:54 +02:00
|
|
|
m_group->insert(dc->action(ShowQmlObjectTree),
|
2012-11-10 23:29:43 +01:00
|
|
|
checkBoxShowQmlObjectTree);
|
2013-03-04 00:42:36 -08:00
|
|
|
m_group->insert(dc->action(WarnOnReleaseBuilds),
|
|
|
|
|
checkBoxWarnOnReleaseBuilds);
|
2014-05-02 12:08:44 +02:00
|
|
|
m_group->insert(dc->action(StationaryEditorWhileStepping),
|
|
|
|
|
checkBoxKeepEditorStationaryWhileStepping);
|
2011-04-01 12:01:14 +02:00
|
|
|
m_group->insert(dc->action(FontSizeFollowsEditor),
|
2012-11-10 23:29:43 +01:00
|
|
|
checkBoxFontSizeFollowsEditor);
|
2011-03-16 18:48:14 +01:00
|
|
|
m_group->insert(dc->action(AutoDerefPointers), 0);
|
|
|
|
|
m_group->insert(dc->action(UseToolTipsInLocalsView), 0);
|
2014-06-03 11:34:52 +02:00
|
|
|
m_group->insert(dc->action(AlwaysAdjustColumnWidths), 0);
|
2011-03-16 18:48:14 +01:00
|
|
|
m_group->insert(dc->action(UseToolTipsInBreakpointsView), 0);
|
2013-09-24 18:00:48 +02:00
|
|
|
m_group->insert(dc->action(UseToolTipsInStackView), 0);
|
2011-03-16 18:48:14 +01:00
|
|
|
m_group->insert(dc->action(UseAddressInBreakpointsView), 0);
|
|
|
|
|
m_group->insert(dc->action(UseAddressInStackView), 0);
|
2012-11-11 00:32:33 +01:00
|
|
|
m_group->insert(dc->action(MaximalStackDepth), spinBoxMaximalStackDepth);
|
2011-03-16 18:48:14 +01:00
|
|
|
m_group->insert(dc->action(ShowStdNamespace), 0);
|
|
|
|
|
m_group->insert(dc->action(ShowQtNamespace), 0);
|
|
|
|
|
m_group->insert(dc->action(SortStructMembers), 0);
|
|
|
|
|
m_group->insert(dc->action(LogTimeStamps), 0);
|
|
|
|
|
m_group->insert(dc->action(VerboseLog), 0);
|
|
|
|
|
m_group->insert(dc->action(BreakOnThrow), 0);
|
|
|
|
|
m_group->insert(dc->action(BreakOnCatch), 0);
|
2012-08-23 15:53:58 +02:00
|
|
|
if (Utils::HostOsInfo::isWindowsHost()) {
|
|
|
|
|
Utils::SavedAction *registerAction = dc->action(RegisterForPostMortem);
|
|
|
|
|
m_group->insert(registerAction,
|
2012-11-10 23:29:43 +01:00
|
|
|
checkBoxRegisterForPostMortem);
|
2012-08-23 15:53:58 +02:00
|
|
|
connect(registerAction, SIGNAL(toggled(bool)),
|
2012-11-10 23:29:43 +01:00
|
|
|
checkBoxRegisterForPostMortem, SLOT(setChecked(bool)));
|
2012-08-23 15:53:58 +02:00
|
|
|
} else {
|
2012-11-10 23:29:43 +01:00
|
|
|
checkBoxRegisterForPostMortem->setVisible(false);
|
2012-08-23 15:53:58 +02:00
|
|
|
}
|
2011-03-04 16:21:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GlobalDebuggerOptions CommonOptionsPageWidget::globalOptions() const
|
|
|
|
|
{
|
|
|
|
|
GlobalDebuggerOptions o;
|
2012-11-10 23:29:43 +01:00
|
|
|
o.sourcePathMap = sourcesMappingWidget->sourcePathMap();
|
2011-03-04 16:21:57 +01:00
|
|
|
return o;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CommonOptionsPageWidget::setGlobalOptions(const GlobalDebuggerOptions &go)
|
|
|
|
|
{
|
2012-11-10 23:29:43 +01:00
|
|
|
sourcesMappingWidget->setSourcePathMap(go.sourcePathMap);
|
2011-03-04 16:21:57 +01:00
|
|
|
}
|
|
|
|
|
|
2011-02-22 12:58:32 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// CommonOptionsPage
|
|
|
|
|
//
|
|
|
|
|
///////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2011-03-04 16:21:57 +01:00
|
|
|
CommonOptionsPage::CommonOptionsPage(const QSharedPointer<GlobalDebuggerOptions> &go) :
|
|
|
|
|
m_options(go)
|
|
|
|
|
{
|
2013-01-16 15:22:58 +01:00
|
|
|
setId(DEBUGGER_COMMON_SETTINGS_ID);
|
2012-05-22 11:17:13 +02:00
|
|
|
setDisplayName(QCoreApplication::translate("Debugger", "General"));
|
2012-12-29 03:37:27 +01:00
|
|
|
setCategory(DEBUGGER_SETTINGS_CATEGORY);
|
2012-05-22 11:17:13 +02:00
|
|
|
setDisplayCategory(QCoreApplication::translate("Debugger", DEBUGGER_SETTINGS_TR_CATEGORY));
|
|
|
|
|
setCategoryIcon(QLatin1String(DEBUGGER_COMMON_SETTINGS_CATEGORY_ICON));
|
2011-03-04 16:21:57 +01:00
|
|
|
}
|
|
|
|
|
|
2011-07-28 15:26:43 +02:00
|
|
|
CommonOptionsPage::~CommonOptionsPage()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2011-02-22 12:58:32 +01:00
|
|
|
void CommonOptionsPage::apply()
|
|
|
|
|
{
|
2012-04-17 08:01:25 +02:00
|
|
|
QTC_ASSERT(!m_widget.isNull() && !m_group.isNull(), return);
|
2011-03-04 16:21:57 +01:00
|
|
|
|
2013-09-04 18:39:43 +02:00
|
|
|
m_group->apply(ICore::settings());
|
2011-03-04 16:21:57 +01:00
|
|
|
|
|
|
|
|
const GlobalDebuggerOptions newGlobalOptions = m_widget->globalOptions();
|
|
|
|
|
if (newGlobalOptions != *m_options) {
|
|
|
|
|
*m_options = newGlobalOptions;
|
2013-09-04 18:39:43 +02:00
|
|
|
m_options->toSettings();
|
2011-03-04 16:21:57 +01:00
|
|
|
}
|
2011-02-22 12:58:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CommonOptionsPage::finish()
|
|
|
|
|
{
|
2011-03-07 11:05:03 +01:00
|
|
|
if (!m_group.isNull())
|
|
|
|
|
m_group->finish();
|
2013-12-03 14:17:03 +01:00
|
|
|
delete m_widget;
|
2011-02-22 12:58:32 +01:00
|
|
|
}
|
|
|
|
|
|
2013-12-03 14:17:03 +01:00
|
|
|
QWidget *CommonOptionsPage::widget()
|
2011-02-22 12:58:32 +01:00
|
|
|
{
|
2011-03-04 16:21:57 +01:00
|
|
|
if (m_group.isNull())
|
|
|
|
|
m_group = QSharedPointer<Utils::SavedActionSet>(new Utils::SavedActionSet);
|
2011-02-22 12:58:32 +01:00
|
|
|
|
2013-12-03 14:17:03 +01:00
|
|
|
if (!m_widget) {
|
|
|
|
|
m_widget = new CommonOptionsPageWidget(m_group);
|
|
|
|
|
m_widget->setGlobalOptions(*m_options);
|
|
|
|
|
}
|
|
|
|
|
return m_widget;
|
2011-02-22 12:58:32 +01:00
|
|
|
}
|
|
|
|
|
|
2012-08-28 14:37:18 +02:00
|
|
|
QString CommonOptionsPage::msgSetBreakpointAtFunction(const char *function)
|
|
|
|
|
{
|
|
|
|
|
return tr("Stop when %1() is called").arg(QLatin1String(function));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString CommonOptionsPage::msgSetBreakpointAtFunctionToolTip(const char *function,
|
|
|
|
|
const QString &hint)
|
|
|
|
|
{
|
|
|
|
|
QString result = QLatin1String("<html><head/><body>");
|
2013-12-04 12:01:17 +01:00
|
|
|
result += tr("Always adds a breakpoint on the <i>%1()</i> function.").arg(QLatin1String(function));
|
2012-08-28 14:37:18 +02:00
|
|
|
if (!hint.isEmpty()) {
|
|
|
|
|
result += QLatin1String("<br>");
|
|
|
|
|
result += hint;
|
|
|
|
|
}
|
|
|
|
|
result += QLatin1String("</body></html>");
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-16 17:32:07 +02:00
|
|
|
|
2011-02-22 12:58:32 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
2012-05-22 11:17:13 +02:00
|
|
|
// LocalsAndExpressionsOptionsPage
|
2011-02-22 12:58:32 +01:00
|
|
|
//
|
|
|
|
|
///////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2012-05-22 11:17:13 +02:00
|
|
|
LocalsAndExpressionsOptionsPage::LocalsAndExpressionsOptionsPage()
|
2011-02-22 12:58:32 +01:00
|
|
|
{
|
2013-01-16 15:22:58 +01:00
|
|
|
setId("Z.LocalsAndExpressions");
|
2012-05-14 15:11:11 +02:00
|
|
|
//: '&&' will appear as one (one is marking keyboard shortcut)
|
2012-05-22 11:17:13 +02:00
|
|
|
setDisplayName(QCoreApplication::translate("Debugger", "Locals && Expressions"));
|
2012-12-29 03:37:27 +01:00
|
|
|
setCategory(DEBUGGER_SETTINGS_CATEGORY);
|
2012-05-22 11:17:13 +02:00
|
|
|
setDisplayCategory(QCoreApplication::translate("Debugger", DEBUGGER_SETTINGS_TR_CATEGORY));
|
|
|
|
|
setCategoryIcon(QLatin1String(DEBUGGER_COMMON_SETTINGS_CATEGORY_ICON));
|
2011-02-22 12:58:32 +01:00
|
|
|
}
|
|
|
|
|
|
2012-05-14 15:11:11 +02:00
|
|
|
void LocalsAndExpressionsOptionsPage::apply()
|
2011-02-22 12:58:32 +01:00
|
|
|
{
|
2012-01-24 15:36:40 +01:00
|
|
|
m_group.apply(ICore::settings());
|
2011-02-22 12:58:32 +01:00
|
|
|
}
|
|
|
|
|
|
2012-05-14 15:11:11 +02:00
|
|
|
void LocalsAndExpressionsOptionsPage::finish()
|
2011-02-22 12:58:32 +01:00
|
|
|
{
|
|
|
|
|
m_group.finish();
|
2013-12-03 14:17:03 +01:00
|
|
|
delete m_widget;
|
2011-02-22 12:58:32 +01:00
|
|
|
}
|
|
|
|
|
|
2013-12-03 14:17:03 +01:00
|
|
|
QWidget *LocalsAndExpressionsOptionsPage::widget()
|
2011-02-22 12:58:32 +01:00
|
|
|
{
|
2013-12-03 14:17:03 +01:00
|
|
|
if (!m_widget) {
|
|
|
|
|
m_widget = new QWidget;
|
|
|
|
|
DebuggerCore *dc = debuggerCore();
|
2011-03-16 18:48:14 +01:00
|
|
|
|
2014-07-08 14:11:48 +02:00
|
|
|
auto debuggingHelperGroupBox = new QGroupBox(m_widget);
|
2014-05-16 17:32:07 +02:00
|
|
|
debuggingHelperGroupBox->setTitle(tr("Use Debugging Helper"));
|
|
|
|
|
debuggingHelperGroupBox->setCheckable(true);
|
|
|
|
|
|
2014-07-08 14:11:48 +02:00
|
|
|
auto label = new QLabel(debuggingHelperGroupBox);
|
2014-05-16 17:32:07 +02:00
|
|
|
label->setTextFormat(Qt::AutoText);
|
|
|
|
|
label->setWordWrap(true);
|
|
|
|
|
label->setText(QLatin1String("<html><head/><body>\n<p>")
|
2014-07-08 14:11:48 +02:00
|
|
|
+ tr("The debugging helpers are used to produce a nice "
|
2014-05-16 17:32:07 +02:00
|
|
|
"display of objects of certain types like QString or "
|
2014-07-08 14:11:48 +02:00
|
|
|
"std::map in the "Locals and Expressions" view. ")
|
2014-05-16 17:32:07 +02:00
|
|
|
+ QLatin1String("</p></body></html>"));
|
|
|
|
|
|
2014-07-08 14:11:48 +02:00
|
|
|
auto checkBoxUseCodeModel = new QCheckBox(debuggingHelperGroupBox);
|
2014-05-16 17:32:07 +02:00
|
|
|
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."));
|
|
|
|
|
|
2014-07-08 14:11:48 +02:00
|
|
|
auto checkBoxShowThreadNames = new QCheckBox(debuggingHelperGroupBox);
|
2014-05-16 17:32:07 +02:00
|
|
|
checkBoxShowThreadNames->setToolTip(tr("Displays names of QThread based threads."));
|
|
|
|
|
checkBoxShowThreadNames->setText(tr("Display thread names"));
|
|
|
|
|
|
2014-07-08 14:11:48 +02:00
|
|
|
auto checkBoxShowStdNamespace = new QCheckBox(m_widget);
|
|
|
|
|
checkBoxShowStdNamespace->setToolTip(tr("Shows \"std::\" prefix for types from the standard library."));
|
2014-05-16 17:32:07 +02:00
|
|
|
checkBoxShowStdNamespace->setText(tr("Show \"std::\" namespace for types"));
|
|
|
|
|
|
2014-07-08 14:11:48 +02:00
|
|
|
auto checkBoxShowQtNamespace = new QCheckBox(m_widget);
|
2014-05-16 17:32:07 +02:00
|
|
|
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"));
|
|
|
|
|
|
2014-07-08 14:11:48 +02:00
|
|
|
auto spinBoxMaximalStringLength = new QSpinBox(m_widget);
|
|
|
|
|
spinBoxMaximalStringLength->setSpecialValueText(tr("<unlimited>"));
|
|
|
|
|
spinBoxMaximalStringLength->setMaximum(10000000);
|
|
|
|
|
spinBoxMaximalStringLength->setSingleStep(1000);
|
|
|
|
|
spinBoxMaximalStringLength->setValue(10000);
|
|
|
|
|
|
|
|
|
|
auto spinBoxDisplayStringLimit = new QSpinBox(m_widget);
|
|
|
|
|
spinBoxDisplayStringLimit->setSpecialValueText(tr("<unlimited>"));
|
|
|
|
|
spinBoxDisplayStringLimit->setMaximum(10000);
|
|
|
|
|
spinBoxDisplayStringLimit->setSingleStep(10);
|
|
|
|
|
spinBoxDisplayStringLimit->setValue(100);
|
|
|
|
|
|
|
|
|
|
auto verticalLayout = new QVBoxLayout(debuggingHelperGroupBox);
|
2014-05-16 17:32:07 +02:00
|
|
|
verticalLayout->addWidget(label);
|
|
|
|
|
verticalLayout->addWidget(checkBoxUseCodeModel);
|
|
|
|
|
verticalLayout->addWidget(checkBoxShowThreadNames);
|
|
|
|
|
|
2014-07-08 14:11:48 +02:00
|
|
|
auto layout1 = new QFormLayout;
|
|
|
|
|
layout1->addItem(new QSpacerItem(10, 10));
|
|
|
|
|
layout1->addRow(checkBoxShowStdNamespace);
|
|
|
|
|
layout1->addRow(checkBoxShowQtNamespace);
|
|
|
|
|
layout1->addItem(new QSpacerItem(10, 10));
|
|
|
|
|
layout1->addRow(tr("Maximum string length:"), spinBoxMaximalStringLength);
|
2014-07-30 09:26:42 +02:00
|
|
|
layout1->addRow(tr("Display string length:"), spinBoxDisplayStringLimit);
|
2014-07-08 14:11:48 +02:00
|
|
|
|
|
|
|
|
auto lowerLayout = new QHBoxLayout;
|
|
|
|
|
lowerLayout->addLayout(layout1);
|
|
|
|
|
lowerLayout->addStretch();
|
|
|
|
|
|
|
|
|
|
auto layout = new QVBoxLayout(m_widget);
|
2014-05-16 17:32:07 +02:00
|
|
|
layout->addWidget(debuggingHelperGroupBox);
|
2014-07-08 14:11:48 +02:00
|
|
|
layout->addLayout(lowerLayout);
|
2014-05-16 17:32:07 +02:00
|
|
|
layout->addStretch();
|
2011-02-22 12:58:32 +01:00
|
|
|
|
2014-05-16 17:32:07 +02:00
|
|
|
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);
|
2014-07-08 14:11:48 +02:00
|
|
|
m_group.insert(dc->action(DisplayStringLimit), spinBoxDisplayStringLimit);
|
|
|
|
|
m_group.insert(dc->action(MaximalStringLength), spinBoxMaximalStringLength);
|
2011-02-22 12:58:32 +01:00
|
|
|
|
|
|
|
|
#ifndef QT_DEBUG
|
|
|
|
|
#if 0
|
2014-05-16 17:32:07 +02:00
|
|
|
cmd = am->registerAction(m_dumpLogAction, DUMP_LOG, globalcontext);
|
2013-12-03 14:17:03 +01:00
|
|
|
//cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+D,Ctrl+L")));
|
|
|
|
|
cmd->setDefaultKeySequence(QKeySequence(QCoreApplication::translate("Debugger", "Ctrl+Shift+F11")));
|
|
|
|
|
mdebug->addAction(cmd);
|
2011-02-22 12:58:32 +01:00
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
}
|
2013-12-03 14:17:03 +01:00
|
|
|
return m_widget;
|
2011-02-22 12:58:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Debugger
|
2014-07-31 13:59:09 +02:00
|
|
|
|
|
|
|
|
#include "commonoptionspage.moc"
|