mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2025-01-17 15:42:10 +00:00
mmg: use app->SafeYield() instead of while(app->Pending()) app->Dispatch()
The latter seems to hang endlessly on Mac OS.
This commit is contained in:
parent
ae9b45d7a8
commit
8c61d83c54
@ -31,20 +31,28 @@ wx_kax_analyzer_c::wx_kax_analyzer_c(wxWindow *parent,
|
||||
wx_kax_analyzer_c::~wx_kax_analyzer_c() {
|
||||
}
|
||||
|
||||
void
|
||||
wx_kax_analyzer_c::yield() {
|
||||
#if wxCHECK_VERSION(2, 9, 0)
|
||||
app->SafeYield(m_prog_dlg, false);
|
||||
#else
|
||||
while (app->Pending())
|
||||
app->Dispatch();
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
wx_kax_analyzer_c::show_progress_start(int64_t) {
|
||||
m_prog_dlg = new wxProgressDialog(Z("Analysis is running"), Z("The file is being analyzed."), 100, m_parent,
|
||||
wxPD_AUTO_HIDE | wxPD_APP_MODAL | wxPD_CAN_ABORT | wxPD_REMAINING_TIME);
|
||||
|
||||
while (app->Pending())
|
||||
app->Dispatch();
|
||||
yield();
|
||||
}
|
||||
|
||||
bool
|
||||
wx_kax_analyzer_c::show_progress_running(int percentage) {
|
||||
bool aborted = !m_prog_dlg->Update(percentage);
|
||||
while (app->Pending())
|
||||
app->Dispatch();
|
||||
|
||||
yield();
|
||||
|
||||
return !aborted;
|
||||
}
|
||||
|
@ -40,6 +40,7 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void _log_debug_message(const std::string &message);
|
||||
virtual void yield();
|
||||
};
|
||||
typedef std::shared_ptr<wx_kax_analyzer_c> wx_kax_analyzer_cptr;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user