summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/MainWindow.cpp
diff options
context:
space:
mode:
authorTillmann Karras <tilkax@gmail.com>2026-04-03 23:50:59 +0100
committerTillmann Karras <tilkax@gmail.com>2026-04-04 22:02:45 +0100
commitf06aef4f8382d258e16bac2ea8a19aa48dda72a0 (patch)
tree5d77788051f47d2259fafa57736deb0725598f92 /Source/Core/DolphinQt/MainWindow.cpp
parent2b6ca9214617e39031536cd70df26d602160670a (diff)
Improve NAND import progress dialog
Now with cancel button and an actual progress bar. For simplicity, we do two passes on the progress bar, one for loading the NAND into memory and one for extracting it. The user directory is likely on an SSD, making the extraction pass invisibly fast.
Diffstat (limited to 'Source/Core/DolphinQt/MainWindow.cpp')
-rw-r--r--Source/Core/DolphinQt/MainWindow.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp
index c3f5b4148c..2713157a74 100644
--- a/Source/Core/DolphinQt/MainWindow.cpp
+++ b/Source/Core/DolphinQt/MainWindow.cpp
@@ -1881,20 +1881,24 @@ void MainWindow::OnImportNANDBackup()
return;
ParallelProgressDialog dialog(this);
- dialog.GetRaw()->setMinimum(0);
- dialog.GetRaw()->setMaximum(0);
- dialog.GetRaw()->setLabelText(tr("Importing NAND backup"));
- dialog.GetRaw()->setCancelButton(nullptr);
-
- auto beginning = QDateTime::currentDateTime().toMSecsSinceEpoch();
+ dialog.GetRaw()->setWindowTitle(tr("Importing NAND backup"));
std::future<void> result = std::async(std::launch::async, [&] {
DiscIO::NANDImporter().ImportNANDBin(
file.toStdString(),
- [&dialog, beginning] {
- dialog.SetLabelText(
- tr("Importing NAND backup\n Time elapsed: %1s")
- .arg((QDateTime::currentDateTime().toMSecsSinceEpoch() - beginning) / 1000));
+ [&dialog](DiscIO::NANDImporter::Step step, u32 cur, u32 max) {
+ switch (step)
+ {
+ case DiscIO::NANDImporter::Step::Loading:
+ dialog.SetLabelText(tr("Loading NAND..."));
+ break;
+ case DiscIO::NANDImporter::Step::Extracting:
+ dialog.SetLabelText(tr("Extracting NAND..."));
+ break;
+ }
+ dialog.SetValue(cur);
+ dialog.SetMaximum(max);
+ return dialog.WasCanceled();
},
[this] {
std::optional<std::string> keys_file = RunOnObject(this, [this] {