| 829 | |
| 830 | |
| 831 | bool MacrosWindow::ChangeOK() |
| 832 | { |
| 833 | if (mChanged) { |
| 834 | int id; |
| 835 | |
| 836 | auto title = XO("%s changed").Format( mActiveMacro ); |
| 837 | auto msg = XO("Do you want to save the changes?"); |
| 838 | |
| 839 | id = AudacityMessageBox( |
| 840 | msg, |
| 841 | title, |
| 842 | wxYES_NO | wxCANCEL); |
| 843 | if (id == wxCANCEL) { |
| 844 | return false; |
| 845 | } |
| 846 | |
| 847 | if (id == wxYES) { |
| 848 | if (!mMacroCommands.WriteMacro(mActiveMacro)) { |
| 849 | return false; |
| 850 | } |
| 851 | } |
| 852 | |
| 853 | mChanged = false; |
| 854 | mSave->Enable( mChanged ); |
| 855 | } |
| 856 | |
| 857 | return true; |
| 858 | } |
| 859 | /// An item in the macros list has been selected. |
| 860 | void MacrosWindow::OnMacroSelected(wxListEvent & event) |
| 861 | { |
nothing calls this directly
no test coverage detected