MCPcopy Create free account
hub / github.com/LongSoft/UEFITool / saveImageFile

Method saveImageFile

uefitool.cpp:552–581  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

550}
551
552void UEFITool::saveImageFile()
553{
554 QString path = QFileDialog::getSaveFileName(this, tr("Save BIOS image file"), currentDir, "BIOS image files (*.rom *.bin *.cap *.bio *.fd *.wph *.dec);;All files (*)");
555
556 if (path.isEmpty())
557 return;
558
559 QByteArray reconstructed;
560 UINT8 result = ffsEngine->reconstructImageFile(reconstructed);
561 showMessages();
562 if (result) {
563 QMessageBox::critical(this, tr("Image reconstruction failed"), errorMessage(result), QMessageBox::Ok);
564 return;
565 }
566
567 QFile outputFile;
568 outputFile.setFileName(path);
569
570 if (!outputFile.open(QFile::WriteOnly)) {
571 QMessageBox::critical(this, tr("Image reconstruction failed"), tr("Can't open output file for rewriting"), QMessageBox::Ok);
572 return;
573 }
574
575 outputFile.resize(0);
576 outputFile.write(reconstructed);
577 outputFile.close();
578 if (QMessageBox::information(this, tr("Image reconstruction successful"), tr("Open reconstructed file?"), QMessageBox::Yes, QMessageBox::No)
579 == QMessageBox::Yes)
580 openImageFile(path);
581}
582
583void UEFITool::openImageFile()
584{

Callers

nothing calls this directly

Calls 2

errorMessageFunction · 0.85
reconstructImageFileMethod · 0.80

Tested by

no test coverage detected