mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-21 23:00:06 +02:00
If the progress dialog is used before the main window is
created, then there won't be a menu bar. So, check for possible NULL pointers. (Are you listening Leland?!?!)
This commit is contained in:
parent
4bde2be9c6
commit
9438fdf3e5
@ -1155,12 +1155,25 @@ ProgressDialog::ProgressDialog(const wxString & title, const wxString & message,
|
|||||||
// while we're active, so we have to kludge around a bit to keep this
|
// while we're active, so we have to kludge around a bit to keep this
|
||||||
// from happening.
|
// from happening.
|
||||||
WindowRef windowRef = (WindowRef) MacGetWindowRef();
|
WindowRef windowRef = (WindowRef) MacGetWindowRef();
|
||||||
SetWindowModality( windowRef, kWindowModalityAppModal, NULL ) ;
|
if (windowRef) {
|
||||||
BeginAppModalStateForWindow(windowRef);
|
SetWindowModality(windowRef, kWindowModalityAppModal, NULL);
|
||||||
|
BeginAppModalStateForWindow(windowRef);
|
||||||
|
}
|
||||||
|
|
||||||
wxMenuBar *bar = wxStaticCast(wxGetTopLevelParent(wxTheApp->GetTopWindow()), wxFrame)->GetMenuBar();
|
w = wxTheApp->GetTopWindow();
|
||||||
bar->Enable(wxID_PREFERENCES, false);
|
if (w) {
|
||||||
bar->Enable(wxID_EXIT, false);
|
w = wxGetTopLevelParent(w);
|
||||||
|
if (w) {
|
||||||
|
wxFrame *f = wxStaticCast(w, wxFrame);
|
||||||
|
if (f) {
|
||||||
|
wxMenuBar *bar = f->GetMenuBar();
|
||||||
|
if (bar) {
|
||||||
|
bar->Enable(wxID_PREFERENCES, false);
|
||||||
|
bar->Enable(wxID_EXIT, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1177,12 +1190,25 @@ ProgressDialog::~ProgressDialog()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__WXMAC__)
|
#if defined(__WXMAC__)
|
||||||
wxMenuBar *bar = wxStaticCast(wxGetTopLevelParent(wxTheApp->GetTopWindow()), wxFrame)->GetMenuBar();
|
wxWindow *w = wxTheApp->GetTopWindow();
|
||||||
bar->Enable(wxID_PREFERENCES, true);
|
if (w) {
|
||||||
bar->Enable(wxID_EXIT, true);
|
w = wxGetTopLevelParent(w);
|
||||||
|
if (w) {
|
||||||
|
wxFrame *f = wxStaticCast(w, wxFrame);
|
||||||
|
if (f) {
|
||||||
|
wxMenuBar *bar = f->GetMenuBar();
|
||||||
|
if (bar) {
|
||||||
|
bar->Enable(wxID_PREFERENCES, true);
|
||||||
|
bar->Enable(wxID_EXIT, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
WindowRef windowRef = (WindowRef) MacGetWindowRef();
|
WindowRef windowRef = (WindowRef) MacGetWindowRef();
|
||||||
EndAppModalStateForWindow(windowRef);
|
if (windowRef) {
|
||||||
|
EndAppModalStateForWindow(windowRef);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (mDisable)
|
if (mDisable)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user