| 1952 | } |
| 1953 | |
| 1954 | void CMainFrame::OnFileImportText() |
| 1955 | { |
| 1956 | CFamiTrackerDoc &Doc = GetDoc(); |
| 1957 | if (!Doc.SaveModified()) |
| 1958 | return; |
| 1959 | |
| 1960 | if (auto path = GetLoadPath("", "", IDS_FILTER_TXT, L"*.txt")) { |
| 1961 | try { |
| 1962 | CTextExport { }.ImportFile(*path, Doc); |
| 1963 | } |
| 1964 | catch (std::runtime_error err) { |
| 1965 | AfxMessageBox(conv::to_wide(err.what()).data(), MB_OK | MB_ICONEXCLAMATION); |
| 1966 | } |
| 1967 | |
| 1968 | SetSongInfo(*Doc.GetModule()); // // // |
| 1969 | Doc.SetModifiedFlag(FALSE); |
| 1970 | Doc.SetExceededFlag(false); // // // |
| 1971 | // TODO figure out how to handle this case, call OnInitialUpdate?? |
| 1972 | //Doc.UpdateAllViews(NULL, CHANGED_ERASE); // Remove |
| 1973 | Doc.UpdateAllViews(NULL, UPDATE_PROPERTIES); |
| 1974 | Doc.UpdateAllViews(NULL, UPDATE_INSTRUMENT); |
| 1975 | FTEnv.GetSoundGenerator()->DocumentPropertiesChanged(&Doc); |
| 1976 | } |
| 1977 | } |
| 1978 | |
| 1979 | void CMainFrame::OnFileExportText() |
| 1980 | { |
nothing calls this directly
no test coverage detected