MCPcopy Create free account
hub / github.com/CE-Programming/CEmu / bootImageExport

Method bootImageExport

gui/qt/settings.cpp:256–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254}
255
256void 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."
258 "\n\nThe bootable image should be placed in the same directory as the CEmu executable. When CEmu is then started, "
259 "the boot image will be loaded automatically and then removed for convience."));
260
261 QString path = QFileDialog::getSaveFileName(this, tr("Save bootable CEmu image"),
262 m_dir.absolutePath(),
263 tr("Bootable CEmu images (*.cemu);"));
264
265 if (!path.isEmpty()) {
266 m_dir = QFileInfo(path).absoluteDir();
267 QFile romFile(m_pathRom);
268 if (!romFile.open(QIODevice::ReadOnly)) {
269 return;
270 }
271 QByteArray romData = romFile.readAll();
272
273 QFile settingsFile(m_pathConfig);
274 if (!settingsFile.open(QIODevice::ReadOnly)) {
275 return;
276 }
277 QByteArray settingsData = settingsFile.readAll();
278
279 QFile writter(path);
280 writter.open(QIODevice::WriteOnly);
281 writter.write(romData);
282 writter.write(settingsData);
283 romFile.close();
284 settingsFile.close();
285 writter.close();
286 }
287}
288
289void MainWindow::setDebugSoftCommands(bool state) {
290 ui->checkDisableSoftCommands->blockSignals(true);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected