diff --git a/src/plugins/debugger/commonoptionspage.cpp b/src/plugins/debugger/commonoptionspage.cpp index ae7484c6389..505c252d25b 100644 --- a/src/plugins/debugger/commonoptionspage.cpp +++ b/src/plugins/debugger/commonoptionspage.cpp @@ -55,29 +55,101 @@ CommonOptionsPageWidget::CommonOptionsPageWidget (const QSharedPointer &group, QWidget *parent) : 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("")); + 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(); m_group->clear(); m_group->insert(dc->action(ListSourceFiles), - m_ui.checkBoxListSourceFiles); + checkBoxListSourceFiles); m_group->insert(dc->action(UseAlternatingRowColors), - m_ui.checkBoxUseAlternatingRowColors); + checkBoxUseAlternatingRowColors); m_group->insert(dc->action(UseToolTipsInMainEditor), - m_ui.checkBoxUseToolTipsInMainEditor); + checkBoxUseToolTipsInMainEditor); m_group->insert(dc->action(CloseBuffersOnExit), - m_ui.checkBoxCloseBuffersOnExit); + checkBoxCloseBuffersOnExit); m_group->insert(dc->action(SwitchModeOnExit), - m_ui.checkBoxSwitchModeOnExit); + checkBoxSwitchModeOnExit); m_group->insert(dc->action(BreakpointsFullPathByDefault), - m_ui.checkBoxBreakpointsFullPath); + checkBoxBreakpointsFullPath); m_group->insert(dc->action(RaiseOnInterrupt), - m_ui.checkBoxBringToForegroundOnInterrrupt); + checkBoxBringToForegroundOnInterrrupt); m_group->insert(dc->action(ShowQmlObjectTree), - m_ui.checkBoxShowQmlObjectTree); + checkBoxShowQmlObjectTree); m_group->insert(dc->action(FontSizeFollowsEditor), - m_ui.checkBoxFontSizeFollowsEditor); + checkBoxFontSizeFollowsEditor); m_group->insert(dc->action(AutoDerefPointers), 0); m_group->insert(dc->action(UseToolTipsInLocalsView), 0); m_group->insert(dc->action(AlwaysAdjustLocalsColumnWidths), 0); @@ -90,7 +162,7 @@ CommonOptionsPageWidget::CommonOptionsPageWidget m_group->insert(dc->action(UseAddressInStackView), 0); m_group->insert(dc->action(AlwaysAdjustStackColumnWidths), 0); m_group->insert(dc->action(MaximalStackDepth), - m_ui.spinBoxMaximalStackDepth); + spinBoxMaximalStackDepth); m_group->insert(dc->action(ShowStdNamespace), 0); m_group->insert(dc->action(ShowQtNamespace), 0); m_group->insert(dc->action(SortStructMembers), 0); @@ -101,11 +173,11 @@ CommonOptionsPageWidget::CommonOptionsPageWidget if (Utils::HostOsInfo::isWindowsHost()) { Utils::SavedAction *registerAction = dc->action(RegisterForPostMortem); m_group->insert(registerAction, - m_ui.checkBoxRegisterForPostMortem); + checkBoxRegisterForPostMortem); connect(registerAction, SIGNAL(toggled(bool)), - m_ui.checkBoxRegisterForPostMortem, SLOT(setChecked(bool))); + checkBoxRegisterForPostMortem, SLOT(setChecked(bool))); } else { - m_ui.checkBoxRegisterForPostMortem->setVisible(false); + checkBoxRegisterForPostMortem->setVisible(false); } } @@ -114,18 +186,18 @@ QString CommonOptionsPageWidget::searchKeyWords() const QString rc; const QLatin1Char sep(' '); QTextStream stream(&rc); - stream << sep << m_ui.checkBoxUseAlternatingRowColors->text() - << sep << m_ui.checkBoxFontSizeFollowsEditor->text() - << sep << m_ui.checkBoxUseToolTipsInMainEditor->text() - << sep << m_ui.checkBoxListSourceFiles->text() - << sep << m_ui.checkBoxBreakpointsFullPath->text() - << sep << m_ui.checkBoxCloseBuffersOnExit->text() - << sep << m_ui.checkBoxSwitchModeOnExit->text() - << sep << m_ui.labelMaximalStackDepth->text() - << sep << m_ui.checkBoxBringToForegroundOnInterrrupt->text() - << sep << m_ui.checkBoxShowQmlObjectTree->text(); + stream << sep << checkBoxUseAlternatingRowColors->text() + << sep << checkBoxFontSizeFollowsEditor->text() + << sep << checkBoxUseToolTipsInMainEditor->text() + << sep << checkBoxListSourceFiles->text() + << sep << checkBoxBreakpointsFullPath->text() + << sep << checkBoxCloseBuffersOnExit->text() + << sep << checkBoxSwitchModeOnExit->text() + << sep << labelMaximalStackDepth->text() + << sep << checkBoxBringToForegroundOnInterrrupt->text() + << sep << checkBoxShowQmlObjectTree->text(); if (Utils::HostOsInfo::isWindowsHost()) - stream << sep << m_ui.checkBoxRegisterForPostMortem->text(); + stream << sep << checkBoxRegisterForPostMortem->text(); rc.remove(QLatin1Char('&')); return rc; @@ -134,13 +206,13 @@ QString CommonOptionsPageWidget::searchKeyWords() const GlobalDebuggerOptions CommonOptionsPageWidget::globalOptions() const { GlobalDebuggerOptions o; - o.sourcePathMap = m_ui.sourcesMappingWidget->sourcePathMap(); + o.sourcePathMap = sourcesMappingWidget->sourcePathMap(); return o; } void CommonOptionsPageWidget::setGlobalOptions(const GlobalDebuggerOptions &go) { - m_ui.sourcesMappingWidget->setSourcePathMap(go.sourcePathMap); + sourcesMappingWidget->setSourcePathMap(go.sourcePathMap); } /////////////////////////////////////////////////////////////////////// diff --git a/src/plugins/debugger/commonoptionspage.h b/src/plugins/debugger/commonoptionspage.h index 6b0ebf67e4d..474aab5514d 100644 --- a/src/plugins/debugger/commonoptionspage.h +++ b/src/plugins/debugger/commonoptionspage.h @@ -30,18 +30,21 @@ #ifndef DEBUGGER_COMMONOPTIONSPAGE_H #define DEBUGGER_COMMONOPTIONSPAGE_H -#include "ui_commonoptionspage.h" +#include "debuggersourcepathmappingwidget.h" #include "ui_localsandexpressionsoptionspage.h" #include #include -#include +#include +#include #include -#include +#include +#include namespace Debugger { namespace Internal { + class GlobalDebuggerOptions; /////////////////////////////////////////////////////////////////////// @@ -60,7 +63,20 @@ public: void setGlobalOptions(const GlobalDebuggerOptions &go); 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 m_group; }; diff --git a/src/plugins/debugger/commonoptionspage.ui b/src/plugins/debugger/commonoptionspage.ui deleted file mode 100644 index d31e3c85ec4..00000000000 --- a/src/plugins/debugger/commonoptionspage.ui +++ /dev/null @@ -1,194 +0,0 @@ - - - Debugger::Internal::CommonOptionsPage - - - - 0 - 0 - 765 - 341 - - - - - - - Behavior - - - - - - Use alternating row colors in debug views - - - - - - - Change the font size in the debugger views when the font size in the main editor changes. - - - Debugger font size follows main editor - - - - - - - Use tooltips in main editor while debugging - - - - - - - Populate the source file view automatically. This might slow down debugger startup considerably. - - - Populate source file view automatically - - - - - - - Close temporary buffers on debugger exit - - - - - - - Switch to previous mode on debugger exit - - - - - - - Bring Qt Creator to foreground when application interrupts - - - - - - - Show QML object tree in Locals & Expressions when connected and not stepping. - - - Show QML object tree - - - - - - - Enable a full file path in breakpoints by default also for the GDB - - - Breakpoints full path by default - - - - - - - Register Qt Creator for debugging crashed applications. - - - Use Qt Creator for post-mortem debugging - - - - - - - - - - 0 - 0 - - - - Maximum stack depth: - - - - - - - - 0 - 0 - - - - <unlimited> - - - 999 - - - 5 - - - 10 - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 40 - 20 - - - - - - - - - - - - - - - - Qt::Vertical - - - QSizePolicy::MinimumExpanding - - - - 0 - 0 - - - - - - - - - Debugger::Internal::DebuggerSourcePathMappingWidget - QGroupBox -
debuggersourcepathmappingwidget.h
- 1 -
-
- - -
diff --git a/src/plugins/debugger/debugger.pro b/src/plugins/debugger/debugger.pro index 5dc236c39de..57dd431b9d7 100644 --- a/src/plugins/debugger/debugger.pro +++ b/src/plugins/debugger/debugger.pro @@ -120,8 +120,7 @@ SOURCES += \ localsandexpressionswindow.cpp FORMS += \ - localsandexpressionsoptionspage.ui \ - commonoptionspage.ui + localsandexpressionsoptionspage.ui RESOURCES += debugger.qrc diff --git a/src/plugins/debugger/debugger.qbs b/src/plugins/debugger/debugger.qbs index 357a1df32d1..3548700b3f7 100644 --- a/src/plugins/debugger/debugger.qbs +++ b/src/plugins/debugger/debugger.qbs @@ -47,7 +47,6 @@ QtcPlugin { "breakwindow.h", "commonoptionspage.cpp", "commonoptionspage.h", - "commonoptionspage.ui", "debugger.qrc", "debugger_global.h", "debuggeractions.cpp",