| 1763 | } |
| 1764 | |
| 1765 | TitleRestorer::TitleRestorer( |
| 1766 | wxTopLevelWindow &window, AudacityProject &project ) |
| 1767 | { |
| 1768 | if( window.IsIconized() ) |
| 1769 | window.Restore(); |
| 1770 | window.Raise(); // May help identifying the window on Mac |
| 1771 | |
| 1772 | // Construct this project's name and number. |
| 1773 | sProjName = project.GetProjectName(); |
| 1774 | if ( sProjName.empty() ) { |
| 1775 | sProjName = _("<untitled>"); |
| 1776 | UnnamedCount = std::count_if( |
| 1777 | AllProjects{}.begin(), AllProjects{}.end(), |
| 1778 | []( const AllProjects::value_type &ptr ){ |
| 1779 | return ptr->GetProjectName().empty(); |
| 1780 | } |
| 1781 | ); |
| 1782 | if ( UnnamedCount > 1 ) { |
| 1783 | sProjNumber.Printf( |
| 1784 | _("[Project %02i] "), project.GetProjectNumber() + 1 ); |
| 1785 | RefreshAllTitles( true ); |
| 1786 | } |
| 1787 | } |
| 1788 | else |
| 1789 | UnnamedCount = 0; |
| 1790 | } |
| 1791 | |
| 1792 | TitleRestorer::~TitleRestorer() { |
| 1793 | if( UnnamedCount > 1 ) |
nothing calls this directly
no test coverage detected