+ if (tmpReader->get_max_frame_index() > g_settings.trim_large_trace_prompt_size())
+ {
+ int ret = QMessageBox::warning(this, tr(g_PROJECT_NAME.toStdString().c_str()), tr("The loaded trace file has many frames and debugging may be difficult.\nWould you like to trim the trace?"),
+ QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
+
+ if (ret == QMessageBox::Yes)
+ {
+ if (trim_trace_file(filename.c_str(), static_cast<uint>(tmpReader->get_max_frame_index()), g_settings.trim_large_trace_prompt_size()))
+ {
+ // user decided to open the new trim file, and the UI should already be updated
+ // clean up here and return
+ vogl_delete(tmpReader);
+ this->setCursor(origCursor);
+ return true;
+ }
+ else
+ {
+ // either there was an error, or the user decided NOT to open the trim file,
+ // so continue to load the original file
+ }
+ }
+ }
+