From b91785abac0f2d4dc16130a9365c056804231d29 Mon Sep 17 00:00:00 2001 From: "giantpune@gmail.com" Date: Tue, 19 Apr 2011 08:24:00 +0000 Subject: [PATCH] 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 --- WiiQt/nandbin.cpp | 13 ++++++++++++- nandBinCheck/main.cpp | 2 +- ohneschwanzenegger/mainwindow.cpp | 19 ++++++++++--------- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/WiiQt/nandbin.cpp b/WiiQt/nandbin.cpp index fe162cf..fe6020f 100755 --- a/WiiQt/nandbin.cpp +++ b/WiiQt/nandbin.cpp @@ -332,7 +332,18 @@ const QString NandBin::FstName( fst_t fst ) QByteArray ba( (char*)fst.filename, 0xc ); QString ret = QString( ba ); 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; } diff --git a/nandBinCheck/main.cpp b/nandBinCheck/main.cpp index 41237ca..988b442 100644 --- a/nandBinCheck/main.cpp +++ b/nandBinCheck/main.cpp @@ -1279,7 +1279,7 @@ int main( int argc, char *argv[] ) qCritical() << "** nandBinCheck : Wii nand info tool **"; qCritical() << " from giantpune"; qCritical() << " built:" << __DATE__ << __TIME__; - args = QCoreApplication::arguments(); + args = QCoreApplication::arguments(); if( args.contains( "-nocolor", Qt::CaseInsensitive ) ) color = false; diff --git a/ohneschwanzenegger/mainwindow.cpp b/ohneschwanzenegger/mainwindow.cpp index 8162ad7..669127e 100644 --- a/ohneschwanzenegger/mainwindow.cpp +++ b/ohneschwanzenegger/mainwindow.cpp @@ -285,14 +285,16 @@ void MainWindow::on_actionSetting_txt_triggered() if( !nandInited ) return; - QTreeWidgetItem *it = ItemFromPath( "/title/00000001/00000002/data/setting.txt" ); - if( !it ) - { - ShowMessage( tr( "There is no setting.txt found in %1" ) - .arg( QFileInfo( ui->lineEdit_nandPath->text() ).absoluteFilePath() ) ); + if( !ItemFromPath( "/title/00000001/00000002/data" ) ) + { + ShowMessage( tr( "You need to have a system menu before you can create a setting.txt" ) ); 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 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() { 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." - "

PLEASE BE AWARE, THIS IS NOT VERY WELL TESTED AND AS OF RIGHT NOW." - " 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" "

YOU HAVE BEEN WARNED" "
giantpune" ); QMessageBox::critical( this, tr( "About" ), txt );