Commit be9943b7 authored by Rafaël Carré's avatar Rafaël Carré

qt4/about: reads data from the files when they are shipped with the binary (i.e. on windows)

parent f4760a11
...@@ -78,18 +78,17 @@ resources.cpp: res.qrc ...@@ -78,18 +78,17 @@ resources.cpp: res.qrc
dialogs/help.cpp: dialogs/about.hpp dialogs/help.cpp: dialogs/about.hpp
dialogs/about.hpp: dialogs/about.hpp: ../../../AUTHORS ../../../COPYING ../../../THANKS
echo "char *psz_licence = { \\" > dialogs/about.hpp echo "#define LICENCE { \\" > dialogs/about.hpp
cat $(top_srcdir)/COPYING | sed s/'"'/'\\"'/g | awk '{ print "\""$$0"\\n\" \\" }' >> dialogs/about.hpp cat $(top_srcdir)/COPYING | sed s/'"'/'\\"'/g | awk '{ print "\""$$0"\\n\" \\" }' >> dialogs/about.hpp
echo "};" >> dialogs/about.hpp echo "};" >> dialogs/about.hpp
echo "char *psz_thanks = { \\" >> dialogs/about.hpp echo "#define THANKS { \\" >> dialogs/about.hpp
cat $(top_srcdir)/THANKS | grep -v '$$Id:' | sed s/'"'/'\\"'/g | awk '{ print "\""$$0"\\n\" \\" }' >> dialogs/about.hpp cat $(top_srcdir)/THANKS | tail -$$((`wc -l $(top_srcdir)/THANKS|cut -d" " -f 1` - 2))|sed s/'"'/'\\"'/g | awk '{ print "\""$$0"\\n\" \\" }' >> dialogs/about.hpp
echo "};" >> dialogs/about.hpp echo "};" >> dialogs/about.hpp
echo "char *psz_authors = { \\" >> dialogs/about.hpp echo "#define AUTHORS { \\" >> dialogs/about.hpp
cat $(top_srcdir)/AUTHORS | grep -v '$$Id:' | sed s/'"'/'\\"'/g | awk '{ print "\""$$0"\\n\" \\" }' >> dialogs/about.hpp cat $(top_srcdir)/AUTHORS | tail -$$((`wc -l $(top_srcdir)/AUTHORS|cut -d" " -f 1` - 2))|sed s/'"'/'\\"'/g | awk '{ print "\""$$0"\\n\" \\" }' >> dialogs/about.hpp
echo "};" >> dialogs/about.hpp echo "};" >> dialogs/about.hpp
SOURCES_qt4 = qt4.cpp \ SOURCES_qt4 = qt4.cpp \
menus.cpp \ menus.cpp \
main_interface.cpp \ main_interface.cpp \
......
...@@ -114,7 +114,15 @@ AboutDialog::AboutDialog( intf_thread_t *_p_intf) : QVLCFrame( _p_intf ) ...@@ -114,7 +114,15 @@ AboutDialog::AboutDialog( intf_thread_t *_p_intf) : QVLCFrame( _p_intf )
/* GPL License */ /* GPL License */
QTextEdit *licenseEdit = new QTextEdit( this ); QTextEdit *licenseEdit = new QTextEdit( this );
licenseEdit->setText( qfu( psz_licence ) ); #ifdef WIN32
QFile *licenseFile = new QFile( "COPYING.txt" );
licenseFile->open( QIODevice::ReadOnly | QIODevice::Text );
licenseEdit->setText( licenseFile->readAll().data() );
licenseFile->close();
#else
char *psz_license = LICENCE;
licenseEdit->setText( qfu( psz_license ) );
#endif
licenseEdit->setReadOnly( true ); licenseEdit->setReadOnly( true );
/* People who helped */ /* People who helped */
...@@ -128,13 +136,29 @@ AboutDialog::AboutDialog( intf_thread_t *_p_intf) : QVLCFrame( _p_intf ) ...@@ -128,13 +136,29 @@ AboutDialog::AboutDialog( intf_thread_t *_p_intf) : QVLCFrame( _p_intf )
thanksLabel->setWordWrap( true ); thanksLabel->setWordWrap( true );
thanksLayout->addWidget( thanksLabel ); thanksLayout->addWidget( thanksLabel );
QTextEdit *thanksEdit = new QTextEdit( this ); QTextEdit *thanksEdit = new QTextEdit( this );
#ifdef WIN32
QFile *thanksFile = new QFile( "THANKS.txt" );
thanksFile->open( QIODevice::ReadOnly | QIODevice::Text );
thanksEdit->setText( thanksFile->readAll().data() );
thanksFile->close();
#else
char *psz_thanks = THANKS;
thanksEdit->setText( qfu( psz_thanks ) ); thanksEdit->setText( qfu( psz_thanks ) );
#endif
thanksEdit->setReadOnly( true ); thanksEdit->setReadOnly( true );
thanksLayout->addWidget( thanksEdit ); thanksLayout->addWidget( thanksEdit );
/* People who wrote the software */ /* People who wrote the software */
QTextEdit *authorsEdit = new QTextEdit( this ); QTextEdit *authorsEdit = new QTextEdit( this );
#ifdef WIN32
QFile *authorsFile = new QFile( "COPYING.txt" );
authorsFile->open( QIODevice::ReadOnly | QIODevice::Text );
authorsEdit->setText( authorsFile->readAll().data() );
authorsFile->close();
#else
char *psz_authors = AUTHORS;
authorsEdit->setText( qfu( psz_authors ) ); authorsEdit->setText( qfu( psz_authors ) );
#endif
authorsEdit->setReadOnly( true ); authorsEdit->setReadOnly( true );
/* add the tabs to the Tabwidget */ /* add the tabs to the Tabwidget */
......
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