mirror of
https://github.com/epasveer/seer.git
synced 2026-08-29 16:40:42 +08:00
Add CLEAR button.
This commit is contained in:
@@ -123,6 +123,7 @@ SeerMainWindow::SeerMainWindow(QWidget* parent) : QMainWindow(parent) {
|
||||
QObject::connect(actionViewBasicStructVisualizer, &QAction::triggered, this, &SeerMainWindow::handleViewStructVisualizer);
|
||||
QObject::connect(actionViewImageVisualizer, &QAction::triggered, this, &SeerMainWindow::handleViewImageVisualizer);
|
||||
QObject::connect(actionViewAssembly, &QAction::triggered, this, &SeerMainWindow::handleViewAssembly);
|
||||
QObject::connect(actionViewExecutionMessages, &QAction::triggered, this, &SeerMainWindow::handleViewExecutionMessages);
|
||||
QObject::connect(actionConsoleNormal, &QAction::triggered, this, &SeerMainWindow::handleViewConsoleNormal);
|
||||
QObject::connect(actionConsoleHidden, &QAction::triggered, this, &SeerMainWindow::handleViewConsoleHidden);
|
||||
QObject::connect(actionConsoleMinimized, &QAction::triggered, this, &SeerMainWindow::handleViewConsoleMinimized);
|
||||
@@ -176,6 +177,7 @@ SeerMainWindow::SeerMainWindow(QWidget* parent) : QMainWindow(parent) {
|
||||
QObject::connect(gdbWidget->gdbMonitor(), &GdbMonitor::astrixTextOutput, runStatus, &SeerRunStatusIndicator::handleText);
|
||||
QObject::connect(gdbWidget->gdbMonitor(), &GdbMonitor::astrixTextOutput, this, &SeerMainWindow::handleText);
|
||||
QObject::connect(gdbWidget->gdbMonitor(), &GdbMonitor::caretTextOutput, this, &SeerMainWindow::handleText);
|
||||
QObject::connect(gdbWidget->gdbMonitor(), &GdbMonitor::equalTextOutput, this, &SeerMainWindow::handleText);
|
||||
QObject::connect(gdbWidget->editorManager(), &SeerEditorManagerWidget::showMessage, this, &SeerMainWindow::handleShowMessage);
|
||||
QObject::connect(gdbWidget->editorManager(), &SeerEditorManagerWidget::assemblyTabShown, this, &SeerMainWindow::handleViewAssemblyShown);
|
||||
|
||||
@@ -552,6 +554,11 @@ void SeerMainWindow::handleViewAssembly () {
|
||||
gdbWidget->editorManager()->showAssembly();
|
||||
}
|
||||
|
||||
void SeerMainWindow::handleViewExecutionMessages () {
|
||||
|
||||
_executionMessages->show();
|
||||
}
|
||||
|
||||
void SeerMainWindow::handleViewAssemblyShown (bool shown) {
|
||||
|
||||
// Corefile always have them off.
|
||||
@@ -990,6 +997,15 @@ void SeerMainWindow::handleText (const QString& text) {
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
}else if (text.startsWith("=thread-group-started,")) {
|
||||
// =thread-group-started,id="i1",pid="30916"
|
||||
|
||||
QString pid_text = Seer::parseFirst(text, "pid=", '"', '"', false);
|
||||
|
||||
//qDebug() << "Inferior pid = " << pid_text;
|
||||
|
||||
_executionMessages->addMessage("Program started. (pid=" + pid_text +")", QMessageBox::Information);
|
||||
}
|
||||
|
||||
// Leave in for stray error messages.
|
||||
|
||||
@@ -69,6 +69,7 @@ class SeerMainWindow : public QMainWindow, protected Ui::SeerMainWindowForm {
|
||||
void handleViewVarVisualizer ();
|
||||
void handleViewImageVisualizer ();
|
||||
void handleViewAssembly ();
|
||||
void handleViewExecutionMessages ();
|
||||
void handleViewAssemblyShown (bool shown);
|
||||
void handleViewConsoleNormal ();
|
||||
void handleViewConsoleHidden ();
|
||||
|
||||
+10
-1
@@ -20,7 +20,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1206</width>
|
||||
<height>28</height>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuFile">
|
||||
@@ -73,6 +73,7 @@
|
||||
<addaction name="actionViewBasicStructVisualizer"/>
|
||||
<addaction name="actionViewImageVisualizer"/>
|
||||
<addaction name="actionViewAssembly"/>
|
||||
<addaction name="actionViewExecutionMessages"/>
|
||||
<addaction name="menuConsole"/>
|
||||
<addaction name="menuStyles"/>
|
||||
</widget>
|
||||
@@ -668,6 +669,14 @@
|
||||
<string>Basic Struct Visualizer</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionViewExecutionMessages">
|
||||
<property name="text">
|
||||
<string>Execution Messages</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>View the program's execution messages.</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#include "SeerMessagesDialog.h"
|
||||
#include <QtWidgets/QTreeWidget>
|
||||
#include <QtWidgets/QTreeWidgetItem>
|
||||
#include <QtWidgets/QApplication>
|
||||
#include <QtWidgets/QDialogButtonBox>
|
||||
#include <QtWidgets/QPushButton>
|
||||
#include <QtCore/QTime>
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtCore/QDebug>
|
||||
@@ -30,7 +31,14 @@ SeerMessagesDialog::SeerMessagesDialog (QWidget* parent) : QDialog(parent) {
|
||||
messageTreeWidget->resizeColumnToContents(0); // timestamp
|
||||
messageTreeWidget->resizeColumnToContents(1); // message type icon
|
||||
messageTreeWidget->resizeColumnToContents(2); // message
|
||||
messageTreeWidget->clear();
|
||||
|
||||
// Add a "CLEAR" button to the dialog's buttonbox.
|
||||
QDialogButtonBox* buttonBox = findChild<QDialogButtonBox*>("buttonBox");
|
||||
if (buttonBox) {
|
||||
QPushButton* clearPushButton = buttonBox->addButton("Clear", QDialogButtonBox::ActionRole);
|
||||
|
||||
QObject::connect(clearPushButton, &QPushButton::clicked, this, &SeerMessagesDialog::clearMessages);
|
||||
}
|
||||
|
||||
// Get icons.
|
||||
_informationIcon = QIcon(":/seer/resources/RelaxLightIcons/data-information.svg");
|
||||
@@ -41,6 +49,9 @@ SeerMessagesDialog::SeerMessagesDialog (QWidget* parent) : QDialog(parent) {
|
||||
|
||||
// Connect things.
|
||||
|
||||
// Clear messages
|
||||
clearMessages();
|
||||
|
||||
// Restore window settings.
|
||||
readSettings();
|
||||
|
||||
@@ -53,8 +64,8 @@ SeerMessagesDialog::~SeerMessagesDialog () {
|
||||
|
||||
void SeerMessagesDialog::addMessage (const QString& message, QMessageBox::Icon messageType) {
|
||||
|
||||
// Shot messages any time a messaged is added.
|
||||
show();
|
||||
//raise();
|
||||
|
||||
// Create an entry with our message.
|
||||
QTreeWidgetItem* item = new QTreeWidgetItem;
|
||||
@@ -100,7 +111,12 @@ void SeerMessagesDialog::addMessage (const QString& message, QMessageBox::Icon m
|
||||
}
|
||||
}
|
||||
|
||||
void SeerMessagesDialog::writeSettings() {
|
||||
void SeerMessagesDialog::clearMessages () {
|
||||
|
||||
messageTreeWidget->clear();
|
||||
}
|
||||
|
||||
void SeerMessagesDialog::writeSettings () {
|
||||
|
||||
QSettings settings;
|
||||
|
||||
@@ -109,7 +125,7 @@ void SeerMessagesDialog::writeSettings() {
|
||||
}settings.endGroup();
|
||||
}
|
||||
|
||||
void SeerMessagesDialog::readSettings() {
|
||||
void SeerMessagesDialog::readSettings () {
|
||||
|
||||
QSettings settings;
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ class SeerMessagesDialog : public QDialog, protected Ui::SeerMessagesDialog {
|
||||
|
||||
public slots:
|
||||
void addMessage (const QString& message, QMessageBox::Icon messageType);
|
||||
void clearMessages ();
|
||||
|
||||
protected slots:
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Ok</set>
|
||||
<set>QDialogButtonBox::Close</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user