Commit cb7d4f8d authored by hjk's avatar hjk

debugger: inline commonoptionspage.ui

Change-Id: I8ededc392485558ed4327cc2b76e73fba81bf562
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent e440ec8a
...@@ -55,29 +55,101 @@ CommonOptionsPageWidget::CommonOptionsPageWidget ...@@ -55,29 +55,101 @@ CommonOptionsPageWidget::CommonOptionsPageWidget
(const QSharedPointer<Utils::SavedActionSet> &group, QWidget *parent) (const QSharedPointer<Utils::SavedActionSet> &group, QWidget *parent)
: QWidget(parent), m_group(group) : QWidget(parent), m_group(group)
{ {
m_ui.setupUi(this); 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);
checkBoxFontSizeFollowsEditor->setToolTip(tr("Change the font size in the debugger views when the font size in the main editor changes."));
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);
checkBoxListSourceFiles->setToolTip(tr("Populate the source file view automatically. This might slow down debugger startup considerably."));
checkBoxListSourceFiles->setText(tr("Populate source file view automatically"));
checkBoxCloseBuffersOnExit = new QCheckBox(behaviorBox);
checkBoxCloseBuffersOnExit->setText(tr("Close temporary buffers on debugger exit"));
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);
checkBoxShowQmlObjectTree->setToolTip(tr("Show QML object tree in Locals & Expressions when connected and not stepping."));
checkBoxShowQmlObjectTree->setText(tr("Show QML object tree"));
checkBoxBreakpointsFullPath = new QCheckBox(behaviorBox);
checkBoxBreakpointsFullPath->setToolTip(tr("Enable a full file path in breakpoints by default also for the GDB"));
checkBoxBreakpointsFullPath->setText(tr("Breakpoints full path by default"));
checkBoxRegisterForPostMortem = new QCheckBox(behaviorBox);
checkBoxRegisterForPostMortem->setToolTip(tr("Register Qt Creator for debugging crashed applications."));
checkBoxRegisterForPostMortem->setText(tr("Use Qt Creator for post-mortem debugging"));
labelMaximalStackDepth = new QLabel(behaviorBox);
labelMaximalStackDepth->setText(tr("Maximum stack depth:"));
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);
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);
gridLayout->addWidget(checkBoxRegisterForPostMortem, 4, 1, 1, 1);
gridLayout->addLayout(horizontalLayout, 6, 0, 1, 2);
QVBoxLayout *verticalLayout = new QVBoxLayout(this);
verticalLayout->addWidget(behaviorBox);
verticalLayout->addWidget(sourcesMappingWidget);
verticalLayout->addStretch();
DebuggerCore *dc = debuggerCore(); DebuggerCore *dc = debuggerCore();
m_group->clear(); m_group->clear();
m_group->insert(dc->action(ListSourceFiles), m_group->insert(dc->action(ListSourceFiles),
m_ui.checkBoxListSourceFiles); checkBoxListSourceFiles);
m_group->insert(dc->action(UseAlternatingRowColors), m_group->insert(dc->action(UseAlternatingRowColors),
m_ui.checkBoxUseAlternatingRowColors); checkBoxUseAlternatingRowColors);
m_group->insert(dc->action(UseToolTipsInMainEditor), m_group->insert(dc->action(UseToolTipsInMainEditor),
m_ui.checkBoxUseToolTipsInMainEditor); checkBoxUseToolTipsInMainEditor);
m_group->insert(dc->action(CloseBuffersOnExit), m_group->insert(dc->action(CloseBuffersOnExit),
m_ui.checkBoxCloseBuffersOnExit); checkBoxCloseBuffersOnExit);
m_group->insert(dc->action(SwitchModeOnExit), m_group->insert(dc->action(SwitchModeOnExit),
m_ui.checkBoxSwitchModeOnExit); checkBoxSwitchModeOnExit);
m_group->insert(dc->action(BreakpointsFullPathByDefault), m_group->insert(dc->action(BreakpointsFullPathByDefault),
m_ui.checkBoxBreakpointsFullPath); checkBoxBreakpointsFullPath);
m_group->insert(dc->action(RaiseOnInterrupt), m_group->insert(dc->action(RaiseOnInterrupt),
m_ui.checkBoxBringToForegroundOnInterrrupt); checkBoxBringToForegroundOnInterrrupt);
m_group->insert(dc->action(ShowQmlObjectTree), m_group->insert(dc->action(ShowQmlObjectTree),
m_ui.checkBoxShowQmlObjectTree); checkBoxShowQmlObjectTree);
m_group->insert(dc->action(FontSizeFollowsEditor), m_group->insert(dc->action(FontSizeFollowsEditor),
m_ui.checkBoxFontSizeFollowsEditor); checkBoxFontSizeFollowsEditor);
m_group->insert(dc->action(AutoDerefPointers), 0); m_group->insert(dc->action(AutoDerefPointers), 0);
m_group->insert(dc->action(UseToolTipsInLocalsView), 0); m_group->insert(dc->action(UseToolTipsInLocalsView), 0);
m_group->insert(dc->action(AlwaysAdjustLocalsColumnWidths), 0); m_group->insert(dc->action(AlwaysAdjustLocalsColumnWidths), 0);
...@@ -90,7 +162,7 @@ CommonOptionsPageWidget::CommonOptionsPageWidget ...@@ -90,7 +162,7 @@ CommonOptionsPageWidget::CommonOptionsPageWidget
m_group->insert(dc->action(UseAddressInStackView), 0); m_group->insert(dc->action(UseAddressInStackView), 0);
m_group->insert(dc->action(AlwaysAdjustStackColumnWidths), 0); m_group->insert(dc->action(AlwaysAdjustStackColumnWidths), 0);
m_group->insert(dc->action(MaximalStackDepth), m_group->insert(dc->action(MaximalStackDepth),
m_ui.spinBoxMaximalStackDepth); spinBoxMaximalStackDepth);
m_group->insert(dc->action(ShowStdNamespace), 0); m_group->insert(dc->action(ShowStdNamespace), 0);
m_group->insert(dc->action(ShowQtNamespace), 0); m_group->insert(dc->action(ShowQtNamespace), 0);
m_group->insert(dc->action(SortStructMembers), 0); m_group->insert(dc->action(SortStructMembers), 0);
...@@ -101,11 +173,11 @@ CommonOptionsPageWidget::CommonOptionsPageWidget ...@@ -101,11 +173,11 @@ CommonOptionsPageWidget::CommonOptionsPageWidget
if (Utils::HostOsInfo::isWindowsHost()) { if (Utils::HostOsInfo::isWindowsHost()) {
Utils::SavedAction *registerAction = dc->action(RegisterForPostMortem); Utils::SavedAction *registerAction = dc->action(RegisterForPostMortem);
m_group->insert(registerAction, m_group->insert(registerAction,
m_ui.checkBoxRegisterForPostMortem); checkBoxRegisterForPostMortem);
connect(registerAction, SIGNAL(toggled(bool)), connect(registerAction, SIGNAL(toggled(bool)),
m_ui.checkBoxRegisterForPostMortem, SLOT(setChecked(bool))); checkBoxRegisterForPostMortem, SLOT(setChecked(bool)));
} else { } else {
m_ui.checkBoxRegisterForPostMortem->setVisible(false); checkBoxRegisterForPostMortem->setVisible(false);
} }
} }
...@@ -114,18 +186,18 @@ QString CommonOptionsPageWidget::searchKeyWords() const ...@@ -114,18 +186,18 @@ QString CommonOptionsPageWidget::searchKeyWords() const
QString rc; QString rc;
const QLatin1Char sep(' '); const QLatin1Char sep(' ');
QTextStream stream(&rc); QTextStream stream(&rc);
stream << sep << m_ui.checkBoxUseAlternatingRowColors->text() stream << sep << checkBoxUseAlternatingRowColors->text()
<< sep << m_ui.checkBoxFontSizeFollowsEditor->text() << sep << checkBoxFontSizeFollowsEditor->text()
<< sep << m_ui.checkBoxUseToolTipsInMainEditor->text() << sep << checkBoxUseToolTipsInMainEditor->text()
<< sep << m_ui.checkBoxListSourceFiles->text() << sep << checkBoxListSourceFiles->text()
<< sep << m_ui.checkBoxBreakpointsFullPath->text() << sep << checkBoxBreakpointsFullPath->text()
<< sep << m_ui.checkBoxCloseBuffersOnExit->text() << sep << checkBoxCloseBuffersOnExit->text()
<< sep << m_ui.checkBoxSwitchModeOnExit->text() << sep << checkBoxSwitchModeOnExit->text()
<< sep << m_ui.labelMaximalStackDepth->text() << sep << labelMaximalStackDepth->text()
<< sep << m_ui.checkBoxBringToForegroundOnInterrrupt->text() << sep << checkBoxBringToForegroundOnInterrrupt->text()
<< sep << m_ui.checkBoxShowQmlObjectTree->text(); << sep << checkBoxShowQmlObjectTree->text();
if (Utils::HostOsInfo::isWindowsHost()) if (Utils::HostOsInfo::isWindowsHost())
stream << sep << m_ui.checkBoxRegisterForPostMortem->text(); stream << sep << checkBoxRegisterForPostMortem->text();
rc.remove(QLatin1Char('&')); rc.remove(QLatin1Char('&'));
return rc; return rc;
...@@ -134,13 +206,13 @@ QString CommonOptionsPageWidget::searchKeyWords() const ...@@ -134,13 +206,13 @@ QString CommonOptionsPageWidget::searchKeyWords() const
GlobalDebuggerOptions CommonOptionsPageWidget::globalOptions() const GlobalDebuggerOptions CommonOptionsPageWidget::globalOptions() const
{ {
GlobalDebuggerOptions o; GlobalDebuggerOptions o;
o.sourcePathMap = m_ui.sourcesMappingWidget->sourcePathMap(); o.sourcePathMap = sourcesMappingWidget->sourcePathMap();
return o; return o;
} }
void CommonOptionsPageWidget::setGlobalOptions(const GlobalDebuggerOptions &go) void CommonOptionsPageWidget::setGlobalOptions(const GlobalDebuggerOptions &go)
{ {
m_ui.sourcesMappingWidget->setSourcePathMap(go.sourcePathMap); sourcesMappingWidget->setSourcePathMap(go.sourcePathMap);
} }
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
......
...@@ -30,18 +30,21 @@ ...@@ -30,18 +30,21 @@
#ifndef DEBUGGER_COMMONOPTIONSPAGE_H #ifndef DEBUGGER_COMMONOPTIONSPAGE_H
#define DEBUGGER_COMMONOPTIONSPAGE_H #define DEBUGGER_COMMONOPTIONSPAGE_H
#include "ui_commonoptionspage.h" #include "debuggersourcepathmappingwidget.h"
#include "ui_localsandexpressionsoptionspage.h" #include "ui_localsandexpressionsoptionspage.h"
#include <coreplugin/dialogs/ioptionspage.h> #include <coreplugin/dialogs/ioptionspage.h>
#include <utils/savedaction.h> #include <utils/savedaction.h>
#include <QSharedPointer> #include <QCheckBox>
#include <QLabel>
#include <QPointer> #include <QPointer>
#include <QWidget> #include <QSharedPointer>
#include <QSpinBox>
namespace Debugger { namespace Debugger {
namespace Internal { namespace Internal {
class GlobalDebuggerOptions; class GlobalDebuggerOptions;
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
...@@ -60,7 +63,20 @@ public: ...@@ -60,7 +63,20 @@ public:
void setGlobalOptions(const GlobalDebuggerOptions &go); void setGlobalOptions(const GlobalDebuggerOptions &go);
private: private:
Ui::CommonOptionsPage m_ui; QCheckBox *checkBoxUseAlternatingRowColors;
QCheckBox *checkBoxFontSizeFollowsEditor;
QCheckBox *checkBoxUseToolTipsInMainEditor;
QCheckBox *checkBoxListSourceFiles;
QCheckBox *checkBoxCloseBuffersOnExit;
QCheckBox *checkBoxSwitchModeOnExit;
QCheckBox *checkBoxBringToForegroundOnInterrrupt;
QCheckBox *checkBoxShowQmlObjectTree;
QCheckBox *checkBoxBreakpointsFullPath;
QCheckBox *checkBoxRegisterForPostMortem;
QLabel *labelMaximalStackDepth;
QSpinBox *spinBoxMaximalStackDepth;
DebuggerSourcePathMappingWidget *sourcesMappingWidget;
const QSharedPointer<Utils::SavedActionSet> m_group; const QSharedPointer<Utils::SavedActionSet> m_group;
}; };
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Debugger::Internal::CommonOptionsPage</class>
<widget class="QWidget" name="Debugger::Internal::CommonOptionsPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>765</width>
<height>341</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="behaviorBox">
<property name="title">
<string>Behavior</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QCheckBox" name="checkBoxUseAlternatingRowColors">
<property name="text">
<string>Use alternating row colors in debug views</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="checkBoxFontSizeFollowsEditor">
<property name="toolTip">
<string>Change the font size in the debugger views when the font size in the main editor changes.</string>
</property>
<property name="text">
<string>Debugger font size follows main editor</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="checkBoxUseToolTipsInMainEditor">
<property name="text">
<string>Use tooltips in main editor while debugging</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="checkBoxListSourceFiles">
<property name="toolTip">
<string>Populate the source file view automatically. This might slow down debugger startup considerably.</string>
</property>
<property name="text">
<string>Populate source file view automatically</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="checkBoxCloseBuffersOnExit">
<property name="text">
<string>Close temporary buffers on debugger exit</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="checkBoxSwitchModeOnExit">
<property name="text">
<string>Switch to previous mode on debugger exit</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="checkBoxBringToForegroundOnInterrrupt">
<property name="text">
<string>Bring Qt Creator to foreground when application interrupts</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="checkBoxShowQmlObjectTree">
<property name="toolTip">
<string>Show QML object tree in Locals &amp; Expressions when connected and not stepping.</string>
</property>
<property name="text">
<string>Show QML object tree</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="checkBoxBreakpointsFullPath">
<property name="toolTip">
<string>Enable a full file path in breakpoints by default also for the GDB</string>
</property>
<property name="text">
<string>Breakpoints full path by default</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="checkBoxRegisterForPostMortem">
<property name="toolTip">
<string>Register Qt Creator for debugging crashed applications.</string>
</property>
<property name="text">
<string>Use Qt Creator for post-mortem debugging</string>
</property>
</widget>
</item>
<item row="6" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="labelMaximalStackDepth">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Maximum stack depth:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBoxMaximalStackDepth">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="specialValueText">
<string>&lt;unlimited&gt;</string>
</property>
<property name="maximum">
<number>999</number>
</property>
<property name="singleStep">
<number>5</number>
</property>
<property name="value">
<number>10</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="Debugger::Internal::DebuggerSourcePathMappingWidget" name="sourcesMappingWidget"/>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Debugger::Internal::DebuggerSourcePathMappingWidget</class>
<extends>QGroupBox</extends>
<header>debuggersourcepathmappingwidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
...@@ -120,8 +120,7 @@ SOURCES += \ ...@@ -120,8 +120,7 @@ SOURCES += \
localsandexpressionswindow.cpp localsandexpressionswindow.cpp
FORMS += \ FORMS += \
localsandexpressionsoptionspage.ui \ localsandexpressionsoptionspage.ui
commonoptionspage.ui
RESOURCES += debugger.qrc RESOURCES += debugger.qrc
......
...@@ -47,7 +47,6 @@ QtcPlugin { ...@@ -47,7 +47,6 @@ QtcPlugin {
"breakwindow.h", "breakwindow.h",
"commonoptionspage.cpp", "commonoptionspage.cpp",
"commonoptionspage.h", "commonoptionspage.h",
"commonoptionspage.ui",
"debugger.qrc", "debugger.qrc",
"debugger_global.h", "debugger_global.h",
"debuggeractions.cpp", "debuggeractions.cpp",
......
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