Debugger: Inline symbolpathsdialog.ui

Change-Id: Ib56735f5a58d2d45687c135ddb4de38359f1d4d7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2022-07-05 15:17:13 +02:00
parent 3ec577ff17
commit 10728efa3b
5 changed files with 68 additions and 159 deletions

View File

@@ -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

View File

@@ -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"
]
}

View File

@@ -24,11 +24,11 @@
****************************************************************************/
#include "symbolpathsdialog.h"
#include "ui_symbolpathsdialog.h"
#include <utils/filepath.h>
#include <QDialogButtonBox>
#include <QHBoxLayout>
#include <QMessageBox>
#include <QVBoxLayout>
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("<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>"));
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;

View File

@@ -25,15 +25,14 @@
#pragma once
#include <QCheckBox>
#include <QDialog>
#include <QLabel>
#include <QString>
namespace Utils { class FilePath; }
#include <utils/pathchooser.h>
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

View File

@@ -1,131 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Debugger::Internal::SymbolPathsDialog</class>
<widget class="QDialog" name="Debugger::Internal::SymbolPathsDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>537</width>
<height>249</height>
</rect>
</property>
<property name="windowTitle">
<string>Set up Symbol Paths</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="pixmapLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignHCenter|Qt::AlignTop</set>
</property>
<property name="margin">
<number>5</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="msgLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The debugger is not configured to use the public Microsoft Symbol Server.&lt;br/&gt;This is recommended for retrieval of the symbols of the operating system libraries.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-style:italic;&quot;&gt;Note:&lt;/span&gt; It is recommended, that if you use the Microsoft Symbol Server, to also use a local symbol cache.&lt;br/&gt;A fast internet connection is required for this to work smoothly,&lt;br/&gt;and a delay might occur when connecting for the first time and caching the symbols.&lt;/p&gt;&lt;p&gt;What would you like to set up?&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="useLocalSymbolCache">
<property name="text">
<string>Use Local Symbol Cache</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="useSymbolServer">
<property name="text">
<string>Use Microsoft Symbol Server</string>
</property>
</widget>
</item>
<item>
<widget class="Utils::PathChooser" name="pathChooser" native="true"/>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Utils::PathChooser</class>
<extends>QWidget</extends>
<header>utils/pathchooser.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>Debugger::Internal::SymbolPathsDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>Debugger::Internal::SymbolPathsDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>