| 232 | } |
| 233 | |
| 234 | bool MainWindow::bootImageImport(const QString &bootImagePath) { |
| 235 | QString newConfigPath = configPath + SETTING_DEFAULT_CONFIG_FILE; |
| 236 | QString romPath = configPath + SETTING_DEFAULT_ROM_FILE; |
| 237 | QFile bootFile(bootImagePath); |
| 238 | QFile romFile(romPath); |
| 239 | romFile.remove(); |
| 240 | if (!romFile.open(QIODevice::WriteOnly)) { return false; } |
| 241 | QFile settingsFile(newConfigPath); |
| 242 | settingsFile.remove(); |
| 243 | if (!settingsFile.open(QIODevice::WriteOnly)) { return false; } |
| 244 | bootFile.open(QIODevice::ReadOnly); |
| 245 | QByteArray romData = bootFile.read(0x400000); |
| 246 | QByteArray settingsData = bootFile.readAll(); |
| 247 | romFile.write(romData); |
| 248 | settingsFile.write(settingsData); |
| 249 | romFile.close(); |
| 250 | settingsFile.close(); |
| 251 | bootFile.close(); |
| 252 | m_pathConfig = newConfigPath; |
| 253 | return true; |
| 254 | } |
| 255 | |
| 256 | void MainWindow::bootImageExport() { |
| 257 | QMessageBox::information(this, MSG_INFORMATION, tr("A bootable image can be used to start CEmu with predefined configurations, without the need for any extra setup." |
nothing calls this directly
no outgoing calls
no test coverage detected