if (event && event->type() == ApiTraceEvent::Call) {
ApiTraceCall *call = static_cast<ApiTraceCall*>(event);
+ m_ui.detailsDock->setWindowTitle(
+ tr("Details View. Frame %1, Call %2")
+ .arg(call->parentFrame() ? call->parentFrame()->number : 0)
+ .arg(call->index()));
m_ui.detailsWebView->setHtml(call->toHtml());
m_ui.detailsDock->show();
if (call->hasBinaryData()) {
QImage img = var.value<QImage>();
viewer->setImage(img);
- QRect screenRect = QApplication::desktop()->availableGeometry();
- viewer->resize(qMin(int(0.75 * screenRect.width()), img.width()) + 40,
- qMin(int(0.75 * screenRect.height()), img.height()) + 40);
viewer->show();
viewer->raise();
viewer->activateWindow();
this, SLOT(slotSaved()));
connect(m_trace, SIGNAL(changed(ApiTraceCall*)),
this, SLOT(slotTraceChanged(ApiTraceCall*)));
- connect(m_trace, SIGNAL(findResult(ApiTrace::SearchResult,ApiTraceCall*)),
- this, SLOT(slotSearchResult(ApiTrace::SearchResult,ApiTraceCall*)));
+ connect(m_trace, SIGNAL(findResult(ApiTrace::SearchRequest,ApiTrace::SearchResult,ApiTraceCall*)),
+ this, SLOT(slotSearchResult(ApiTrace::SearchRequest,ApiTrace::SearchResult,ApiTraceCall*)));
connect(m_trace, SIGNAL(foundFrameStart(ApiTraceFrame*)),
this, SLOT(slotFoundFrameStart(ApiTraceFrame*)));
connect(m_trace, SIGNAL(foundFrameEnd(ApiTraceFrame*)),
connect(m_ui.actionOptions, SIGNAL(triggered()),
this, SLOT(showSettings()));
- connect(m_ui.callView, SIGNAL(activated(const QModelIndex &)),
+ connect(m_ui.callView->selectionModel(), SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)),
this, SLOT(callItemSelected(const QModelIndex &)));
connect(m_ui.callView, SIGNAL(customContextMenuRequested(QPoint)),
this, SLOT(customContextMenuRequested(QPoint)));
connect(m_ui.actionShowErrorsDock, SIGNAL(triggered(bool)),
m_ui.errorsDock, SLOT(setVisible(bool)));
connect(m_ui.errorsTreeWidget,
- SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)),
+ SIGNAL(itemActivated(QTreeWidgetItem*, int)),
this, SLOT(slotErrorSelected(QTreeWidgetItem*)));
}
m_progressBar->setValue(percent);
}
-void MainWindow::slotSearchResult(ApiTrace::SearchResult result,
+void MainWindow::slotSearchResult(const ApiTrace::SearchRequest &request,
+ ApiTrace::SearchResult result,
ApiTraceCall *call)
{
switch (result) {
break;
case ApiTrace::SearchResult_Found: {
QModelIndex index = m_proxyModel->indexForCall(call);
- m_ui.callView->setCurrentIndex(index);
- m_searchWidget->setFound(true);
+
+ if (index.isValid()) {
+ m_ui.callView->setCurrentIndex(index);
+ m_searchWidget->setFound(true);
+ } else {
+ //call is filtered out, so continue searching but from the
+ // filtered call
+ if (!call) {
+ qDebug()<<"Error: search success with no call";
+ return;
+ }
+// qDebug()<<"filtered! search from "<<call->searchText()
+// <<", call idx = "<<call->index();
+
+ if (request.direction == ApiTrace::SearchRequest::Next) {
+ m_trace->findNext(call->parentFrame(), call,
+ request.text, request.cs);
+ } else {
+ m_trace->findNext(call->parentFrame(), call,
+ request.text, request.cs);
+ }
+ }
}
break;
case ApiTrace::SearchResult_Wrapped: