diff --git a/src/plugins/debugger/CMakeLists.txt b/src/plugins/debugger/CMakeLists.txt index de760bd0d18..2bd5da24498 100644 --- a/src/plugins/debugger/CMakeLists.txt +++ b/src/plugins/debugger/CMakeLists.txt @@ -73,7 +73,7 @@ add_qtc_plugin(Debugger shared/cdbsymbolpathlisteditor.cpp shared/cdbsymbolpathlisteditor.h shared/hostutils.cpp shared/hostutils.h shared/peutils.cpp shared/peutils.h - shared/symbolpathsdialog.cpp shared/symbolpathsdialog.h shared/symbolpathsdialog.ui + shared/symbolpathsdialog.cpp shared/symbolpathsdialog.h simplifytype.cpp simplifytype.h sourceagent.cpp sourceagent.h sourcefileshandler.cpp sourcefileshandler.h diff --git a/src/plugins/debugger/debugger.qbs b/src/plugins/debugger/debugger.qbs index 33c7f61e9ad..50f1eba24f9 100644 --- a/src/plugins/debugger/debugger.qbs +++ b/src/plugins/debugger/debugger.qbs @@ -168,7 +168,7 @@ Project { "cdbsymbolpathlisteditor.h", "hostutils.cpp", "hostutils.h", "peutils.cpp", "peutils.h", - "symbolpathsdialog.ui", "symbolpathsdialog.cpp", "symbolpathsdialog.h" + "symbolpathsdialog.cpp", "symbolpathsdialog.h" ] } diff --git a/src/plugins/debugger/shared/symbolpathsdialog.cpp b/src/plugins/debugger/shared/symbolpathsdialog.cpp index be8ef21afec..379f01ecb6b 100644 --- a/src/plugins/debugger/shared/symbolpathsdialog.cpp +++ b/src/plugins/debugger/shared/symbolpathsdialog.cpp @@ -24,11 +24,11 @@ ****************************************************************************/ #include "symbolpathsdialog.h" -#include "ui_symbolpathsdialog.h" - -#include +#include +#include #include +#include using namespace Utils; @@ -36,49 +36,87 @@ namespace Debugger { namespace Internal { SymbolPathsDialog::SymbolPathsDialog(QWidget *parent) : - QDialog(parent), - ui(new Ui::SymbolPathsDialog) + QDialog(parent) { - ui->setupUi(this); - ui->pixmapLabel->setPixmap(QMessageBox::standardIcon(QMessageBox::Question)); + setWindowTitle(tr("Set up Symbol Paths", nullptr)); + + m_pixmapLabel = new QLabel(this); + m_pixmapLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); + m_pixmapLabel->setAlignment(Qt::AlignHCenter|Qt::AlignTop); + m_pixmapLabel->setMargin(5); + m_pixmapLabel->setPixmap(QMessageBox::standardIcon(QMessageBox::Question)); + + m_msgLabel = new QLabel(tr("

The debugger is not configured to use the " + "public Microsoft Symbol Server.
This is recommended for retrieval of the symbols " + "of the operating system libraries.

" + "

Note: It is recommended, that if you use " + "the Microsoft Symbol Server, to also use a local symbol cache.
" + "A fast internet connection is required for this to work smoothly,
" + "and a delay might occur when connecting for the first time and caching the symbols.

" + "

What would you like to set up?

