m_nonDefaultsLookupEvent(0)
{
m_ui.setupUi(this);
+ updateActionsState(false);
initObjects();
initConnections();
}
newTraceFile(fileName);
}
+void MainWindow::setRemoteTarget(const QString &host)
+{
+ m_retracer->setRemoteTarget(host);
+}
+
void MainWindow::callItemSelected(const QModelIndex &index)
{
ApiTraceEvent *event =
}
}
}
+ m_ui.backtraceBrowser->setText(call->backtrace());
+ m_ui.backtraceDock->setVisible(!call->backtrace().isNull());
m_ui.vertexDataDock->setVisible(call->hasBinaryData());
m_selectedEvent = call;
} else {
m_selectedEvent = 0;
}
m_ui.detailsDock->hide();
+ m_ui.backtraceDock->hide();
m_ui.vertexDataDock->hide();
}
if (m_selectedEvent && m_selectedEvent->hasState()) {
void MainWindow::replayStop()
{
m_retracer->quit();
- m_ui.actionStop->setEnabled(false);
- m_ui.actionReplay->setEnabled(true);
- m_ui.actionProfile->setEnabled(true);
- m_ui.actionLookupState->setEnabled(true);
- m_ui.actionShowThumbnails->setEnabled(true);
+ updateActionsState(true, true);
}
void MainWindow::newTraceFile(const QString &fileName)
m_trace->setFileName(fileName);
if (fileName.isEmpty()) {
- m_ui.actionReplay->setEnabled(false);
- m_ui.actionProfile->setEnabled(false);
- m_ui.actionLookupState->setEnabled(false);
- m_ui.actionShowThumbnails->setEnabled(false);
+ updateActionsState(false);
setWindowTitle(tr("QApiTrace"));
} else {
+ updateActionsState(true);
QFileInfo info(fileName);
- m_ui.actionReplay->setEnabled(true);
- m_ui.actionProfile->setEnabled(true);
- m_ui.actionLookupState->setEnabled(true);
- m_ui.actionShowThumbnails->setEnabled(true);
- m_ui.actionTrim->setEnabled(true);
setWindowTitle(
tr("QApiTrace - %1").arg(info.fileName()));
}
void MainWindow::replayFinished(const QString &message)
{
- m_ui.actionStop->setEnabled(false);
- m_ui.actionReplay->setEnabled(true);
- m_ui.actionProfile->setEnabled(true);
- m_ui.actionLookupState->setEnabled(true);
- m_ui.actionShowThumbnails->setEnabled(true);
-
+ updateActionsState(true);
m_progressBar->hide();
statusBar()->showMessage(message, 2000);
m_stateEvent = 0;
void MainWindow::replayError(const QString &message)
{
- m_ui.actionStop->setEnabled(false);
- m_ui.actionReplay->setEnabled(true);
- m_ui.actionProfile->setEnabled(true);
- m_ui.actionLookupState->setEnabled(true);
- m_ui.actionShowThumbnails->setEnabled(true);
+ updateActionsState(true);
m_stateEvent = 0;
m_nonDefaultsLookupEvent = 0;
m_argsEditor = new ArgumentsEditor(this);
m_ui.detailsDock->hide();
+ m_ui.backtraceDock->hide();
m_ui.errorsDock->hide();
m_ui.vertexDataDock->hide();
m_ui.stateDock->hide();
tabifyDockWidget(m_ui.stateDock, m_ui.vertexDataDock);
tabifyDockWidget(m_ui.detailsDock, m_ui.errorsDock);
+ tabifyDockWidget(m_ui.detailsDock, m_ui.backtraceDock);
m_ui.surfacesTreeWidget->setContextMenuPolicy(Qt::CustomContextMenu);
this, SLOT(slotJumpTo(int)));
}
+void MainWindow::updateActionsState(bool traceLoaded, bool stopped)
+{
+ if (traceLoaded) {
+ /* Edit */
+ m_ui.actionFind ->setEnabled(true);
+ m_ui.actionGo ->setEnabled(true);
+ m_ui.actionGoFrameStart ->setEnabled(true);
+ m_ui.actionGoFrameEnd ->setEnabled(true);
+
+ /* Trace */
+ if (stopped) {
+ m_ui.actionStop->setEnabled(false);
+ m_ui.actionReplay->setEnabled(true);
+ }
+ else {
+ m_ui.actionStop->setEnabled(true);
+ m_ui.actionReplay->setEnabled(false);
+ }
+
+ m_ui.actionProfile ->setEnabled(true);
+ m_ui.actionLookupState ->setEnabled(true);
+ m_ui.actionShowThumbnails->setEnabled(true);
+ m_ui.actionTrim ->setEnabled(true);
+ }
+ else {
+ /* Edit */
+ m_ui.actionFind ->setEnabled(false);
+ m_ui.actionGo ->setEnabled(false);
+ m_ui.actionGoFrameStart ->setEnabled(false);
+ m_ui.actionGoFrameEnd ->setEnabled(false);
+
+ /* Trace */
+ m_ui.actionReplay ->setEnabled(false);
+ m_ui.actionProfile ->setEnabled(false);
+ m_ui.actionStop ->setEnabled(false);
+ m_ui.actionLookupState ->setEnabled(false);
+ m_ui.actionShowThumbnails->setEnabled(false);
+ m_ui.actionTrim ->setEnabled(false);
+ }
+}
+
void MainWindow::closeEvent(QCloseEvent * event)
{
m_profileDialog->close();