diff options
Diffstat (limited to 'Source/Core/DolphinWX/Frame.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/Frame.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp index 28e25b4806..08bbcc4a52 100644 --- a/Source/Core/DolphinWX/Frame.cpp +++ b/Source/Core/DolphinWX/Frame.cpp @@ -20,6 +20,7 @@ #include <wx/menu.h> #include <wx/msgdlg.h> #include <wx/panel.h> +#include <wx/progdlg.h> #include <wx/sizer.h> #include <wx/statusbr.h> #include <wx/textctrl.h> @@ -817,6 +818,37 @@ void CFrame::OnHostMessage(wxCommandEvent& event) case IDM_STOPPED: OnStopped(); break; + + case IDM_UPDATE_PROGRESS_DIALOG: + { + int current = event.GetInt(); + int total = static_cast<int>(event.GetExtraLong()); + if (total < 0 || current >= total) + { + if (m_progress_dialog) + { + delete m_progress_dialog; + m_progress_dialog = nullptr; + } + } + else if (total > 0 && current < total) + { + if (!m_progress_dialog) + { + m_progress_dialog = new wxProgressDialog( + _("Operation in progress..."), event.GetString(), total, m_render_frame, + wxPD_APP_MODAL | wxPD_ELAPSED_TIME | wxPD_SMOOTH | wxPD_REMAINING_TIME); + m_progress_dialog->Show(); + } + else + { + if (m_progress_dialog->GetRange() != total) + m_progress_dialog->SetRange(total); + m_progress_dialog->Update(current, event.GetString()); + } + } + } + break; } } |
