]> git.cworth.org Git - apitrace/blobdiff - gui/mainwindow.cpp
gui: Implement a new surface viewer
[apitrace] / gui / mainwindow.cpp
index e46fce6a095ece39d12f698464cca740a8017bb5..00469bca3d9f67450daa196472ef4a7302eeed53 100644 (file)
@@ -121,13 +121,6 @@ void MainWindow::callItemSelected(const QModelIndex &index)
 
     if (event && event->type() == ApiTraceEvent::Call) {
         ApiTraceCall *call = static_cast<ApiTraceCall*>(event);
-        if (!call->backtrace().isNull()) {
-            m_ui.backtraceBrowser->setText(call->backtrace());
-            m_ui.backtraceDock->show();
-        }
-        else {
-            m_ui.backtraceDock->hide();
-        }
         m_ui.detailsDock->setWindowTitle(
             tr("Details View. Frame %1, Call %2")
             .arg(call->parentFrame() ? call->parentFrame()->number : 0)
@@ -157,6 +150,8 @@ void MainWindow::callItemSelected(const QModelIndex &index)
                 }
             }
         }
+        m_ui.backtraceBrowser->setText(call->backtrace());
+        m_ui.backtraceDock->setVisible(!call->backtrace().isNull());
         m_ui.vertexDataDock->setVisible(call->hasBinaryData());
         m_selectedEvent = call;
     } else {
@@ -201,6 +196,9 @@ void MainWindow::replayStart()
     dlgUi.errorCheckCB->setChecked(
         !m_retracer->isBenchmarking());
 
+    dlgUi.singlethreadCB->setChecked(
+        m_retracer->isSinglethread());
+
     if (dlg.exec() == QDialog::Accepted) {
         m_retracer->setDoubleBuffered(
             dlgUi.doubleBufferingCB->isChecked());
@@ -208,6 +206,9 @@ void MainWindow::replayStart()
         m_retracer->setBenchmarking(
             !dlgUi.errorCheckCB->isChecked());
 
+        m_retracer->setSinglethread(
+            dlgUi.singlethreadCB->isChecked());
+
         m_retracer->setProfiling(false, false, false);
 
         replayTrace(false, false);
@@ -369,8 +370,11 @@ void MainWindow::replayTrace(bool dumpState, bool dumpThumbnails)
 
 void MainWindow::trimEvent()
 {
+    int trimIndex = 0;
+
+    Q_ASSERT(m_trimEvent->type() == ApiTraceEvent::Call ||
+             m_trimEvent->type() == ApiTraceEvent::Frame);
 
-    int trimIndex;
     if (m_trimEvent->type() == ApiTraceEvent::Call) {
         ApiTraceCall *call = static_cast<ApiTraceCall*>(m_trimEvent);
         trimIndex = call->index();