Commit e41e70d1 authored by Rohit Yadav's avatar Rohit Yadav

About.cpp: Fix retranslation event bug and apply HACKINGS.

Problem: If we're using any variables (in constructor) to set text
in a QLabel (of a ui file) using %1, %2...%n and then if we change
the locale from the "preferences", all those string which are translated
will set the %1...%n as such so fix this behaviour;

NOTES: PL. APPLY this kind of rectification in any other file.
parent 2fd18c9d
......@@ -44,32 +44,44 @@ About::About( QWidget *parent ) : QDialog( parent )
"cross-platform, non-linear video editing software based on the VLC "
"Media Player.\n" ) );
m_ui.labelTitle->setText(
m_ui.labelTitle->setText(
m_ui.labelTitle->text().arg( PROJECT_VERSION, CODENAME ) );
m_ui.labelBuild->setText(
m_ui.labelBuild->text().arg( HOSTNAME, SYSNAME, QT_VERSION_STR, qVersion() ) );
m_ui.labelBuild->text().arg( HOSTNAME, SYSNAME,
QT_VERSION_STR, qVersion() ) );
m_ui.labelCopyright->setText(
m_ui.labelCopyright->text().arg( PROJECT_COPYRIGHT, PROJECT_CONTACT, ORG_WEBSITE ) );
m_ui.labelCopyright->setText(
m_ui.labelCopyright->text().arg( PROJECT_COPYRIGHT, PROJECT_CONTACT,
ORG_WEBSITE ) );
connect( qApp, SIGNAL( aboutToQuit() ), this, SLOT( deleteLater() ) );
}
void About::changeEvent( QEvent *e )
void
About::changeEvent( QEvent *e )
{
QDialog::changeEvent( e );
switch ( e->type() )
{
case QEvent::LanguageChange:
m_ui.retranslateUi( this );
m_ui.labelTitle->setText(
m_ui.labelTitle->text().arg( PROJECT_VERSION, CODENAME ) );
m_ui.labelBuild->setText(
m_ui.labelBuild->text().arg( HOSTNAME, SYSNAME,
QT_VERSION_STR, qVersion() ) );
m_ui.labelCopyright->setText(
m_ui.labelCopyright->text().arg( PROJECT_COPYRIGHT,
PROJECT_CONTACT, ORG_WEBSITE ) );
break;
default:
break;
}
}
void About::setText( const QString& filename, QPlainTextEdit* widget )
void
About::setText( const QString& filename, QPlainTextEdit* widget )
{
QFile file( filename );
......
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