Debugger: Move std:: Qt namespace actions to options

Rename 'Debugging Helper' options pane to 'Locals & Expressions',
and move the two actions for showing/hiding std:: and Qt namespaces
in type name to the page.

Change-Id: If7ec66016b330a4c579597bcc81f1fa5a3eff815
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
Kai Koehne
2012-05-14 15:11:11 +02:00
committed by hjk
parent d64cced130
commit 02973b9681
7 changed files with 59 additions and 51 deletions

View File

@@ -224,42 +224,43 @@ bool CommonOptionsPage::matches(const QString &s) const
// //
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
QString DebuggingHelperOptionPage::id() const QString LocalsAndExpressionsOptionsPage::id() const
{ {
return _("Z.DebuggingHelper"); return _("Z.LocalsAndExpressions");
} }
QString DebuggingHelperOptionPage::displayName() const QString LocalsAndExpressionsOptionsPage::displayName() const
{ {
return QCoreApplication::translate("Debugger", "Debugging Helper"); //: '&&' will appear as one (one is marking keyboard shortcut)
return QCoreApplication::translate("Debugger", "Locals && Expressions");
} }
QString DebuggingHelperOptionPage::category() const QString LocalsAndExpressionsOptionsPage::category() const
{ {
return _(DEBUGGER_SETTINGS_CATEGORY); return _(DEBUGGER_SETTINGS_CATEGORY);
} }
QString DebuggingHelperOptionPage::displayCategory() const QString LocalsAndExpressionsOptionsPage::displayCategory() const
{ {
return QCoreApplication::translate("Debugger", DEBUGGER_SETTINGS_TR_CATEGORY); return QCoreApplication::translate("Debugger", DEBUGGER_SETTINGS_TR_CATEGORY);
} }
QIcon DebuggingHelperOptionPage::categoryIcon() const QIcon LocalsAndExpressionsOptionsPage::categoryIcon() const
{ {
return QIcon(QLatin1String(DEBUGGER_COMMON_SETTINGS_CATEGORY_ICON)); return QIcon(QLatin1String(DEBUGGER_COMMON_SETTINGS_CATEGORY_ICON));
} }
void DebuggingHelperOptionPage::apply() void LocalsAndExpressionsOptionsPage::apply()
{ {
m_group.apply(ICore::settings()); m_group.apply(ICore::settings());
} }
void DebuggingHelperOptionPage::finish() void LocalsAndExpressionsOptionsPage::finish()
{ {
m_group.finish(); m_group.finish();
} }
QWidget *DebuggingHelperOptionPage::createPage(QWidget *parent) QWidget *LocalsAndExpressionsOptionsPage::createPage(QWidget *parent)
{ {
QWidget *w = new QWidget(parent); QWidget *w = new QWidget(parent);
m_ui.setupUi(w); m_ui.setupUi(w);
@@ -276,6 +277,8 @@ QWidget *DebuggingHelperOptionPage::createPage(QWidget *parent)
m_group.insert(dc->action(ShowThreadNames), m_group.insert(dc->action(ShowThreadNames),
m_ui.checkBoxShowThreadNames); m_ui.checkBoxShowThreadNames);
m_group.insert(dc->action(ShowStdNamespace), m_ui.checkBoxShowStdNamespace);
m_group.insert(dc->action(ShowQtNamespace), m_ui.checkBoxShowQtNamespace);
#ifndef QT_DEBUG #ifndef QT_DEBUG
@@ -292,13 +295,16 @@ QWidget *DebuggingHelperOptionPage::createPage(QWidget *parent)
QTextStream(&m_searchKeywords) QTextStream(&m_searchKeywords)
<< ' ' << m_ui.debuggingHelperGroupBox->title() << ' ' << m_ui.debuggingHelperGroupBox->title()
<< ' ' << m_ui.checkBoxUseCodeModel->text() << ' ' << m_ui.checkBoxUseCodeModel->text()
<< ' ' << m_ui.checkBoxShowThreadNames->text(); << ' ' << m_ui.checkBoxShowThreadNames->text()
<< ' ' << m_ui.checkBoxShowStdNamespace->text()
<< ' ' << m_ui.checkBoxShowQtNamespace->text();
m_searchKeywords.remove(QLatin1Char('&')); m_searchKeywords.remove(QLatin1Char('&'));
} }
return w; return w;
} }
bool DebuggingHelperOptionPage::matches(const QString &s) const bool LocalsAndExpressionsOptionsPage::matches(const QString &s) const
{ {
return m_searchKeywords.contains(s, Qt::CaseInsensitive); return m_searchKeywords.contains(s, Qt::CaseInsensitive);
} }

