+
+ connect(m_ui.actionShowProfileDialog, SIGNAL(triggered(bool)),
+ m_profileDialog, SLOT(show()));
+ connect(m_profileDialog, SIGNAL(jumpToCall(int)),
+ 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();
+ QMainWindow::closeEvent(event);
+}
+
+void MainWindow::replayProfileFound(trace::Profile *profile)
+{
+ m_ui.actionShowProfileDialog->setEnabled(true);
+ m_profileDialog->setProfile(profile);
+ m_profileDialog->show();
+ m_profileDialog->activateWindow();
+ m_profileDialog->setFocus();