* ohneschwanzenegger:: allow passing nand filename as argv

* nandBinCheck:: default to "-all -v -v" if no args are given

git-svn-id: http://wiiqt.googlecode.com/svn/trunk@104 389f4c8b-5dfe-645f-db0e-df882bc27289
This commit is contained in:
giantpune 2011-05-30 23:39:10 +00:00
parent 7752ff1843
commit 06da4707a6
5 changed files with 23 additions and 6 deletions

View File

@ -354,6 +354,7 @@ QString NusDownloader::GetCachePath( quint32 idx )
return path; return path;
} }
#if 0
//print info about a job //print info about a job
void NusDownloader::DbgJoB( const NusJob &job ) void NusDownloader::DbgJoB( const NusJob &job )
{ {
@ -366,6 +367,7 @@ void NusDownloader::DbgJoB( const NusJob &job )
.arg( job.version ).arg( job.decrypt ? "decrypted" : "encrypted" ) .arg( job.version ).arg( job.decrypt ? "decrypted" : "encrypted" )
.arg( dataStuff ); .arg( dataStuff );
} }
#endif
//check a hash and add the data to the return item //check a hash and add the data to the return item
bool NusDownloader::DecryptCheckHashAndAppendData( const QByteArray &encData, quint16 idx ) bool NusDownloader::DecryptCheckHashAndAppendData( const QByteArray &encData, quint16 idx )
@ -540,7 +542,6 @@ void NusDownloader::downloadFinished()
{ {
emit SendDownloadProgress( 100 ); emit SendDownloadProgress( 100 );
FileIsFinishedDownloading( dlJob ); FileIsFinishedDownloading( dlJob );
} }
currentDownload->deleteLater(); currentDownload->deleteLater();
} }

View File

@ -127,10 +127,10 @@ private:
//send a fail message about the current job and skip to the next //send a fail message about the current job and skip to the next
void CurrentJobErrored( const QString &str ); void CurrentJobErrored( const QString &str );
#if 0
//print info about a job to qDebug() //print info about a job to qDebug()
void DbgJoB( const NusJob &job ); void DbgJoB( const NusJob &job );
#endif
//get the path for a file in the local cache //get the path for a file in the local cache
QString GetCachePath( quint32 idx ); QString GetCachePath( quint32 idx );

View File

@ -89,7 +89,7 @@ public:
quint32 content_count(); quint32 content_count();
//get the last error encountered while trying to do something //get the last error encountered while trying to do something
const QString LastError(){ return errStr; } const QString &LastError(){ return errStr; }
//get a name for a wad as it would be seen in a wii disc update partition //get a name for a wad as it would be seen in a wii disc update partition
//if a path is given, it will check that path for existing wads with the name and append a number to the end "(1)" to avoid duplicate files //if a path is given, it will check that path for existing wads with the name and append a number to the end "(1)" to avoid duplicate files

View File

@ -165,6 +165,7 @@ void DebugHandler( QtMsgType type, const char *msg )
void Usage() void Usage()
{ {
qWarning() << "usage:" << QCoreApplication::arguments().at( 0 ) << "nand.bin" << "<other options>"; qWarning() << "usage:" << QCoreApplication::arguments().at( 0 ) << "nand.bin" << "<other options>";
qDebug() << "\nif no <other options> are given, it will default to \"-all -v -v\"";
qDebug() << "\nOther options:"; qDebug() << "\nOther options:";
qDebug() << " -boot shows information about boot 1 and 2"; qDebug() << " -boot shows information about boot 1 and 2";
qDebug() << ""; qDebug() << "";
@ -1328,7 +1329,7 @@ int main( int argc, char *argv[] )
if( args.contains( "-about", Qt::CaseInsensitive ) ) if( args.contains( "-about", Qt::CaseInsensitive ) )
About(); About();
if( args.size() < 3 ) if( args.size() < 2 )
Usage(); Usage();
if( !QFile( args.at( 1 ) ).exists() ) if( !QFile( args.at( 1 ) ).exists() )
@ -1337,6 +1338,11 @@ int main( int argc, char *argv[] )
if( !nand.SetPath( args.at( 1 ) ) || !nand.InitNand() ) if( !nand.SetPath( args.at( 1 ) ) || !nand.InitNand() )
Fail( "Error setting path to nand object" ); Fail( "Error setting path to nand object" );
if( args.size() < 3 )
{
args << "-all" << "-v" << "-v";
}
root = NULL; root = NULL;
verbose = args.count( "-v" ); verbose = args.count( "-v" );

View File

@ -57,8 +57,18 @@ MainWindow::MainWindow( QWidget *parent ) : QMainWindow( parent ), ui( new Ui::M
connect( &nand, SIGNAL( SendText( QString ) ), ui->statusBar, SLOT( showMessage( QString ) ) ); connect( &nand, SIGNAL( SendText( QString ) ), ui->statusBar, SLOT( showMessage( QString ) ) );
LoadSettings(); LoadSettings();
QStringList args = QCoreApplication::arguments();
if( args.size() > 1 && QFileInfo( args.at( 1 ) ).exists() )
{
ui->lineEdit_nandPath->setText( args.at( 1 ) );
InitNand( args.at( 1 ) );
}
else
{
ui->lineEdit_nandPath->setText( "./testNand.bin" ); ui->lineEdit_nandPath->setText( "./testNand.bin" );
} }
}
MainWindow::~MainWindow() MainWindow::~MainWindow()
{ {