")); + m_msgLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + m_msgLabel->setTextFormat(Qt::RichText); + m_msgLabel->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop); + + m_useLocalSymbolCache = new QCheckBox(tr("Use Local Symbol Cache")); + + m_useSymbolServer = new QCheckBox(tr("Use Microsoft Symbol Server")); + + m_pathChooser = new PathChooser; + + auto buttonBox = new QDialogButtonBox; + buttonBox->setOrientation(Qt::Horizontal); + buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); + + connect(buttonBox, &QDialogButtonBox::accepted, this, qOverload<>(&QDialog::accept)); + connect(buttonBox, &QDialogButtonBox::rejected, this, qOverload<>(&QDialog::reject)); + + auto horizontalLayout = new QHBoxLayout(); + horizontalLayout->addWidget(m_pixmapLabel); + horizontalLayout->addWidget(m_msgLabel); + + auto verticalLayout = new QVBoxLayout(this); + verticalLayout->addLayout(horizontalLayout); + verticalLayout->addWidget(m_useLocalSymbolCache); + verticalLayout->addWidget(m_useSymbolServer); + verticalLayout->addWidget(m_pathChooser); + verticalLayout->addWidget(buttonBox); } -SymbolPathsDialog::~SymbolPathsDialog() -{ - delete ui; -} +SymbolPathsDialog::~SymbolPathsDialog() = default; bool SymbolPathsDialog::useSymbolCache() const { - return ui->useLocalSymbolCache->isChecked(); + return m_useLocalSymbolCache->isChecked(); } bool SymbolPathsDialog::useSymbolServer() const { - return ui->useSymbolServer->isChecked(); + return m_useSymbolServer->isChecked(); } FilePath SymbolPathsDialog::path() const { - return ui->pathChooser->filePath(); + return m_pathChooser->filePath(); } void SymbolPathsDialog::setUseSymbolCache(bool useSymbolCache) { - ui->useLocalSymbolCache->setChecked(useSymbolCache); + m_useLocalSymbolCache->setChecked(useSymbolCache); } void SymbolPathsDialog::setUseSymbolServer(bool useSymbolServer) { - ui->useSymbolServer->setChecked(useSymbolServer); + m_useSymbolServer->setChecked(useSymbolServer); } void SymbolPathsDialog::setPath(const FilePath &path) { - ui->pathChooser->setFilePath(path); + m_pathChooser->setFilePath(path); } -bool SymbolPathsDialog::useCommonSymbolPaths(bool &useSymbolCache, bool &useSymbolServer, +bool SymbolPathsDialog::useCommonSymbolPaths(bool &useSymbolCache, + bool &useSymbolServer, FilePath &path) { SymbolPathsDialog dialog; diff --git a/src/plugins/debugger/shared/symbolpathsdialog.h b/src/plugins/debugger/shared/symbolpathsdialog.h index c77e112ea41..1619de0193e 100644 --- a/src/plugins/debugger/shared/symbolpathsdialog.h +++ b/src/plugins/debugger/shared/symbolpathsdialog.h @@ -25,15 +25,14 @@ #pragma once +#include #include +#include #include -namespace Utils { class FilePath; } +#include -namespace Debugger { -namespace Internal { - -namespace Ui { class SymbolPathsDialog; } +namespace Debugger::Internal { class SymbolPathsDialog : public QDialog { @@ -56,8 +55,11 @@ public: static bool useCommonSymbolPaths(bool &useSymbolCache, bool &useSymbolServer, Utils::FilePath &path); private: - Ui::SymbolPathsDialog *ui; + QLabel *m_pixmapLabel; + QLabel *m_msgLabel; + QCheckBox *m_useLocalSymbolCache; + QCheckBox *m_useSymbolServer; + Utils::PathChooser *m_pathChooser; }; -} // namespace Internal -} // namespace Debugger +} // Debugger::Internal diff --git a/src/plugins/debugger/shared/symbolpathsdialog.ui b/src/plugins/debugger/shared/symbolpathsdialog.ui deleted file mode 100644 index 782d068512e..00000000000 --- a/src/plugins/debugger/shared/symbolpathsdialog.ui +++ /dev/null @@ -1,131 +0,0 @@ - - - Debugger::Internal::SymbolPathsDialog - - - - 0 - 0 - 537 - 249 - - - - Set up Symbol Paths - - - - - - - - - 0 - 0 - - - - - - - Qt::AlignHCenter|Qt::AlignTop - - - 5 - - - - - - - - 0 - 0 - - - - <html><head/><body><p>The debugger is not configured to use the public Microsoft Symbol Server.<br/>This is recommended for retrieval of the symbols of the operating system libraries.</p><p><span style=" font-style:italic;">Note:</span> It is recommended, that if you use the Microsoft Symbol Server, to also use a local symbol cache.<br/>A fast internet connection is required for this to work smoothly,<br/>and a delay might occur when connecting for the first time and caching the symbols.</p><p>What would you like to set up?</p></body></html> - - - Qt::RichText - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - - - Use Local Symbol Cache - - - - - - - Use Microsoft Symbol Server - - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - Utils::PathChooser - QWidget -
utils/pathchooser.h
- 1 -
-
- - - - buttonBox - accepted() - Debugger::Internal::SymbolPathsDialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - Debugger::Internal::SymbolPathsDialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - -