nandbin.cpp: add more characters to replace to support lame-ass windows filesystems

git-svn-id: http://wiiqt.googlecode.com/svn/trunk@77 389f4c8b-5dfe-645f-db0e-df882bc27289
This commit is contained in:
giantpune@gmail.com 2011-04-19 08:24:00 +00:00
parent 13610f87ad
commit b91785abac
3 changed files with 23 additions and 11 deletions

View File

@ -332,7 +332,18 @@ const QString NandBin::FstName( fst_t fst )
QByteArray ba( (char*)fst.filename, 0xc ); QByteArray ba( (char*)fst.filename, 0xc );
QString ret = QString( ba ); QString ret = QString( ba );
if( fatNames ) if( fatNames )
{
ret.replace( ":", "-" ); ret.replace( ":", "-" );
ret.replace( "?", "-" );
ret.replace( "<", "-" );
ret.replace( ">", "-" );
ret.replace( "\\", "-" );
ret.replace( ":", "-" );
ret.replace( "*", "-" );
ret.replace( "|", "-" );
ret.replace( "\"", "-" );
ret.replace( "^", "-" );
}
return ret; return ret;
} }

View File

@ -285,14 +285,16 @@ void MainWindow::on_actionSetting_txt_triggered()
if( !nandInited ) if( !nandInited )
return; return;
QTreeWidgetItem *it = ItemFromPath( "/title/00000001/00000002/data/setting.txt" ); if( !ItemFromPath( "/title/00000001/00000002/data" ) )
if( !it )
{ {
ShowMessage( tr( "<b>There is no setting.txt found in %1</b>" ) ShowMessage( tr( "<b>You need to have a system menu before you can create a setting.txt</b>" ) );
.arg( QFileInfo( ui->lineEdit_nandPath->text() ).absoluteFilePath() ) );
return; return;
} }
QByteArray ba = nand.GetData( "/title/00000001/00000002/data/setting.txt" ); //read the current setting.txt
QByteArray ba;
if( ItemFromPath( "/title/00000001/00000002/data/setting.txt" ) )
ba = nand.GetData( "/title/00000001/00000002/data/setting.txt" ); //read the current setting.txt
ba = SettingTxtDialog::Edit( this, ba ); //call a dialog to edit that existing file and store the result in the same bytearray ba = SettingTxtDialog::Edit( this, ba ); //call a dialog to edit that existing file and store the result in the same bytearray
if( !ba.isEmpty() ) //if the dialog returned anything ( cancel wasnt pressed ) write that new setting.txt to the nand dump if( !ba.isEmpty() ) //if the dialog returned anything ( cancel wasnt pressed ) write that new setting.txt to the nand dump
{ {
@ -776,8 +778,7 @@ bool MainWindow::InstallNUSItem( NusJob job )
void MainWindow::on_actionAbout_triggered() void MainWindow::on_actionAbout_triggered()
{ {
QString txt = tr( "This is an example program from WiiQt. It is designed to write titles to a nand.bin and even create one from scratch." QString txt = tr( "This is an example program from WiiQt. It is designed to write titles to a nand.bin and even create one from scratch."
"<br><br>PLEASE BE AWARE, THIS IS NOT VERY WELL TESTED AND AS OF RIGHT NOW." "<br><br>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"
" 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"
"<br><br>YOU HAVE BEEN WARNED" "<br><br>YOU HAVE BEEN WARNED"
"<br>giantpune" ); "<br>giantpune" );
QMessageBox::critical( this, tr( "About" ), txt ); QMessageBox::critical( this, tr( "About" ), txt );