First attempt.

This commit is contained in:
Ernie Pasveer
2022-09-18 20:46:48 -05:00
parent 5d58c79f56
commit 6ea8d63565
9 changed files with 140 additions and 27 deletions
+33 -1
View File
@@ -1,6 +1,10 @@
#include "SeerThreadManagerWidget.h"
#include "QHContainerWidget.h"
#include <QtWidgets/QToolButton>
#include <QtWidgets/QTextBrowser>
#include <QtGui/QIcon>
#include <QtCore/QUrl>
#include <QtCore/QDirIterator>
#include <QtCore/QDebug>
SeerThreadManagerWidget::SeerThreadManagerWidget (QWidget* parent) : QWidget(parent) {
@@ -25,10 +29,20 @@ SeerThreadManagerWidget::SeerThreadManagerWidget (QWidget* parent) : QWidget(par
QToolButton* refreshToolButton = new QToolButton(tabWidget);
refreshToolButton->setIcon(QIcon(":/seer/resources/RelaxLightIcons/view-refresh.svg"));
refreshToolButton->setToolTip("Refresh the thread information.");
tabWidget->setCornerWidget(refreshToolButton, Qt::TopRightCorner);
QToolButton* helpToolButton = new QToolButton(tabWidget);
helpToolButton->setIcon(QIcon(":/seer/resources/RelaxLightIcons/help-about.svg"));
helpToolButton->setToolTip("Help on thread information.");
QHContainerWidget* hcontainer = new QHContainerWidget(this);
hcontainer->addWidget(refreshToolButton);
hcontainer->addWidget(helpToolButton);
tabWidget->setCornerWidget(hcontainer, Qt::TopRightCorner);
// Connect things.
QObject::connect(refreshToolButton, &QToolButton::clicked, this, &SeerThreadManagerWidget::handleRefreshToolButtonClicked);
QObject::connect(helpToolButton, &QToolButton::clicked, this, &SeerThreadManagerWidget::handleHelpToolButtonClicked);
QObject::connect(schedulerLockingComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SeerThreadManagerWidget::handleSchedulerLockingComboBox);
QObject::connect(scheduleMultipleComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SeerThreadManagerWidget::handleScheduleMultipleComboBox);
QObject::connect(forkFollowsComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SeerThreadManagerWidget::handleForkFollowComboBox);
@@ -86,6 +100,24 @@ void SeerThreadManagerWidget::handleRefreshToolButtonClicked () {
threadGroupsBrowserWidget()->refresh();
}
void SeerThreadManagerWidget::handleHelpToolButtonClicked () {
// Get the Help text from the resource.
QFile file(":/seer/resources/help/ThreadProcessInfoBrowser.md");
file.open(QFile::ReadOnly | QFile::Text);
QTextStream stream(&file);
QString text = stream.readAll();
// Put the Help text in as markdown. Move back to the begining.
QTextBrowser* browser = new QTextBrowser(0);
browser->setOpenExternalLinks(true);
browser->setMarkdown(text);
browser->moveCursor(QTextCursor::Start);
browser->show();
}
void SeerThreadManagerWidget::handleSchedulerLockingComboBox (int index) {
Q_UNUSED(index);