View File

@@ -34,7 +34,7 @@
#define DEBUGGER_COMMONOPTIONSPAGE_H #define DEBUGGER_COMMONOPTIONSPAGE_H
#include "ui_commonoptionspage.h" #include "ui_commonoptionspage.h"
#include "ui_dumperoptionpage.h" #include "ui_localsandexpressionsoptionspage.h"
#include <coreplugin/dialogs/ioptionspage.h> #include <coreplugin/dialogs/ioptionspage.h>
#include <utils/savedaction.h> #include <utils/savedaction.h>
@@ -96,14 +96,14 @@ private:
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
// //
// DebuggingHelperOptionPage // LocalsAndExpressionsOptionsPage
// //
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
class DebuggingHelperOptionPage : public Core::IOptionsPage class LocalsAndExpressionsOptionsPage : public Core::IOptionsPage
{ {
public: public:
DebuggingHelperOptionPage() {} LocalsAndExpressionsOptionsPage() {}
// IOptionsPage // IOptionsPage
QString id() const; QString id() const;

View File

@@ -131,7 +131,7 @@ FORMS += attachexternaldialog.ui \
attachcoredialog.ui \ attachcoredialog.ui \
breakcondition.ui \ breakcondition.ui \
breakpoint.ui \ breakpoint.ui \
dumperoptionpage.ui \ localsandexpressionsoptionspage.ui \
commonoptionspage.ui \ commonoptionspage.ui \
startexternaldialog.ui \ startexternaldialog.ui \
startremotedialog.ui \ startremotedialog.ui \

View File

@@ -75,7 +75,7 @@ QtcPlugin {
"disassembleragent.h", "disassembleragent.h",
"disassemblerlines.cpp", "disassemblerlines.cpp",
"disassemblerlines.h", "disassemblerlines.h",
"dumperoptionpage.ui", "localsandexpressionsoptionspage.ui",
"localsandwatcherswindow.cpp", "localsandwatcherswindow.cpp",
"localsandwatcherswindow.h", "localsandwatcherswindow.h",
"logwindow.cpp", "logwindow.cpp",

View File

@@ -3411,7 +3411,7 @@ void DebuggerPluginPrivate::extensionsInitialized()
foreach (IOptionsPage *op, engineOptionPages) foreach (IOptionsPage *op, engineOptionPages)
m_plugin->addAutoReleasedObject(op); m_plugin->addAutoReleasedObject(op);
m_plugin->addAutoReleasedObject(new DebuggingHelperOptionPage); m_plugin->addAutoReleasedObject(new LocalsAndExpressionsOptionsPage);
connect(ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode*)), connect(ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode*)),
SLOT(onModeChanged(Core::IMode*))); SLOT(onModeChanged(Core::IMode*)));

View File

@@ -11,6 +11,15 @@
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_3"> <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> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="text"> <property name="text">
@@ -25,31 +34,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>3</height>
</size>
</property>
</spacer>
</item>
<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> <item>
<widget class="QCheckBox" name="checkBoxUseCodeModel"> <widget class="QCheckBox" name="checkBoxUseCodeModel">
<property name="toolTip"> <property name="toolTip">
@@ -73,6 +57,26 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item>
<widget class="QCheckBox" name="checkBoxShowStdNamespace">
<property name="toolTip">
<string>Show '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>Show 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> <item>
<spacer name="verticalSpacer"> <spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">

View File

@@ -868,8 +868,6 @@ void WatchTreeView::contextMenuEvent(QContextMenuEvent *ev)
menu.addAction(debuggerCore()->action(UseDebuggingHelpers)); menu.addAction(debuggerCore()->action(UseDebuggingHelpers));
menu.addAction(debuggerCore()->action(UseToolTipsInLocalsView)); menu.addAction(debuggerCore()->action(UseToolTipsInLocalsView));
menu.addAction(debuggerCore()->action(AutoDerefPointers)); menu.addAction(debuggerCore()->action(AutoDerefPointers));
menu.addAction(debuggerCore()->action(ShowStdNamespace));
menu.addAction(debuggerCore()->action(ShowQtNamespace));
menu.addAction(debuggerCore()->action(SortStructMembers)); menu.addAction(debuggerCore()->action(SortStructMembers));
menu.addAction(debuggerCore()->action(UseDynamicType)); menu.addAction(debuggerCore()->action(UseDynamicType));