mirror of
https://github.com/martravi/wiiqt6.git
synced 2024-12-25 12:31:49 +01:00
* ohneschwanzenegger: if trying to install multiple wads, and one fails, keep going. add testlog on format as well as creating new nand (yet untested)
git-svn-id: http://wiiqt.googlecode.com/svn/trunk@95 389f4c8b-5dfe-645f-db0e-df882bc27289
This commit is contained in:
parent
c744b29d04
commit
ad906d24d9
@ -242,11 +242,10 @@ void MainWindow::on_pushButton_GetTitle_clicked()
|
||||
}
|
||||
}
|
||||
//decide how we want nus to give us the title
|
||||
bool decrypt = true;
|
||||
nus.SetCachePath( ui->lineEdit_cachePath->text() );
|
||||
if( wholeUpdate )
|
||||
{
|
||||
if( !nus.GetUpdate( ui->lineEdit_tid->text(), decrypt ) )
|
||||
if( !nus.GetUpdate( ui->lineEdit_tid->text(), true ) )
|
||||
{
|
||||
ShowMessage( tr( "<b>I dont know the titles that were in the %1 update</b>" ).arg( ui->lineEdit_tid->text() ) );
|
||||
return;
|
||||
@ -254,7 +253,7 @@ void MainWindow::on_pushButton_GetTitle_clicked()
|
||||
}
|
||||
else
|
||||
{
|
||||
nus.Get( tid, decrypt, ver );
|
||||
nus.Get( tid, true, ver );
|
||||
}
|
||||
}
|
||||
|
||||
@ -333,13 +332,13 @@ void MainWindow::on_actionImportWad_triggered()
|
||||
{
|
||||
QByteArray data = ReadFile( fn );
|
||||
if( data.isEmpty() )
|
||||
return;
|
||||
continue;
|
||||
|
||||
Wad wad( data );
|
||||
if( !wad.IsOk() )
|
||||
{
|
||||
ShowMessage( tr( "Wad data not ok for \"%1\"" ).arg( fn ) );
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
|
||||
//work smart, not hard... just turn the wad into a NUSJob and reused the same code to install it
|
||||
@ -360,7 +359,6 @@ void MainWindow::on_actionImportWad_triggered()
|
||||
ShowMessage( tr( "Installing %1 to nand" ).arg( fn ) );
|
||||
InstallNUSItem( job );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::on_actionNew_nand_from_keys_triggered()
|
||||
@ -382,7 +380,8 @@ void MainWindow::on_actionNew_nand_from_keys_triggered()
|
||||
ShowMessage( "<b>Error creating title subdirs<\b>" );
|
||||
return;
|
||||
}
|
||||
|
||||
WriteTestLog();
|
||||
#if 0
|
||||
//add some factory test logs and whatnot
|
||||
quint32 _uid = uid.GetUid( NAND_TEST_OWNER, true );
|
||||
if( !nand.CreateEntry( "/shared2/test", _uid, NAND_TEST_GROUP, NAND_DIR, NAND_RW, NAND_RW, NAND_RW )
|
||||
@ -405,6 +404,7 @@ void MainWindow::on_actionNew_nand_from_keys_triggered()
|
||||
}
|
||||
UpdateTree();
|
||||
ShowMessage( "Created /shared2/test/testlog.txt" );
|
||||
#endif
|
||||
}
|
||||
|
||||
void MainWindow::on_pushButton_initNand_clicked()
|
||||
@ -913,6 +913,34 @@ void MainWindow::on_actionWrite_meta_entries_triggered()
|
||||
AddStuffToMetaFolder();
|
||||
}
|
||||
|
||||
void MainWindow::WriteTestLog()
|
||||
{
|
||||
if( ( !nandInited && !InitNand( ui->lineEdit_nandPath->text() ) )
|
||||
|| ItemFromPath( "/shared2/test/testlog.txt" ) ) //already exists
|
||||
return;
|
||||
|
||||
quint32 _uid = uid.GetUid( NAND_TEST_OWNER, true );
|
||||
if( !CreateIfNeeded( "/shared2/test", _uid, NAND_TEST_GROUP, NAND_DIR, NAND_RW, NAND_RW, NAND_RW )
|
||||
|| !CreateIfNeeded( "/shared2/sys", _uid, NAND_TEST_GROUP, NAND_DIR, NAND_RW, NAND_RW, NAND_RW ) )
|
||||
{
|
||||
ShowMessage( "<b>Error creating folder for testlog<\b>" );
|
||||
return;
|
||||
}
|
||||
quint16 handle = CreateIfNeeded( "/shared2/test/testlog.txt", _uid, NAND_TEST_GROUP, NAND_FILE, NAND_RW, NAND_RW, NAND_RW );
|
||||
if( !handle )
|
||||
{
|
||||
ShowMessage( "<b>Error creating testlog<\b>" );
|
||||
return;
|
||||
}
|
||||
QByteArray tLog = ReadFile( ":/testlog.txt" );
|
||||
if( !nand.SetData( handle, tLog ) )
|
||||
{
|
||||
ShowMessage( "<b>Error writing to testlog.txt<\b>" );
|
||||
return;
|
||||
}
|
||||
ShowMessage( "Created /shared2/test/testlog.txt" );
|
||||
}
|
||||
|
||||
//content -> format
|
||||
void MainWindow::on_actionFormat_triggered()
|
||||
{
|
||||
@ -1001,5 +1029,6 @@ void MainWindow::on_actionFormat_triggered()
|
||||
ShowMessage( "<b>Error finalizing formatting!</b>" );
|
||||
return;
|
||||
}
|
||||
WriteTestLog();
|
||||
ShowMessage( "Done!" );
|
||||
}
|
||||
|
@ -54,6 +54,8 @@ private:
|
||||
void AddStuffToMetaFolder();
|
||||
QByteArray GenMeta( const QString &desc, quint64 tid, quint16 version );
|
||||
|
||||
void WriteTestLog();
|
||||
|
||||
public slots:
|
||||
//slots for getting info from the NUS downloader
|
||||
void GetError( const QString &message, const NusJob &job );
|
||||
|
Loading…
Reference in New Issue
Block a user