Merge pull request #3216 from aserna3/WiiDiscWarning

[DolphinWX] Added warning to Wii disc compression
This commit is contained in:
Pierre Bourdon 2015-11-01 05:28:15 +01:00
commit 491e149545
2 changed files with 16 additions and 2 deletions

View File

@ -1080,6 +1080,9 @@ void CGameListCtrl::CompressSelection(bool _compress)
if (!iso->IsCompressed() && _compress) if (!iso->IsCompressed() && _compress)
{ {
if (iso->GetPlatform() == DiscIO::IVolume::WII_DISC && !WiiCompressWarning())
return;
std::string FileName, FileExt; std::string FileName, FileExt;
SplitPath(iso->GetFileName(), nullptr, &FileName, &FileExt); SplitPath(iso->GetFileName(), nullptr, &FileName, &FileExt);
m_currentFilename = FileName; m_currentFilename = FileName;
@ -1093,7 +1096,7 @@ void CGameListCtrl::CompressSelection(bool _compress)
if (File::Exists(OutputFileName) && if (File::Exists(OutputFileName) &&
wxMessageBox( wxMessageBox(
wxString::Format(_("The file %s already exists.\nDo you wish to replace it?"), wxString::Format(_("The file %s already exists.\nDo you wish to replace it?"),
StrToWxStr(OutputFileName)), StrToWxStr(OutputFileName)),
_("Confirm File Overwrite"), _("Confirm File Overwrite"),
wxYES_NO) == wxNO) wxYES_NO) == wxNO)
continue; continue;
@ -1121,7 +1124,7 @@ void CGameListCtrl::CompressSelection(bool _compress)
if (File::Exists(OutputFileName) && if (File::Exists(OutputFileName) &&
wxMessageBox( wxMessageBox(
wxString::Format(_("The file %s already exists.\nDo you wish to replace it?"), wxString::Format(_("The file %s already exists.\nDo you wish to replace it?"),
StrToWxStr(OutputFileName)), StrToWxStr(OutputFileName)),
_("Confirm File Overwrite"), _("Confirm File Overwrite"),
wxYES_NO) == wxNO) wxYES_NO) == wxNO)
continue; continue;
@ -1178,6 +1181,9 @@ void CGameListCtrl::OnCompressISO(wxCommandEvent& WXUNUSED (event))
} }
else else
{ {
if (iso->GetPlatform() == DiscIO::IVolume::WII_DISC && !WiiCompressWarning())
return;
path = wxFileSelector( path = wxFileSelector(
_("Save compressed GCM/ISO"), _("Save compressed GCM/ISO"),
StrToWxStr(FilePath), StrToWxStr(FilePath),
@ -1292,3 +1298,10 @@ void CGameListCtrl::UnselectAll()
SetItemState(i, 0, wxLIST_STATE_SELECTED); SetItemState(i, 0, wxLIST_STATE_SELECTED);
} }
} }
bool CGameListCtrl::WiiCompressWarning()
{
return wxMessageBox(
_("Compressing a Wii disc image will irreversibly change the compressed copy by removing padding data. Your disc image will still work. Continue?"),
_("Warning"),
wxYES_NO) == wxYES;
}

View File

@ -107,4 +107,5 @@ private:
static size_t m_numberItem; static size_t m_numberItem;
static bool CompressCB(const std::string& text, float percent, void* arg); static bool CompressCB(const std::string& text, float percent, void* arg);
static bool MultiCompressCB(const std::string& text, float percent, void* arg); static bool MultiCompressCB(const std::string& text, float percent, void* arg);
static bool WiiCompressWarning();
}; };