From d923934bb943665456c46f94ed320af3cc5a2ff5 Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Tue, 19 Apr 2011 23:43:06 -0400 Subject: [PATCH] Go to the selected error. --- gui/mainwindow.cpp | 17 +++++++++++++++++ gui/mainwindow.h | 2 ++ gui/ui/mainwindow.ui | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index c9489f8..4360f19 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -734,6 +734,8 @@ void MainWindow::initConnections() m_ui.actionShowErrorsDock, SLOT(setChecked(bool))); connect(m_ui.actionShowErrorsDock, SIGNAL(triggered(bool)), m_ui.errorsDock, SLOT(setVisible(bool))); + connect(m_ui.errorsTreeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), + this, SLOT(slotErrorSelected(QTreeWidgetItem*))); } void MainWindow::replayStateFound(const ApiTraceState &state) @@ -1041,4 +1043,19 @@ void MainWindow::slotRetraceErrors(const QList &errors) } } +void MainWindow::slotErrorSelected(QTreeWidgetItem *current) +{ + if (current) { + ApiTraceCall *call = + current->data(0, Qt::UserRole).value(); + Q_ASSERT(call); + QModelIndex index = m_proxyModel->indexForCall(call); + if (index.isValid()) { + m_ui.callView->setCurrentIndex(index); + } else { + statusBar()->showMessage(tr("Call has been filtered out.")); + } + } +} + #include "mainwindow.moc" diff --git a/gui/mainwindow.h b/gui/mainwindow.h index 400f7a3..74ffeb3 100644 --- a/gui/mainwindow.h +++ b/gui/mainwindow.h @@ -18,6 +18,7 @@ class ImageViewer; class JumpWidget; class QModelIndex; class QProgressBar; +class QTreeWidgetItem; class QUrl; class RetraceError; class Retracer; @@ -68,6 +69,7 @@ private slots: void slotGoFrameEnd(); void slotTraceChanged(ApiTraceCall *call); void slotRetraceErrors(const QList &errors); + void slotErrorSelected(QTreeWidgetItem *current); private: void initObjects(); diff --git a/gui/ui/mainwindow.ui b/gui/ui/mainwindow.ui index 544097e..1bda2bd 100644 --- a/gui/ui/mainwindow.ui +++ b/gui/ui/mainwindow.ui @@ -397,7 +397,7 @@ - Name + Type -- 2.43.0