From 6a75212e7a5c7849f29eabcb47f612b2c196571c Mon Sep 17 00:00:00 2001 From: JosJuice Date: Thu, 17 Dec 2015 12:49:23 +0100 Subject: [PATCH] DolphinWX: Only show Wii compression warning once When compressing multiple Wii games, the warning used to be showed once for each game. Now it only appears once at the beginning. --- Source/Core/DolphinWX/GameListCtrl.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/Source/Core/DolphinWX/GameListCtrl.cpp b/Source/Core/DolphinWX/GameListCtrl.cpp index 925bea1c4b..aa8596159a 100644 --- a/Source/Core/DolphinWX/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/GameListCtrl.cpp @@ -1087,6 +1087,23 @@ void CGameListCtrl::OnMultiDecompressISO(wxCommandEvent& /*event*/) void CGameListCtrl::CompressSelection(bool _compress) { + const std::vector selected_items = GetAllSelectedISOs(); + + // If any Wii discs are going to be compressed, show the Wii compression warning once + if (_compress) + { + for (const GameListItem* iso : selected_items) + { + if (!iso->IsCompressed() && iso->GetPlatform() == DiscIO::IVolume::WII_DISC) + { + if (WiiCompressWarning()) + break; + else + return; + } + } + } + wxString dirHome; wxGetHomeDir(&dirHome); @@ -1113,7 +1130,7 @@ void CGameListCtrl::CompressSelection(bool _compress) m_currentItem = 0; m_numberItem = GetSelectedItemCount(); - for (const GameListItem* iso : GetAllSelectedISOs()) + for (const GameListItem* iso : selected_items) { if (iso->GetPlatform() != DiscIO::IVolume::GAMECUBE_DISC && iso->GetPlatform() != DiscIO::IVolume::WII_DISC) continue; @@ -1122,9 +1139,6 @@ void CGameListCtrl::CompressSelection(bool _compress) if (!iso->IsCompressed() && _compress) { - if (iso->GetPlatform() == DiscIO::IVolume::WII_DISC && !WiiCompressWarning()) - return; - std::string FileName, FileExt; SplitPath(iso->GetFileName(), nullptr, &FileName, &FileExt); // Update the file name in the progress dialog