Commit eb8f2eae authored by Christophe Courtaut's avatar Christophe Courtaut

Added missing tr. Translate track control at runtime

parent c1144938
...@@ -309,15 +309,15 @@ void MainWindow::initializeDockWidgets( void ) ...@@ -309,15 +309,15 @@ void MainWindow::initializeDockWidgets( void )
void MainWindow::createGlobalPreferences() void MainWindow::createGlobalPreferences()
{ {
m_globalPreferences = new Settings( false, "VLMC", this ); m_globalPreferences = new Settings( false, "VLMC", this );
m_globalPreferences->addWidget("VLMC", m_globalPreferences->addWidget( tr ( "VLMC" ),
new VLMCPreferences( m_globalPreferences ), new VLMCPreferences( m_globalPreferences ),
QIcon( ":/images/images/vlmc.png" ), QIcon( ":/images/images/vlmc.png" ),
"VLMC settings"); tr ( "VLMC settings" ) );
m_globalPreferences->addWidget("Language preferences", m_globalPreferences->addWidget( tr ("Language preferences" ),
new LanguagePreferences( m_globalPreferences ), new LanguagePreferences( m_globalPreferences ),
QIcon( ":/images/images/vlmc.png" ), QIcon( ":/images/images/vlmc.png" ),
"Langage settings"); tr ( "Language settings" ) );
m_globalPreferences->addWidget( "Keyboard", m_globalPreferences->addWidget( tr ("Keyboard" ),
new KeyboardShortcut( m_globalPreferences ), new KeyboardShortcut( m_globalPreferences ),
QIcon( ":/images/keyboard" ), QIcon( ":/images/keyboard" ),
tr( "Keyboard Settings" ) ); tr( "Keyboard Settings" ) );
...@@ -326,18 +326,18 @@ void MainWindow::createGlobalPreferences() ...@@ -326,18 +326,18 @@ void MainWindow::createGlobalPreferences()
void MainWindow::createProjectPreferences() void MainWindow::createProjectPreferences()
{ {
m_projectPreferences = new Settings( false, "project", this ); m_projectPreferences = new Settings( false, "project", this );
m_projectPreferences->addWidget("Project", m_projectPreferences->addWidget( tr( "Project" ),
new ProjectPreferences, new ProjectPreferences,
QIcon( ":/images/images/vlmc.png" ), QIcon( ":/images/images/vlmc.png" ),
"Project settings" ); tr ( "Project settings" ) );
m_projectPreferences->addWidget( "Video", m_projectPreferences->addWidget( tr ( "Video" ),
new VideoProjectPreferences, new VideoProjectPreferences,
QIcon( ":/images/images/video.png" ), QIcon( ":/images/images/video.png" ),
"Video settings" ); tr ( "Video settings" ) );
m_projectPreferences->addWidget( "Audio", m_projectPreferences->addWidget( tr ( "Audio" ),
new AudioProjectPreferences, new AudioProjectPreferences,
QIcon( ":/images/images/audio.png" ), QIcon( ":/images/images/audio.png" ),
"Audio settings" ); tr ( "Audio settings" ) );
} }
...@@ -369,11 +369,11 @@ void MainWindow::on_actionRender_triggered() ...@@ -369,11 +369,11 @@ void MainWindow::on_actionRender_triggered()
{ {
if ( MainWorkflow::getInstance()->getLengthFrame() <= 0 ) if ( MainWorkflow::getInstance()->getLengthFrame() <= 0 )
{ {
QMessageBox::warning( NULL, "VLMC Renderer", "There is nothing to render." ); QMessageBox::warning( NULL, tr ( "VLMC Renderer" ), tr( "There is nothing to render." ) );
return ; return ;
} }
QString outputFileName = QString outputFileName =
QFileDialog::getSaveFileName( NULL, "Enter the output file name", QFileDialog::getSaveFileName( NULL, tr ( "Enter the output file name" ),
QDir::currentPath(), "Videos(*.avi *.mpg)" ); QDir::currentPath(), "Videos(*.avi *.mpg)" );
if ( outputFileName.length() == 0 ) if ( outputFileName.length() == 0 )
return ; return ;
......
...@@ -32,11 +32,7 @@ TrackControls::TrackControls( GraphicsTrack* track, QWidget *parent ) : ...@@ -32,11 +32,7 @@ TrackControls::TrackControls( GraphicsTrack* track, QWidget *parent ) :
setTrackDisabled( !m_track->isEnabled() ); setTrackDisabled( !m_track->isEnabled() );
connect( m_ui->disableButton, SIGNAL( clicked(bool) ), connect( m_ui->disableButton, SIGNAL( clicked(bool) ),
this, SLOT( setTrackDisabled(bool) ) ); this, SLOT( setTrackDisabled(bool) ) );
updateTextLabels();
if ( m_track->mediaType() == MainWorkflow::VideoTrack )
m_ui->trackLabel->setText( tr( "Video #%1" ).arg( QString::number( m_track->trackNumber() + 1 ) ) );
else if ( m_track->mediaType() == MainWorkflow::AudioTrack )
m_ui->trackLabel->setText( tr( "Audio #%1" ).arg( QString::number( m_track->trackNumber() + 1 ) ) );
} }
TrackControls::~TrackControls() TrackControls::~TrackControls()
...@@ -44,12 +40,21 @@ TrackControls::~TrackControls() ...@@ -44,12 +40,21 @@ TrackControls::~TrackControls()
delete m_ui; delete m_ui;
} }
void TrackControls::updateTextLabels()
{
if ( m_track->mediaType() == MainWorkflow::VideoTrack )
m_ui->trackLabel->setText( tr( "Video #%1" ).arg( QString::number( m_track->trackNumber() + 1 ) ) );
else if ( m_track->mediaType() == MainWorkflow::AudioTrack )
m_ui->trackLabel->setText( tr( "Audio #%1" ).arg( QString::number( m_track->trackNumber() + 1 ) ) );
}
void TrackControls::changeEvent( QEvent *e ) void TrackControls::changeEvent( QEvent *e )
{ {
QWidget::changeEvent( e ); QWidget::changeEvent( e );
switch ( e->type() ) { switch ( e->type() ) {
case QEvent::LanguageChange: case QEvent::LanguageChange:
m_ui->retranslateUi( this ); m_ui->retranslateUi( this );
updateTextLabels();
break; break;
default: default:
break; break;
......
...@@ -45,6 +45,7 @@ private slots: ...@@ -45,6 +45,7 @@ private slots:
void setTrackDisabled( bool disable ); void setTrackDisabled( bool disable );
private: private:
void updateTextLabels();
Ui::TrackControls *m_ui; Ui::TrackControls *m_ui;
GraphicsTrack* m_track; GraphicsTrack* m_track;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment