| 753 | } |
| 754 | |
| 755 | bool ProjectFileManager::SaveFromTimerRecording(wxFileName fnFile) |
| 756 | { |
| 757 | auto &project = mProject; |
| 758 | auto &projectFileIO = ProjectFileIO::Get( project ); |
| 759 | |
| 760 | // MY: Will save the project to a NEW location a-la Save As |
| 761 | // and then tidy up after itself. |
| 762 | |
| 763 | wxString sNewFileName = fnFile.GetFullPath(); |
| 764 | |
| 765 | // MY: To allow SaveAs from Timer Recording we need to check what |
| 766 | // the value of mFileName is before we change it. |
| 767 | FilePath sOldFilename; |
| 768 | if (!projectFileIO.IsModified()) { |
| 769 | sOldFilename = projectFileIO.GetFileName(); |
| 770 | } |
| 771 | |
| 772 | // MY: If the project file already exists then bail out |
| 773 | // and send populate the message string (pointer) so |
| 774 | // we can tell the user what went wrong. |
| 775 | if (wxFileExists(sNewFileName)) { |
| 776 | return false; |
| 777 | } |
| 778 | |
| 779 | auto success = DoSave(sNewFileName, true); |
| 780 | |
| 781 | if (success) { |
| 782 | FileHistory::Global().Append( projectFileIO.GetFileName() ); |
| 783 | } |
| 784 | |
| 785 | return success; |
| 786 | } |
| 787 | |
| 788 | void ProjectFileManager::CompactProjectOnClose() |
| 789 | { |
no test coverage detected