From: José Fonseca Date: Sat, 24 Mar 2012 09:27:27 +0000 (+0000) Subject: Make thumbnailing an non-automatic action. X-Git-Url: https://git.cworth.org/git?p=apitrace;a=commitdiff_plain;h=e5fa5417ce8042612304152779e563174782153d Make thumbnailing an non-automatic action. This allows to avoid performance issues with big traces, and also give opportunity to the user to change the replay settings. --- diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 5a90241..0236351 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -182,6 +182,7 @@ void MainWindow::replayStop() m_ui.actionStop->setEnabled(false); m_ui.actionReplay->setEnabled(true); m_ui.actionLookupState->setEnabled(true); + m_ui.actionShowThumbnails->setEnabled(true); } void MainWindow::newTraceFile(const QString &fileName) @@ -194,11 +195,13 @@ void MainWindow::newTraceFile(const QString &fileName) if (fileName.isEmpty()) { m_ui.actionReplay->setEnabled(false); m_ui.actionLookupState->setEnabled(false); + m_ui.actionShowThumbnails->setEnabled(false); setWindowTitle(tr("QApiTrace")); } else { QFileInfo info(fileName); m_ui.actionReplay->setEnabled(true); m_ui.actionLookupState->setEnabled(true); + m_ui.actionShowThumbnails->setEnabled(true); setWindowTitle( tr("QApiTrace - %1").arg(info.fileName())); } @@ -209,6 +212,7 @@ void MainWindow::replayFinished(const QString &output) m_ui.actionStop->setEnabled(false); m_ui.actionReplay->setEnabled(true); m_ui.actionLookupState->setEnabled(true); + m_ui.actionShowThumbnails->setEnabled(true); m_progressBar->hide(); if (output.length() < 80) { @@ -230,6 +234,7 @@ void MainWindow::replayError(const QString &message) m_ui.actionStop->setEnabled(false); m_ui.actionReplay->setEnabled(true); m_ui.actionLookupState->setEnabled(true); + m_ui.actionShowThumbnails->setEnabled(true); m_stateEvent = 0; m_nonDefaultsLookupEvent = 0; @@ -262,9 +267,6 @@ void MainWindow::finishedLoadingTrace() m_trace->findCallIndex(m_initalCallNum); m_initalCallNum = -1; } - - // force initial capture of thumbnails - replayTrace(false, true); } void MainWindow::replayTrace(bool dumpState, bool dumpThumbnails) @@ -337,6 +339,11 @@ void MainWindow::lookupState() replayTrace(true, false); } +void MainWindow::showThumbnails() +{ + replayTrace(false, true); +} + MainWindow::~MainWindow() { delete m_trace; @@ -788,6 +795,8 @@ void MainWindow::initConnections() this, SLOT(replayStop())); connect(m_ui.actionLookupState, SIGNAL(triggered()), this, SLOT(lookupState())); + connect(m_ui.actionShowThumbnails, SIGNAL(triggered()), + this, SLOT(showThumbnails())); connect(m_ui.actionOptions, SIGNAL(triggered()), this, SLOT(showSettings())); diff --git a/gui/mainwindow.h b/gui/mainwindow.h index d898f3c..76ae594 100644 --- a/gui/mainwindow.h +++ b/gui/mainwindow.h @@ -55,6 +55,7 @@ private slots: void loadProgess(int percent); void finishedLoadingTrace(); void lookupState(); + void showThumbnails(); void showSettings(); void openHelp(const QUrl &url); void showSurfacesMenu(const QPoint &pos); diff --git a/gui/ui/mainwindow.ui b/gui/ui/mainwindow.ui index 5b48dc2..52cf49e 100644 --- a/gui/ui/mainwindow.ui +++ b/gui/ui/mainwindow.ui @@ -75,6 +75,7 @@ + @@ -525,6 +526,17 @@ Ctrl+L + + + false + + + Show &Thumbnails + + + Ctrl+T + + Options