diff --git a/.gitattributes b/.gitattributes index d73fcb8..9f47f2c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -160,3 +160,6 @@ thp_player/thpwindow.ui -text thp_player/vol_high.png -text thp_player/vol_low.png -text thp_player/vol_med.png -text +tools/SubWCRev.exe -text +tools/makesvnrev.sh -text +tools/svnrev_template.h -text diff --git a/WiiQt/tools.cpp b/WiiQt/tools.cpp index d3e3565..ba5de54 100644 --- a/WiiQt/tools.cpp +++ b/WiiQt/tools.cpp @@ -249,6 +249,21 @@ quint8 AttrFromSave( const SaveGame &save, const QString &name ) return 0; } +QString CleanSvnStr( const QString &orig ) +{ + QString ret = orig; + + if( ret.isEmpty() ) + return ret; + + QRegExp notNum( "[^0-9]" ); + QStringList parts = ret.split( notNum, QString::SkipEmptyParts ); + if( parts.size() ) + return parts.at( parts.size() - 1 ); + + return ret; +} + #define CERTS_DAT_SIZE 2560 const quint8 certs_dat[ CERTS_DAT_SIZE ] = { 0x00, 0x01, 0x00, 0x01, 0x7D, 0x9D, 0x5E, 0xBA, 0x52, 0x81, 0xDC, 0xA7, 0x06, 0x5D, 0x2F, 0x08, diff --git a/WiiQt/tools.h b/WiiQt/tools.h index 5ebc842..135bd6a 100644 --- a/WiiQt/tools.h +++ b/WiiQt/tools.h @@ -78,6 +78,9 @@ QByteArray ReadFile( const QString &path ); //save a file to disc bool WriteFile( const QString &path, const QByteArray &ba ); +//cleanup an svn revision string +QString CleanSvnStr( const QString &orig ); + #define CERTS_DAT_SIZE 2560 extern const quint8 certs_dat[ CERTS_DAT_SIZE ]; extern const quint8 root_dat[]; diff --git a/ohneschwanzenegger/mainwindow.cpp b/ohneschwanzenegger/mainwindow.cpp index c97425b..9fb4757 100644 --- a/ohneschwanzenegger/mainwindow.cpp +++ b/ohneschwanzenegger/mainwindow.cpp @@ -1,5 +1,6 @@ #include "mainwindow.h" #include "newnandbin.h" +#include "svnrev.h" #include "ui_mainwindow.h" #include "../WiiQt/settingtxtdialog.h" @@ -57,7 +58,6 @@ MainWindow::MainWindow( QWidget *parent ) : QMainWindow( parent ), ui( new Ui::M LoadSettings(); ui->lineEdit_nandPath->setText( "./testNand.bin" ); - } MainWindow::~MainWindow() @@ -785,7 +785,7 @@ void MainWindow::on_actionAbout_triggered() "

IT SHOULD ONLY BE USED BY PEOPLE THAT KNOW HOW TO VERIFY THE FILES IT PRODUCES. AND HAVE A WAY TO FIX A BRICKED WII SHOULD THIS PROGRAM HAVE BUGS" "

YOU HAVE BEEN WARNED" "
giantpune" ); - QMessageBox::critical( this, tr( "About" ), txt ); + QMessageBox::critical( this, tr( "svn r%1" ).arg( CleanSvnStr( SVN_REV_STR ) ), txt ); } #if 0 diff --git a/ohneschwanzenegger/refleurii.pro b/ohneschwanzenegger/refleurii.pro index 3819063..66222b5 100644 --- a/ohneschwanzenegger/refleurii.pro +++ b/ohneschwanzenegger/refleurii.pro @@ -39,3 +39,14 @@ FORMS += mainwindow.ui \ ../WiiQt/settingtxtdialog.ui \ newnandbin.ui RESOURCES += rc.qrc + + +# create new svnrev.h +unix { + system( chmod 755 ../tools/makesvnrev.sh ) + system( ../tools/makesvnrev.sh ) +} + +win32 { + system( ../tools/SubWCRev.exe "." "../tools/svnrev_template.h" "./svnrev.h" ) +} diff --git a/tools/SubWCRev.exe b/tools/SubWCRev.exe new file mode 100644 index 0000000..32a252b Binary files /dev/null and b/tools/SubWCRev.exe differ diff --git a/tools/makesvnrev.sh b/tools/makesvnrev.sh new file mode 100755 index 0000000..6c71bbd --- /dev/null +++ b/tools/makesvnrev.sh @@ -0,0 +1,6 @@ +REV=`svnversion -n .` +echo $REV +cat > ./svnrev.h <