* @brief Opens a file selection dialog for MDF4 files */
| 394 | * @brief Opens a file selection dialog for MDF4 files |
| 395 | */ |
| 396 | void MDF4::Player::openFile() |
| 397 | { |
| 398 | auto* dialog = new QFileDialog(qApp->activeWindow(), |
| 399 | tr("Select MDF4 file"), |
| 400 | Misc::WorkspaceManager::instance().path("MDF4"), |
| 401 | tr("MDF4 files (*.mf4 *.dat)")); |
| 402 | |
| 403 | dialog->setFileMode(QFileDialog::ExistingFile); |
| 404 | dialog->setAttribute(Qt::WA_DeleteOnClose); |
| 405 | |
| 406 | connect(dialog, &QFileDialog::fileSelected, this, [this](const QString& path) { |
| 407 | if (path.isEmpty()) |
| 408 | return; |
| 409 | |
| 410 | QMetaObject::invokeMethod(this, [this, path]() { openFile(path); }, Qt::QueuedConnection); |
| 411 | }); |
| 412 | |
| 413 | dialog->open(); |
| 414 | } |
| 415 | |
| 416 | /** |
| 417 | * @brief Opens an MDF4 file from the specified path |
nothing calls this directly
no test coverage detected