Pass a number in to show project number, or -1 not to.
| 1564 | |
| 1565 | // Pass a number in to show project number, or -1 not to. |
| 1566 | void ProjectFileIO::SetProjectTitle(int number) |
| 1567 | { |
| 1568 | auto &project = mProject; |
| 1569 | wxString name = project.GetProjectName(); |
| 1570 | |
| 1571 | // If we are showing project numbers, then we also explicitly show "<untitled>" if there |
| 1572 | // is none. |
| 1573 | if (number >= 0) |
| 1574 | { |
| 1575 | name = |
| 1576 | /* i18n-hint: The %02i is the project number, the %s is the project name.*/ |
| 1577 | XO("[Project %02i] Audacity \"%s\"") |
| 1578 | .Format( number + 1, |
| 1579 | name.empty() ? XO("<untitled>") : Verbatim((const char *)name)) |
| 1580 | .Translation(); |
| 1581 | } |
| 1582 | // If we are not showing numbers, then <untitled> shows as 'Audacity'. |
| 1583 | else if (name.empty()) |
| 1584 | { |
| 1585 | name = _TS("Audacity"); |
| 1586 | } |
| 1587 | |
| 1588 | if (mRecovered) |
| 1589 | { |
| 1590 | name += wxT(" "); |
| 1591 | /* i18n-hint: E.g this is recovered audio that had been lost.*/ |
| 1592 | name += _("(Recovered)"); |
| 1593 | } |
| 1594 | |
| 1595 | if (name != mTitle) { |
| 1596 | mTitle = name; |
| 1597 | BasicUI::CallAfter( [wThis = weak_from_this()]{ |
| 1598 | if (auto pThis = wThis.lock()) |
| 1599 | pThis->Publish(ProjectFileIOMessage::ProjectTitleChange); |
| 1600 | } ); |
| 1601 | } |
| 1602 | } |
| 1603 | |
| 1604 | const FilePath &ProjectFileIO::GetFileName() const |
| 1605 | { |
no test coverage detected