| 858 | #include "Project.h" |
| 859 | |
| 860 | void DoReloadPreferences( AudacityProject &project ) |
| 861 | { |
| 862 | PreferenceInitializer::ReinitializeAll(); |
| 863 | |
| 864 | { |
| 865 | GlobalPrefsDialog dialog( |
| 866 | &GetProjectFrame( project ) /* parent */, &project ); |
| 867 | wxCommandEvent Evt; |
| 868 | //dialog.Show(); |
| 869 | dialog.OnOK(Evt); |
| 870 | } |
| 871 | |
| 872 | // LL: Moved from PrefsDialog since wxWidgets on OSX can't deal with |
| 873 | // rebuilding the menus while the PrefsDialog is still in the modal |
| 874 | // state. |
| 875 | for (auto p : AllProjects{}) { |
| 876 | MenuCreator::Get(*p).RebuildMenuBar(); |
| 877 | // TODO: The comment below suggests this workaround is obsolete. |
| 878 | #if defined(__WXGTK__) |
| 879 | // Workaround for: |
| 880 | // |
| 881 | // http://bugzilla.audacityteam.org/show_bug.cgi?id=458 |
| 882 | // |
| 883 | // This workaround should be removed when Audacity updates to wxWidgets |
| 884 | // 3.x which has a fix. |
| 885 | auto &window = GetProjectFrame( *p ); |
| 886 | wxRect r = window.GetRect(); |
| 887 | window.SetSize(wxSize(1,1)); |
| 888 | window.SetSize(r.GetSize()); |
| 889 | #endif |
| 890 | } |
| 891 | } |