forked from qt-creator/qt-creator
Clean up CDB options page, make room for further options.
Introduce grid layout and columns. Move the paths to separate dialogs, saving space. Fix search keywords. Task-number: QTCREATORBUG-8141 Change-Id: I05b5ee3ab0c123bbe018f4b6d8613dffe8558d34 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -32,6 +32,7 @@
|
|||||||
#include "commonoptionspage.h"
|
#include "commonoptionspage.h"
|
||||||
#include "debuggerinternalconstants.h"
|
#include "debuggerinternalconstants.h"
|
||||||
#include "cdbengine.h"
|
#include "cdbengine.h"
|
||||||
|
#include "cdbsymbolpathlisteditor.h"
|
||||||
|
|
||||||
#include <utils/synchronousprocess.h>
|
#include <utils/synchronousprocess.h>
|
||||||
|
|
||||||
@@ -39,7 +40,10 @@
|
|||||||
|
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
|
#include <QDialogButtonBox>
|
||||||
|
#include <QPushButton>
|
||||||
#include <QCheckBox>
|
#include <QCheckBox>
|
||||||
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -157,6 +161,46 @@ QStringList CdbBreakEventWidget::breakEvents() const
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CdbPathDialog::CdbPathDialog(QWidget *parent, Mode mode)
|
||||||
|
: QDialog(parent)
|
||||||
|
, m_pathListEditor(0)
|
||||||
|
{
|
||||||
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
|
setMinimumWidth(700);
|
||||||
|
|
||||||
|
switch (mode) {
|
||||||
|
case SymbolPaths:
|
||||||
|
setWindowTitle(tr("CDB Symbol Paths"));
|
||||||
|
m_pathListEditor = new CdbSymbolPathListEditor(this);
|
||||||
|
break;
|
||||||
|
case SourcePaths:
|
||||||
|
setWindowTitle(tr("CDB Source Paths"));
|
||||||
|
m_pathListEditor = new Utils::PathListEditor(this);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||||
|
QGroupBox *groupBox = new QGroupBox(this);
|
||||||
|
(new QVBoxLayout(groupBox))->addWidget(m_pathListEditor);
|
||||||
|
layout->addWidget(groupBox);
|
||||||
|
QDialogButtonBox *buttonBox =
|
||||||
|
new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
|
||||||
|
Qt::Horizontal, this);
|
||||||
|
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
||||||
|
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
||||||
|
layout->addWidget(buttonBox);
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList CdbPathDialog::paths() const
|
||||||
|
{
|
||||||
|
return m_pathListEditor->pathList();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CdbPathDialog::setPaths(const QStringList &paths)
|
||||||
|
{
|
||||||
|
m_pathListEditor->setPathList(paths);
|
||||||
|
}
|
||||||
|
|
||||||
CdbOptionsPageWidget::CdbOptionsPageWidget(QWidget *parent) :
|
CdbOptionsPageWidget::CdbOptionsPageWidget(QWidget *parent) :
|
||||||
QWidget(parent), m_breakEventWidget(new CdbBreakEventWidget)
|
QWidget(parent), m_breakEventWidget(new CdbBreakEventWidget)
|
||||||
{
|
{
|
||||||
@@ -165,11 +209,11 @@ CdbOptionsPageWidget::CdbOptionsPageWidget(QWidget *parent) :
|
|||||||
// accommodate all options. This page only shows on
|
// accommodate all options. This page only shows on
|
||||||
// Windows, which has large margins by default.
|
// Windows, which has large margins by default.
|
||||||
|
|
||||||
const int margin = m_ui.verticalLayout->margin();
|
const int margin = layout()->margin();
|
||||||
const QMargins margins(margin, margin / 3, margin, margin / 3);
|
const QMargins margins(margin, margin / 3, margin, margin / 3);
|
||||||
|
|
||||||
m_ui.startupFormLayout->setContentsMargins(margins);
|
m_ui.startupFormLayout->setContentsMargins(margins);
|
||||||
m_ui.pathFormLayout->setContentsMargins(margins);
|
m_ui.pathGroupBox->layout()->setContentsMargins(margins);
|
||||||
m_ui.breakpointLayout->setContentsMargins(margins);
|
m_ui.breakpointLayout->setContentsMargins(margins);
|
||||||
|
|
||||||
QVBoxLayout *eventLayout = new QVBoxLayout;
|
QVBoxLayout *eventLayout = new QVBoxLayout;
|
||||||
@@ -181,13 +225,34 @@ CdbOptionsPageWidget::CdbOptionsPageWidget(QWidget *parent) :
|
|||||||
const QString hint = tr("This is useful to catch runtime error messages, for example caused by assert().");
|
const QString hint = tr("This is useful to catch runtime error messages, for example caused by assert().");
|
||||||
m_ui.breakCrtDbgReportCheckBox
|
m_ui.breakCrtDbgReportCheckBox
|
||||||
->setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip(CdbOptions::crtDbgReport, hint));
|
->setToolTip(CommonOptionsPage::msgSetBreakpointAtFunctionToolTip(CdbOptions::crtDbgReport, hint));
|
||||||
|
|
||||||
|
connect(m_ui.symbolPathButton, SIGNAL(clicked()), this, SLOT(showSymbolPathDialog()));
|
||||||
|
connect(m_ui.sourcePathButton, SIGNAL(clicked()), this, SLOT(showSourcePathDialog()));
|
||||||
|
}
|
||||||
|
|
||||||
|
void CdbOptionsPageWidget::setSymbolPaths(const QStringList &s)
|
||||||
|
{
|
||||||
|
m_symbolPaths = s;
|
||||||
|
const QString summary =
|
||||||
|
tr("Symbol paths: %1").arg(m_symbolPaths.isEmpty() ?
|
||||||
|
tr("<none>") : QString::number(m_symbolPaths.size()));
|
||||||
|
m_ui.symbolPathLabel->setText(summary);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CdbOptionsPageWidget::setSourcePaths(const QStringList &s)
|
||||||
|
{
|
||||||
|
m_sourcePaths = s;
|
||||||
|
const QString summary =
|
||||||
|
tr("Source paths: %1").arg(m_sourcePaths.isEmpty() ?
|
||||||
|
tr("<none>") : QString::number(m_sourcePaths.size()));
|
||||||
|
m_ui.sourcePathLabel->setText(summary);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CdbOptionsPageWidget::setOptions(CdbOptions &o)
|
void CdbOptionsPageWidget::setOptions(CdbOptions &o)
|
||||||
{
|
{
|
||||||
m_ui.additionalArgumentsLineEdit->setText(o.additionalArguments);
|
m_ui.additionalArgumentsLineEdit->setText(o.additionalArguments);
|
||||||
setSymbolPaths(o.symbolPaths);
|
setSymbolPaths(o.symbolPaths);
|
||||||
m_ui.sourcePathListEditor->setPathList(o.sourcePaths);
|
setSourcePaths(o.sourcePaths);
|
||||||
m_breakEventWidget->setBreakEvents(o.breakEvents);
|
m_breakEventWidget->setBreakEvents(o.breakEvents);
|
||||||
m_ui.consoleCheckBox->setChecked(o.cdbConsole);
|
m_ui.consoleCheckBox->setChecked(o.cdbConsole);
|
||||||
m_ui.breakpointCorrectionCheckBox->setChecked(o.breakpointCorrection);
|
m_ui.breakpointCorrectionCheckBox->setChecked(o.breakpointCorrection);
|
||||||
@@ -198,8 +263,8 @@ CdbOptions CdbOptionsPageWidget::options() const
|
|||||||
{
|
{
|
||||||
CdbOptions rc;
|
CdbOptions rc;
|
||||||
rc.additionalArguments = m_ui.additionalArgumentsLineEdit->text().trimmed();
|
rc.additionalArguments = m_ui.additionalArgumentsLineEdit->text().trimmed();
|
||||||
rc.symbolPaths = symbolPaths();
|
rc.symbolPaths = m_symbolPaths;
|
||||||
rc.sourcePaths = m_ui.sourcePathListEditor->pathList();
|
rc.sourcePaths = m_sourcePaths;
|
||||||
rc.breakEvents = m_breakEventWidget->breakEvents();
|
rc.breakEvents = m_breakEventWidget->breakEvents();
|
||||||
rc.cdbConsole = m_ui.consoleCheckBox->isChecked();
|
rc.cdbConsole = m_ui.consoleCheckBox->isChecked();
|
||||||
rc.breakpointCorrection = m_ui.breakpointCorrectionCheckBox->isChecked();
|
rc.breakpointCorrection = m_ui.breakpointCorrectionCheckBox->isChecked();
|
||||||
@@ -208,21 +273,39 @@ CdbOptions CdbOptionsPageWidget::options() const
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList CdbOptionsPageWidget::symbolPaths() const
|
void CdbOptionsPageWidget::showSymbolPathDialog()
|
||||||
{
|
{
|
||||||
return m_ui.symbolPathListEditor->pathList();
|
CdbPathDialog pathDialog(this, CdbPathDialog::SymbolPaths);
|
||||||
|
pathDialog.setPaths(m_symbolPaths);
|
||||||
|
if (pathDialog.exec() == QDialog::Accepted)
|
||||||
|
setSymbolPaths(pathDialog.paths());
|
||||||
}
|
}
|
||||||
|
|
||||||
void CdbOptionsPageWidget::setSymbolPaths(const QStringList &s)
|
void CdbOptionsPageWidget::showSourcePathDialog()
|
||||||
{
|
{
|
||||||
m_ui.symbolPathListEditor->setPathList(s);
|
CdbPathDialog pathDialog(this, CdbPathDialog::SourcePaths);
|
||||||
|
pathDialog.setPaths(m_sourcePaths);
|
||||||
|
if (pathDialog.exec() == QDialog::Accepted)
|
||||||
|
setSourcePaths(pathDialog.paths());
|
||||||
|
}
|
||||||
|
|
||||||
|
static QString stripColon(QString s)
|
||||||
|
{
|
||||||
|
const int lastColon = s.lastIndexOf(QLatin1Char(':'));
|
||||||
|
if (lastColon != -1)
|
||||||
|
s.truncate(lastColon);
|
||||||
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CdbOptionsPageWidget::searchKeywords() const
|
QString CdbOptionsPageWidget::searchKeywords() const
|
||||||
{
|
{
|
||||||
QString rc;
|
QString rc;
|
||||||
QTextStream(&rc) << m_ui.symbolPathLabel->text()
|
QTextStream(&rc)
|
||||||
<< ' ' << m_ui.sourcePathLabel->text();
|
<< stripColon(m_ui.additionalArgumentsLabel->text()) << ' '
|
||||||
|
<< stripColon(m_ui.breakFunctionGroupBox->title()) << ' '
|
||||||
|
<< m_ui.breakpointsGroupBox->title() << ' '
|
||||||
|
<< stripColon(m_ui.symbolPathLabel->text()) << ' '
|
||||||
|
<< stripColon(m_ui.sourcePathLabel->text());
|
||||||
rc.remove(QLatin1Char('&'));
|
rc.remove(QLatin1Char('&'));
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,14 +38,20 @@
|
|||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
#include <QSharedPointer>
|
#include <QSharedPointer>
|
||||||
|
#include <QDialog>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QCheckBox;
|
class QCheckBox;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
namespace Utils {
|
||||||
|
class PathListEditor;
|
||||||
|
}
|
||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
|
class CdbSymbolPathListEditor;
|
||||||
|
|
||||||
// Widget displaying a list of break events for the 'sxe' command
|
// Widget displaying a list of break events for the 'sxe' command
|
||||||
// with a checkbox to enable 'break' and optionally a QLineEdit for
|
// with a checkbox to enable 'break' and optionally a QLineEdit for
|
||||||
// events with parameters (like 'out:Needle').
|
// events with parameters (like 'out:Needle').
|
||||||
@@ -67,6 +73,24 @@ private:
|
|||||||
QList<QLineEdit*> m_lineEdits;
|
QList<QLineEdit*> m_lineEdits;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class CdbPathDialog : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
enum Mode {
|
||||||
|
SymbolPaths,
|
||||||
|
SourcePaths
|
||||||
|
};
|
||||||
|
|
||||||
|
explicit CdbPathDialog(QWidget *parent, Mode mode);
|
||||||
|
|
||||||
|
QStringList paths() const;
|
||||||
|
void setPaths(const QStringList &paths);
|
||||||
|
|
||||||
|
private:
|
||||||
|
Utils::PathListEditor *m_pathListEditor;
|
||||||
|
};
|
||||||
|
|
||||||
class CdbOptionsPageWidget : public QWidget
|
class CdbOptionsPageWidget : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -79,13 +103,20 @@ public:
|
|||||||
|
|
||||||
QString searchKeywords() const;
|
QString searchKeywords() const;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void showSymbolPathDialog();
|
||||||
|
void showSourcePathDialog();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QStringList symbolPaths() const;
|
void setSymbolPaths(const QStringList &);
|
||||||
void setSymbolPaths(const QStringList &s);
|
void setSourcePaths(const QStringList &);
|
||||||
|
|
||||||
inline QString path() const;
|
inline QString path() const;
|
||||||
|
|
||||||
Ui::CdbOptionsPageWidget m_ui;
|
Ui::CdbOptionsPageWidget m_ui;
|
||||||
CdbBreakEventWidget *m_breakEventWidget;
|
CdbBreakEventWidget *m_breakEventWidget;
|
||||||
|
QStringList m_symbolPaths;
|
||||||
|
QStringList m_sourcePaths;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CdbOptionsPage : public Core::IOptionsPage
|
class CdbOptionsPage : public Core::IOptionsPage
|
||||||
|
|||||||
@@ -12,8 +12,8 @@
|
|||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<item>
|
<item row="0" column="0">
|
||||||
<widget class="QGroupBox" name="cdbPathGroupBox">
|
<widget class="QGroupBox" name="cdbPathGroupBox">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string extracomment="Placeholder">Startup</string>
|
<string extracomment="Placeholder">Startup</string>
|
||||||
@@ -54,47 +54,50 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
<item row="0" column="1">
|
||||||
</item>
|
<widget class="QGroupBox" name="pathGroupBox">
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="startupGroupBox">
|
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Debugger Paths</string>
|
<string>Paths</string>
|
||||||
</property>
|
|
||||||
<layout class="QFormLayout" name="pathFormLayout">
|
|
||||||
<property name="fieldGrowthPolicy">
|
|
||||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
|
||||||
</property>
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="symbolPathLabel">
|
<widget class="QLabel" name="symbolPathLabel">
|
||||||
<property name="text">
|
<property name="sizePolicy">
|
||||||
<string>&Symbol paths:</string>
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||||
</property>
|
<horstretch>0</horstretch>
|
||||||
<property name="buddy">
|
<verstretch>0</verstretch>
|
||||||
<cstring>symbolPathListEditor</cstring>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="Debugger::Internal::CdbSymbolPathListEditor" name="symbolPathListEditor" native="true"/>
|
<widget class="QPushButton" name="symbolPathButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Edit...</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="sourcePathLabel">
|
<widget class="QLabel" name="sourcePathLabel">
|
||||||
<property name="text">
|
<property name="sizePolicy">
|
||||||
<string>S&ource paths:</string>
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||||
</property>
|
<horstretch>0</horstretch>
|
||||||
<property name="buddy">
|
<verstretch>0</verstretch>
|
||||||
<cstring>sourcePathListEditor</cstring>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="Utils::PathListEditor" name="sourcePathListEditor" native="true"/>
|
<widget class="QPushButton" name="sourcePathButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Edit...</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="1" column="0">
|
||||||
<widget class="QGroupBox" name="breakpointsGroupBox">
|
<widget class="QGroupBox" name="breakpointsGroupBox">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Breakpoints</string>
|
<string>Breakpoints</string>
|
||||||
@@ -113,14 +116,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="1" column="1">
|
||||||
<widget class="QGroupBox" name="eventGroupBox">
|
|
||||||
<property name="title">
|
|
||||||
<string>Break on:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="breakFunctionGroupBox">
|
<widget class="QGroupBox" name="breakFunctionGroupBox">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Break on functions:</string>
|
<string>Break on functions:</string>
|
||||||
@@ -132,6 +128,15 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="2" column="0" colspan="2">
|
||||||
|
<widget class="QGroupBox" name="eventGroupBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>Break on:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
@@ -147,20 +152,6 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
|
||||||
<customwidget>
|
|
||||||
<class>Utils::PathListEditor</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header location="global">utils/pathlisteditor.h</header>
|
|
||||||
<container>1</container>
|
|
||||||
</customwidget>
|
|
||||||
<customwidget>
|
|
||||||
<class>Debugger::Internal::CdbSymbolPathListEditor</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header location="global">cdbsymbolpathlisteditor.h</header>
|
|
||||||
<container>1</container>
|
|
||||||
</customwidget>
|
|
||||||
</customwidgets>
|
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
Reference in New Issue
Block a user