From 04926374f77115c8e388a8bc5a8c375af94f5bff Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Mon, 18 Jul 2016 21:28:58 +0300 Subject: [PATCH] PKG installer fix --- rpcs3/Gui/MainFrame.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/rpcs3/Gui/MainFrame.cpp b/rpcs3/Gui/MainFrame.cpp index 6dc1406cf7..efbf7b6217 100644 --- a/rpcs3/Gui/MainFrame.cpp +++ b/rpcs3/Gui/MainFrame.cpp @@ -283,13 +283,15 @@ void MainFrame::InstallPkg(wxCommandEvent& WXUNUSED(event)) if (pkg_install(pkg_f, local_path + '/', progress)) { progress = 1.; + return_; } // TODO: Ask user to delete files on cancellation/failure? + progress = -1.; }); // Wait for the completion - while (std::this_thread::sleep_for(5ms), progress < 1.) + while (std::this_thread::sleep_for(5ms), std::abs(progress) < 1.) { // Update progress window if (!pdlg.Update(static_cast(progress * pdlg.GetRange()))) @@ -299,6 +301,12 @@ void MainFrame::InstallPkg(wxCommandEvent& WXUNUSED(event)) break; } } + + if (progress > 0.) + { + pdlg.Update(pdlg.GetRange()); + std::this_thread::sleep_for(100ms); + } } pdlg.Close();