2011-02-18 20:14:45 +01:00
///////////////////////////////////////////////////////////////////////////////
2010-11-11 19:37:16 +01:00
// LameXP - Audio Encoder Front-End
2015-01-01 18:06:21 +01:00
// Copyright (C) 2004-2015 LoRd_MuldeR <MuldeR2@GMX.de>
2010-11-11 19:37:16 +01:00
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
2013-10-23 20:56:57 +02:00
// (at your option) any later version, but always including the *additional*
// restrictions defined in the "License.txt" file.
2010-11-11 19:37:16 +01:00
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//
// http://www.gnu.org/licenses/gpl-2.0.txt
///////////////////////////////////////////////////////////////////////////////
# include "Dialog_About.h"
2014-11-24 18:28:53 +01:00
# include "UIC_AboutDialog.h"
2012-12-10 23:50:45 +01:00
2014-11-25 02:14:42 +01:00
//Internal
2010-11-11 19:37:16 +01:00
# include "Global.h"
2010-11-29 20:36:27 +01:00
# include "Model_Settings.h"
2010-11-11 19:37:16 +01:00
2014-11-25 02:14:42 +01:00
//MUtils
# include <MUtils/Global.h>
# include <MUtils/OSSupport.h>
2014-12-05 21:08:26 +01:00
# include <MUtils/Sound.h>
2014-12-08 22:06:01 +01:00
# include <MUtils/GUI.h>
2014-11-25 02:14:42 +01:00
# include <MUtils/Version.h>
2013-10-06 19:28:12 +02:00
2014-11-25 02:14:42 +01:00
//Qt
2010-11-11 19:37:16 +01:00
# include <QDate>
# include <QApplication>
# include <QIcon>
# include <QPushButton>
2010-11-12 15:58:53 +01:00
# include <QDesktopServices>
# include <QUrl>
2010-11-12 19:02:01 +01:00
# include <QTimer>
2010-12-18 16:49:04 +01:00
# include <QFileInfo>
# include <QDir>
2011-04-24 23:18:39 +02:00
# include <QDesktopWidget>
# include <QLabel>
2012-09-15 20:46:26 +02:00
# include <QMessageBox>
# include <QTextStream>
2012-09-16 14:15:32 +02:00
# include <QScrollBar>
2012-09-16 18:13:53 +02:00
# include <QCloseEvent>
2014-12-06 15:54:58 +01:00
# include <QElapsedTimer>
2012-09-18 01:41:00 +02:00
# include <QWindowsVistaStyle>
# include <QWindowsXPStyle>
2010-11-11 19:37:16 +01:00
2014-11-25 02:14:42 +01:00
//CRT
# include <math.h>
2010-11-11 19:37:16 +01:00
//Helper macros
2011-10-16 16:38:01 +02:00
# define LINK(URL) QString("<a href=\"%1\">%2< / a>").arg(URL).arg(QString(URL).replace("-", "−"))
2012-09-16 18:13:53 +02:00
# define TRIM_RIGHT(STR) do { while(STR.endsWith(QChar(' ')) || STR.endsWith(QChar('\t')) || STR.endsWith(QChar('\r')) || STR.endsWith(QChar('\n'))) STR.chop(1); } while(0)
2012-09-18 01:41:00 +02:00
# define MAKE_TRANSPARENT(WIDGET) do { QPalette _p = (WIDGET)->palette(); _p.setColor(QPalette::Background, Qt::transparent); (WIDGET)->setPalette(_p); } while(0)
2010-11-11 19:37:16 +01:00
2010-11-11 22:58:02 +01:00
//Constants
2015-04-05 15:07:29 +02:00
const char * AboutDialog : : neroAacUrl = " http://www.nero.com/eng/company/about-nero/nero-aac-codec.php " ; //"http://www.videohelp.com/tools/Nero-AAC-Codec";
2013-10-16 18:23:12 +02:00
const char * AboutDialog : : disqueUrl = " http://muldersoft.com/?player_url=38X-MXOB014 " ;
2010-11-11 22:58:02 +01:00
2011-01-20 22:54:10 +01:00
//Contributors
static const struct
2011-01-07 23:00:32 +01:00
{
char * pcFlag ;
2011-02-18 20:14:45 +01:00
wchar_t * pcLanguage ;
wchar_t * pcName ;
2011-01-07 23:00:32 +01:00
char * pcMail ;
2011-01-20 22:54:10 +01:00
}
2012-09-15 20:46:26 +02:00
g_lamexp_translators [ ] =
2011-01-07 23:00:32 +01:00
{
2015-03-29 16:59:20 +02:00
{ " en " , L " Englisch " , L " LoRd_MuldeR " , " MuldeR2@GMX.de " } ,
{ " de " , L " Deutsch " , L " LoRd_MuldeR " , " MuldeR2@GMX.de " } ,
{ " " , L " " , L " Bodo Thevissen " , " Bodo@thevissen.de " } ,
{ " es " , L " Español " , L " Rub3nCT " , " Rub3nCT@gmail.com " } ,
{ " fr " , L " Française " , L " Dodich Informatique " , " Dodich@live.fr " } ,
2015-04-08 21:50:41 +02:00
{ " hu " , L " Magyarul " , L " ZityiSoft Team " , " zityisoft@gmail.com " } ,
2015-03-29 16:59:20 +02:00
{ " it " , L " Italiano " , L " Roberto " , " Gulliver_69@libero.it " } ,
2015-11-19 22:36:15 +01:00
{ " " , L " " , L " Gianluca Papi " , " johnnyb.goode68@gmail.com " } ,
2015-03-29 16:59:20 +02:00
{ " kr " , L " 한국어 " , L " JaeHyung Lee " , " Kolanp@gmail.com " } ,
{ " pl " , L " Polski " , L " Sir Daniel K " , " Sir.Daniel.K@gmail.com " } ,
{ " ru " , L " Русский " , L " Neonailol " , " Neonailol@gmail.com " } ,
{ " " , L " " , L " Иван Митин " , " bardak@inbox.ru " } ,
{ " sv " , L " Svenska " , L " Åke Engelbrektson " , " eson@svenskasprakfiler.se " } ,
{ " tw " , L " 繁体中文 " , L " 456Vv " , " 123@456vv.com " } ,
{ " uk " , L " Українська " , L " Arestarh " , " Arestarh@ukr.net " } ,
{ " zh " , L " 简体中文 " , L " 456Vv " , " 123@456vv.com " } ,
{ " " , L " " , L " 庄泓川 " , " kidneybean@sohu.com " } ,
2011-01-07 23:00:32 +01:00
{ NULL , NULL , NULL , NULL }
} ;
2014-05-04 21:46:46 +02:00
//Special Thanks
static const struct
{
char * pcName ;
char * pcAddress ;
}
g_lamexp_specialThanks [ ] =
{
{ " Doom9's Forum " , " http://forum.doom9.org/ " } ,
{ " Gleitz | German Doom9 " , " http://forum.gleitz.info/ " } ,
{ " Hydrogenaudio Forums " , " http://www.hydrogenaudio.org/ " } ,
{ " RareWares " , " http://www.rarewares.org/ " } ,
{ " GitHub " , " http://github.com/ " } ,
{ " SourceForge " , " http://sourceforge.net/ " } ,
{ " Qt Developer Network " , " http://qt-project.org/ " } ,
{ " CodePlex " , " http://www.codeplex.com/ " } ,
{ " Marius Hudea " , " http://savedonthe.net/ " } ,
{ " Codecs.com " , " http://www.codecs.com/ " } ,
{ NULL , NULL }
} ;
//Mirrors
static const struct
{
char * pcName ;
char * pcAddress ;
}
g_lamexp_mirrors [ ] =
{
{ " GitHub.com " , " https://github.com/lordmulder/LameXP " } ,
{ " SourceForge.net " , " http://sourceforge.net/p/lamexp/code/ " } ,
{ " Bitbucket.org " , " https://bitbucket.org/lord_mulder/lamexp " } ,
2015-10-23 20:02:51 +02:00
{ " GitLab.com " , " https://gitlab.com/lamexp/lamexp " } ,
2014-05-04 21:46:46 +02:00
{ " Codeplex.com " , " https://lamexp.codeplex.com/SourceControl/latest " } ,
{ " Assembla.com " , " https://www.assembla.com/spaces/lamexp/ " } ,
{ NULL , NULL }
} ;
2010-11-11 22:58:02 +01:00
////////////////////////////////////////////////////////////
// Constructor
////////////////////////////////////////////////////////////
2010-11-29 20:36:27 +01:00
AboutDialog : : AboutDialog ( SettingsModel * settings , QWidget * parent , bool firstStart )
:
2012-09-15 20:46:26 +02:00
QDialog ( parent ) ,
2012-12-10 23:50:45 +01:00
ui ( new Ui : : AboutDialog ) ,
2011-04-24 23:34:52 +02:00
m_settings ( settings ) ,
2012-09-16 14:15:32 +02:00
m_initFlags ( new QMap < QWidget * , bool > ) ,
2011-04-24 23:34:52 +02:00
m_disque ( NULL ) ,
2011-04-25 21:13:52 +02:00
m_disqueTimer ( NULL ) ,
m_rotateNext ( false ) ,
2012-09-18 01:41:00 +02:00
m_lastTab ( 0 )
2010-11-11 19:37:16 +01:00
{
2012-09-15 20:46:26 +02:00
//Init the dialog, from the .ui file
2012-12-10 23:50:45 +01:00
ui - > setupUi ( this ) ;
2012-09-15 20:46:26 +02:00
setWindowFlags ( windowFlags ( ) & ( ~ Qt : : WindowContextHelpButtonHint ) ) ;
resize ( this - > minimumSize ( ) ) ;
2012-09-18 01:41:00 +02:00
2012-09-15 20:46:26 +02:00
//Disable "X" button
2012-09-16 18:13:53 +02:00
if ( firstStart )
2011-04-25 21:13:52 +02:00
{
2014-12-08 22:06:01 +01:00
MUtils : : GUI : : enable_close_button ( this , false ) ;
2011-04-25 21:13:52 +02:00
}
2012-09-16 18:13:53 +02:00
//Init images
2012-09-15 20:46:26 +02:00
for ( int i = 0 ; i < 4 ; i + + )
2012-04-11 00:44:40 +02:00
{
2012-09-15 20:46:26 +02:00
m_cartoon [ i ] = NULL ;
2012-04-11 00:44:40 +02:00
}
2012-09-16 14:15:32 +02:00
//Init tab widget
2012-12-10 23:50:45 +01:00
connect ( ui - > tabWidget , SIGNAL ( currentChanged ( int ) ) , this , SLOT ( tabChanged ( int ) ) ) ;
2010-11-12 15:58:53 +01:00
2012-09-18 01:41:00 +02:00
//Make transparent
2012-12-19 23:43:27 +01:00
const type_info & styleType = typeid ( * qApp - > style ( ) ) ;
if ( ( typeid ( QWindowsVistaStyle ) = = styleType ) | | ( typeid ( QWindowsXPStyle ) = = styleType ) )
2012-09-18 01:41:00 +02:00
{
2012-12-10 23:50:45 +01:00
MAKE_TRANSPARENT ( ui - > infoScrollArea ) ;
MAKE_TRANSPARENT ( ui - > contributorsScrollArea ) ;
MAKE_TRANSPARENT ( ui - > softwareScrollArea ) ;
MAKE_TRANSPARENT ( ui - > licenseScrollArea ) ;
2012-09-18 01:41:00 +02:00
}
2012-09-16 14:15:32 +02:00
//Show about dialog for the first time?
2012-09-15 20:46:26 +02:00
if ( ! firstStart )
{
2014-11-25 02:14:42 +01:00
MUtils : : seed_rand ( ) ;
2012-10-13 12:36:41 +02:00
2012-12-10 23:50:45 +01:00
ui - > acceptButton - > hide ( ) ;
ui - > declineButton - > hide ( ) ;
ui - > aboutQtButton - > show ( ) ;
ui - > closeButton - > show ( ) ;
2012-10-13 12:36:41 +02:00
2011-04-24 23:18:39 +02:00
QPixmap disque ( " :/images/Disque.png " ) ;
m_disque = new QLabel ( this , Qt : : Window | Qt : : FramelessWindowHint | Qt : : WindowStaysOnTopHint ) ;
2013-04-04 01:25:04 +02:00
m_disque - > resize ( disque . size ( ) ) ;
2011-04-24 23:18:39 +02:00
m_disque - > setStyleSheet ( " background:transparent; " ) ;
m_disque - > setAttribute ( Qt : : WA_TranslucentBackground ) ;
m_disque - > setPixmap ( disque ) ;
2013-04-04 01:25:04 +02:00
m_disque - > installEventFilter ( this ) ;
connect ( QApplication : : desktop ( ) , SIGNAL ( workAreaResized ( int ) ) , this , SLOT ( geometryUpdated ( ) ) ) ;
geometryUpdated ( ) ;
m_discOpacity = 0.01 ;
2014-11-25 02:14:42 +01:00
m_disquePos . setX ( static_cast < int > ( MUtils : : next_rand32 ( ) % static_cast < unsigned int > ( m_disqueBound . right ( ) - disque . width ( ) - m_disqueBound . left ( ) ) ) + m_disqueBound . left ( ) ) ;
m_disquePos . setY ( static_cast < int > ( MUtils : : next_rand32 ( ) % static_cast < unsigned int > ( m_disqueBound . bottom ( ) - disque . height ( ) - m_disqueBound . top ( ) ) ) + m_disqueBound . top ( ) ) ;
m_disqueFlags [ 0 ] = ( MUtils : : next_rand32 ( ) > ( UINT_MAX / 2 ) ) ;
m_disqueFlags [ 1 ] = ( MUtils : : next_rand32 ( ) > ( UINT_MAX / 2 ) ) ;
2013-04-04 01:25:04 +02:00
m_disque - > move ( m_disquePos ) ;
m_disque - > setWindowOpacity ( m_discOpacity ) ;
m_disque - > show ( ) ;
2011-04-24 23:18:39 +02:00
m_disqueTimer = new QTimer ;
connect ( m_disqueTimer , SIGNAL ( timeout ( ) ) , this , SLOT ( moveDisque ( ) ) ) ;
2013-04-04 01:25:04 +02:00
m_disqueTimer - > start ( 10 ) ;
2012-09-15 20:46:26 +02:00
2012-12-10 23:50:45 +01:00
connect ( ui - > aboutQtButton , SIGNAL ( clicked ( ) ) , this , SLOT ( showAboutQt ( ) ) ) ;
2011-04-24 23:18:39 +02:00
}
2012-09-15 20:46:26 +02:00
else
{
2012-12-10 23:50:45 +01:00
ui - > acceptButton - > show ( ) ;
ui - > declineButton - > show ( ) ;
ui - > aboutQtButton - > hide ( ) ;
ui - > closeButton - > hide ( ) ;
2012-09-15 20:46:26 +02:00
}
2012-09-16 14:15:32 +02:00
//Activate "show license" button
2012-12-10 23:50:45 +01:00
ui - > showLicenseButton - > show ( ) ;
connect ( ui - > showLicenseButton , SIGNAL ( clicked ( ) ) , this , SLOT ( gotoLicenseTab ( ) ) ) ;
2012-09-16 14:15:32 +02:00
2010-11-12 15:58:53 +01:00
m_firstShow = firstStart ;
2010-11-11 19:37:16 +01:00
}
AboutDialog : : ~ AboutDialog ( void )
{
2011-04-24 23:18:39 +02:00
if ( m_disque )
{
m_disque - > close ( ) ;
2014-11-25 02:14:42 +01:00
MUTILS_DELETE ( m_disque ) ;
2011-04-24 23:18:39 +02:00
}
if ( m_disqueTimer )
{
m_disqueTimer - > stop ( ) ;
2014-11-25 02:14:42 +01:00
MUTILS_DELETE ( m_disqueTimer ) ;
2011-04-24 23:18:39 +02:00
}
2011-04-25 21:13:52 +02:00
for ( int i = 0 ; i < 4 ; i + + )
{
2014-11-25 02:14:42 +01:00
MUTILS_DELETE ( m_cartoon [ i ] ) ;
2011-04-25 21:13:52 +02:00
}
2014-11-25 02:14:42 +01:00
MUTILS_DELETE ( m_initFlags ) ;
MUTILS_DELETE ( ui ) ;
2010-11-11 19:37:16 +01:00
}
2010-11-11 22:58:02 +01:00
////////////////////////////////////////////////////////////
// Public Functions
////////////////////////////////////////////////////////////
2010-11-11 19:37:16 +01:00
int AboutDialog : : exec ( )
{
2010-11-29 20:36:27 +01:00
if ( m_settings - > soundsEnabled ( ) )
{
2011-01-29 21:57:53 +01:00
if ( m_firstShow )
{
2014-12-20 13:37:20 +01:00
if ( ! MUtils : : Sound : : play_sound_file ( " imageres.dll " , 5080 , true ) )
2011-01-29 21:57:53 +01:00
{
2014-12-05 21:08:26 +01:00
MUtils : : Sound : : play_system_sound ( " SystemStart " , true ) ;
2011-01-29 21:57:53 +01:00
}
}
else
2010-12-18 16:49:04 +01:00
{
2014-12-05 21:08:26 +01:00
MUtils : : Sound : : play_sound ( " uuaarrgh " , true ) ;
2010-12-18 16:49:04 +01:00
}
2010-11-29 20:36:27 +01:00
}
2010-11-11 19:37:16 +01:00
2012-09-15 20:46:26 +02:00
switch ( QDialog : : exec ( ) )
2010-11-12 15:58:53 +01:00
{
2010-11-12 19:02:01 +01:00
case 1 :
return 1 ;
break ;
case 2 :
return - 1 ;
break ;
default :
return 0 ;
break ;
2010-11-12 15:58:53 +01:00
}
2010-11-12 19:02:01 +01:00
}
////////////////////////////////////////////////////////////
// Slots
////////////////////////////////////////////////////////////
2013-04-04 01:25:04 +02:00
# define TEMP_HIDE_DISQUE(CMD) do \
{ \
bool _tmp = ( m_disque ) ? m_disque - > isVisible ( ) : false ; \
if ( _tmp ) m_disque - > hide ( ) ; \
{ CMD } \
if ( _tmp ) \
{ \
m_discOpacity = 0.01 ; \
m_disque - > setWindowOpacity ( m_discOpacity ) ; \
m_disque - > show ( ) ; \
} \
} \
while ( 0 )
2011-08-29 15:57:17 +02:00
2013-10-28 00:26:54 +01:00
void AboutDialog : : tabChanged ( int index , const bool silent )
2012-09-16 14:15:32 +02:00
{
2012-12-10 23:50:45 +01:00
bool bInitialized = m_initFlags - > value ( ui - > tabWidget - > widget ( index ) , false ) ;
2012-09-16 14:15:32 +02:00
if ( ! bInitialized )
{
qApp - > setOverrideCursor ( QCursor ( Qt : : WaitCursor ) ) ;
2012-12-10 23:50:45 +01:00
if ( QWidget * tab = ui - > tabWidget - > widget ( index ) )
2012-09-16 14:15:32 +02:00
{
2012-09-18 01:41:00 +02:00
bool ok = false ;
2012-09-16 14:15:32 +02:00
2012-12-10 23:50:45 +01:00
if ( tab = = ui - > infoTab ) { initInformationTab ( ) ; ok = true ; }
if ( tab = = ui - > contributorsTab ) { initContributorsTab ( ) ; ok = true ; }
if ( tab = = ui - > softwareTab ) { initSoftwareTab ( ) ; ok = true ; }
if ( tab = = ui - > licenseTab ) { initLicenseTab ( ) ; ok = true ; }
2012-09-18 01:41:00 +02:00
if ( ok )
{
m_initFlags - > insert ( tab , true ) ;
}
else
{
qWarning ( " Unknown tab %p encountered, cannot initialize !!! " , tab ) ;
}
}
2012-09-16 18:13:53 +02:00
2012-12-10 23:50:45 +01:00
ui - > tabWidget - > widget ( index ) - > update ( ) ;
2012-09-16 14:15:32 +02:00
qApp - > processEvents ( ) ;
qApp - > restoreOverrideCursor ( ) ;
}
2013-10-28 00:26:54 +01:00
//Play tick sound
if ( m_settings - > soundsEnabled ( ) & & ( ! silent ) )
{
2014-12-05 21:08:26 +01:00
MUtils : : Sound : : play_sound ( " tick " , true ) ;
2013-10-28 00:26:54 +01:00
}
2012-09-16 14:15:32 +02:00
//Scroll to the top
2012-12-10 23:50:45 +01:00
if ( QWidget * tab = ui - > tabWidget - > widget ( index ) )
2012-09-16 14:15:32 +02:00
{
2012-12-10 23:50:45 +01:00
if ( tab = = ui - > infoTab ) ui - > infoScrollArea - > verticalScrollBar ( ) - > setSliderPosition ( 0 ) ;
if ( tab = = ui - > contributorsTab ) ui - > contributorsScrollArea - > verticalScrollBar ( ) - > setSliderPosition ( 0 ) ;
if ( tab = = ui - > softwareTab ) ui - > softwareScrollArea - > verticalScrollBar ( ) - > setSliderPosition ( 0 ) ;
if ( tab = = ui - > licenseTab ) ui - > licenseScrollArea - > verticalScrollBar ( ) - > setSliderPosition ( 0 ) ;
2012-09-16 14:15:32 +02:00
}
2012-09-18 01:41:00 +02:00
//Update license button
2012-12-10 23:50:45 +01:00
ui - > showLicenseButton - > setChecked ( ui - > tabWidget - > widget ( index ) = = ui - > licenseTab ) ;
if ( ui - > tabWidget - > widget ( index ) ! = ui - > licenseTab ) m_lastTab = index ;
2012-09-16 14:15:32 +02:00
}
2010-11-12 19:02:01 +01:00
void AboutDialog : : enableButtons ( void )
{
2012-12-10 23:50:45 +01:00
ui - > acceptButton - > setEnabled ( true ) ;
ui - > declineButton - > setEnabled ( true ) ;
2010-11-12 19:02:01 +01:00
setCursor ( QCursor ( Qt : : ArrowCursor ) ) ;
2010-11-11 19:37:16 +01:00
}
2012-09-15 20:46:26 +02:00
void AboutDialog : : openURL ( const QString & url )
2010-11-12 19:02:01 +01:00
{
2012-09-15 20:46:26 +02:00
if ( ! QDesktopServices : : openUrl ( QUrl ( url ) ) )
{
2014-12-04 00:02:42 +01:00
MUtils : : OS : : shell_open ( this , url ) ;
2012-09-15 20:46:26 +02:00
}
2010-11-12 19:02:01 +01:00
}
void AboutDialog : : showAboutQt ( void )
{
2011-08-29 15:57:17 +02:00
TEMP_HIDE_DISQUE
(
QMessageBox : : aboutQt ( this ) ;
) ;
2010-11-12 19:02:01 +01:00
}
2010-11-11 22:58:02 +01:00
2012-09-16 14:15:32 +02:00
void AboutDialog : : gotoLicenseTab ( void )
{
2012-12-10 23:50:45 +01:00
ui - > tabWidget - > setCurrentIndex ( ui - > tabWidget - > indexOf ( ui - > showLicenseButton - > isChecked ( ) ? ui - > licenseTab : ui - > tabWidget - > widget ( m_lastTab ) ) ) ;
2012-09-16 14:15:32 +02:00
}
2011-04-24 23:18:39 +02:00
void AboutDialog : : moveDisque ( void )
{
2011-04-25 21:13:52 +02:00
int delta = 2 ;
2014-12-06 15:54:58 +01:00
QElapsedTimer elapsedTimer ;
elapsedTimer . start ( ) ;
2011-04-25 21:13:52 +02:00
2014-12-06 15:54:58 +01:00
if ( ( ! m_disqueDelay . isNull ( ) ) & & m_disqueDelay - > isValid ( ) )
2011-04-25 21:13:52 +02:00
{
2014-12-06 15:54:58 +01:00
const qint64 delay = m_disqueDelay - > restart ( ) ;
delta = qBound ( 1 , static_cast < int > ( ceil ( static_cast < double > ( delay ) / 5.12 ) ) , 128 ) ;
}
else
{
m_disqueDelay . reset ( new QElapsedTimer ( ) ) ;
m_disqueDelay - > start ( ) ;
2011-04-25 21:13:52 +02:00
}
2011-04-24 23:34:52 +02:00
if ( m_disque )
2011-04-24 23:18:39 +02:00
{
2013-04-08 01:13:58 +02:00
if ( m_disquePos . x ( ) < = m_disqueBound . left ( ) ) { m_disqueFlags [ 0 ] = true ; m_rotateNext = true ; }
if ( m_disquePos . x ( ) > = m_disqueBound . right ( ) ) { m_disqueFlags [ 0 ] = false ; m_rotateNext = true ; }
if ( m_disquePos . y ( ) < = m_disqueBound . top ( ) ) { m_disqueFlags [ 1 ] = true ; m_rotateNext = true ; }
if ( m_disquePos . y ( ) > = m_disqueBound . bottom ( ) ) { m_disqueFlags [ 1 ] = false ; m_rotateNext = true ; }
2011-05-01 00:42:34 +02:00
2013-04-04 01:25:04 +02:00
m_disquePos . setX ( m_disqueFlags [ 0 ] ? ( m_disquePos . x ( ) + delta ) : ( m_disquePos . x ( ) - delta ) ) ;
m_disquePos . setY ( m_disqueFlags [ 1 ] ? ( m_disquePos . y ( ) + delta ) : ( m_disquePos . y ( ) - delta ) ) ;
2011-04-25 21:13:52 +02:00
2013-04-04 01:25:04 +02:00
m_disque - > move ( m_disquePos ) ;
2011-04-25 21:13:52 +02:00
if ( m_rotateNext )
{
QPixmap * cartoon = NULL ;
if ( m_disqueFlags [ 0 ] = = true & & m_disqueFlags [ 1 ] ! = true ) cartoon = m_cartoon [ 0 ] ;
if ( m_disqueFlags [ 0 ] = = true & & m_disqueFlags [ 1 ] = = true ) cartoon = m_cartoon [ 1 ] ;
if ( m_disqueFlags [ 0 ] ! = true & & m_disqueFlags [ 1 ] = = true ) cartoon = m_cartoon [ 2 ] ;
if ( m_disqueFlags [ 0 ] ! = true & & m_disqueFlags [ 1 ] ! = true ) cartoon = m_cartoon [ 3 ] ;
if ( cartoon )
{
m_disque - > setPixmap ( * cartoon ) ;
2013-04-04 01:25:04 +02:00
if ( m_disque - > size ( ) ! = cartoon - > size ( ) )
{
m_disque - > resize ( cartoon - > size ( ) ) ;
geometryUpdated ( ) ;
}
2011-04-25 21:13:52 +02:00
}
m_rotateNext = false ;
2011-04-24 23:34:52 +02:00
}
2013-04-04 01:25:04 +02:00
if ( m_discOpacity ! = 1.0 )
2011-04-24 23:34:52 +02:00
{
2013-04-04 01:25:04 +02:00
m_discOpacity = m_discOpacity + 0.01 ;
if ( qFuzzyCompare ( m_discOpacity , 1.0 ) | | ( m_discOpacity > 1.0 ) )
2013-03-29 03:06:26 +01:00
{
2013-04-04 01:25:04 +02:00
m_discOpacity = 1.0 ;
2013-03-29 03:06:26 +01:00
}
2013-04-04 01:25:04 +02:00
m_disque - > setWindowOpacity ( m_discOpacity ) ;
m_disque - > update ( ) ;
2011-04-24 23:34:52 +02:00
}
2011-04-24 23:18:39 +02:00
}
}
2012-09-20 22:52:52 +02:00
2013-04-04 01:25:04 +02:00
void AboutDialog : : geometryUpdated ( void )
{
if ( m_disque )
{
QRect screenGeometry = QApplication : : desktop ( ) - > availableGeometry ( ) ;
2013-04-08 01:13:58 +02:00
m_disqueBound . setLeft ( screenGeometry . left ( ) ) ;
m_disqueBound . setRight ( screenGeometry . width ( ) - m_disque - > width ( ) + screenGeometry . left ( ) ) ;
m_disqueBound . setTop ( screenGeometry . top ( ) ) ;
m_disqueBound . setBottom ( screenGeometry . height ( ) - m_disque - > height ( ) + screenGeometry . top ( ) ) ;
}
else
{
m_disqueBound = QApplication : : desktop ( ) - > availableGeometry ( ) ;
2013-04-04 01:25:04 +02:00
}
}
2012-09-20 22:52:52 +02:00
void AboutDialog : : adjustSize ( void )
{
2013-11-30 13:09:36 +01:00
const int maxH = QApplication : : desktop ( ) - > availableGeometry ( ) . height ( ) ;
const int maxW = QApplication : : desktop ( ) - > availableGeometry ( ) . width ( ) ;
2012-09-20 22:52:52 +02:00
2013-11-30 13:09:36 +01:00
const int deltaH = ui - > infoScrollArea - > widget ( ) - > height ( ) - ui - > infoScrollArea - > viewport ( ) - > height ( ) ;
const int deltaW = ui - > infoScrollArea - > widget ( ) - > width ( ) - ui - > infoScrollArea - > viewport ( ) - > width ( ) ;
if ( deltaH > 0 )
2012-09-20 22:52:52 +02:00
{
2013-11-30 13:09:36 +01:00
this - > resize ( this - > width ( ) , qMin ( this - > height ( ) + deltaH , maxH ) ) ;
this - > move ( this - > x ( ) , this - > y ( ) - ( deltaH / 2 ) ) ;
2012-09-20 22:52:52 +02:00
this - > setMinimumHeight ( qMax ( this - > minimumHeight ( ) , this - > height ( ) ) ) ;
}
2013-11-30 13:09:36 +01:00
if ( deltaW > 0 )
{
this - > resize ( qMin ( this - > width ( ) + deltaW , maxW ) , this - > height ( ) ) ;
this - > move ( this - > x ( ) - ( deltaW / 2 ) , this - > y ( ) ) ;
this - > setMinimumWidth ( qMax ( this - > minimumWidth ( ) , this - > width ( ) ) ) ;
}
2012-09-20 22:52:52 +02:00
}
2010-11-12 19:02:01 +01:00
////////////////////////////////////////////////////////////
// Protected Functions
////////////////////////////////////////////////////////////
void AboutDialog : : showEvent ( QShowEvent * e )
{
QDialog : : showEvent ( e ) ;
2012-09-18 01:41:00 +02:00
2012-12-10 23:50:45 +01:00
ui - > tabWidget - > setCurrentIndex ( ui - > tabWidget - > indexOf ( ui - > infoTab ) ) ;
2013-10-28 00:26:54 +01:00
tabChanged ( m_lastTab = ui - > tabWidget - > currentIndex ( ) , true ) ;
2012-09-18 01:41:00 +02:00
2010-11-12 19:02:01 +01:00
if ( m_firstShow )
{
2012-12-10 23:50:45 +01:00
ui - > acceptButton - > setEnabled ( false ) ;
ui - > declineButton - > setEnabled ( false ) ;
2010-11-12 19:02:01 +01:00
QTimer : : singleShot ( 5000 , this , SLOT ( enableButtons ( ) ) ) ;
setCursor ( QCursor ( Qt : : WaitCursor ) ) ;
}
2012-09-20 22:52:52 +02:00
QTimer : : singleShot ( 0 , this , SLOT ( adjustSize ( ) ) ) ;
2010-11-12 19:02:01 +01:00
}
2012-09-16 18:13:53 +02:00
void AboutDialog : : closeEvent ( QCloseEvent * e )
{
if ( m_firstShow ) e - > ignore ( ) ;
}
2011-04-24 23:18:39 +02:00
bool AboutDialog : : eventFilter ( QObject * obj , QEvent * event )
{
if ( ( obj = = m_disque ) & & ( event - > type ( ) = = QEvent : : MouseButtonPress ) )
{
2011-04-25 21:13:52 +02:00
QPixmap cartoon ( " :/images/Cartoon.png " ) ;
for ( int i = 0 ; i < 4 ; i + + )
{
if ( ! m_cartoon [ i ] )
{
m_cartoon [ i ] = new QPixmap ( cartoon . transformed ( QMatrix ( ) . rotate ( static_cast < double > ( i * 90 ) + 45.0 ) , Qt : : SmoothTransformation ) ) ;
m_rotateNext = true ;
}
}
2011-04-24 23:18:39 +02:00
QDesktopServices : : openUrl ( QUrl ( disqueUrl ) ) ;
}
return false ;
}
2010-11-12 19:02:01 +01:00
////////////////////////////////////////////////////////////
// Private Functions
////////////////////////////////////////////////////////////
2010-12-18 16:49:04 +01:00
2012-09-15 20:46:26 +02:00
void AboutDialog : : initInformationTab ( void )
{
2014-11-25 22:34:20 +01:00
const QDate versionDate = MUtils : : Version : : app_build_date ( ) ;
2014-11-25 02:14:42 +01:00
2012-09-15 20:46:26 +02:00
const QString versionStr = QString ( ) . sprintf
(
" Version %d.%02d %s, Build %d [%s], %s %s, Qt v%s " ,
lamexp_version_major ( ) ,
lamexp_version_minor ( ) ,
lamexp_version_release ( ) ,
lamexp_version_build ( ) ,
2014-11-25 02:14:42 +01:00
versionDate . toString ( Qt : : ISODate ) . toLatin1 ( ) . constData ( ) ,
MUtils : : Version : : compiler_version ( ) ,
MUtils : : Version : : compiler_arch ( ) ,
2012-09-15 20:46:26 +02:00
qVersion ( )
) ;
const QString copyrightStr = QString ( ) . sprintf
(
" Copyright (C) 2004-%04d LoRd_MuldeR <MuldeR2@GMX.de>. Some rights reserved. " ,
2014-11-25 02:14:42 +01:00
qMax ( versionDate . year ( ) , MUtils : : OS : : current_date ( ) . year ( ) )
2012-09-15 20:46:26 +02:00
) ;
QString aboutText ;
aboutText + = QString ( " <h2>%1</h2> " ) . arg ( NOBR ( tr ( " LameXP - Audio Encoder Front-end " ) ) ) ;
aboutText + = QString ( " <b>%1</b><br> " ) . arg ( NOBR ( copyrightStr ) ) ;
aboutText + = QString ( " <b>%1</b><br><br> " ) . arg ( NOBR ( versionStr ) ) ;
aboutText + = QString ( " %1<br> " ) . arg ( NOBR ( tr ( " Please visit %1 for news and updates! " ) . arg ( LINK ( lamexp_website_url ( ) ) ) ) ) ;
# if QT_VERSION < QT_VERSION_CHECK(5,0,0)
2014-11-25 02:14:42 +01:00
const QDate currentDate = MUtils : : OS : : current_date ( ) ;
if ( MUTILS_DEBUG )
2012-09-15 20:46:26 +02:00
{
2013-01-12 01:53:43 +01:00
int daysLeft = qMax ( currentDate . daysTo ( lamexp_version_expires ( ) ) , 0 ) ;
2012-09-15 20:46:26 +02:00
aboutText + = QString ( " <hr><font color= \" crimson \" >%1</font> " ) . arg ( NOBR ( QString ( " !!! --- DEBUG BUILD --- Expires at: %1 · Days left: %2 --- DEBUG BUILD --- !!! " ) . arg ( lamexp_version_expires ( ) . toString ( Qt : : ISODate ) , QString : : number ( daysLeft ) ) ) ) ;
}
else if ( lamexp_version_demo ( ) )
{
2013-01-12 01:53:43 +01:00
int daysLeft = qMax ( currentDate . daysTo ( lamexp_version_expires ( ) ) , 0 ) ;
2012-09-15 20:46:26 +02:00
aboutText + = QString ( " <hr><font color= \" crimson \" >%1</font> " ) . arg ( NOBR ( tr ( " Note: This demo (pre-release) version of LameXP will expire at %1. Still %2 days left. " ) . arg ( lamexp_version_expires ( ) . toString ( Qt : : ISODate ) , QString : : number ( daysLeft ) ) ) ) ;
}
# else
2013-01-12 01:53:43 +01:00
const QDate currentDate = lamexp_current_date_safe ( ) ;
2012-09-15 20:46:26 +02:00
if ( LAMEXP_DEBUG )
{
2013-01-12 01:53:43 +01:00
int daysLeft = qMax ( currentDate . daysTo ( lamexp_version_expires ( ) ) , 0 i64 ) ;
2012-09-15 20:46:26 +02:00
aboutText + = QString ( " <hr><font color= \" crimson \" >%1</font> " ) . arg ( NOBR ( QString ( " !!! --- DEBUG BUILD --- Expires at: %1 · Days left: %2 --- DEBUG BUILD --- !!! " ) . arg ( lamexp_version_expires ( ) . toString ( Qt : : ISODate ) , QString : : number ( daysLeft ) ) ) ) ;
}
else if ( lamexp_version_demo ( ) )
{
2013-01-12 01:53:43 +01:00
int daysLeft = qMax ( currentDate . daysTo ( lamexp_version_expires ( ) ) , 0 i64 ) ;
2012-09-15 20:46:26 +02:00
aboutText + = QString ( " <hr><font color= \" crimson \" >%1</font> " ) . arg ( NOBR ( tr ( " Note: This demo (pre-release) version of LameXP will expire at %1. Still %2 days left. " ) . arg ( lamexp_version_expires ( ) . toString ( Qt : : ISODate ) , QString : : number ( daysLeft ) ) ) ) ;
}
# endif
aboutText + = " <hr><br> " ;
2013-10-23 20:56:57 +02:00
aboutText + = " <nobr><tt>This program is free software; you can redistribute it and/or modify<br> " ;
aboutText + = " it under the terms of the GNU General Public License as published by<br> " ;
aboutText + = " the Free Software Foundation; either version 2 of the License, or<br> " ;
aboutText + = " (at your option) any later version, but always including the *additional*<br> " ;
aboutText + = " restrictions defined in the \" License.txt \" file (see \" License \" tab).<br><br> " ;
2012-09-15 20:46:26 +02:00
aboutText + = " This program is distributed in the hope that it will be useful,<br> " ;
aboutText + = " but WITHOUT ANY WARRANTY; without even the implied warranty of<br> " ;
aboutText + = " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br> " ;
aboutText + = " GNU General Public License for more details.<br><br> " ;
aboutText + = " You should have received a copy of the GNU General Public License<br> " ;
aboutText + = " along with this program; if not, write to the Free Software<br> " ;
aboutText + = " Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110−1301, USA.</tt></nobr><br> " ;
2012-09-16 14:15:32 +02:00
aboutText + = " <hr><table style= \" margin-top:4px \" ><tr> " ;
2012-09-15 20:46:26 +02:00
aboutText + = " <td valign= \" middle \" ><img src= \" :/icons/error_big.png \" </td><td> </td> " ;
aboutText + = QString ( " <td><font color= \" darkred \" >%1</font></td> " ) . arg ( tr ( " Note: LameXP is free software. Do <b>not</b> pay money to obtain or use LameXP! If some third-party website tries to make you pay for downloading LameXP, you should <b>not</b> respond to the offer !!! " ) ) ;
2012-09-16 14:15:32 +02:00
aboutText + = " </tr></table> " ;
2012-09-15 20:46:26 +02:00
2012-12-10 23:50:45 +01:00
ui - > infoLabel - > setText ( aboutText ) ;
ui - > infoIcon - > setPixmap ( lamexp_app_icon ( ) . pixmap ( QSize ( 72 , 72 ) ) ) ;
connect ( ui - > infoLabel , SIGNAL ( linkActivated ( QString ) ) , this , SLOT ( openURL ( QString ) ) ) ;
2012-09-15 20:46:26 +02:00
}
void AboutDialog : : initContributorsTab ( void )
{
2012-09-16 14:15:32 +02:00
const QString spaces ( " " ) ;
const QString extraVSpace ( " <font style= \" font-size:7px \" ><br> </font> " ) ;
2012-09-15 20:46:26 +02:00
QString contributorsAboutText ;
contributorsAboutText + = QString ( " <h3>%1</h3> " ) . arg ( NOBR ( tr ( " The following people have contributed to LameXP: " ) ) ) ;
2012-09-18 01:41:00 +02:00
contributorsAboutText + = " <table style= \" margin-top:12px;white-space:nowrap \" > " ;
2012-09-15 20:46:26 +02:00
2012-09-16 14:15:32 +02:00
contributorsAboutText + = QString ( " <tr><td colspan= \" 7 \" ><b>%1</b>%2</td></tr> " ) . arg ( tr ( " Programmers: " ) , extraVSpace ) ;
QString icon = QString ( " <img src= \" :/icons/%1.png \" > " ) . arg ( " user_gray " ) ;
contributorsAboutText + = QString ( " <tr><td valign= \" middle \" >%1</td><td>%2</td> " ) . arg ( icon , spaces ) ;
contributorsAboutText + = QString ( " <td valign= \" middle \" >%1</td><td>%2</td> " ) . arg ( tr ( " Project Leader " ) , spaces ) ;
2014-05-19 22:21:35 +02:00
contributorsAboutText + = QString ( " <td valign= \" middle \" >%1</td><td>%2</td><td><a href= \" mailto:%3 \" ><%3></a></td></tr> " ) . arg ( " LoRd_MuldeR " , spaces , " MuldeR2@GMX.de " ) ;
2012-09-15 20:46:26 +02:00
contributorsAboutText + = QString ( " <tr><td colspan= \" 7 \" ><b> </b></td></tr> " ) ;
2012-09-16 14:15:32 +02:00
contributorsAboutText + = QString ( " <tr><td colspan= \" 7 \" ><b>%1</b>%2</td></tr> " ) . arg ( tr ( " Translators: " ) , extraVSpace ) ;
2012-09-15 20:46:26 +02:00
for ( int i = 0 ; g_lamexp_translators [ i ] . pcName ; i + + )
{
QString flagIcon = ( strlen ( g_lamexp_translators [ i ] . pcFlag ) > 0 ) ? QString ( " <img src= \" :/flags/%1.png \" > " ) . arg ( g_lamexp_translators [ i ] . pcFlag ) : QString ( ) ;
2012-09-16 14:15:32 +02:00
contributorsAboutText + = QString ( " <tr><td valign= \" middle \" >%1</td><td>%2</td> " ) . arg ( flagIcon , spaces ) ;
2014-11-25 02:14:42 +01:00
contributorsAboutText + = QString ( " <td valign= \" middle \" >%1</td><td>%2</td> " ) . arg ( MUTILS_QSTR ( g_lamexp_translators [ i ] . pcLanguage ) , spaces ) ;
contributorsAboutText + = QString ( " <td valign= \" middle \" >%1</td><td>%2</td><td><a href= \" mailto:%3 \" ><%3></a></td></tr> " ) . arg ( MUTILS_QSTR ( g_lamexp_translators [ i ] . pcName ) , spaces , g_lamexp_translators [ i ] . pcMail ) ;
2012-09-15 20:46:26 +02:00
}
2012-09-18 01:41:00 +02:00
contributorsAboutText + = QString ( " <tr><td colspan= \" 7 \" ><b> </b></td></tr> " ) ;
contributorsAboutText + = QString ( " <tr><td colspan= \" 7 \" ><b>%1</b>%2</td></tr> " ) . arg ( tr ( " Special thanks to: " ) , extraVSpace ) ;
QString webIcon = QString ( " <img src= \" :/icons/%1.png \" > " ) . arg ( " world " ) ;
2014-05-04 21:46:46 +02:00
for ( int i = 0 ; g_lamexp_specialThanks [ i ] . pcName ; i + + )
{
contributorsAboutText + = QString ( " <tr><td valign= \" middle \" >%1</td><td>%2</td> " ) . arg ( webIcon , spaces ) ;
contributorsAboutText + = QString ( " <td valign= \" middle \" >%1</td><td>%2</td><td valign= \" middle \" colspan= \" 3 \" ><a href= \" %3 \" >%3</td></tr> " ) . arg ( QString : : fromLatin1 ( g_lamexp_specialThanks [ i ] . pcName ) , spaces , QString : : fromLatin1 ( g_lamexp_specialThanks [ i ] . pcAddress ) ) ;
}
contributorsAboutText + = QString ( " <tr><td colspan= \" 7 \" ><b> </b></td></tr> " ) ;
contributorsAboutText + = QString ( " <tr><td colspan= \" 7 \" ><b>%1</b>%2</td></tr> " ) . arg ( tr ( " Official Mirrors: " ) , extraVSpace ) ;
QString serverIcon = QString ( " <img src= \" :/icons/%1.png \" > " ) . arg ( " server_database " ) ;
for ( int i = 0 ; g_lamexp_mirrors [ i ] . pcName ; i + + )
{
contributorsAboutText + = QString ( " <tr><td valign= \" middle \" >%1</td><td>%2</td> " ) . arg ( serverIcon , spaces ) ;
contributorsAboutText + = QString ( " <td valign= \" middle \" >%1</td><td>%2</td><td valign= \" middle \" colspan= \" 3 \" ><a href= \" %3 \" >%3</td></tr> " ) . arg ( QString : : fromLatin1 ( g_lamexp_mirrors [ i ] . pcName ) , spaces , QString : : fromLatin1 ( g_lamexp_mirrors [ i ] . pcAddress ) ) ;
}
2012-09-18 01:41:00 +02:00
contributorsAboutText + = " </table><br><br><br> " ;
contributorsAboutText + = QString ( " <i>%1</i><br> " ) . arg ( NOBR ( tr ( " If you are willing to contribute a LameXP translation, feel free to contact us! " ) ) ) ;
2012-09-15 20:46:26 +02:00
2012-12-10 23:50:45 +01:00
ui - > contributorsLabel - > setText ( contributorsAboutText ) ;
ui - > contributorsIcon - > setPixmap ( QIcon ( " :/images/Logo_Contributors.png " ) . pixmap ( QSize ( 72 , 84 ) ) ) ;
connect ( ui - > contributorsLabel , SIGNAL ( linkActivated ( QString ) ) , this , SLOT ( openURL ( QString ) ) ) ;
2012-09-15 20:46:26 +02:00
}
void AboutDialog : : initSoftwareTab ( void )
{
QString moreAboutText ;
moreAboutText + = QString ( " <h3>%1</h3> " ) . arg ( tr ( " The following third-party software is used in LameXP: " ) ) ;
moreAboutText + = " <div style= \" margin-left:-25px;white-space:nowrap \" ><table><tr><td><ul> " ; //;font-size:7pt
moreAboutText + = makeToolText
(
tr ( " LAME - OpenSource mp3 Encoder " ) ,
2013-02-12 00:08:21 +01:00
" lame.exe " , " v?.??, #-? " ,
2012-09-15 20:46:26 +02:00
tr ( " Released under the terms of the GNU Lesser General Public License. " ) ,
" http://lame.sourceforge.net/ "
) ;
moreAboutText + = makeToolText
(
2014-06-27 16:20:10 +02:00
tr ( " OggEnc - Vorbis Encoder " ) ,
" oggenc2.exe " , " v?.??, libvorbis v?.?? + aoTuV b?.??_# " ,
2012-09-15 20:46:26 +02:00
tr ( " Completely open and patent-free audio encoding technology. " ) ,
2014-06-27 16:20:10 +02:00
" http://www.rarewares.org/ogg-oggenc.php "
2012-09-15 20:46:26 +02:00
) ;
moreAboutText + = makeToolText
(
tr ( " Nero AAC Reference MPEG-4 Encoder " ) ,
" neroAacEnc.exe " , " v?.?.?.? " ,
tr ( " Freeware state-of-the-art HE-AAC encoder with 2-Pass support. " ) ,
neroAacUrl ,
tr ( " Available from vendor web-site as free download: " )
) ;
moreAboutText + = makeToolText
(
tr ( " Aften - A/52 audio encoder " ) ,
" aften.exe " , " v?.?.? " ,
tr ( " Released under the terms of the GNU Lesser General Public License. " ) ,
" http://aften.sourceforge.net/ "
) ;
moreAboutText + = makeToolText
(
tr ( " FLAC - Free Lossless Audio Codec " ) ,
" flac.exe " , " v?.?.? " ,
tr ( " Open and patent-free lossless audio compression technology. " ) ,
" http://flac.sourceforge.net/ "
) ;
moreAboutText + = makeToolText
(
tr ( " Opus Audio Codec " ) ,
2013-04-21 13:25:27 +02:00
" opusenc.exe " , " #, ????-??-?? " ,
2012-09-15 20:46:26 +02:00
tr ( " Totally open, royalty-free, highly versatile audio codec. " ) ,
" http://www.opus-codec.org/ "
) ;
moreAboutText + = makeToolText
(
tr ( " mpg123 - Fast Console MPEG Audio Player/Decoder " ) ,
" mpg123.exe " , " v?.??.? " ,
tr ( " Released under the terms of the GNU Lesser General Public License. " ) ,
" http://www.mpg123.de/ "
) ;
moreAboutText + = makeToolText
(
tr ( " FAAD - OpenSource MPEG-4 and MPEG-2 AAC Decoder " ) ,
" faad.exe " , " v?.? " ,
tr ( " Released under the terms of the GNU General Public License. " ) ,
" http://www.audiocoding.com/ "
) ;
moreAboutText + = makeToolText
2014-06-27 16:20:10 +02:00
(
tr ( " OggDec - Vorbis Decoder " ) ,
" oggdec.exe " , " v?.??.? " ,
tr ( " Command line Ogg Vorbis decoder created by John33. " ) ,
" http://www.rarewares.org/ogg-oggdec.php "
) ;
moreAboutText + = makeToolText
2012-09-15 20:46:26 +02:00
(
2013-02-12 00:08:21 +01:00
tr ( " Valdec from AC3Filter Tools - AC3/DTS Decoder " ) ,
2013-04-08 01:13:58 +02:00
" valdec.exe " , " v?.??# " ,
2012-09-15 20:46:26 +02:00
tr ( " Released under the terms of the GNU Lesser General Public License. " ) ,
" http://www.ac3filter.net/projects/tools "
) ;
moreAboutText + = makeToolText
(
tr ( " WavPack - Hybrid Lossless Compression " ) ,
" wvunpack.exe " , " v?.??.? " ,
tr ( " Completely open audio compression format. " ) ,
" http://www.wavpack.com/ "
) ;
moreAboutText + = makeToolText
(
tr ( " Musepack - Living Audio Compression " ) ,
" mpcdec.exe " , " r??? " ,
tr ( " Released under the terms of the GNU Lesser General Public License. " ) ,
" http://www.musepack.net/ "
) ;
moreAboutText + = makeToolText
(
tr ( " Monkey's Audio - Lossless Audio Compressor " ) ,
" mac.exe " , " v?.?? " ,
tr ( " Freely available source code, simple SDK and non-restrictive licensing. " ) ,
" http://www.monkeysaudio.com/ "
) ;
moreAboutText + = makeToolText
(
tr ( " Shorten - Lossless Audio Compressor " ) ,
" shorten.exe " , " v?.?.? " ,
tr ( " Released under the terms of the GNU Lesser General Public License. " ) ,
" http://etree.org/shnutils/shorten/ "
) ;
moreAboutText + = makeToolText
(
tr ( " Speex - Free Codec For Free Speech " ) ,
" speexdec.exe " , " v?.? " ,
tr ( " Open Source patent-free audio format designed for speech. " ) ,
" http://www.speex.org/ "
) ;
moreAboutText + = makeToolText
(
tr ( " The True Audio - Lossless Audio Codec " ) ,
" tta.exe " , " v?.? " ,
tr ( " Released under the terms of the GNU Lesser General Public License. " ) ,
" http://tta.sourceforge.net/ "
) ;
moreAboutText + = makeToolText
(
2012-10-29 20:47:49 +01:00
tr ( " refalac - Win32 command line ALAC encoder/decoder " ) ,
" refalac.exe " , " v?.?? " ,
tr ( " The ALAC reference implementation by Apple is available under the Apache license. " ) ,
" http://alac.macosforge.org/ "
2012-09-15 20:46:26 +02:00
) ;
moreAboutText + = makeToolText
(
tr ( " wma2wav - Dump WMA files to Wave Audio " ) ,
" wma2wav.exe " , " ????-??-?? " ,
tr ( " Copyright (c) 2011 LoRd_MuldeR <mulder2@gmx.de>. Some rights reserved. " ) ,
" http://forum.doom9.org/showthread.php?t=140273 "
) ;
moreAboutText + = makeToolText
(
tr ( " avs2wav - Avisynth to Wave Audio converter " ) ,
" avs2wav.exe " , " v?.? " ,
tr ( " By Jory Stone <jcsston@toughguy.net> and LoRd_MuldeR <mulder2@gmx.de>. " ) ,
" http://forum.doom9.org/showthread.php?t=70882 "
) ;
moreAboutText + = makeToolText
(
tr ( " dcaenc " ) ,
" dcaenc.exe " , " ????-??-?? " ,
tr ( " Copyright (c) 2008-2011 Alexander E. Patrakov. Distributed under the LGPL. " ) ,
2015-08-30 13:47:08 +02:00
" https://gitlab.com/patrakov/dcaenc "
2012-09-15 20:46:26 +02:00
) ;
moreAboutText + = makeToolText
(
tr ( " MediaInfo - Media File Analysis Tool " ) ,
" mediainfo.exe " , " v?.?.?? " ,
tr ( " Released under the terms of the GNU Lesser General Public License. " ) ,
" http://mediainfo.sourceforge.net/ "
) ;
moreAboutText + = makeToolText
(
tr ( " SoX - Sound eXchange " ) ,
" sox.exe " , " v??.?.? " ,
tr ( " Released under the terms of the GNU Lesser General Public License. " ) ,
" http://sox.sourceforge.net/ "
) ;
moreAboutText + = makeToolText
(
tr ( " GnuPG - The GNU Privacy Guard " ) ,
" gpgv.exe " , " v?.?.?? " ,
tr ( " Released under the terms of the GNU Lesser General Public License. " ) ,
" http://www.gnupg.org/ "
) ;
moreAboutText + = makeToolText
(
tr ( " GNU Wget - Software for retrieving files using HTTP " ) ,
" wget.exe " , " v?.??.? " ,
tr ( " Released under the terms of the GNU Lesser General Public License. " ) ,
" http://www.gnu.org/software/wget/ "
) ;
moreAboutText + = makeToolText
2012-09-20 01:27:56 +02:00
(
tr ( " UPX - The Ultimate Packer for eXecutables " ) ,
2013-04-11 00:01:33 +02:00
QString ( ) , " v3.09 " ,
2012-09-20 01:27:56 +02:00
tr ( " Released under the terms of the GNU Lesser General Public License. " ) ,
" http://upx.sourceforge.net/ "
) ;
moreAboutText + = makeToolText
2012-09-15 20:46:26 +02:00
(
tr ( " Silk Icons - Over 700 icons in PNG format " ) ,
QString ( ) , " v1.3 " ,
tr ( " By Mark James, released under the Creative Commons 'by' License. " ) ,
" http://www.famfamfam.com/lab/icons/silk/ "
) ;
2012-09-16 18:13:53 +02:00
moreAboutText + = QString ( " </ul></td><td> </td></tr></table></div><br><i>%1</i><br> " ) . arg
2012-09-15 20:46:26 +02:00
(
2012-09-16 14:15:32 +02:00
tr ( " The copyright of LameXP as a whole belongs to LoRd_MuldeR. The copyright of third-party software used in LameXP belongs to the individual authors. " )
2012-09-15 20:46:26 +02:00
) ;
2012-12-10 23:50:45 +01:00
ui - > softwareLabel - > setText ( moreAboutText ) ;
ui - > softwareIcon - > setPixmap ( QIcon ( " :/images/Logo_Software.png " ) . pixmap ( QSize ( 72 , 65 ) ) ) ;
connect ( ui - > softwareLabel , SIGNAL ( linkActivated ( QString ) ) , this , SLOT ( openURL ( QString ) ) ) ;
2012-09-15 20:46:26 +02:00
}
void AboutDialog : : initLicenseTab ( void )
{
2013-10-23 20:56:57 +02:00
bool bFoundHeader = false ;
QRegExp header ( " ^( \\ s*) ( GNU GENERAL PUBLIC LICENSE ) ( \ \ s * ) $ " ) ;
2012-09-15 20:46:26 +02:00
QString licenseText ;
licenseText + = ( " <tt> " ) ;
QFile file ( " :/License.txt " ) ;
if ( file . open ( QIODevice : : ReadOnly ) )
{
QTextStream stream ( & file ) ;
while ( ( ! stream . atEnd ( ) ) & & ( stream . status ( ) = = QTextStream : : Ok ) )
{
2012-09-16 18:13:53 +02:00
QString line = stream . readLine ( ) ;
line . replace ( ' < ' , " < " ) . replace ( ' > ' , " > " ) ;
2013-10-23 20:56:57 +02:00
if ( ( ! bFoundHeader ) & & ( header . indexIn ( line ) > = 0 ) )
2012-09-15 20:46:26 +02:00
{
2013-10-23 20:56:57 +02:00
line . replace ( header , " \\ 1<b> \\ 2</b> \\ 3 " ) ;
bFoundHeader = true ;
2012-09-15 20:46:26 +02:00
}
2013-10-23 20:56:57 +02:00
TRIM_RIGHT ( line ) ;
licenseText + = QString ( " <nobr>%1</nobr><br> " ) . arg ( line . replace ( ' ' , " " ) ) ;
2012-09-15 20:46:26 +02:00
}
2012-09-20 22:52:52 +02:00
licenseText + = QString ( " <br> " ) ;
2012-09-15 20:46:26 +02:00
stream . device ( ) - > close ( ) ;
}
else
{
2012-09-16 18:13:53 +02:00
licenseText + = QString ( " <font color= \" darkred \" >Oups, failed to load license text. Please refer to:</font><br> " ) ;
2012-09-15 20:46:26 +02:00
licenseText + = LINK ( " http://www.gnu.org/licenses/gpl-2.0.html " ) ;
}
licenseText + = ( " </tt> " ) ;
2012-12-10 23:50:45 +01:00
ui - > licenseLabel - > setText ( licenseText ) ;
ui - > licenseIcon - > setPixmap ( QIcon ( " :/images/Logo_GNU.png " ) . pixmap ( QSize ( 72 , 65 ) ) ) ;
connect ( ui - > licenseLabel , SIGNAL ( linkActivated ( QString ) ) , this , SLOT ( openURL ( QString ) ) ) ;
2012-09-15 20:46:26 +02:00
}
2011-01-07 23:00:32 +01:00
QString AboutDialog : : makeToolText ( const QString & toolName , const QString & toolBin , const QString & toolVerFmt , const QString & toolLicense , const QString & toolWebsite , const QString & extraInfo )
{
2013-02-12 00:08:21 +01:00
QString toolText , toolTag , verStr ( toolVerFmt ) ;
2011-01-07 23:00:32 +01:00
if ( ! toolBin . isEmpty ( ) )
{
2014-12-20 23:44:43 +01:00
const unsigned int version = lamexp_tools_version ( toolBin , & toolTag ) ;
verStr = lamexp_version2string ( toolVerFmt , version , tr ( " n/a " ) , toolTag ) ;
2011-01-07 23:00:32 +01:00
}
2011-10-16 16:38:01 +02:00
toolText + = QString ( " <li>%1<br> " ) . arg ( NOBR ( QString ( " <b>%1 (%2)</b> " ) . arg ( toolName , verStr ) ) ) ;
toolText + = QString ( " %1<br> " ) . arg ( NOBR ( toolLicense ) ) ;
if ( ! extraInfo . isEmpty ( ) ) toolText + = QString ( " <i>%1</i><br> " ) . arg ( NOBR ( extraInfo ) ) ;
toolText + = QString ( " <nobr>%1</nobr> " ) . arg ( LINK ( toolWebsite ) ) ;
2012-09-16 18:13:53 +02:00
toolText + = QString ( " <font style= \" font-size:9px \" ><br> </font> " ) ;
2011-01-07 23:00:32 +01:00
return toolText ;
}