From 7d57b925e6eaaa5f9b6a72c7f17d5685a924c660 Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Sat, 24 Mar 2012 20:59:20 -0700 Subject: [PATCH] Disable wxHAS_MSW_TASKDIALOG because as of wxW svn r70933, there is a bug with the wxPD_AUTO_HIDE style which can cause a non-dolphin window to come to the foreground after auto-closing of the TaskDialog. --- .../include/wx/msw/private/msgdlg.h | 5 +- Source/Core/DolphinWX/Src/FrameTools.cpp | 12 +-- Source/Core/DolphinWX/Src/GameListCtrl.cpp | 74 ++++++++----------- Source/Core/DolphinWX/Src/ISOProperties.cpp | 24 +++--- 4 files changed, 54 insertions(+), 61 deletions(-) diff --git a/Externals/wxWidgets3/include/wx/msw/private/msgdlg.h b/Externals/wxWidgets3/include/wx/msw/private/msgdlg.h index 82b5246855..9598f7fc11 100644 --- a/Externals/wxWidgets3/include/wx/msw/private/msgdlg.h +++ b/Externals/wxWidgets3/include/wx/msw/private/msgdlg.h @@ -19,7 +19,10 @@ // by the task dialogs only. Also notice that task dialogs are available for // Unicode applications only. #if defined(TD_WARNING_ICON) && wxUSE_UNICODE - #define wxHAS_MSW_TASKDIALOG +// (shuffle2) This is turned off because as of wxW svn r70933, +// there is a bug with the wxPD_AUTO_HIDE style which can cause a non-dolphin +// window to come to the foreground after auto-closing of the TaskDialog. +// #define wxHAS_MSW_TASKDIALOG #endif // Provides methods for creating a task dialog. diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index 4da736bbaa..7abe03d35c 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -1375,17 +1375,13 @@ void CFrame::OnInstallWAD(wxCommandEvent& event) wxProgressDialog dialog(_("Installing WAD..."), _("Working..."), - 1000, // range - this, // parent + 1000, + this, wxPD_APP_MODAL | - wxPD_ELAPSED_TIME | - wxPD_ESTIMATED_TIME | - wxPD_REMAINING_TIME | - wxPD_SMOOTH // - makes indeterminate mode bar on WinXP very small + wxPD_ELAPSED_TIME | wxPD_ESTIMATED_TIME | wxPD_REMAINING_TIME | + wxPD_SMOOTH ); - dialog.CenterOnParent(); - u64 titleID = DiscIO::CNANDContentManager::Access().Install_WiiWAD(fileName); if (titleID == TITLEID_SYSMENU) { diff --git a/Source/Core/DolphinWX/Src/GameListCtrl.cpp b/Source/Core/DolphinWX/Src/GameListCtrl.cpp index 20322673a1..5eed67a123 100644 --- a/Source/Core/DolphinWX/Src/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/Src/GameListCtrl.cpp @@ -557,17 +557,17 @@ void CGameListCtrl::ScanForISOs() if (rFilenames.size() > 0) { - wxProgressDialog dialog(_("Scanning for ISOs"), - _("Scanning..."), - (int)rFilenames.size(), // range - this, // parent - wxPD_APP_MODAL | - wxPD_ELAPSED_TIME | - wxPD_ESTIMATED_TIME | - wxPD_REMAINING_TIME | - wxPD_SMOOTH // - makes indeterminate mode bar on WinXP very small - ); - dialog.CenterOnParent(); + wxProgressDialog dialog( + _("Scanning for ISOs"), + _("Scanning..."), + (int)rFilenames.size() - 1, + this, + wxPD_APP_MODAL | + wxPD_AUTO_HIDE | + wxPD_CAN_ABORT | + wxPD_ELAPSED_TIME | wxPD_ESTIMATED_TIME | wxPD_REMAINING_TIME | + wxPD_SMOOTH // - makes updates as small as possible (down to 1px) + ); for (u32 i = 0; i < rFilenames.size(); i++) { @@ -575,9 +575,9 @@ void CGameListCtrl::ScanForISOs() SplitPath(rFilenames[i], NULL, &FileName, NULL); // Update with the progress (i) and the message - bool Cont = dialog.Update(i, - wxString::Format(_("Scanning %s"), wxString(FileName.c_str(), *wxConvCurrent).c_str())); - if (!Cont) + dialog.Update(i, wxString::Format(_("Scanning %s"), + wxString(FileName.c_str(), *wxConvCurrent).c_str())); + if (dialog.WasCancelled()) break; std::auto_ptr iso_file(new GameListItem(rFilenames[i])); @@ -1089,20 +1089,15 @@ void CGameListCtrl::CompressSelection(bool _compress) if (browseDialog.ShowModal() != wxID_OK) return; - wxProgressDialog progressDialog(_compress ? - _("Compressing ISO") : _("Decompressing ISO"), - _("Working..."), - 1000, // range - this, // parent - wxPD_APP_MODAL | - wxPD_ELAPSED_TIME | - wxPD_ESTIMATED_TIME | - wxPD_REMAINING_TIME | - wxPD_SMOOTH // - makes indeterminate mode bar on WinXP very small - ); - - progressDialog.SetSize(wxSize(340, 180)); - progressDialog.CenterOnParent(); + wxProgressDialog progressDialog( + _compress ? _("Compressing ISO") : _("Decompressing ISO"), + _("Working..."), + 1000, + this, + wxPD_APP_MODAL | + wxPD_ELAPSED_TIME | wxPD_ESTIMATED_TIME | wxPD_REMAINING_TIME | + wxPD_SMOOTH + ); m_currentItem = 0; m_numberItem = GetSelectedItemCount(); @@ -1222,20 +1217,15 @@ void CGameListCtrl::OnCompressGCM(wxCommandEvent& WXUNUSED (event)) _("Confirm File Overwrite"), wxYES_NO) == wxNO); - wxProgressDialog dialog(iso->IsCompressed() ? - _("Decompressing ISO") : _("Compressing ISO"), - _("Working..."), - 1000, // range - this, // parent - wxPD_APP_MODAL | - wxPD_ELAPSED_TIME | - wxPD_ESTIMATED_TIME | - wxPD_REMAINING_TIME | - wxPD_SMOOTH // - makes indeterminate mode bar on WinXP very small - ); - - dialog.SetSize(wxSize(340, 180)); - dialog.CenterOnParent(); + wxProgressDialog dialog( + iso->IsCompressed() ? _("Decompressing ISO") : _("Compressing ISO"), + _("Working..."), + 1000, + this, + wxPD_APP_MODAL | + wxPD_ELAPSED_TIME | wxPD_ESTIMATED_TIME | wxPD_REMAINING_TIME | + wxPD_SMOOTH + ); if (iso->IsCompressed()) DiscIO::DecompressBlobToFile(iso->GetFileName().c_str(), diff --git a/Source/Core/DolphinWX/Src/ISOProperties.cpp b/Source/Core/DolphinWX/Src/ISOProperties.cpp index b5e5c82d1d..258a71e621 100644 --- a/Source/Core/DolphinWX/Src/ISOProperties.cpp +++ b/Source/Core/DolphinWX/Src/ISOProperties.cpp @@ -718,22 +718,26 @@ void CISOProperties::ExportDir(const char* _rFullPath, const char* _rExportFolde } wxString dialogTitle = index[0] ? _("Extracting Directory") : _("Extracting All Files"); - wxProgressDialog dialog(dialogTitle, - _("Extracting..."), - index[1], // range - this, // parent - wxPD_APP_MODAL | wxPD_AUTO_HIDE | wxPD_CAN_ABORT | - wxPD_ELAPSED_TIME | wxPD_ESTIMATED_TIME | wxPD_REMAINING_TIME | - wxPD_SMOOTH // - makes indeterminate mode bar on WinXP very small - ); - dialog.CenterOnParent(); + wxProgressDialog dialog( + dialogTitle, + _("Extracting..."), + index[1] - 1, + this, + wxPD_APP_MODAL | wxPD_AUTO_HIDE | wxPD_CAN_ABORT | + wxPD_ELAPSED_TIME | wxPD_ESTIMATED_TIME | wxPD_REMAINING_TIME | + wxPD_SMOOTH + ); // Extraction for (u32 i = index[0]; i < index[1]; i++) { dialog.SetTitle(wxString::Format(wxT("%s : %d%%"), dialogTitle.c_str(), (u32)(((float)(i - index[0]) / (float)(index[1] - index[0])) * 100))); - if (!dialog.Update(i, wxString::Format(_("Extracting %s"), wxString(fst[i]->m_FullPath, *wxConvCurrent).c_str()))) + + dialog.Update(i, wxString::Format(_("Extracting %s"), + wxString(fst[i]->m_FullPath, *wxConvCurrent).c_str())); + + if (dialog.WasCancelled()) break; if (fst[i]->IsDirectory())