m_loader = new LoaderThread(this);
connect(m_loader, SIGNAL(parsedFrames(const QList<ApiTraceFrame*>)),
this, SLOT(addFrames(const QList<ApiTraceFrame*>)));
+ connect(m_loader, SIGNAL(started()),
+ this, SIGNAL(startedLoadingTrace()));
+ connect(m_loader, SIGNAL(finished()),
+ this, SIGNAL(finishedLoadingTrace()));
}
ApiTrace::~ApiTrace()
#include <QLineEdit>
#include <QMessageBox>
#include <QProcess>
+#include <QProgressBar>
#include <QToolBar>
#include <QWebView>
m_ui.setupUi(this);
m_trace = new ApiTrace();
+ connect(m_trace, SIGNAL(startedLoadingTrace()),
+ this, SLOT(startedLoadingTrace()));
+ connect(m_trace, SIGNAL(finishedLoadingTrace()),
+ this, SLOT(finishedLoadingTrace()));
m_model = new ApiTraceModel();
m_model->setApiTrace(m_trace);
m_filterEdit = new QLineEdit(toolBar);
toolBar->addWidget(m_filterEdit);
+ m_progressBar = new QProgressBar();
+ m_progressBar->setRange(0, 0);
+ statusBar()->addPermanentWidget(m_progressBar);
+ m_progressBar->hide();
+
m_ui.detailsDock->hide();
connect(m_ui.actionOpen, SIGNAL(triggered()),
}
qDebug()<< "Loading : " <<fileName;
+ m_progressBar->setValue(0);
newTraceFile(fileName);
}
tr("Couldn't execute the replay file '%1'").arg(m_traceFileName));
}
+void MainWindow::startedLoadingTrace()
+{
+ Q_ASSERT(m_trace);
+ m_progressBar->show();
+ QFileInfo info(m_trace->fileName());
+ statusBar()->showMessage(
+ tr("Loading %1...").arg(info.fileName()));
+}
+
+void MainWindow::finishedLoadingTrace()
+{
+ m_progressBar->hide();
+ if (!m_trace) {
+ return;
+ }
+ QFileInfo info(m_trace->fileName());
+ statusBar()->showMessage(
+ tr("Loaded %1").arg(info.fileName()), 3000);
+}
+
#include "mainwindow.moc"
class QLineEdit;
class QModelIndex;
class QProcess;
+class QProgressBar;
class MainWindow : public QMainWindow
{
void replayStop();
void replayFinished();
void replayError(QProcess::ProcessError err);
+ void startedLoadingTrace();
+ void finishedLoadingTrace();
private:
void newTraceFile(const QString &fileName);
QProcess *m_replayProcess;
+ QProgressBar *m_progressBar;
+
QString m_traceFileName;
};