mirror of
https://github.com/cookiengineer/audacity
synced 2025-12-13 16:16:33 +01:00
TranslatableString for more status bar messages
This commit is contained in:
@@ -512,9 +512,9 @@ void InitProjectWindow( ProjectWindow &window )
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
window.UpdateStatusWidths();
|
window.UpdateStatusWidths();
|
||||||
wxString msg = wxString::Format(_("Welcome to Audacity version %s"),
|
auto msg = XO("Welcome to Audacity version %s")
|
||||||
AUDACITY_VERSION_STRING);
|
.Format( AUDACITY_VERSION_STRING );
|
||||||
statusBar->SetStatusText(msg, mainStatusBarField);
|
ProjectManager::Get( project ).SetStatusText( msg, mainStatusBarField );
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_DA2
|
#ifdef EXPERIMENTAL_DA2
|
||||||
ClearBackground();// For wxGTK.
|
ClearBackground();// For wxGTK.
|
||||||
@@ -942,13 +942,10 @@ void ProjectManager::OnTimer(wxTimerEvent& WXUNUSED(event))
|
|||||||
{
|
{
|
||||||
auto &project = mProject;
|
auto &project = mProject;
|
||||||
auto &projectAudioIO = ProjectAudioIO::Get( project );
|
auto &projectAudioIO = ProjectAudioIO::Get( project );
|
||||||
auto &window = GetProjectFrame( project );
|
|
||||||
auto &dirManager = DirManager::Get( project );
|
auto &dirManager = DirManager::Get( project );
|
||||||
auto mixerToolBar = &MixerToolBar::Get( project );
|
auto mixerToolBar = &MixerToolBar::Get( project );
|
||||||
mixerToolBar->UpdateControls();
|
mixerToolBar->UpdateControls();
|
||||||
|
|
||||||
auto &statusBar = *window.GetStatusBar();
|
|
||||||
|
|
||||||
auto gAudioIO = AudioIO::Get();
|
auto gAudioIO = AudioIO::Get();
|
||||||
// gAudioIO->GetNumCaptureChannels() should only be positive
|
// gAudioIO->GetNumCaptureChannels() should only be positive
|
||||||
// when we are recording.
|
// when we are recording.
|
||||||
@@ -961,7 +958,7 @@ void ProjectManager::OnTimer(wxTimerEvent& WXUNUSED(event))
|
|||||||
.Format( GetHoursMinsString(iRecordingMins) );
|
.Format( GetHoursMinsString(iRecordingMins) );
|
||||||
|
|
||||||
// Do not change mLastMainStatusMessage
|
// Do not change mLastMainStatusMessage
|
||||||
statusBar.SetStatusText(sMessage.Translation(), mainStatusBarField);
|
SetStatusText(sMessage, mainStatusBarField);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(ODManager::IsInstanceCreated())
|
else if(ODManager::IsInstanceCreated())
|
||||||
@@ -970,7 +967,7 @@ void ProjectManager::OnTimer(wxTimerEvent& WXUNUSED(event))
|
|||||||
int numTasks = ODManager::Instance()->GetTotalNumTasks();
|
int numTasks = ODManager::Instance()->GetTotalNumTasks();
|
||||||
if(numTasks)
|
if(numTasks)
|
||||||
{
|
{
|
||||||
wxString msg;
|
TranslatableString msg;
|
||||||
float ratioComplete= ODManager::Instance()->GetOverallPercentComplete();
|
float ratioComplete= ODManager::Instance()->GetOverallPercentComplete();
|
||||||
|
|
||||||
if(ratioComplete>=1.0f)
|
if(ratioComplete>=1.0f)
|
||||||
@@ -980,20 +977,18 @@ void ProjectManager::OnTimer(wxTimerEvent& WXUNUSED(event))
|
|||||||
//signal the od task queue loop to wake up so it can remove the tasks from the queue and the queue if it is empty.
|
//signal the od task queue loop to wake up so it can remove the tasks from the queue and the queue if it is empty.
|
||||||
ODManager::Instance()->SignalTaskQueueLoop();
|
ODManager::Instance()->SignalTaskQueueLoop();
|
||||||
|
|
||||||
|
msg = XO("On-demand import and waveform calculation complete.");
|
||||||
msg = _("On-demand import and waveform calculation complete.");
|
|
||||||
statusBar.SetStatusText(msg, mainStatusBarField);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(numTasks>1)
|
else if(numTasks>1)
|
||||||
msg.Printf(_("Import(s) complete. Running %d on-demand waveform calculations. Overall %2.0f%% complete."),
|
msg = XO(
|
||||||
numTasks,ratioComplete*100.0);
|
"Import(s) complete. Running %d on-demand waveform calculations. Overall %2.0f%% complete.")
|
||||||
|
.Format( numTasks, ratioComplete * 100.0 );
|
||||||
else
|
else
|
||||||
msg.Printf(_("Import complete. Running an on-demand waveform calculation. %2.0f%% complete."),
|
msg = XO(
|
||||||
ratioComplete*100.0);
|
"Import complete. Running an on-demand waveform calculation. %2.0f%% complete.")
|
||||||
|
.Format( ratioComplete * 100.0 );
|
||||||
|
|
||||||
|
SetStatusText(msg, mainStatusBarField);
|
||||||
statusBar.SetStatusText(msg, mainStatusBarField);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1020,7 +1015,7 @@ void ProjectManager::OnStatusChange( wxCommandEvent &evt )
|
|||||||
|
|
||||||
auto field = static_cast<StatusBarField>( evt.GetInt() );
|
auto field = static_cast<StatusBarField>( evt.GetInt() );
|
||||||
const auto &msg = ProjectStatus::Get( project ).Get( field );
|
const auto &msg = ProjectStatus::Get( project ).Get( field );
|
||||||
window.GetStatusBar()->SetStatusText(msg.Translation(), field);
|
SetStatusText( msg, field );
|
||||||
|
|
||||||
if ( field == mainStatusBarField )
|
if ( field == mainStatusBarField )
|
||||||
// When recording, let the NEW status message stay at least as long as
|
// When recording, let the NEW status message stay at least as long as
|
||||||
@@ -1029,6 +1024,16 @@ void ProjectManager::OnStatusChange( wxCommandEvent &evt )
|
|||||||
RestartTimer();
|
RestartTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ProjectManager::SetStatusText( const TranslatableString &text, int number )
|
||||||
|
{
|
||||||
|
auto &project = mProject;
|
||||||
|
auto pWindow = ProjectWindow::Find( &project );
|
||||||
|
if ( !pWindow )
|
||||||
|
return;
|
||||||
|
auto &window = *pWindow;
|
||||||
|
window.GetStatusBar()->SetStatusText(text.Translation(), number);
|
||||||
|
}
|
||||||
|
|
||||||
TranslatableString ProjectManager::GetHoursMinsString(int iMinutes)
|
TranslatableString ProjectManager::GetHoursMinsString(int iMinutes)
|
||||||
{
|
{
|
||||||
if (iMinutes < 1)
|
if (iMinutes < 1)
|
||||||
|
|||||||
@@ -61,6 +61,8 @@ public:
|
|||||||
// Converts number of minutes to human readable format
|
// Converts number of minutes to human readable format
|
||||||
TranslatableString GetHoursMinsString(int iMinutes);
|
TranslatableString GetHoursMinsString(int iMinutes);
|
||||||
|
|
||||||
|
void SetStatusText( const TranslatableString &text, int number );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void OnCloseWindow(wxCloseEvent & event);
|
void OnCloseWindow(wxCloseEvent & event);
|
||||||
void OnTimer(wxTimerEvent & event);
|
void OnTimer(wxTimerEvent & event);
|
||||||
|
|||||||
Reference in New Issue
Block a user