| 3257 | } |
| 3258 | |
| 3259 | QString MainWindow::getDiscDevicePath(const QString& title) |
| 3260 | { |
| 3261 | QString ret; |
| 3262 | |
| 3263 | const std::vector<std::string> devices(GetOpticalDriveList()); |
| 3264 | if (devices.empty()) |
| 3265 | { |
| 3266 | QMessageBox::critical(this, title, |
| 3267 | tr("Could not find any CD/DVD-ROM devices. Please ensure you have a drive connected and " |
| 3268 | "sufficient permissions to access it.")); |
| 3269 | return ret; |
| 3270 | } |
| 3271 | |
| 3272 | // if there's only one, select it automatically |
| 3273 | if (devices.size() == 1) |
| 3274 | { |
| 3275 | ret = QString::fromStdString(devices.front()); |
| 3276 | return ret; |
| 3277 | } |
| 3278 | |
| 3279 | QStringList input_options; |
| 3280 | for (const std::string& name : devices) |
| 3281 | input_options.append(QString::fromStdString(name)); |
| 3282 | |
| 3283 | QInputDialog input_dialog(this); |
| 3284 | input_dialog.setWindowTitle(title); |
| 3285 | input_dialog.setLabelText(tr("Select disc drive:")); |
| 3286 | input_dialog.setInputMode(QInputDialog::TextInput); |
| 3287 | input_dialog.setOptions(QInputDialog::UseListViewForComboBoxItems); |
| 3288 | input_dialog.setComboBoxEditable(false); |
| 3289 | input_dialog.setComboBoxItems(std::move(input_options)); |
| 3290 | if (input_dialog.exec() == 0) |
| 3291 | return ret; |
| 3292 | |
| 3293 | ret = input_dialog.textValue(); |
| 3294 | return ret; |
| 3295 | } |
| 3296 | |
| 3297 | void MainWindow::startGameListEntry(const GameList::Entry& entry, std::optional<s32> save_slot, std::optional<bool> fast_boot, bool load_backup) |
| 3298 | { |
nothing calls this directly
no test coverage detected