]> git.sesse.net Git - vlc/commitdiff
qt4/about: reads data from the files when they are shipped with the binary (i.e....
authorRafaël Carré <funman@videolan.org>
Sat, 1 Sep 2007 16:36:15 +0000 (16:36 +0000)
committerRafaël Carré <funman@videolan.org>
Sat, 1 Sep 2007 16:36:15 +0000 (16:36 +0000)
modules/gui/qt4/Modules.am
modules/gui/qt4/dialogs/help.cpp

index e12901010f4df93ee7f3f24198782ff30f7ad406..c863e4cb2ee0490d594bda4374df2d16d3f614c1 100644 (file)
@@ -78,18 +78,17 @@ resources.cpp: res.qrc
 
 dialogs/help.cpp: dialogs/about.hpp
 
-dialogs/about.hpp:
-       echo "char *psz_licence = { \\" > dialogs/about.hpp
+dialogs/about.hpp: ../../../AUTHORS ../../../COPYING ../../../THANKS
+       echo "#define LICENCE { \\" > dialogs/about.hpp
        cat $(top_srcdir)/COPYING | sed s/'"'/'\\"'/g | awk '{ print "\""$$0"\\n\" \\" }' >> dialogs/about.hpp
        echo "};" >> dialogs/about.hpp
-       echo "char *psz_thanks = { \\" >> dialogs/about.hpp
-       cat $(top_srcdir)/THANKS | grep -v '$$Id:' | sed s/'"'/'\\"'/g | awk '{ print "\""$$0"\\n\" \\" }' >> dialogs/about.hpp
+       echo "#define THANKS { \\" >> 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 "char *psz_authors = { \\" >> dialogs/about.hpp
-       cat $(top_srcdir)/AUTHORS | grep -v '$$Id:' | sed s/'"'/'\\"'/g | awk '{ print "\""$$0"\\n\" \\" }' >> dialogs/about.hpp
+       echo "#define AUTHORS { \\" >> 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
 
-
 SOURCES_qt4 =  qt4.cpp \
                menus.cpp \
                main_interface.cpp \
index a219312465712805e011315853461cada653b081..eaebffdbc0013f5a7225cc3f8b0674c53c9098d4 100644 (file)
@@ -114,7 +114,15 @@ AboutDialog::AboutDialog( intf_thread_t *_p_intf) :  QVLCFrame( _p_intf )
 
     /* GPL License */
     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 );
 
     /* People who helped */
@@ -128,13 +136,29 @@ AboutDialog::AboutDialog( intf_thread_t *_p_intf) :  QVLCFrame( _p_intf )
     thanksLabel->setWordWrap( true );
     thanksLayout->addWidget( thanksLabel );
     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 ) );
+#endif
     thanksEdit->setReadOnly( true );
     thanksLayout->addWidget( thanksEdit );
 
     /* People who wrote the software */
     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 ) );
+#endif
     authorsEdit->setReadOnly( true );
 
     /* add the tabs to the Tabwidget */