| 60 | } |
| 61 | |
| 62 | std::string ExportWindow::getOutputPath() { |
| 63 | if (itemHandle == nullptr) { |
| 64 | return ""; |
| 65 | } |
| 66 | std::string itemName = GetItemName(itemHandle) + ".pag"; |
| 67 | |
| 68 | QDir dir(GetProjectPath()); |
| 69 | QString defaultPath = dir.filePath(itemName.data()); |
| 70 | QFileDialog dialog(QApplication::topLevelWidgets().value(0), QObject::tr("Select Storage Path"), |
| 71 | defaultPath); |
| 72 | dialog.setAcceptMode(QFileDialog::AcceptSave); |
| 73 | dialog.setDefaultSuffix("pag"); |
| 74 | |
| 75 | if (dialog.exec() == QDialog::Accepted) { |
| 76 | QStringList selectedFiles = dialog.selectedFiles(); |
| 77 | if (!selectedFiles.isEmpty()) { |
| 78 | return selectedFiles.first().toStdString(); |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | return ""; |
| 83 | } |
| 84 | |
| 85 | void ExportWindow::init() { |
| 86 | if (QThread::currentThread() != app->thread()) { |
nothing calls this directly
no test coverage detected