mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
VolumeVerifier: Check hashes in Wii partitions
This commit is contained in:
@ -238,12 +238,6 @@ void FilesystemWidget::ShowContextMenu(const QPoint&)
|
||||
if (!folder.isEmpty())
|
||||
ExtractPartition(partition, folder);
|
||||
});
|
||||
if (m_volume->IsEncryptedAndHashed())
|
||||
{
|
||||
menu->addSeparator();
|
||||
menu->addAction(tr("Check Partition Integrity"), this,
|
||||
[this, partition] { CheckIntegrity(partition); });
|
||||
}
|
||||
break;
|
||||
case EntryType::File:
|
||||
menu->addAction(tr("Extract File..."), this, [this, partition, path] {
|
||||
@ -327,35 +321,3 @@ void FilesystemWidget::ExtractFile(const DiscIO::Partition& partition, const QSt
|
||||
else
|
||||
ModalMessageBox::critical(this, tr("Error"), tr("Failed to extract file."));
|
||||
}
|
||||
|
||||
void FilesystemWidget::CheckIntegrity(const DiscIO::Partition& partition)
|
||||
{
|
||||
QProgressDialog* dialog = new QProgressDialog(this);
|
||||
std::future<bool> is_valid = std::async(
|
||||
std::launch::async, [this, partition] { return m_volume->CheckIntegrity(partition); });
|
||||
|
||||
dialog->setLabelText(tr("Verifying integrity of partition..."));
|
||||
dialog->setWindowFlags(dialog->windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
dialog->setWindowTitle(tr("Verifying partition"));
|
||||
|
||||
dialog->setMinimum(0);
|
||||
dialog->setMaximum(0);
|
||||
dialog->show();
|
||||
|
||||
while (is_valid.wait_for(std::chrono::milliseconds(50)) != std::future_status::ready)
|
||||
QCoreApplication::processEvents();
|
||||
|
||||
dialog->close();
|
||||
|
||||
if (is_valid.get())
|
||||
{
|
||||
ModalMessageBox::information(this, tr("Success"),
|
||||
tr("Integrity check completed. No errors have been found."));
|
||||
}
|
||||
else
|
||||
{
|
||||
ModalMessageBox::critical(this, tr("Error"),
|
||||
tr("Integrity check for partition failed. The disc image is most "
|
||||
"likely corrupted or has been patched incorrectly."));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user