1
0
Fork 0
forked from len0rd/rockbox

Support for Theme installing in rbUtil. FS#6709

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12781 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dominik Wenger 2007-03-15 14:02:37 +00:00
parent 1625c91fbd
commit 994a6d6c4c
14 changed files with 1218 additions and 705 deletions

View file

@ -42,14 +42,14 @@ bool ipodpatcher(int mode)
// downloading files
if(mode == BOOTLOADER_ADD)
{
src.Printf("%s/ipod/%s.ipod", gv->bootloader_url.c_str(),gv->curbootloader.c_str());
dest.Printf("%s" PATH_SEP "download" PATH_SEP "%s",
src.Printf(wxT("%s/ipod/%s.ipod"), gv->bootloader_url.c_str(),gv->curbootloader.c_str());
dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "%s"),
gv->stdpaths->GetUserDataDir().c_str(),gv->curbootloader.c_str());
if ( DownloadURL(src, dest) )
{
wxRemoveFile(dest);
buf.Printf(_("Unable to download %s"), src.c_str() );
ERR_DIALOG(buf, _("Install"));
buf.Printf(wxT("Unable to download %s"), src.c_str() );
ERR_DIALOG(buf, wxT("Install"));
return false;
}
}
@ -59,45 +59,45 @@ bool ipodpatcher(int mode)
int n = ipod_scan(&ipod);
if (n == 0)
{
ERR_DIALOG("[ERR] No ipods found.", _("Scanning for Ipods"));
ERR_DIALOG(wxT("[ERR] No ipods found."), wxT("Scanning for Ipods"));
return false;
}
if (n > 1)
{
ERR_DIALOG("[ERR] to many ipods found.", _("Scanning for Ipods"));
ERR_DIALOG(wxT("[ERR] to many ipods found."), wxT("Scanning for Ipods"));
return false;
}
if (ipod_open(&ipod, 0) < 0)
{
ERR_DIALOG("[ERR] could not open ipod", _("open Ipod"));
ERR_DIALOG(wxT("[ERR] could not open ipod"), wxT("open Ipod"));
return false;
}
if (read_partinfo(&ipod,0) < 0)
{
ERR_DIALOG("[ERR] could not read partitiontable", _("reading partitiontable"));
ERR_DIALOG(wxT("[ERR] could not read partitiontable"), wxT("reading partitiontable"));
return false;
}
if (ipod.pinfo[0].start==0)
{
ERR_DIALOG("[ERR] No partition 0 on disk", _("reading partitiontable"));
ERR_DIALOG(wxT("[ERR] No partition 0 on disk"), wxT("reading partitiontable"));
int i;
double sectors_per_MB = (1024.0*1024.0)/ipod.sector_size;
buf.Printf("[INFO] Part Start Sector End Sector Size (MB) Type\n");
ERR_DIALOG(buf, _("reading partitiontable"));
buf.Printf(wxT("[INFO] Part Start Sector End Sector Size (MB) Type\n"));
ERR_DIALOG(buf, wxT("reading partitiontable"));
for ( i = 0; i < 4; i++ ) {
if (ipod.pinfo[i].start != 0) {
buf.Printf("[INFO] %d %10ld %10ld %10.1f %s (0x%02x)\n",
buf.Printf(wxT("[INFO] %d %10ld %10ld %10.1f %s (0x%02x)\n"),
i,
ipod.pinfo[i].start,
ipod.pinfo[i].start+ipod.pinfo[i].size-1,
ipod.pinfo[i].size/sectors_per_MB,
get_parttype(ipod.pinfo[i].type),
ipod.pinfo[i].type);
ERR_DIALOG(buf, _("reading partitiontable"));
ERR_DIALOG(buf, wxT("reading partitiontable"));
}
}
return false;
@ -107,52 +107,52 @@ bool ipodpatcher(int mode)
if (ipod.nimages <= 0)
{
ERR_DIALOG("[ERR] Failed to read firmware directory", _("reading directory"));
ERR_DIALOG(wxT("[ERR] Failed to read firmware directory"), wxT("reading directory"));
return false;
}
if (getmodel(&ipod,(ipod.ipod_directory[0].vers>>8)) < 0)
{
buf.Printf(_("[ERR] Unknown version number in firmware (%08x)\n"),
buf.Printf(wxT("[ERR] Unknown version number in firmware (%08x)\n"),
ipod.ipod_directory[0].vers );
ERR_DIALOG(buf, _("reading directory"));
ERR_DIALOG(buf, wxT("reading directory"));
return false;
}
if (ipod.macpod)
{
WARN_DIALOG("Warning this is a MacPod, Rockbox doesnt work on this. Convert it to WinPod",_("MacPod"));
WARN_DIALOG(wxT("Warning this is a MacPod, Rockbox doesnt work on this. Convert it to WinPod"),wxT("MacPod"));
}
if(mode == BOOTLOADER_ADD)
{
if (ipod_reopen_rw(&ipod) < 0) {
ERR_DIALOG("[ERR] Could not open Ipod in RW mode", _("Bootloader add"));
ERR_DIALOG(wxT("[ERR] Could not open Ipod in RW mode"), wxT("Bootloader add"));
return false;
}
if (add_bootloader(&ipod, (char*)dest.c_str(), FILETYPE_DOT_IPOD)==0) {
} else {
ERR_DIALOG("[ERR] failed to add Bootloader", _("Bootloader add"));
ERR_DIALOG(wxT("[ERR] failed to add Bootloader"), wxT("Bootloader add"));
return false;
}
}
else if(mode == BOOTLOADER_REM)
{
if (ipod_reopen_rw(&ipod) < 0) {
ERR_DIALOG("[ERR] Could not open Ipod in RW mode", _("Bootloader add"));
ERR_DIALOG(wxT("[ERR] Could not open Ipod in RW mode"), wxT("Bootloader add"));
return false;
}
if (ipod.ipod_directory[0].entryOffset==0) {
ERR_DIALOG("[ERR] No bootloader detected.\n", _("Bootloader del"));
ERR_DIALOG(wxT("[ERR] No bootloader detected.\n"), wxT("Bootloader del"));
return false;
} else {
if (delete_bootloader(&ipod)==0) {
} else {
ERR_DIALOG("[ERR] --delete-bootloader failed.\n", _("Bootloader del"));
ERR_DIALOG(wxT("[ERR] --delete-bootloader failed.\n"), wxT("Bootloader del"));
return false;
}
}
@ -169,65 +169,65 @@ bool gigabeatf(int mode)
wxString err;
wxString src,dest;
path1.Printf("%s" PATH_SEP "GBSYSTEM" PATH_SEP "FWIMG" PATH_SEP "FWIMG01.DAT",gv->curdestdir.c_str());
path1.Printf(wxT("%s" PATH_SEP "GBSYSTEM" PATH_SEP "FWIMG" PATH_SEP "FWIMG01.DAT"),gv->curdestdir.c_str());
if(mode == BOOTLOADER_ADD)
{
//Files downloaden
src.Printf("%s/gigabeat/%s", gv->bootloader_url.c_str(),gv->curbootloader.c_str());
dest.Printf("%s" PATH_SEP "download" PATH_SEP "%s",
src.Printf(wxT("%s/gigabeat/%s"), gv->bootloader_url.c_str(),gv->curbootloader.c_str());
dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "%s"),
gv->stdpaths->GetUserDataDir().c_str(),gv->curbootloader.c_str());
if( DownloadURL(src, dest) )
{
wxRemoveFile(dest);
err.Printf(_("Unable to download %s"), src.c_str() );
ERR_DIALOG(err, _("Install"));
err.Printf(wxT("Unable to download %s"), src.c_str() );
ERR_DIALOG(err, wxT("Install"));
return false;
}
if(!wxFileExists(path1))
{
err.Printf("[ERR] Coud not find %s",path1.c_str());
ERR_DIALOG(err, _("Bootloader add"));
err.Printf(wxT("[ERR] Coud not find %s"),path1.c_str());
ERR_DIALOG(err, wxT("Bootloader add"));
return false;
}
path2 = path1;
path2.Append(".ORIG");
path2.Append(wxT(".ORIG"));
if(wxFileExists(path2))
{
err = "Its seems there is already a Bootloader install, if not, delete the *.IMG.ORIG file";
ERR_DIALOG(err, _("Bootloader add"));
err = wxT("Its seems there is already a Bootloader install, if not, delete the *.IMG.ORIG file");
ERR_DIALOG(err, wxT("Bootloader add"));
return false;
}
if(!wxRenameFile(path1,path2,false))
{
err.Printf("[ERR] Coud not rename %s to %s",path1.c_str(),path2.c_str());
ERR_DIALOG(err, _("Bootloader add"));
err.Printf(wxT("[ERR] Coud not rename %s to %s"),path1.c_str(),path2.c_str());
ERR_DIALOG(err, wxT("Bootloader add"));
return false;
}
if(!wxCopyFile(dest,path1))
{
err.Printf("[ERR] Coud not copy %s to %s",dest.c_str(),path2.c_str());
ERR_DIALOG(err, _("Bootloader add"));
err.Printf(wxT("[ERR] Coud not copy %s to %s"),dest.c_str(),path2.c_str());
ERR_DIALOG(err, wxT("Bootloader add"));
return false;
}
}
else if(mode == BOOTLOADER_REM)
{
path2 = path1;
path2.Append(".ORIG");
path2.Append(wxT(".ORIG"));
if(!wxFileExists(path2))
{
err.Printf("[ERR] Coud not find %s",path1.c_str());
ERR_DIALOG(err, _("Bootloader del"));
err.Printf(wxT("[ERR] Coud not find %s"),path1.c_str());
ERR_DIALOG(err, wxT("Bootloader del"));
return false;
}
if(!wxRenameFile(path2,path1,true))
{
err.Printf("[ERR] Coud not rename %s to %s",path1.c_str(),path2.c_str());
ERR_DIALOG(err, _("Bootloader del"));
err.Printf(wxT("[ERR] Coud not rename %s to %s"),path1.c_str(),path2.c_str());
ERR_DIALOG(err, wxT("Bootloader del"));
return false;
}
}
@ -241,27 +241,27 @@ bool iaudiox5(int mode)
wxString err;
wxString src,dest;
path1.Printf("%s" PATH_SEP "FIRMWARE" PATH_SEP "%s",gv->curdestdir.c_str(),gv->curbootloader.c_str());
path1.Printf(wxT("%s" PATH_SEP "FIRMWARE" PATH_SEP "%s"),gv->curdestdir.c_str(),gv->curbootloader.c_str());
if(mode == BOOTLOADER_ADD)
{
//Files downloaden
src.Printf("%s/iaudio/%s", gv->bootloader_url.c_str(),gv->curbootloader.c_str());
dest.Printf("%s" PATH_SEP "download" PATH_SEP "%s",
src.Printf(wxT("%s/iaudio/%s"), gv->bootloader_url.c_str(),gv->curbootloader.c_str());
dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "%s"),
gv->stdpaths->GetUserDataDir().c_str(),gv->curbootloader.c_str());
if( DownloadURL(src, dest) )
{
wxRemoveFile(dest);
err.Printf(_("Unable to download %s"), src.c_str() );
ERR_DIALOG(err, _("Install"));
err.Printf(wxT("Unable to download %s"), src.c_str() );
ERR_DIALOG(err, wxT("Install"));
return false;
}
// copy file
if(!wxCopyFile(dest,path1))
{
err.Printf("[ERR] Coud not copy %s to %s",dest.c_str(),path2.c_str());
ERR_DIALOG(err, _("Bootloader add"));
err.Printf(wxT("[ERR] Coud not copy %s to %s"),dest.c_str(),path2.c_str());
ERR_DIALOG(err, wxT("Bootloader add"));
return false;
}
@ -284,46 +284,46 @@ bool h10(int mode)
if(mode == BOOTLOADER_ADD)
{
//Files downloaden
src.Printf("%s/iriver/%s", gv->bootloader_url.c_str(),gv->curbootloader.c_str());
dest.Printf("%s" PATH_SEP "download" PATH_SEP "%s",
src.Printf(wxT("%s/iriver/%s"), gv->bootloader_url.c_str(),gv->curbootloader.c_str());
dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "%s"),
gv->stdpaths->GetUserDataDir().c_str(),firmwarename.c_str());
if( DownloadURL(src, dest) )
{
wxRemoveFile(dest);
err.Printf(_("Unable to download %s"), src.c_str() );
ERR_DIALOG(err, _("Install"));
err.Printf(wxT("Unable to download %s"), src.c_str() );
ERR_DIALOG(err, wxT("Install"));
return false;
}
path1.Printf("%sSYSTEM" PATH_SEP "%s",gv->curdestdir.c_str(),firmwarename.c_str());
path2.Printf("%sSYSTEM" PATH_SEP "Original.mi4",gv->curdestdir.c_str());
path1.Printf(wxT("%sSYSTEM" PATH_SEP "%s"),gv->curdestdir.c_str(),firmwarename.c_str());
path2.Printf(wxT("%sSYSTEM" PATH_SEP "Original.mi4"),gv->curdestdir.c_str());
if(!wxFileExists(path1)) //Firmware dosent exists on player
{
path1.Printf("%sSYSTEM" PATH_SEP "H10EMP.mi4"); //attempt other firmwarename
path1.Printf(wxT("%sSYSTEM" PATH_SEP "H10EMP.mi4")); //attempt other firmwarename
if(!wxFileExists(path1)) //Firmware dosent exists on player
{
err.Printf("[ERR] File %s does not Exist",path1.c_str());
ERR_DIALOG(err, _("Bootloader add"));
err.Printf(wxT("[ERR] File %s does not Exist"),path1.c_str());
ERR_DIALOG(err, wxT("Bootloader add"));
return false;
}
}
if(wxFileExists(path2)) //there is already a original firmware
{
err.Printf("[ERR2] File %s does Exist",path2.c_str());
ERR_DIALOG(err, _("Bootloader add"));
err.Printf(wxT("[ERR2] File %s does Exist"),path2.c_str());
ERR_DIALOG(err, wxT("Bootloader add"));
return false;
}
if(!wxRenameFile(path1,path2,false)) //rename Firmware to Original
{
err.Printf("[ERR] Coud not rename %s to %s",path1.c_str(),path2.c_str());
ERR_DIALOG(err, _("Bootloader add"));
err.Printf(wxT("[ERR] Coud not rename %s to %s"),path1.c_str(),path2.c_str());
ERR_DIALOG(err, wxT("Bootloader add"));
return false;
}
if(!wxCopyFile(dest,path1)) // copy file
{
err.Printf("[ERR] Coud not copy %s to %s",dest.c_str(),path1.c_str());
ERR_DIALOG(err, _("Bootloader add"));
err.Printf(wxT("[ERR] Coud not copy %s to %s"),dest.c_str(),path1.c_str());
ERR_DIALOG(err,wxT("Bootloader add"));
return false;
}
@ -332,30 +332,30 @@ bool h10(int mode)
}
else if(mode == BOOTLOADER_REM)
{
path1.Printf("%sSYSTEM" PATH_SEP "%s",gv->curdestdir.c_str(),firmwarename.c_str());
path2.Printf("%sSYSTEM" PATH_SEP "Original.mi4",gv->curdestdir.c_str());
path1.Printf(wxT("%sSYSTEM" PATH_SEP "%s"),gv->curdestdir.c_str(),firmwarename.c_str());
path2.Printf(wxT("%sSYSTEM" PATH_SEP "Original.mi4"),gv->curdestdir.c_str());
if(!wxFileExists(path1)) //Firmware dosent exists on player
{
path1.Printf("%s" PATH_SEP "SYSTEM" PATH_SEP "H10EMP.mi4"); //attempt other firmwarename
path1.Printf(wxT("%s" PATH_SEP "SYSTEM" PATH_SEP "H10EMP.mi4")); //attempt other firmwarename
if(!wxFileExists(path1)) //Firmware dosent exists on player
{
err.Printf("[ERR] File %s does not Exist",path1.c_str());
ERR_DIALOG(err, _("Bootloader rem"));
err.Printf(wxT("[ERR] File %s does not Exist"),path1.c_str());
ERR_DIALOG(err, wxT("Bootloader rem"));
return false;
}
}
if(!wxFileExists(path2)) //Original Firmware dosent exists on player
{
err.Printf("[ERR] File %s does not Exist",path2.c_str());
ERR_DIALOG(err, _("Bootloader rem"));
err.Printf(wxT("[ERR] File %s does not Exist"),path2.c_str());
ERR_DIALOG(err, wxT("Bootloader rem"));
return false;
}
if(!wxRenameFile(path2,path1,true)) //rename Firmware to Original
{
err.Printf("[ERR] Coud not rename %s to %s",path2.c_str(),path1.c_str());
ERR_DIALOG(err, _("Bootloader add"));
err.Printf(wxT("[ERR] Coud not rename %s to %s"),path2.c_str(),path1.c_str());
ERR_DIALOG(err, wxT("Bootloader add"));
return false;
}
@ -372,7 +372,7 @@ bool fwpatcher(int mode)
int series,table_entry;
if (!FileMD5(gv->curfirmware, &md5sum_str)) {
ERR_DIALOG("Could not open firmware", _("Open Firmware"));
ERR_DIALOG(wxT("Could not open firmware"), wxT("Open Firmware"));
return false;
}
else {
@ -398,44 +398,44 @@ bool fwpatcher(int mode)
}
}
if (series == 0) {
ERR_DIALOG("Could not detect firmware type", _("Detect Player out of Firmware"));
ERR_DIALOG(wxT("Could not detect firmware type"), wxT("Detect Player out of Firmware"));
return false;
}
else
{
//Download bootloader
src.Printf("%s/iriver/%s", gv->bootloader_url.c_str(),gv->curbootloader.c_str());
dest.Printf("%s" PATH_SEP "download" PATH_SEP "%s",
src.Printf(wxT("%s/iriver/%s"), gv->bootloader_url.c_str(),gv->curbootloader.c_str());
dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "%s"),
gv->stdpaths->GetUserDataDir().c_str(),gv->curbootloader.c_str());
if( DownloadURL(src, dest) )
{
wxRemoveFile(dest);
err.Printf(_("Unable to download %s"), src.c_str() );
ERR_DIALOG(err, _("Install"));
err.Printf(wxT("Unable to download %s"), src.c_str() );
ERR_DIALOG(err, wxT("Install"));
return false;
}
if(!PatchFirmware(gv->curfirmware,dest,series, table_entry)) // Patch firmware
{
ERR_DIALOG("Patching Firmware failed", _("Patching Firmware"));
ERR_DIALOG(wxT("Patching Firmware failed"), wxT("Patching Firmware"));
return false;
}
}
// Load patched Firmware to player
src.Printf("%s" PATH_SEP "download" PATH_SEP "new.hex",
src.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "new.hex"),
gv->stdpaths->GetUserDataDir().c_str());
if(gv->curplat == "h100")
dest.Printf("%s" PATH_SEP "ihp_100.hex",gv->curdestdir.c_str());
dest.Printf(wxT("%s" PATH_SEP "ihp_100.hex"),gv->curdestdir.c_str());
else if(gv->curplat == "h120")
dest.Printf("%s" PATH_SEP "ihp_120.hex",gv->curdestdir.c_str());
dest.Printf(wxT("%s" PATH_SEP "ihp_120.hex"),gv->curdestdir.c_str());
else if(gv->curplat == "h300")
dest.Printf("%s" PATH_SEP "H300.hex",gv->curdestdir.c_str());
dest.Printf(wxT("%s" PATH_SEP "H300.hex"),gv->curdestdir.c_str());
if(!wxRenameFile(src,dest))
{
ERR_DIALOG("Copying Firmware to Device failed", _("Copying Firmware"));
ERR_DIALOG(wxT("Copying Firmware to Device failed"), wxT("Copying Firmware"));
return false;
}
else

View file

@ -22,7 +22,7 @@
#define CREDITS_H_INCLUDED
#define RBUTIL_FULLNAME "The Rockbox Utility"
#define RBUTIL_VERSION "Version 0.2.1.1"
#define RBUTIL_VERSION "Version 0.3.0.0"
static const char* rbutil_developers[] = {
"Christi Alice Scarborough",

View file

@ -61,13 +61,13 @@ bool mkboot(wxString infile, wxString outfile,wxString bootloader,int origin)
wxFile f;
if(!f.Open(infile))
{
err.Printf("Could not open: %s",infile.c_str());
ERR_DIALOG(err, _("mkboot"));
err.Printf(wxT("Could not open: %s"),infile.c_str());
ERR_DIALOG(err, wxT("mkboot"));
return false;
}
i = f.Read(image,16);
if(i < 16) {
ERR_DIALOG("reading header failed", _("mkboot"));
ERR_DIALOG(wxT("reading header failed"), wxT("mkboot"));
return false;
}
@ -80,7 +80,7 @@ bool mkboot(wxString infile, wxString outfile,wxString bootloader,int origin)
len = binary_length+0x200-16;
i = f.Read(image+16, len);
if(i < len) {
ERR_DIALOG("reading firmware failed", _("mkboot"));
ERR_DIALOG(wxT("reading firmware failed"),wxT("mkboot"));
return false;
}
@ -88,8 +88,8 @@ bool mkboot(wxString infile, wxString outfile,wxString bootloader,int origin)
/* Now, read the boot loader into the image */
if(!f.Open(bootloader))
{
err.Printf("Could not open: %s",bootloader.c_str());
ERR_DIALOG(err, _("mkboot"));
err.Printf(wxT("Could not open: %s"),bootloader.c_str());
ERR_DIALOG(err, wxT("mkboot"));
return false;
}
@ -97,7 +97,7 @@ bool mkboot(wxString infile, wxString outfile,wxString bootloader,int origin)
i = f.Read(image+0x220 + origin, bllen);
if(i < bllen) {
ERR_DIALOG("reading bootloader failed", _("mkboot"));
ERR_DIALOG(wxT("reading bootloader failed"), wxT("mkboot"));
return false;
}
@ -105,8 +105,8 @@ bool mkboot(wxString infile, wxString outfile,wxString bootloader,int origin)
if(!f.Open(outfile,wxFile::write))
{
err.Printf("Could not open: %s",outfile.c_str());
ERR_DIALOG(err, _("mkboot"));
err.Printf(wxT("Could not open: %s"),outfile.c_str());
ERR_DIALOG(err, wxT("mkboot"));
return false;
}
@ -158,7 +158,7 @@ bool mkboot(wxString infile, wxString outfile,wxString bootloader,int origin)
i = f.Write(image,total_length);
if(i < total_length) {
ERR_DIALOG("writing bootloader failed", _("mkboot"));
ERR_DIALOG(wxT("writing bootloader failed"), wxT("mkboot"));
return false;
}
@ -230,21 +230,21 @@ int iriver_decode(wxString infile_name, wxString outfile_name, unsigned int modi
if(!infile.Open(infile_name))
{
err.Printf("Could not open: %s",infile_name.c_str());
ERR_DIALOG(err, _("iriver_decode"));
err.Printf(wxT("Could not open: %s"),infile_name.c_str());
ERR_DIALOG(err, wxT("iriver_decode"));
return -1;
}
if(!outfile.Open(outfile_name,wxFile::write))
{
err.Printf("Could not open: %s",outfile_name.c_str());
ERR_DIALOG(err, _("iriver_decode"));
err.Printf(wxT("Could not open: %s"),outfile_name.c_str());
ERR_DIALOG(err, wxT("iriver_decode"));
return -1;
}
lenread = infile.Read( headerdata, 512);
if( lenread != 512 )
{
ERR_DIALOG(_("This doesn't look like a valid encrypted iHP "
"firmware - reason: header length\n"),_("iriver_decode"));
ERR_DIALOG(wxT("This doesn't look like a valid encrypted iHP "
"firmware - reason: header length\n"),wxT("iriver_decode"));
infile.Close();
outfile.Close();
@ -254,8 +254,8 @@ int iriver_decode(wxString infile_name, wxString outfile_name, unsigned int modi
i = testheader( headerdata );
if( i == -1 )
{
ERR_DIALOG( _( "This firmware is for an unknown model, or is not"
" a valid encrypted iHP firmware\n" ),_("iriver_decode"));
ERR_DIALOG( wxT( "This firmware is for an unknown model, or is not"
" a valid encrypted iHP firmware\n" ),wxT("iriver_decode"));
infile.Close();
outfile.Close();
return -1;
@ -277,8 +277,8 @@ int iriver_decode(wxString infile_name, wxString outfile_name, unsigned int modi
dwLength2>>9 != dwLength3 ||
dwLength2+dwLength3+512 != dwLength1 )
{
ERR_DIALOG( _( "This doesn't look like a valid encrypted "
"iHP firmware - reason: file 'length' data\n" ),_("iriver_decode"));
ERR_DIALOG( wxT( "This doesn't look like a valid encrypted "
"iHP firmware - reason: file 'length' data\n" ),wxT("iriver_decode"));
infile.Close();
outfile.Close();
return -1;
@ -339,8 +339,8 @@ int iriver_decode(wxString infile_name, wxString outfile_name, unsigned int modi
if( fp != dwLength2 )
{
ERR_DIALOG( _( "This doesn't look like a valid encrypted "
"iHP firmware - reason: 'length2' mismatch\n" ),_("iriver_decode"));
ERR_DIALOG( wxT( "This doesn't look like a valid encrypted "
"iHP firmware - reason: 'length2' mismatch\n" ),wxT("iriver_decode"));
infile.Close();
outfile.Close();
return -1;
@ -356,8 +356,8 @@ int iriver_decode(wxString infile_name, wxString outfile_name, unsigned int modi
outfile.Write( blockdata, lenread );
if( memcmp( ppChecksums, blockdata, lenread ) != 0 )
{
ERR_DIALOG( _( "This doesn't look like a valid encrypted "
"iHP firmware - reason: Checksum mismatch!" ),_("iriver_decode"));
ERR_DIALOG( wxT( "This doesn't look like a valid encrypted "
"iHP firmware - reason: Checksum mismatch!" ),wxT("iriver_decode"));
infile.Close();
outfile.Close();
return -1;
@ -367,8 +367,8 @@ int iriver_decode(wxString infile_name, wxString outfile_name, unsigned int modi
if( fp != dwLength3 )
{
ERR_DIALOG(_( "This doesn't look like a valid encrypted "
"iHP firmware - reason: 'length3' mismatch\n" ),_("iriver_decode"));
ERR_DIALOG(wxT( "This doesn't look like a valid encrypted "
"iHP firmware - reason: 'length3' mismatch\n" ),wxT("iriver_decode"));
infile.Close();
outfile.Close();
return -1;
@ -419,22 +419,22 @@ int iriver_encode(wxString infile_name, wxString outfile_name, unsigned int modi
if(!infile.Open(infile_name,wxFile::read))
{
err.Printf("Could not open: %s",infile_name.c_str());
ERR_DIALOG(err, _("iriver_decode"));
err.Printf(wxT("Could not open: %s"),infile_name.c_str());
ERR_DIALOG(err, wxT("iriver_decode"));
return -1;
}
if(!outfile.Open(outfile_name,wxFile::write))
{
err.Printf("Could not open: %s",outfile_name.c_str());
ERR_DIALOG(err, _("iriver_decode"));
err.Printf(wxT("Could not open: %s"),outfile_name.c_str());
ERR_DIALOG(err, wxT("iriver_decode"));
return -1;
}
lenread = infile.Read( headerdata, 512 );
if( lenread != 512 )
{
ERR_DIALOG("This doesn't look like a valid decoded "
"iHP firmware - reason: header length\n", _("iriver_decode"));
ERR_DIALOG(wxT("This doesn't look like a valid decoded "
"iHP firmware - reason: header length\n"), wxT("iriver_decode"));
infile.Close();
outfile.Close();
};
@ -447,8 +447,8 @@ int iriver_encode(wxString infile_name, wxString outfile_name, unsigned int modi
i = testheader( headerdata );
if( i == -1 )
{
ERR_DIALOG("This firmware is for an unknown model, or is not"
" a valid decoded iHP firmware\n", _("iriver_decode"));
ERR_DIALOG(wxT("This firmware is for an unknown model, or is not"
" a valid decoded iHP firmware\n"), wxT("iriver_decode"));
infile.Close();
outfile.Close();
};
@ -468,8 +468,8 @@ int iriver_encode(wxString infile_name, wxString outfile_name, unsigned int modi
dwLength3 > dwLength1 ||
dwLength2+dwLength3+512 != dwLength1 )
{
ERR_DIALOG("This doesn't look like a valid decoded iHP"
" firmware - reason: file 'length' data\n", _("iriver_decode"));
ERR_DIALOG(wxT("This doesn't look like a valid decoded iHP"
" firmware - reason: file 'length' data\n"), wxT("iriver_decode"));
infile.Close();
outfile.Close();
};
@ -506,8 +506,8 @@ int iriver_encode(wxString infile_name, wxString outfile_name, unsigned int modi
if( fp != dwLength2 )
{
ERR_DIALOG("This doesn't look like a valid decoded "
"iHP firmware - reason: 'length1' mismatch\n", _("iriver_decode"));
ERR_DIALOG(wxT("This doesn't look like a valid decoded "
"iHP firmware - reason: 'length1' mismatch\n"), wxT("iriver_decode"));
infile.Close();
outfile.Close();
};
@ -526,8 +526,8 @@ int iriver_encode(wxString infile_name, wxString outfile_name, unsigned int modi
if( fp != dwLength3 )
{
ERR_DIALOG("This doesn't look like a valid decoded "
"iHP firmware - reason: 'length2' mismatch\n", _("iriver_decode"));
ERR_DIALOG(wxT("This doesn't look like a valid decoded "
"iHP firmware - reason: 'length2' mismatch\n"), wxT("iriver_decode"));
infile.Close();
outfile.Close();
};
@ -565,30 +565,30 @@ bool PatchFirmware(wxString firmware,wxString bootloader,int series, int table_e
break;
}
name1.Printf("%s" PATH_SEP "download" PATH_SEP "firmware.bin",
name1.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "firmware.bin"),
gv->stdpaths->GetUserDataDir().c_str());
/* descrambled file */
name2.Printf("%s" PATH_SEP "download" PATH_SEP "new.bin",
name2.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "new.bin"),
gv->stdpaths->GetUserDataDir().c_str());
/* patched file */
name3.Printf("%s" PATH_SEP "download" PATH_SEP "new.hex",
name3.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "new.hex"),
gv->stdpaths->GetUserDataDir().c_str());
if (iriver_decode(firmware, name1, FALSE, STRIP_NONE) == -1) {
ERR_DIALOG("Error in descramble", _("Descramble Firmware"));
ERR_DIALOG(wxT("Error in descramble"), wxT("Descramble Firmware"));
wxRemoveFile(name1);
wxRemoveFile(name2);
wxRemoveFile(name3);
return false;
}
if (!mkboot(name1, name2, bootloader, origin)) {
ERR_DIALOG("Error in patching",_("Patching Firmware"));
ERR_DIALOG(wxT("Error in patching"),wxT("Patching Firmware"));
wxRemoveFile(name1);
wxRemoveFile(name2);
wxRemoveFile(name3);
return false;
}
if (iriver_encode(name2, name3, FALSE) == -1) {
ERR_DIALOG("Error in scramble",_("Scramble Firmware"));
ERR_DIALOG(wxT("Error in scramble"),wxT("Scramble Firmware"));
wxRemoveFile(name1);
wxRemoveFile(name2);
wxRemoveFile(name3);
@ -596,7 +596,7 @@ bool PatchFirmware(wxString firmware,wxString bootloader,int series, int table_e
}
/* now md5sum it */
if (!FileMD5(name3, &md5sum_str)) {
ERR_DIALOG("Error in checksumming",_("Checksumming Firmware"));
ERR_DIALOG(wxT("Error in checksumming"),wxT("Checksumming Firmware"));
wxRemoveFile(name1);
wxRemoveFile(name2);
wxRemoveFile(name3);

View file

@ -1,8 +1,8 @@
#define RBUTIL 1
#include <wx/msw/wx.rc>
RBUTIL VERSIONINFO
FILEVERSION 0,2,1,1
PRODUCTVERSION 0,2,1,1
FILEVERSION 0,3,0,0
PRODUCTVERSION 0,3,0,0
FILEOS 0x00000004
FILETYPE 0x00000001
BEGIN
@ -10,12 +10,12 @@ BEGIN
BEGIN
BLOCK "FFFF0000"
BEGIN
VALUE "FileVersion", "0.2.1.1\0"
VALUE "ProductVersion", "0.2.1.1\0"
VALUE "FileVersion", "0.3.0.0\0"
VALUE "ProductVersion", "0.3.0.0\0"
VALUE "CompanyName", "Rockbox Team\0"
VALUE "FileDescription", "Rockbox Utility\0"
VALUE "InternalName", "rbutil\0"
VALUE "LegalCopyright", "(C) 2005,6 Rockbox Team\0"
VALUE "LegalCopyright", "(C) 2005 - 2007 Rockbox Team\0"
VALUE "ProductName", "Rockbox Utility\0"
END
END

View file

@ -82,6 +82,10 @@
<Add library="oleaut32" />
<Add library="uuid" />
<Add library="libwxzlib" />
<Add library="libwxregex" />
<Add library="libwxpng" />
<Add library="libwxjpeg" />
<Add library="libwxtiff" />
<Add directory="$(#WX.lib)\gcc_lib$(WX_CFG)" />
<Add directory="$(#WX.lib)" />
<Add directory=".\" />
@ -127,8 +131,10 @@
<Unit filename="rbutilFrm.cpp" />
<Unit filename="rbutilFrm.h" />
<Unit filename="rbutilFrm_XPM.xpm" />
<Unit filename="themes_3d.xpm" />
<Unit filename="tools2_3d.xpm" />
<Unit filename="uninstall_3d.xpm" />
<Unit filename="untools2_3d.xpm" />
<Unit filename="wizard.xpm" />
<Unit filename="wizard_pages.cpp" />
<Unit filename="wizard_pages.h" />

View file

@ -58,15 +58,70 @@ const wxChar* _rootmatch[] = {
const wxArrayString* rootmatch = new wxArrayString(
(size_t) (sizeof(_rootmatch) / sizeof(wxChar*)), _rootmatch);
bool InstallTheme(wxString Themesrc)
{
wxString dest,src,err;
int pos = Themesrc.Find('/',true);
wxString themename = Themesrc.SubString(pos+1,Themesrc.Length());
src.Printf(wxT("%s/%s"), gv->themes_url.c_str(),Themesrc.c_str());
dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "%s"),
gv->stdpaths->GetUserDataDir().c_str(),themename.c_str());
if( DownloadURL(src, dest) )
{
wxRemoveFile(dest);
err.Printf(wxT("Unable to download %s"), src.c_str() );
ERR_DIALOG(err, wxT("Install Theme"));
return false;
}
if(!checkZip(dest))
{
err.Printf(wxT("The Zip %s does not contain the correct dir structure"), dest.c_str());
ERR_DIALOG(err, wxT("Install Theme"));
return false;
}
if(UnzipFile(dest,gv->curdestdir, true))
{
err.Printf(wxT("Unable to unzip %s to %s"), dest.c_str(), gv->curdestdir.c_str());
ERR_DIALOG(err, wxT("Install Theme"));
return false;
}
return true;
}
bool checkZip(wxString zipname)
{
wxZipEntryPtr entry;
wxFFileInputStream* in_file = new wxFFileInputStream(zipname);
wxZipInputStream* in_zip = new wxZipInputStream(*in_file);
entry.reset(in_zip->GetNextEntry());
wxString name = entry->GetName();
if(entry->IsDir())
{
if(name.Contains(wxT(".rockbox\\")))
{
return true;
}
}
return false;
}
int DownloadURL(wxString src, wxString dest)
{
int input, errnum = 0, success = false;
wxString buf, errstr;
wxLogVerbose(_("=== begin DownloadURL(%s,%s)"), src.c_str(),
wxLogVerbose(wxT("=== begin DownloadURL(%s,%s)"), src.c_str(),
dest.c_str());
buf.Printf(_("Fetching %s"), src.c_str());
wxProgressDialog* progress = new wxProgressDialog(_("Downloading"),
buf.Printf(wxT("Fetching %s"), src.c_str());
wxProgressDialog* progress = new wxProgressDialog(wxT("Downloading"),
buf, 100, NULL, wxPD_APP_MODAL |
wxPD_AUTO_HIDE | wxPD_SMOOTH | wxPD_ELAPSED_TIME |
wxPD_REMAINING_TIME | wxPD_CAN_ABORT);
@ -105,7 +160,7 @@ int DownloadURL(wxString src, wxString dest)
current += os->LastWrite();
if (!progress->Update(current * 100 / filesize))
{
errstr = _("Download aborted by user");
errstr = wxT("Download aborted by user");
errnum = 1000;
break;
}
@ -113,7 +168,7 @@ int DownloadURL(wxString src, wxString dest)
} else
{
errnum = os->GetLastError();
errstr.Printf(_("Can't write to output stream (%s)"),
errstr.Printf(wxT("Can't write to output stream (%s)"),
stream_err_str(errnum).c_str() );
break;
@ -127,7 +182,7 @@ int DownloadURL(wxString src, wxString dest)
errnum = 0;
break;
}
errstr.Printf(_("Can't read from input stream (%s)"),
errstr.Printf(wxT("Can't read from input stream (%s)"),
stream_err_str(errnum).c_str() );
}
}
@ -136,7 +191,7 @@ int DownloadURL(wxString src, wxString dest)
if (! errnum)
{
errnum = os->GetLastError();
errstr.Printf(_("Can't close output file (%s)"),
errstr.Printf(wxT("Can't close output file (%s)"),
stream_err_str(errnum).c_str() );
input = false;
@ -147,26 +202,26 @@ int DownloadURL(wxString src, wxString dest)
} else
{
errnum = is->GetLastError();
errstr.Printf(_("Can't get input stream size (%s)"),
errstr.Printf(wxT("Can't get input stream size (%s)"),
stream_err_str(errnum).c_str() );
}
} else
{
errnum = in_http->GetError();
errstr.Printf(_("Can't get input stream (%d)"), errnum);
errstr.Printf(wxT("Can't get input stream (%d)"), errnum);
}
delete is;
} else
{
errnum = os->GetLastError();
errstr.Printf(_("Can't create output stream (%s)"),
errstr.Printf(wxT("Can't create output stream (%s)"),
stream_err_str(errnum).c_str() );
}
delete os;
} else
{
errstr.Printf(_("Can't open URL %s (%d)"), src.c_str(),
errstr.Printf(wxT("Can't open URL %s (%d)"), src.c_str(),
in_http->GetError() );
errnum = 100;
}
@ -179,19 +234,19 @@ int DownloadURL(wxString src, wxString dest)
if (errnum == 0) errnum = 999;
if (input)
{
buf.Printf(_("%s reading\n%s"),
buf.Printf(wxT("%s reading\n%s"),
errstr.c_str(), src.c_str());
ERR_DIALOG(buf, _("Download URL"));
ERR_DIALOG(buf, wxT("Download URL"));
} else
{
buf.Printf(_("%s writing to download\n/%s"),
buf.Printf(wxT("%s writing to download\n/%s"),
errstr.c_str(), dest.c_str());
ERR_DIALOG(buf, _("Download URL"));
ERR_DIALOG(buf, wxT("Download URL"));
}
}
wxLogVerbose(_("=== end DownloadURL"));
wxLogVerbose(wxT("=== end DownloadURL"));
return errnum;
}
@ -202,7 +257,7 @@ int UnzipFile(wxString src, wxString destdir, bool isInstall)
int errnum = 0, curfile = 0, totalfiles = 0;
InstallLog* log = NULL;
wxLogVerbose(_("===begin UnzipFile(%s,%s,%i)"),
wxLogVerbose(wxT("===begin UnzipFile(%s,%s,%i)"),
src.c_str(), destdir.c_str(), isInstall);
wxFFileInputStream* in_file = new wxFFileInputStream(src);
@ -212,9 +267,9 @@ int UnzipFile(wxString src, wxString destdir, bool isInstall)
if (! in_zip->IsOk() )
{
errnum = in_zip->GetLastError();
buf.Printf(_("Can't open ZIP stream %s for reading (%s)"),
buf.Printf(wxT("Can't open ZIP stream %s for reading (%s)"),
src.c_str(), stream_err_str(errnum).c_str() );
ERR_DIALOG(buf, _("Unzip File") );
ERR_DIALOG(buf, wxT("Unzip File") );
delete in_zip;
delete in_file;
return true;
@ -224,9 +279,9 @@ int UnzipFile(wxString src, wxString destdir, bool isInstall)
if (! in_zip->IsOk() )
{
errnum = in_zip->GetLastError();
buf.Printf(_("Error Getting total ZIP entries for %s (%s)"),
buf.Printf(wxT("Error Getting total ZIP entries for %s (%s)"),
src.c_str(), stream_err_str(errnum).c_str() );
ERR_DIALOG(buf, _("Unzip File") );
ERR_DIALOG(buf, wxT("Unzip File") );
delete in_zip;
delete in_file;
return true;
@ -234,16 +289,16 @@ int UnzipFile(wxString src, wxString destdir, bool isInstall)
} else
{
errnum = in_file->GetLastError();
buf.Printf(_("Can't open %s (%s)"), src.c_str(),
buf.Printf(wxT("Can't open %s (%s)"), src.c_str(),
stream_err_str(errnum).c_str() );
ERR_DIALOG(buf, _("Unzip File") );
ERR_DIALOG(buf, wxT("Unzip File") );
delete in_zip;
delete in_file;
return true;
}
wxProgressDialog* progress = new wxProgressDialog(_("Unpacking archive"),
_("Preparing to unpack the downloaded files to your audio"
wxProgressDialog* progress = new wxProgressDialog(wxT("Unpacking archive"),
wxT("Preparing to unpack the downloaded files to your audio"
"device"), totalfiles, NULL, wxPD_APP_MODAL |
wxPD_AUTO_HIDE | wxPD_SMOOTH | wxPD_ELAPSED_TIME |
wxPD_REMAINING_TIME | wxPD_CAN_ABORT);
@ -262,9 +317,9 @@ int UnzipFile(wxString src, wxString destdir, bool isInstall)
curfile++;
wxString name = entry->GetName();
progress_msg.Printf(_("Unpacking %s"), name.c_str());
progress_msg.Printf(wxT("Unpacking %s"), name.c_str());
if (! progress->Update(curfile, progress_msg) ) {
buf.Printf(_("Unpacking cancelled by user"));
buf.Printf(wxT("Unpacking cancelled by user"));
MESG_DIALOG(buf);
errnum = 1000;
break;
@ -275,7 +330,7 @@ int UnzipFile(wxString src, wxString destdir, bool isInstall)
if (entry->IsDir() ) {
if (!wxDirExists(in_str) ) {
if (! wxMkdir(in_str, 0777) ) {
buf.Printf(_("Unable to create directory %s"),
buf.Printf(wxT("Unable to create directory %s"),
in_str.c_str() );
errnum = 100;
break;
@ -288,7 +343,7 @@ int UnzipFile(wxString src, wxString destdir, bool isInstall)
wxFFileOutputStream* out = new wxFFileOutputStream(in_str);
if (! out->IsOk() )
{
buf.Printf(_("Can't open file %s for writing"), in_str.c_str() );
buf.Printf(wxT("Can't open file %s for writing"), in_str.c_str() );
delete out;
return 100;
} else if (isInstall)
@ -298,19 +353,19 @@ int UnzipFile(wxString src, wxString destdir, bool isInstall)
in_zip->Read(*out);
if (! out->IsOk()) {
buf.Printf(_("Can't write to %s (%d)"), in_str.c_str(),
buf.Printf(wxT("Can't write to %s (%d)"), in_str.c_str(),
errnum = out->GetLastError() );
}
if (!in_zip->IsOk() && ! in_file->GetLastError() == wxSTREAM_EOF)
{
buf.Printf(_("Can't read from %s (%d)"), src.c_str(),
buf.Printf(wxT("Can't read from %s (%d)"), src.c_str(),
errnum = in_file->GetLastError() );
}
if (! out->Close() && errnum == 0)
{
buf.Printf(_("Unable to close %s (%d)"), in_str.c_str(),
buf.Printf(wxT("Unable to close %s (%d)"), in_str.c_str(),
errnum = out->GetLastError() );
}
@ -323,11 +378,11 @@ int UnzipFile(wxString src, wxString destdir, bool isInstall)
if (errnum)
{
ERR_DIALOG(buf, _("Unzip File"));
ERR_DIALOG(buf, wxT("Unzip File"));
}
if (log) delete log;
wxLogVerbose(_("=== end UnzipFile"));
wxLogVerbose(wxT("=== end UnzipFile"));
return(errnum);
}
@ -339,10 +394,10 @@ int Uninstall(const wxString dir, bool isFullUninstall) {
InstallLog *log = NULL;
wxArrayString* FilesToRemove = NULL;
wxLogVerbose(_("=== begin Uninstall(%s,%i)"), dir.c_str(), isFullUninstall);
wxLogVerbose(wxT("=== begin Uninstall(%s,%i)"), dir.c_str(), isFullUninstall);
wxProgressDialog* progress = new wxProgressDialog(_("Uninstalling"),
_("Reading uninstall data from jukebox"), 100, NULL,
wxProgressDialog* progress = new wxProgressDialog(wxT("Uninstalling"),
wxT("Reading uninstall data from jukebox"), 100, NULL,
wxPD_APP_MODAL | wxPD_AUTO_HIDE | wxPD_SMOOTH |
wxPD_ELAPSED_TIME | wxPD_REMAINING_TIME | wxPD_CAN_ABORT);
progress->Update(0);
@ -358,19 +413,19 @@ int Uninstall(const wxString dir, bool isFullUninstall) {
if (FilesToRemove == NULL || FilesToRemove->GetCount() < 1) {
wxLogNull lognull;
if ( wxMessageDialog(NULL,
_("Rockbox Utility can't find any uninstall data on this "
wxT("Rockbox Utility can't find any uninstall data on this "
"jukebox.\n"
"Would you like to attempt a full uninstall?\n"
"(WARNING: A full uninstall removes all files in your Rockbox "
"folder)"),
_("Standard uninstall not possible"),
wxT("Standard uninstall not possible"),
wxICON_EXCLAMATION | wxYES_NO | wxNO_DEFAULT).ShowModal()
== wxID_YES)
{
isFullUninstall = true;
}
else {
MESG_DIALOG(_("Uninstall cancelled by user"));
MESG_DIALOG(wxT("Uninstall cancelled by user"));
delete progress;
return 1000;
}
@ -382,8 +437,8 @@ int Uninstall(const wxString dir, bool isFullUninstall) {
buf.Printf(wxT("%s" PATH_SEP ".rockbox"), dir.c_str());
if (rm_rf(buf) )
{
WARN_DIALOG(_("Unable to completely remove Rockbox directory"),
_("Full uninstall") );
WARN_DIALOG(wxT("Unable to completely remove Rockbox directory"),
wxT("Full uninstall") );
errflag = true;
}
@ -413,8 +468,8 @@ int Uninstall(const wxString dir, bool isFullUninstall) {
{
if (! wxRemoveFile((*special)[i]) )
{
buf.Printf(_("Can't delete %s"), (*special)[i].c_str());
WARN_DIALOG(buf.c_str(), _("Full uninstall"));
buf.Printf(wxT("Can't delete %s"), (*special)[i].c_str());
WARN_DIALOG(buf.c_str(), wxT("Full uninstall"));
errflag = true;
}
}
@ -441,11 +496,11 @@ int Uninstall(const wxString dir, bool isFullUninstall) {
wxString* buf2 = new wxString;
buf.Printf("%s%s", dir.c_str() , FilesToRemove->Item(i).c_str() );
buf2->Format(_("Deleting %s"), buf.c_str());
buf2->Format(wxT("Deleting %s"), buf.c_str());
if (! progress->Update((i + 1) * 100 / totalfiles, *buf2) )
{
WARN_DIALOG(_("Cancelled by user"), _("Normal Uninstall"));
WARN_DIALOG(wxT("Cancelled by user"), wxT("Normal Uninstall"));
delete progress;
return true;
}
@ -463,41 +518,41 @@ int Uninstall(const wxString dir, bool isFullUninstall) {
if ( rc = ! wxRmdir(buf) )
{
buf = buf.Format(_("Can't remove directory %s"),
buf = buf.Format(wxT("Can't remove directory %s"),
buf.c_str());
errflag = true;
WARN_DIALOG(buf.c_str(), _("Standard uninstall"));
WARN_DIALOG(buf.c_str(), wxT("Standard uninstall"));
}
} else if (wxFileExists(buf) )
{
if ( rc = ! wxRemoveFile(buf) )
{
buf = buf.Format(_("Can't delete file %s"),
buf = buf.Format(wxT("Can't delete file %s"),
buf.c_str());
errflag = true;
WARN_DIALOG(buf.c_str(), _("Standard uninstall"));
WARN_DIALOG(buf.c_str(), wxT("Standard uninstall"));
}
} else
{
errflag = true;
buf = buf.Format(_("Can't find file or directory %s"),
buf = buf.Format(wxT("Can't find file or directory %s"),
buf.c_str() );
WARN_DIALOG(buf.c_str(), _("Standard uninstall") );
WARN_DIALOG(buf.c_str(), wxT("Standard uninstall") );
}
uninst = uninst.AfterFirst('\n');
}
if (errflag)
{
ERR_DIALOG(_("Unable to remove some files"),
_("Standard uninstall")) ;
ERR_DIALOG(wxT("Unable to remove some files"),
wxT("Standard uninstall")) ;
}
if (FilesToRemove != NULL) delete FilesToRemove;
}
delete progress;
wxLogVerbose(_("=== end Uninstall"));
wxLogVerbose(wxT("=== end Uninstall"));
return errflag;
}
@ -553,8 +608,8 @@ bool InstallRbutil(wxString dest)
if (! wxMkdir(destdir, 0777) )
{
buf.Printf(wxT("%s (%s)"),
_("Unable to create directory for installer"), destdir.c_str());
WARN_DIALOG(buf , _("Portable install") );
wxT("Unable to create directory for installer"), destdir.c_str());
WARN_DIALOG(buf , wxT("Portable install") );
return false;
}
log->WriteFile(wxT("RockboxUtility"), true);
@ -564,7 +619,7 @@ bool InstallRbutil(wxString dest)
wxDIR_FILES);
if (filestocopy.GetCount() < 1)
{
WARN_DIALOG(_("No files to copy"), _("Portable install") );
WARN_DIALOG(wxT("No files to copy"), wxT("Portable install") );
return false;
}
@ -581,8 +636,8 @@ bool InstallRbutil(wxString dest)
if (! wxCopyFile(filestocopy[i], dstr) )
{
buf.Printf(wxT("%s (%s -> %s)"),
_("Error copying file"), filestocopy[i].c_str(), dstr.c_str());
WARN_DIALOG(buf, _("Portable Install") );
wxT("Error copying file"), filestocopy[i].c_str(), dstr.c_str());
WARN_DIALOG(buf, wxT("Portable Install") );
return false;
}
buf = dstr;
@ -599,7 +654,7 @@ bool InstallRbutil(wxString dest)
{
buf.Printf(wxT("Can't copy program binary %s -> %s"),
str.c_str(), dstr.c_str() );
WARN_DIALOG(buf, _("Portable Install") );
WARN_DIALOG(buf, wxT("Portable Install") );
return false;
}
buf = dstr;
@ -613,9 +668,9 @@ bool InstallRbutil(wxString dest)
if (! wxCopyFile(gv->UserConfigFile, dstr) )
{
buf.Printf(wxT("%s (%s -> %s)"),
_("Unable to install user config file"), gv->UserConfigFile.c_str(),
wxT("Unable to install user config file"), gv->UserConfigFile.c_str(),
dstr.c_str() );
WARN_DIALOG(buf, _("Portable Install") );
WARN_DIALOG(buf, wxT("Portable Install") );
return false;
}
buf = dstr;
@ -628,7 +683,7 @@ bool InstallRbutil(wxString dest)
bool rm_rf(wxString file)
{
wxLogVerbose(_("=== begin rm-rf(%s)"), file.c_str() );
wxLogVerbose(wxT("=== begin rm-rf(%s)"), file.c_str() );
wxString buf;
wxArrayString selected;
@ -649,8 +704,8 @@ bool rm_rf(wxString file)
selected.Sort(true);
selected.Add(file);
wxProgressDialog* progress = new wxProgressDialog(_("Removing files"),
_("Deleting files"), selected.GetCount(), NULL,
wxProgressDialog* progress = new wxProgressDialog(wxT("Removing files"),
wxT("Deleting files"), selected.GetCount(), NULL,
wxPD_APP_MODAL | wxPD_AUTO_HIDE | wxPD_SMOOTH |
wxPD_ELAPSED_TIME | wxPD_REMAINING_TIME | wxPD_CAN_ABORT);
@ -659,10 +714,10 @@ bool rm_rf(wxString file)
wxLogVerbose(selected[i]);
if (progress != NULL)
{
buf.Printf(_("Deleting %s"), selected[i].c_str() );
buf.Printf(wxT("Deleting %s"), selected[i].c_str() );
if (! progress->Update(i, buf))
{
WARN_DIALOG(_("Cancelled by user"), _("Erase Files"));
WARN_DIALOG(wxT("Cancelled by user"), wxT("Erase Files"));
delete progress;
return true;
}
@ -672,27 +727,27 @@ bool rm_rf(wxString file)
{
if (rc = ! wxRmdir(selected[i]) )
{
buf.Printf(_("Can't remove directory %s"),
buf.Printf(wxT("Can't remove directory %s"),
selected[i].c_str());
errflag = true;
WARN_DIALOG(buf.c_str(), _("Erase files"));
WARN_DIALOG(buf.c_str(), wxT("Erase files"));
}
} else if (rc = ! wxRemoveFile(selected[i]) )
{
buf.Printf(_("Error deleting file %s"), selected[i].c_str() );
buf.Printf(wxT("Error deleting file %s"), selected[i].c_str() );
errflag = true;
WARN_DIALOG(buf.c_str(),_("Erase files"));
WARN_DIALOG(buf.c_str(),wxT("Erase files"));
}
}
delete progress;
} else
{
buf.Printf(_("Can't find expected file %s"), file.c_str());
WARN_DIALOG(buf.c_str(), _("Erase files"));
buf.Printf(wxT("Can't find expected file %s"), file.c_str());
WARN_DIALOG(buf.c_str(), wxT("Erase files"));
return true;
}
wxLogVerbose(_("=== end rm-rf"));
wxLogVerbose(wxT("=== end rm-rf"));
return rc ? true : false;
}

View file

@ -90,6 +90,7 @@ public:
wxArrayString plat_bootloadername;
wxArrayInt plat_autodetect;
wxArrayString plat_combinedname;
wxArrayString plat_resolution;
wxString download_url;
wxString daily_url;
wxString bleeding_url;
@ -98,6 +99,7 @@ public:
wxString last_release;
wxString prog_name;
wxString bootloader_url;
wxString themes_url;
// User configuration data.
wxString curplat;
@ -110,6 +112,8 @@ public:
wxString curbootloadermethod;
wxString curbootloader;
wxString curfirmware;
wxString curresolution;
wxArrayString themesToInstall;
// Global system variables
wxFFile* logfile;
@ -126,6 +130,8 @@ int DownloadURL(wxString src, wxString dest);
int UnzipFile(wxString src, wxString destdir, bool isInstall = false);
int Uninstall(const wxString dir, bool isFullUninstall = false);
bool InstallRbutil(wxString dest);
bool InstallTheme(wxString src);
bool checkZip(wxString zipname);
wxString stream_err_str(int errnum);
bool rm_rf(wxString file);

View file

@ -7,6 +7,7 @@ font_url=http://www.rockbox.org/daily/fonts/rockbox-fonts-
last_release=2.5
prog_name=rockbox
bootloader_url=http://download.rockbox.org/bootloader
themes_url=http://www.rockbox-themes.org/
[platforms]
platform1=player
@ -44,6 +45,7 @@ bootloadermethod=
bootloadername=
autodetect=no
combinedname=
resolution=11x2x1
[recorder]
name=Archos Jukebox Recorder 10, 20
@ -54,6 +56,7 @@ bootloadermethod=
bootloadername=
autodetect=no
combinedname=
resolution=112x64x1
[recorder8mb]
name=Archos Jukebox Recorder 10, 20 (with 8mb memory)
@ -64,6 +67,7 @@ bootloadermethod=
bootloadername=
autodetect=no
combinedname=
resolution=112x64x1
[recorderv2]
name=Archos Jukebox Recorder v2 (20GB)
@ -74,6 +78,7 @@ bootloadermethod=
bootloadername=
autodetect=no
combinedname=
resolution=112x64x1
[fmrecorder]
name=Archos Jukebox Recorder FM
@ -84,6 +89,7 @@ bootloadermethod=
bootloadername=
autodetect=no
combinedname=
resolution=112x64x1
[fmrecorder8mb]
name=Archos Jukebox Recorder FM (with 8mb memory)
@ -94,6 +100,7 @@ bootloadermethod=
bootloadername=
autodetect=no
combinedname=
resolution=112x64x1
[ondiosp]
name=Archos Ondio SP
@ -104,6 +111,7 @@ bootloadermethod=
bootloadername=
autodetect=no
combinedname=
resolution=112x64x1
[ondiofm]
name=Archos Ondio FM
@ -114,6 +122,7 @@ bootloadermethod=
bootloadername=
autodetect=no
combinedname=
resolution=112x64x1
[h100]
name=Iriver iHP100, iHP110
@ -124,6 +133,7 @@ bootloadermethod=fwpatcher
bootloadername=bootloader-h100.bin
autodetect=no
combinedname=
resolution=160x128x2
[h120]
name=Iriver iHP120, iHP140, H120, H140
@ -134,6 +144,7 @@ bootloadermethod=fwpatcher
bootloadername=bootloader-h120.bin
autodetect=no
combinedname=
resolution=160x128x2
[h300]
name=Iriver H320, H340
@ -144,9 +155,10 @@ bootloadermethod=fwpatcher
bootloadername=bootloader-h300.bin
autodetect=no
combinedname=
resolution=220x176x16
[h10_5gbums]
name=Iriver H10 (5GB) UMS
name=Iriver H10 (5/6GB) UMS
platform=h10_5gb
released=no
needsbootloader=yes
@ -154,9 +166,10 @@ bootloadermethod=h10
bootloadername=H10.mi4
autodetect=no
combinedname=
resolution=128x128x16
[h10_5gbmtp]
name=Iriver H10 (5GB) MTP
name=Iriver H10 (5/6GB) MTP
platform=h10_5gb
released=no
needsbootloader=yes
@ -164,6 +177,7 @@ bootloadermethod=h10
bootloadername=H10_5GB-MTP/H10.mi4
autodetect=no
combinedname=
resolution=128x128x16
[h10]
name=Iriver H10 (20GB)
@ -174,6 +188,7 @@ bootloadermethod=h10
bootloadername=H10_20GC.mi4
autodetect=no
combinedname=
resolution=160x128x16
[ipodcolor]
name=Apple Ipod Colour/Photo/U2 (4th gen)
@ -184,6 +199,7 @@ bootloadermethod=ipodpatcher
bootloadername=none
autodetect=yes
combinedname=Ipod mini 1g, mini 2g, 3g, 4g, color, video, nano 1g
resolution=220x176x16
[ipodnano]
name=Apple Ipod Nano (1st gen)
@ -194,6 +210,7 @@ bootloadermethod=ipodpatcher
bootloadername=none
autodetect=yes
combinedname=Ipod mini 1g, mini 2g, 3g, 4g, color, video, nano 1g
resolution=176x132x16
[ipod4gray]
name=Apple Ipod (4th gen, greyscale)
@ -204,6 +221,7 @@ bootloadermethod=ipodpatcher
bootloadername=none
autodetect=yes
combinedname=Ipod mini 1g, mini 2g, 3g, 4g, color, video, nano 1g
resolution=160x128x2
[ipodvideo]
name=Apple Ipod Video (5th gen)
@ -214,6 +232,7 @@ bootloadermethod=ipodpatcher
bootloadername=none
autodetect=yes
combinedname=Ipod mini 1g, mini 2g, 3g, 4g, color, video, nano 1g
resolution=320x240x16
[ipod3g]
name=Apple Ipod (3rd gen)
@ -224,6 +243,7 @@ bootloadermethod=ipodpatcher
bootloadername=none
autodetect=yes
combinedname=Ipod mini 1g, mini 2g, 3g, 4g, color, video, nano 1g
resolution=160x128x2
[ipodmini1g]
name=Apple Ipod Mini (1st gen)
@ -234,6 +254,7 @@ bootloadermethod=ipodpatcher
bootloadername=none
autodetect=yes
combinedname=Ipod mini 1g, mini 2g, 3g, 4g, color, video, nano 1g
resolution=138x110x2
[ipodmini2g]
name=Apple Ipod Mini (2nd gen)
@ -244,6 +265,7 @@ bootloadermethod=ipodpatcher
bootloadername=none
autodetect=yes
combinedname=Ipod mini 1g, mini 2g, 3g, 4g, color, video, nano 1g
resolution=138x110x2
[iaudiox5]
name=Cowon iAudio X5 , X5L
@ -254,6 +276,7 @@ bootloadermethod=iaudio
bootloadername=x5_fw.bin
autodetect=no
combinedname=
resolution=160x128x16
[iaudiox5v]
name=Cowon iAudio X5V
@ -264,6 +287,7 @@ bootloadermethod=iaudio
bootloadername=x5v_fw.bin
autodetect=no
combinedname=
resolution=160x128x2
[iaudiom5]
name=Cowon iAudio M5 , M5L
@ -274,6 +298,7 @@ bootloadermethod=iaudio
bootloadername=m5_fw.bin
autodetect=no
combinedname=
resolution=160x128x16
[gigabeatf]
name=Toshiba Gigabeat F , X
@ -283,3 +308,4 @@ bootloadermethod=gigabeatf
bootloadername=FWIMG01.DAT
autodetect=no
combinedname=
resolution=240x320x16

View file

@ -27,7 +27,7 @@ IMPLEMENT_APP(rbutilFrmApp)
bool rbutilFrmApp::OnInit()
{
wxString buf = "";
wxString buf = wxT("");
wxLogVerbose(wxT("=== begin rbutilFrmApp::Oninit()"));
@ -48,7 +48,7 @@ bool rbutilFrmApp::OnInit()
wxLogNull lognull;
if (! wxMkdir(buf, 0777))
{
wxLogFatalError(_("Can't create data directory %s"),
wxLogFatalError(wxT("Can't create data directory %s"),
buf.c_str());
}
}
@ -56,7 +56,7 @@ bool rbutilFrmApp::OnInit()
buf += wxT(PATH_SEP "rbutil.log");
gv->logfile = new wxFFile(buf, "w");
if (! gv->logfile->IsOpened() )
wxLogFatalError(_("Unable to open log file"));
wxLogFatalError(wxT("Unable to open log file"));
gv->loggui = new wxLogGui();
gv->loggui->SetActiveTarget(gv->loggui);
@ -73,7 +73,7 @@ bool rbutilFrmApp::OnInit()
if (!ReadGlobalConfig(NULL))
{
ERR_DIALOG(gv->ErrStr->GetData(), _("Rockbox Utility"));
ERR_DIALOG(gv->ErrStr->GetData(), wxT("Rockbox Utility"));
return FALSE;
}
ReadUserConfig();
@ -83,6 +83,8 @@ bool rbutilFrmApp::OnInit()
myFrame->Show(TRUE);
initIpodpatcher(); // reserve mem for ipodpatcher
wxInitAllImageHandlers(); //init Image handlers
wxLogVerbose(wxT("=== end rbUtilFrmApp::OnInit()"));
return TRUE;
}
@ -136,7 +138,7 @@ bool rbutilFrmApp::ReadGlobalConfig(rbutilFrm* myFrame)
wxFileInputStream* cfgis = new wxFileInputStream(buf);
if (!cfgis->CanRead()) {
gv->ErrStr = new wxString(_("Unable to open configuration file"));
gv->ErrStr = new wxString(wxT("Unable to open configuration file"));
return false;
}
@ -175,6 +177,9 @@ bool rbutilFrmApp::ReadGlobalConfig(rbutilFrm* myFrame)
gv->GlobalConfig->Read(buf.Format(wxT("/%s/combinedname"),
cur.c_str()), &tmpstr);
gv->plat_combinedname.Add(tmpstr);
gv->GlobalConfig->Read(buf.Format(wxT("/%s/resolution"),
cur.c_str()), &tmpstr);
gv->plat_resolution.Add(tmpstr);
i++;
}
@ -210,6 +215,9 @@ bool rbutilFrmApp::ReadGlobalConfig(rbutilFrm* myFrame)
gv->GlobalConfig->Read(wxT("bootloader_url"), &tmpstr);
gv->bootloader_url = tmpstr;
gv->GlobalConfig->Read(wxT("themes_url"), &tmpstr);
gv->themes_url = tmpstr;
#ifdef __WXMSW__
gv->curdestdir = wxT("D:\\");
#else

View file

@ -27,6 +27,8 @@
#include "fonts_3d.xpm"
#include "tools2_3d.xpm"
#include "rblogo.xpm"
#include "untools2_3d.xpm"
#include "themes_3d.xpm"
#include "bootloaders.h"
@ -40,6 +42,7 @@ BEGIN_EVENT_TABLE(rbutilFrm,wxFrame)
EVT_BUTTON (ID_INSTALL_BTN, rbutilFrm::OnInstallBtn)
EVT_BUTTON (ID_REMOVE_BTN, rbutilFrm::OnRemoveBtn)
EVT_BUTTON (ID_FONT_BTN, rbutilFrm::OnFontBtn)
EVT_BUTTON (ID_THEMES_BTN, rbutilFrm::OnThemesBtn)
EVT_BUTTON (ID_BOOTLOADER_BTN, rbutilFrm::OnBootloaderBtn)
EVT_BUTTON (ID_BOOTLOADERREMOVE_BTN, rbutilFrm::OnBootloaderRemoveBtn)
@ -83,7 +86,7 @@ void rbutilFrm::CreateGUIControls(void)
WxBoxSizer2->Add(WxStaticBitmap1,0,wxALIGN_CENTER_HORIZONTAL | wxALL,5);
wxStaticBox* WxStaticBoxSizer3_StaticBoxObj = new wxStaticBox(WxPanel1,
wxID_ANY, _("Please choose an option"));
wxID_ANY, wxT("Please choose an option"));
wxStaticBoxSizer* WxStaticBoxSizer3 =
new wxStaticBoxSizer(WxStaticBoxSizer3_StaticBoxObj,wxHORIZONTAL);
WxBoxSizer2->Add(WxStaticBoxSizer3,1,wxALIGN_CENTER_HORIZONTAL | wxALL, 5);
@ -95,13 +98,13 @@ void rbutilFrm::CreateGUIControls(void)
WxBitmapButton4 = new wxBitmapButton(WxPanel1, ID_BOOTLOADER_BTN,
BootloaderInstallButton, wxPoint(0,0), wxSize(64,54),
wxRAISED_BORDER | wxBU_AUTODRAW);
WxBitmapButton4->SetToolTip(_("Instructions for installing the "
WxBitmapButton4->SetToolTip(wxT("Instructions for installing the "
"Rockbox bootloader on your audio device"));
WxFlexGridSizer1->Add(WxBitmapButton4, 0,
wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5);
wxStaticText* WxStaticText5 = new wxStaticText(WxPanel1, wxID_ANY,
_("Bootloader installation instructions\n\n"
wxT("Bootloader installation instructions\n\n"
"Before Rockbox can be installed on your audio player, you "
"may have to\ninstall a bootloader. This can not currently "
"be done automatically, but is\nonly necessary the first time "
@ -114,12 +117,12 @@ void rbutilFrm::CreateGUIControls(void)
WxBitmapButton1_BITMAP, wxPoint(0,0), wxSize(64,54),
wxRAISED_BORDER | wxBU_AUTODRAW, wxDefaultValidator,
wxT("WxBitmapButton1"));
WxBitmapButton1->SetToolTip(_("Install Rockbox"));
WxBitmapButton1->SetToolTip(wxT("Install Rockbox"));
WxFlexGridSizer1->Add(WxBitmapButton1,0,
wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5);
WxStaticText2 = new wxStaticText(WxPanel1, ID_WXSTATICTEXT2,
_("Install Rockbox on your audio player"));
wxT("Install Rockbox on your audio player"));
WxFlexGridSizer1->Add(WxStaticText2,0,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5);
@ -127,13 +130,13 @@ void rbutilFrm::CreateGUIControls(void)
WxBitmapButton3 = new wxBitmapButton(WxPanel1, ID_FONT_BTN,
FontInstallButton, wxPoint(0,0), wxSize(64,54),
wxRAISED_BORDER | wxBU_AUTODRAW);
WxBitmapButton3->SetToolTip(_("Download the most up to date "
WxBitmapButton3->SetToolTip(wxT("Download the most up to date "
"Rockbox fonts."));
WxFlexGridSizer1->Add(WxBitmapButton3, 0,
wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5);
wxStaticText* WxStaticText4 = new wxStaticText(WxPanel1, wxID_ANY,
_("Install the Rockbox fonts package\n\n"
wxT("Install the Rockbox fonts package\n\n"
"This step is only needed if you have installed "
"a daily build and want\nthe full set of Rockbox fonts. You "
"will not need to download these\nagain unless you uninstall "
@ -141,48 +144,62 @@ void rbutilFrm::CreateGUIControls(void)
WxFlexGridSizer1->Add(WxStaticText4, 0,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5);
wxBitmap ThemesInstallButton (themes_3d_xpm);
WxBitmapButton5 = new wxBitmapButton(WxPanel1, ID_THEMES_BTN,
ThemesInstallButton, wxPoint(0,0), wxSize(64,54),
wxRAISED_BORDER | wxBU_AUTODRAW);
WxBitmapButton5->SetToolTip(wxT("Download other Themes for Rockbox."));
WxFlexGridSizer1->Add(WxBitmapButton5, 0,
wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5);
wxStaticText* WxStaticText6 = new wxStaticText(WxPanel1, wxID_ANY,
wxT("Install more Themes for Rockbox.\n\n"));
WxFlexGridSizer1->Add(WxStaticText6, 0,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5);
wxBitmap WxBitmapButton2_BITMAP (uninstall_3d_xpm);
WxBitmapButton2 = new wxBitmapButton(WxPanel1, ID_REMOVE_BTN,
WxBitmapButton2_BITMAP, wxPoint(0,0), wxSize(64,54),
wxRAISED_BORDER | wxBU_AUTODRAW, wxDefaultValidator,
wxT("WxBitmapButton2"));
WxBitmapButton2->SetToolTip(_("Uninstall Rockbox"));
WxBitmapButton2->SetToolTip(wxT("Uninstall Rockbox"));
WxFlexGridSizer1->Add(WxBitmapButton2,0,
wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5);
WxStaticText3 = new wxStaticText(WxPanel1, ID_WXSTATICTEXT3,
_("Remove Rockbox from your audio player"));
wxT("Remove Rockbox from your audio player"));
WxFlexGridSizer1->Add(WxStaticText3,0,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5);
wxBitmap WxBitmapButton4_BITMAP (uninstall_3d_xpm);
wxBitmap WxBitmapButton4_BITMAP (untools2_3d_xpm);
WxBitmapButton4 = new wxBitmapButton(WxPanel1, ID_BOOTLOADERREMOVE_BTN,
WxBitmapButton4_BITMAP, wxPoint(0,0), wxSize(64,54),
wxRAISED_BORDER | wxBU_AUTODRAW, wxDefaultValidator,
wxT("WxBitmapButton4"));
WxBitmapButton4->SetToolTip(_("Uninstall Bootloader"));
WxBitmapButton4->SetToolTip(wxT("Uninstall Bootloader"));
WxFlexGridSizer1->Add(WxBitmapButton4,0,
wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL | wxALL,5);
WxStaticText4 = new wxStaticText(WxPanel1, ID_WXSTATICTEXT4,
_("Remove Rockbox Bootloader from your audio player"));
wxT("Remove Rockbox Bootloader from your audio player"));
WxFlexGridSizer1->Add(WxStaticText4,0,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL,5);
WxMenuBar1 = new wxMenuBar();
wxMenu *ID_FILE_MENU_Mnu_Obj = new wxMenu(0);
WxMenuBar1->Append(ID_FILE_MENU_Mnu_Obj, _("&File"));
WxMenuBar1->Append(ID_FILE_MENU_Mnu_Obj, wxT("&File"));
ID_FILE_MENU_Mnu_Obj->Append(ID_FILE_WIPECACHE,
_("&Empty local download cache"), wxT(""), wxITEM_NORMAL);
wxT("&Empty local download cache"), wxT(""), wxITEM_NORMAL);
if (! gv->portable )
{
ID_FILE_MENU_Mnu_Obj->Append(ID_PORTABLE_INSTALL,
_("&Install Rockbox Utility on device"), wxT(""), wxITEM_NORMAL);
wxT("&Install Rockbox Utility on device"), wxT(""), wxITEM_NORMAL);
}
ID_FILE_MENU_Mnu_Obj->Append(ID_FILE_ABOUT, _("&About"), wxT(""),
ID_FILE_MENU_Mnu_Obj->Append(ID_FILE_ABOUT, wxT("&About"), wxT(""),
wxITEM_NORMAL);
ID_FILE_MENU_Mnu_Obj->Append(ID_FILE_EXIT, _("E&xit\tCtrl+X"), wxT(""),
ID_FILE_MENU_Mnu_Obj->Append(ID_FILE_EXIT, wxT("E&xit\tCtrl+X"), wxT(""),
wxITEM_NORMAL);
this->SetMenuBar(WxMenuBar1);
@ -191,24 +208,24 @@ void rbutilFrm::CreateGUIControls(void)
GetSizer()->SetSizeHints(this);
if (gv->portable)
{
this->SetTitle(_("Rockbox Utility (portable)"));
this->SetTitle(wxT("Rockbox Utility (portable)"));
} else
{
this->SetTitle(_("Rockbox Utility"));
this->SetTitle(wxT("Rockbox Utility"));
}
this->Center();
wxIcon rbutilFrm_ICON (rbutilFrm_XPM);
this->SetIcon(rbutilFrm_XPM);
this->SetToolTip(wxT("Install Rockbox"));
wxLogVerbose("=== end rbutilFrm::CreateGUIControls");
wxLogVerbose(wxT("=== end rbutilFrm::CreateGUIControls"));
}
void rbutilFrm::rbutilFrmClose(wxCloseEvent& event)
{
wxLogVerbose("=== begin rbutilFrm::rbutilFrmClose(event)");
wxLogVerbose(wxT("=== begin rbutilFrm::rbutilFrmClose(event)"));
Destroy();
wxLogVerbose("=== end rbutilFrm::rbutilFrmClose");
wxLogVerbose(wxT("=== end rbutilFrm::rbutilFrmClose"));
}
@ -217,9 +234,9 @@ void rbutilFrm::rbutilFrmClose(wxCloseEvent& event)
*/
void rbutilFrm::OnFileExit(wxCommandEvent& event)
{
wxLogVerbose("=== begin rbutilFrm::OnFileExit(event)");
wxLogVerbose(wxT("=== begin rbutilFrm::OnFileExit(event)"));
Close();
wxLogVerbose("=== end rbutilFrm::OnFileExit");
wxLogVerbose(wxT("=== end rbutilFrm::OnFileExit"));
}
// The routines this code uses are in the wxWidgets documentation, but
@ -230,11 +247,11 @@ void rbutilFrm::OnFileAbout(wxCommandEvent& event)
/*
wxAboutDialogInfo *info = new wxAboutDialogInfo();
info->SetName(_(RBUTIL_FULLNAME));
info->SetVersion(_(RBUTIL_VERSION));
info->SetCopyright(_(RBUTIL_COPYRIGHT));
info->SetDescription(_(RBUTIL_DESCRIPTION));
info->SetWebSite(_(RBUTIL_WEBSITE));
info->SetName(wxT(RBUTIL_FULLNAME));
info->SetVersion(wxT(RBUTIL_VERSION));
info->SetCopyright(wxT(RBUTIL_COPYRIGHT));
info->SetDescription(wxT(RBUTIL_DESCRIPTION));
info->SetWebSite(wxT(RBUTIL_WEBSITE));
long i = 0;
while (rbutil_developers[i] != "")
@ -256,8 +273,8 @@ void rbutilFrm::OnFileWipeCache(wxCommandEvent& event)
datadir = gv->stdpaths->GetUserDataDir();
if (datadir == "")
{
ERR_DIALOG(_("Can't locate user data directory. Unable to delete "
"cache."), _("Delete download cache.") );
ERR_DIALOG(wxT("Can't locate user data directory. Unable to delete "
"cache."), wxT("Delete download cache.") );
return;
}
@ -266,13 +283,13 @@ void rbutilFrm::OnFileWipeCache(wxCommandEvent& event)
if (! rm_rf(cacheloc) )
{
wxMessageDialog* msg = new wxMessageDialog(this, _("Local download cache has been deleted.")
wxMessageDialog* msg = new wxMessageDialog(this, wxT("Local download cache has been deleted.")
,"Cache deletion", wxOK |wxICON_INFORMATION);
msg->ShowModal();
delete msg;
}
else {
MESG_DIALOG(_("Errors occured deleting the local download cache."));
MESG_DIALOG(wxT("Errors occured deleting the local download cache."));
}
wxMkdir(cacheloc, 0777);
@ -280,10 +297,10 @@ void rbutilFrm::OnFileWipeCache(wxCommandEvent& event)
void rbutilFrm::OnBootloaderRemoveBtn(wxCommandEvent& event)
{
wxLogVerbose("=== begin rbutilFrm::OnBootloaderRemoveBtn(event)");
wxLogVerbose(wxT("=== begin rbutilFrm::OnBootloaderRemoveBtn(event)"));
wxWizard *wizard = new wxWizard(this, wxID_ANY,
_("Rockbox Bootloader Uninstallation Wizard"),
wxT("Rockbox Bootloader Uninstallation Wizard"),
wxBitmap(wizard_xpm),
wxDefaultPosition,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
@ -302,83 +319,83 @@ void rbutilFrm::OnBootloaderRemoveBtn(wxCommandEvent& event)
if (wizard->RunWizard(page1) )
{
// uninstall the bootloader
if(gv->curbootloadermethod == "ipodpatcher")
if(gv->curbootloadermethod == wxT("ipodpatcher"))
{
if(ipodpatcher(BOOTLOADER_REM))
{
wxMessageDialog* msg = new wxMessageDialog(this, _("The Bootloader has been uninstalled.")
,"Uninstallation", wxOK |wxICON_INFORMATION);
wxMessageDialog* msg = new wxMessageDialog(this, wxT("The Bootloader has been uninstalled.")
,wxT("Uninstallation"), wxOK |wxICON_INFORMATION);
msg->ShowModal();
delete msg;
}
else
{
MESG_DIALOG(_("The Uninstallation has failed.") );
MESG_DIALOG(wxT("The Uninstallation has failed.") );
}
}
else if(gv->curbootloadermethod == "gigabeatf")
else if(gv->curbootloadermethod == wxT("gigabeatf"))
{
if(gigabeatf(BOOTLOADER_REM))
{
wxMessageDialog* msg = new wxMessageDialog(this, _("The Bootloader has been uninstalled.")
,"Uninstallation", wxOK |wxICON_INFORMATION);
wxMessageDialog* msg = new wxMessageDialog(this, wxT("The Bootloader has been uninstalled.")
,wxT("Uninstallation"), wxOK |wxICON_INFORMATION);
msg->ShowModal();
delete msg;
}
else
MESG_DIALOG(_("The Uninstallation has failed.") );
MESG_DIALOG(wxT("The Uninstallation has failed.") );
}
else if(gv->curbootloadermethod == "h10")
else if(gv->curbootloadermethod == wxT("h10"))
{
if(h10(BOOTLOADER_REM))
{
wxMessageDialog* msg = new wxMessageDialog(this, _("The Bootloader has been uninstalled.")
,"Uninstallation", wxOK |wxICON_INFORMATION);
wxMessageDialog* msg = new wxMessageDialog(this, wxT("The Bootloader has been uninstalled.")
,wxT("Uninstallation"), wxOK |wxICON_INFORMATION);
msg->ShowModal();
delete msg;
}
else
MESG_DIALOG(_("The Uninstallation has failed.") );
MESG_DIALOG(wxT("The Uninstallation has failed.") );
}
else if(gv->curbootloadermethod == "iaudio" )
else if(gv->curbootloadermethod == wxT("iaudio") )
{
wxMessageDialog* msg = new wxMessageDialog(this, _("To uninstall the Bootloader on this Device,\n"
wxMessageDialog* msg = new wxMessageDialog(this, wxT("To uninstall the Bootloader on this Device,\n"
"you need to download and install an Original Firmware from the Manufacturer.")
,"Uninstallation", wxOK |wxICON_INFORMATION);
,wxT("Uninstallation"), wxOK |wxICON_INFORMATION);
msg->ShowModal();
delete msg;
}
else if(gv->curbootloadermethod == "fwpatcher" )
else if(gv->curbootloadermethod == wxT("fwpatcher") )
{
wxMessageDialog* msg = new wxMessageDialog(this, _("To uninstall the Bootloader on this Device,\n"
wxMessageDialog* msg = new wxMessageDialog(this, wxT("To uninstall the Bootloader on this Device,\n"
"you need to download and install an original Firmware from the Manufacturer.\n"
"To do this, you need to boot into the original Firmware.")
,"Uninstallation", wxOK |wxICON_INFORMATION);
,wxT("Uninstallation"), wxOK |wxICON_INFORMATION);
msg->ShowModal();
delete msg;
}
else
{
MESG_DIALOG(_("Unsupported Bootloader Method") );
MESG_DIALOG(wxT("Unsupported Bootloader Method") );
}
}
else
{
MESG_DIALOG(_("The bootloader Uninstallation wizard was cancelled") );
MESG_DIALOG(wxT("The bootloader Uninstallation wizard was cancelled") );
}
wxLogVerbose("=== end rbutilFrm::OnBootloaderRemoveBtn");
wxLogVerbose(wxT("=== end rbutilFrm::OnBootloaderRemoveBtn"));
}
void rbutilFrm::OnBootloaderBtn(wxCommandEvent& event)
{
wxLogVerbose("=== begin rbutilFrm::OnBootloaderBtn(event)");
wxLogVerbose(wxT("=== begin rbutilFrm::OnBootloaderBtn(event)"));
wxWizard *wizard = new wxWizard(this, wxID_ANY,
_("Rockbox Installation Wizard"),
wxT("Rockbox Installation Wizard"),
wxBitmap(wizard_xpm),
wxDefaultPosition,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
@ -399,84 +416,84 @@ void rbutilFrm::OnBootloaderBtn(wxCommandEvent& event)
if (wizard->RunWizard(page1) )
{
// start installation depending on player
if(gv->curbootloadermethod == "ipodpatcher")
if(gv->curbootloadermethod == wxT("ipodpatcher"))
{
if(ipodpatcher(BOOTLOADER_ADD))
{
wxMessageDialog* msg = new wxMessageDialog(this, _("The Bootloader has been installed on your device.")
,"Installation", wxOK |wxICON_INFORMATION);
wxMessageDialog* msg = new wxMessageDialog(this, wxT("The Bootloader has been installed on your device.")
,wxT("Installation"), wxOK |wxICON_INFORMATION);
msg->ShowModal();
delete msg;
}
else
{
MESG_DIALOG(_("The installation has failed.") );
MESG_DIALOG(wxT("The installation has failed.") );
}
}
else if(gv->curbootloadermethod == "gigabeatf")
else if(gv->curbootloadermethod == wxT("gigabeatf"))
{
if(gigabeatf(BOOTLOADER_ADD))
{
wxMessageDialog* msg = new wxMessageDialog(this, _("The Bootloader has been installed on your device.")
,"Installation", wxOK |wxICON_INFORMATION);
wxMessageDialog* msg = new wxMessageDialog(this, wxT("The Bootloader has been installed on your device.")
,wxT("Installation"), wxOK |wxICON_INFORMATION);
msg->ShowModal();
delete msg;
}
else
MESG_DIALOG(_("The installation has failed.") );
MESG_DIALOG(wxT("The installation has failed.") );
}
else if(gv->curbootloadermethod == "iaudio" )
else if(gv->curbootloadermethod == wxT("iaudio") )
{
if(iaudiox5(BOOTLOADER_ADD))
{
wxMessageDialog* msg = new wxMessageDialog(this, _("The Bootloader has been installed on your device.\n"
wxMessageDialog* msg = new wxMessageDialog(this, wxT("The Bootloader has been installed on your device.\n"
"Now turn OFF your Device, unplug USB,and insert Charger\n"
"Your Device will automatically upgrade the flash with the Rockbox bootloader")
,"Installation", wxOK |wxICON_INFORMATION);
,wxT("Installation"), wxOK |wxICON_INFORMATION);
msg->ShowModal();
delete msg;
}
else
MESG_DIALOG(_("The installation has failed.") );
MESG_DIALOG(wxT("The installation has failed.") );
}
else if(gv->curbootloadermethod == "fwpatcher")
else if(gv->curbootloadermethod == wxT("fwpatcher"))
{
if(fwpatcher(BOOTLOADER_ADD))
{
wxMessageDialog* msg = new wxMessageDialog(this, _("The Bootloader has been patched and copied on your device.\n"
wxMessageDialog* msg = new wxMessageDialog(this, wxT("The Bootloader has been patched and copied on your device.\n"
"Now use the Firmware upgrade option of your Device\n")
,"Installation", wxOK |wxICON_INFORMATION);
,wxT("Installation"), wxOK |wxICON_INFORMATION);
msg->ShowModal();
delete msg;
}
else
MESG_DIALOG(_("The installation has failed.") );
MESG_DIALOG(wxT("The installation has failed.") );
}
else if(gv->curbootloadermethod == "h10")
else if(gv->curbootloadermethod == wxT("h10"))
{
if(h10(BOOTLOADER_ADD))
{
wxMessageDialog* msg = new wxMessageDialog(this, _("The Bootloader has been patched and copied on your device.\n")
,"Installation", wxOK |wxICON_INFORMATION);
wxMessageDialog* msg = new wxMessageDialog(this, wxT("The Bootloader has been patched and copied on your device.\n")
,wxT("Installation"), wxOK |wxICON_INFORMATION);
msg->ShowModal();
delete msg;
}
else
MESG_DIALOG(_("The installation has failed.") );
MESG_DIALOG(wxT("The installation has failed.") );
}
else
{
MESG_DIALOG(_("Unsupported Bootloader Method") );
MESG_DIALOG(wxT("Unsupported Bootloader Method") );
}
}
else
{
MESG_DIALOG(_("The bootloader installation wizard was cancelled") );
MESG_DIALOG(wxT("The bootloader installation wizard was cancelled") );
}
wxLogVerbose("=== end rbutilFrm::OnBootloaderBtn");
wxLogVerbose(wxT("=== end rbutilFrm::OnBootloaderBtn"));
}
@ -485,13 +502,13 @@ void rbutilFrm::OnInstallBtn(wxCommandEvent& event)
wxString src, dest, buf;
wxDateTime date;
wxTimeSpan day(24);
wxLogVerbose("=== begin rbutilFrm::OnInstallBtn(event)");
wxLogVerbose(wxT("=== begin rbutilFrm::OnInstallBtn(event)"));
wxFileSystem fs;
wxFileConfig* buildinfo;
wxDateSpan oneday;
wxWizard *wizard = new wxWizard(this, wxID_ANY,
_("Rockbox Installation Wizard"),
wxT("Rockbox Installation Wizard"),
wxBitmap(wizard_xpm),
wxDefaultPosition,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
@ -511,20 +528,20 @@ void rbutilFrm::OnInstallBtn(wxCommandEvent& event)
{
case BUILD_RELEASE:
// This is a URL - don't use PATH_SEP
src.Printf("%s%s-%s-%s.zip",
src.Printf(wxT("%s%s-%s-%s.zip"),
gv->download_url.c_str(), gv->prog_name.c_str(),
gv->last_release.c_str(), gv->curplat.c_str());
dest.Printf("%s" PATH_SEP "download" PATH_SEP "%s-%s-%s.zip",
dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "%s-%s-%s.zip"),
gv->stdpaths->GetUserDataDir().c_str(),
gv->prog_name.c_str(), gv->last_release.c_str(),
gv->curplat.c_str());
break;
case BUILD_DAILY:
dest.Printf("%s" PATH_SEP "download" PATH_SEP "build-info",
dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "build-info"),
gv->stdpaths->GetUserDataDir().c_str());
if (DownloadURL(gv->server_conf_url, dest)) {
WARN_DIALOG(_("Unable to download build status."),
_("Install"));
WARN_DIALOG(wxT("Unable to download build status."),
wxT("Install"));
buf = "";
} else
{
@ -534,41 +551,41 @@ void rbutilFrm::OnInstallBtn(wxCommandEvent& event)
buildinfo->DeleteAll();
if (buf.Len() != 8) {
dest.Printf(_("Invalid build date: %s"), buf.c_str());
WARN_DIALOG(dest, _("Install"));
buf = "";
dest.Printf(wxT("Invalid build date: %s"), buf.c_str());
WARN_DIALOG(dest, wxT("Install"));
buf = wxT("");
}
}
if (buf == "") {
WARN_DIALOG(_("Can't get date of latest build from "
"server. Using yesterday's date."), _("Install") );
WARN_DIALOG(wxT("Can't get date of latest build from "
"server. Using yesterday's date."), wxT("Install") );
date = wxDateTime::Now();
date.Subtract(oneday.Day());
buf = date.Format(wxT("%Y%m%d")); // yes, we want UTC
}
src.Printf("%s%s/%s-%s-%s.zip",
src.Printf(wxT("%s%s/%s-%s-%s.zip"),
gv->daily_url.c_str(), gv->curplat.c_str(),
gv->prog_name.c_str(), gv->curplat.c_str(),
buf.c_str() );
dest.Printf("%s" PATH_SEP "download" PATH_SEP "%s-%s-%s.zip",
dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "%s-%s-%s.zip"),
gv->stdpaths->GetUserDataDir().c_str(),
gv->prog_name.c_str(),
gv->curplat.c_str(), buf.c_str() );
break;
case BUILD_BLEEDING:
src.Printf("%s%s/%s.zip",
src.Printf(wxT("%s%s/%s.zip"),
gv->bleeding_url.c_str(), gv->curplat.c_str(),
gv->prog_name.c_str() );
dest.Printf("%s" PATH_SEP "download" PATH_SEP "%s.zip",
dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "%s.zip"),
gv->stdpaths->GetUserDataDir().c_str(),
gv->prog_name.c_str() );
break;
default:
ERR_DIALOG(_("Something seriously odd has happened."),
_("Install"));
ERR_DIALOG(wxT("Something seriously odd has happened."),
wxT("Install"));
return;
break;
}
@ -578,30 +595,30 @@ void rbutilFrm::OnInstallBtn(wxCommandEvent& event)
if ( DownloadURL(src, dest) )
{
wxRemoveFile(dest);
buf.Printf(_("Unable to download %s"), src.c_str() );
ERR_DIALOG(buf, _("Install"));
buf.Printf(wxT("Unable to download %s"), src.c_str() );
ERR_DIALOG(buf, wxT("Install"));
return;
}
}
if ( !UnzipFile(dest, gv->curdestdir, true) )
{
wxMessageDialog* msg = new wxMessageDialog(this, _("Rockbox has been installed on your device.")
,"Installation", wxOK |wxICON_INFORMATION);
wxMessageDialog* msg = new wxMessageDialog(this, wxT("Rockbox has been installed on your device.")
,wxT("Installation"), wxOK |wxICON_INFORMATION);
msg->ShowModal();
delete msg;
} else
{
wxRemoveFile(dest);
buf.Printf(_("Unable to unzip %s"), dest.c_str() );
ERR_DIALOG(buf, _("Install"));
buf.Printf(wxT("Unable to unzip %s"), dest.c_str() );
ERR_DIALOG(buf, wxT("Install"));
}
} else
{
MESG_DIALOG(_("The installation wizard was cancelled") );
MESG_DIALOG(wxT("The installation wizard was cancelled") );
}
wxLogVerbose("=== end rbutilFrm::OnInstallBtn");
wxLogVerbose(wxT("=== end rbutilFrm::OnInstallBtn"));
}
void rbutilFrm::OnFontBtn(wxCommandEvent& event)
@ -609,13 +626,13 @@ void rbutilFrm::OnFontBtn(wxCommandEvent& event)
wxString src, dest, buf;
wxDateTime date;
wxTimeSpan day(24);
wxLogVerbose("=== begin rbutilFrm::OnFontBtn(event)");
wxLogVerbose(wxT("=== begin rbutilFrm::OnFontBtn(event)"));
wxFileSystem fs;
wxFileConfig* buildinfo;
wxDateSpan oneday;
wxWizard *wizard = new wxWizard(this, wxID_ANY,
_("Rockbox Font Installation Wizard"),
wxT("Rockbox Font Installation Wizard"),
wxBitmap(wizard_xpm),
wxDefaultPosition,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
@ -628,9 +645,9 @@ void rbutilFrm::OnFontBtn(wxCommandEvent& event)
buf.Printf(wxT("%s" PATH_SEP ".rockbox"), gv->curdestdir.c_str()) ;
if (! wxDirExists(buf) )
{
buf.Printf(_("Rockbox is not yet installed on %s - install "
buf.Printf(wxT("Rockbox is not yet installed on %s - install "
"Rockbox first."), buf.c_str() );
WARN_DIALOG(buf, _("Can't install fonts") );
WARN_DIALOG(buf, wxT("Can't install fonts") );
return;
}
@ -638,8 +655,8 @@ void rbutilFrm::OnFontBtn(wxCommandEvent& event)
gv->stdpaths->GetUserDataDir().c_str());
if (DownloadURL(gv->server_conf_url, dest))
{
WARN_DIALOG(_("Unable to download build status."),
_("Font Install"));
WARN_DIALOG(wxT("Unable to download build status."),
wxT("Font Install"));
buf = "";
} else
{
@ -649,25 +666,25 @@ void rbutilFrm::OnFontBtn(wxCommandEvent& event)
buildinfo->DeleteAll();
if (buf.Len() != 8) {
dest.Printf(_("Invalid build date: %s"), buf.c_str());
WARN_DIALOG(dest, _("Font Install"));
dest.Printf(wxT("Invalid build date: %s"), buf.c_str());
WARN_DIALOG(dest, wxT("Font Install"));
buf = "";
}
}
if (buf == "") {
WARN_DIALOG(_("Can't get date of latest build from "
WARN_DIALOG(wxT("Can't get date of latest build from "
"server. Using yesterday's date."),
_("Font Install") );
wxT("Font Install") );
date = wxDateTime::Now();
date.Subtract(oneday.Day());
buf = date.Format(wxT("%Y%m%d")); // yes, we want UTC
}
src.Printf("%s%s.zip", gv->font_url.c_str(), buf.c_str() );
src.Printf(wxT("%s%s.zip"), gv->font_url.c_str(), buf.c_str() );
dest.Printf("%s" PATH_SEP "download" PATH_SEP
"rockbox-fonts-%s.zip", gv->stdpaths->GetUserDataDir().c_str(),
dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP
"rockbox-fonts-%s.zip"), gv->stdpaths->GetUserDataDir().c_str(),
buf.c_str() );
if ( ! wxFileExists(dest) )
@ -675,38 +692,88 @@ void rbutilFrm::OnFontBtn(wxCommandEvent& event)
if ( DownloadURL(src, dest) )
{
wxRemoveFile(dest);
buf.Printf(_("Unable to download %s"), src.c_str() );
ERR_DIALOG(buf, _("Font Install"));
buf.Printf(wxT("Unable to download %s"), src.c_str() );
ERR_DIALOG(buf, wxT("Font Install"));
return;
}
}
if ( !UnzipFile(dest, gv->curdestdir, true) )
{
wxMessageDialog* msg = new wxMessageDialog(this, _("The Rockbox fonts have been installed on your device.")
,"Installation", wxOK |wxICON_INFORMATION);
wxMessageDialog* msg = new wxMessageDialog(this, wxT("The Rockbox fonts have been installed on your device.")
,wxT("Installation"), wxOK |wxICON_INFORMATION);
msg->ShowModal();
delete msg;
} else
{
wxRemoveFile(dest);
buf.Printf(_("Unable to unzip %s"), dest.c_str() );
ERR_DIALOG(buf, _("Font Install"));
buf.Printf(wxT("Unable to unzip %s"), dest.c_str() );
ERR_DIALOG(buf, wxT("Font Install"));
}
} else
{
MESG_DIALOG(_("The font installation wizard was cancelled") );
MESG_DIALOG(wxT("The font installation wizard was cancelled") );
}
wxLogVerbose("=== end rbutilFrm::OnFontBtn");
wxLogVerbose(wxT("=== end rbutilFrm::OnFontBtn"));
}
void rbutilFrm::OnThemesBtn(wxCommandEvent& event)
{
wxString src, dest, buf;
wxTimeSpan day(24);
wxLogVerbose(wxT("=== begin rbutilFrm::OnThemesBtn(event)"));
wxWizard *wizard = new wxWizard(this, wxID_ANY,
wxT("Rockbox Themes Installation Wizard"),
wxBitmap(wizard_xpm),
wxDefaultPosition,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
wxPlatformPage* page1 = new wxPlatformPage(wizard);
wxLocationPage* page2 = new wxLocationPage(wizard);
wxThemesPage* page3 = new wxThemesPage(wizard);
page1->SetNext(page2);
page2->SetPrev(page1);
page2->SetNext(page3);
page3->SetPrev(page2);
wizard->GetPageAreaSizer()->Add(page1);
if (wizard->RunWizard(page1) )
{
bool success=true;
for(int i=0 ;i < gv->themesToInstall.GetCount();i++)
{
if(!InstallTheme(gv->themesToInstall[i]))
{
MESG_DIALOG(wxT("The Themes installation has failed") );
success=false;
break;
}
}
if(success)
{
MESG_DIALOG(wxT("The Theme installation completed successfully.") );
}
}
else
{
MESG_DIALOG(wxT("The Themes installation wizard was cancelled") );
}
wxLogVerbose(wxT("=== end rbutilFrm::OnThemesBtn(event)"));
}
void rbutilFrm::OnRemoveBtn(wxCommandEvent& event)
{
wxLogVerbose("=== begin rbutilFrm::OnRemoveBtn(event)");
wxLogVerbose(wxT("=== begin rbutilFrm::OnRemoveBtn(event)"));
wxWizard *wizard = new wxWizard(this, wxID_ANY,
_("Rockbox Uninstallation Wizard"),
wxT("Rockbox Uninstallation Wizard"),
wxBitmap(wizard_xpm),
wxDefaultPosition,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
@ -722,33 +789,33 @@ void rbutilFrm::OnRemoveBtn(wxCommandEvent& event)
if (Uninstall(gv->curdestdir, gv->curisfull) )
{
MESG_DIALOG(
_("The uninstallation wizard was cancelled or completed with "
wxT("The uninstallation wizard was cancelled or completed with "
"some errors.") );
} else {
wxMessageDialog* msg = new wxMessageDialog(this, _("The uninstall wizard completed successfully\n"
wxMessageDialog* msg = new wxMessageDialog(this, wxT("The uninstall wizard completed successfully\n"
"Depending on which Device you own, you also have to uninstall the Bootloader")
,"Uninstallation", wxOK |wxICON_INFORMATION);
,wxT("Uninstallation"), wxOK |wxICON_INFORMATION);
msg->ShowModal();
delete msg;
}
} else
{
MESG_DIALOG(_("The uninstallation wizard was cancelled.") );
MESG_DIALOG(wxT("The uninstallation wizard was cancelled.") );
}
wxLogVerbose("=== end rbutilFrm::OnRemoveBtn");
wxLogVerbose(wxT("=== end rbutilFrm::OnRemoveBtn"));
}
void rbutilFrm::OnPortableInstall(wxCommandEvent& event)
{
wxString src, dest, buf;
wxLogVerbose("=== begin rbutilFrm::OnPortableInstall(event)");
wxLogVerbose(wxT("=== begin rbutilFrm::OnPortableInstall(event)"));
wxFileSystem fs;
wxFileConfig* buildinfo;
wxDateSpan oneday;
wxWizard *wizard = new wxWizard(this, wxID_ANY,
_("Rockbox Utility Portable Installation Wizard"),
wxT("Rockbox Utility Portable Installation Wizard"),
wxBitmap(wizard_xpm),
wxDefaultPosition,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
@ -760,24 +827,24 @@ void rbutilFrm::OnPortableInstall(wxCommandEvent& event)
{
if ( InstallRbutil(gv->curdestdir) )
{
wxMessageDialog* msg = new wxMessageDialog(this, _("The Rockbox Utility has been installed on your device.")
,"Installation", wxOK |wxICON_INFORMATION);
wxMessageDialog* msg = new wxMessageDialog(this, wxT("The Rockbox Utility has been installed on your device.")
,wxT("Installation"), wxOK |wxICON_INFORMATION);
msg->ShowModal();
delete msg;
} else
{
ERR_DIALOG(_("Installation failed"), _("Portable Install"));
ERR_DIALOG(wxT("Installation failed"), wxT("Portable Install"));
}
} else
{
MESG_DIALOG(_("The portable installation wizard was cancelled") );
MESG_DIALOG(wxT("The portable installation wizard was cancelled") );
}
wxLogVerbose("=== end rbutilFrm::OnUnstallPortable");
wxLogVerbose(wxT("=== end rbutilFrm::OnUnstallPortable"));
}
AboutDlg::AboutDlg(rbutilFrm* parent)
: wxDialog(parent, -1, _("About"), wxDefaultPosition, wxDefaultSize,
: wxDialog(parent, -1, wxT("About"), wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE)
{
wxBoxSizer* WxBoxSizer1 = new wxBoxSizer(wxVERTICAL);
@ -792,13 +859,13 @@ AboutDlg::AboutDlg(rbutilFrm* parent)
WxBoxSizer2->Add(WxStaticBitmap1, 0, wxALL | wxCENTER, 5);
wxStaticText* WxStaticText1 = new wxStaticText(this, wxID_ANY,
_(RBUTIL_FULLNAME), wxDefaultPosition, wxDefaultSize,
wxT(RBUTIL_FULLNAME), wxDefaultPosition, wxDefaultSize,
wxALIGN_CENTER | wxST_NO_AUTORESIZE );
WxBoxSizer2->Add(WxStaticText1, 0, wxALL | wxCENTER, 5);
WxBoxSizer1->Add(WxBoxSizer2, 0, wxALL, 5);
wxStaticText* WxStaticText2 = new wxStaticText(this, wxID_ANY,
_(RBUTIL_VERSION "\n" RBUTIL_DESCRIPTION "\n\n" RBUTIL_COPYRIGHT));
wxT(RBUTIL_VERSION "\n" RBUTIL_DESCRIPTION "\n\n" RBUTIL_COPYRIGHT));
WxStaticText2->Wrap(400);
WxBoxSizer1->Add(WxStaticText2, 0, wxALL, 5);
@ -806,7 +873,7 @@ AboutDlg::AboutDlg(rbutilFrm* parent)
wxT(RBUTIL_WEBSITE), wxT(RBUTIL_WEBSITE) );
WxBoxSizer1->Add(WxHyperlink1, 0, wxALL, 5);
wxStaticBox* WxStaticBox1 = new wxStaticBox(this, wxID_ANY, _("Contributors:"));
wxStaticBox* WxStaticBox1 = new wxStaticBox(this, wxID_ANY, wxT("Contributors:"));
wxStaticBoxSizer* WxStaticBoxSizer2 = new wxStaticBoxSizer(WxStaticBox1,
wxVERTICAL);
wxTextCtrl* WxTextCtrl1 = new wxTextCtrl(this, wxID_ANY, wxEmptyString,
@ -816,7 +883,7 @@ AboutDlg::AboutDlg(rbutilFrm* parent)
while ( rbutil_developers[i] != "")
{
WxTextCtrl1->AppendText(rbutil_developers[i++]);
WxTextCtrl1->AppendText("\n");
WxTextCtrl1->AppendText(wxT("\n"));
}
WxBoxSizer1->Add(WxStaticBoxSizer2, 1, wxGROW | wxALL, 5);

View file

@ -58,13 +58,13 @@ public:
public:
wxMenuBar *WxMenuBar1;
wxStaticText *WxStaticText3;
wxStaticText *WxStaticText4;
wxBitmapButton *WxBitmapButton2;
wxStaticText *WxStaticText2;
wxBitmapButton *WxBitmapButton1;
wxBitmapButton *WxBitmapButton3;
wxBitmapButton *WxBitmapButton4;
wxBitmapButton *WxBitmapButton5;
wxBitmapButton *WxBitmapButton6;
wxFlexGridSizer *WxFlexGridSizer1;
wxStaticBoxSizer *WxStaticBoxSizer3;
wxStaticBitmap *WxStaticBitmap1;
@ -87,6 +87,7 @@ public:
ID_INSTALL_BTN = 1028,
ID_WXSTATICBITMAP1 = 1053,
ID_FONT_BTN = 1128,
ID_THEMES_BTN = 1139,
ID_BOOTLOADER_BTN = 1129,
ID_WXPANEL1 = 1064,
@ -102,6 +103,7 @@ public:
void OnInstallBtn(wxCommandEvent& event);
void OnRemoveBtn(wxCommandEvent& event);
void OnFontBtn(wxCommandEvent& event);
void OnThemesBtn(wxCommandEvent& event);
void OnBootloaderBtn(wxCommandEvent& event);
void OnPortableInstall(wxCommandEvent& event);
void OnBootloaderRemoveBtn(wxCommandEvent& event);

View file

@ -1,286 +1,313 @@
/* WxBitmapButton2 XPM */
/* XPM */
static char * uninstall_3d_xpm[] = {
"56 46 236 2",
" c None",
" 0 c #BEBABE",
" 1 c #BEC3BE",
" 2 c #000011",
" 3 c #AEAAAE",
" 4 c #9E9A9E",
" 5 c #C0B3AE",
" 6 c #C97577",
" 7 c #C45759",
" 8 c #BF6B6D",
" 9 c #BEB9BD",
" a c #BFB1B5",
" b c #C49793",
" c c #CE5254",
" d c #D81413",
" e c #DB0505",
" f c #DB0303",
" g c #D81717",
" h c #CB6668",
" i c #C1A6AA",
" j c #C64E50",
" k c #D71E1F",
" l c #D31F1F",
" m c #CF4C4D",
" n c #BA797D",
" o c #C29EA2",
" p c #AFA4A8",
" q c #C0AAAE",
" r c #C25C5E",
" s c #D6201E",
" t c #DA0606",
" u c #D81A1B",
" v c #CD5D5F",
" w c #D90E0D",
" x c #D62423",
" y c #C68789",
" z c #010101",
" A c #130101",
" B c #650101",
" C c #C40202",
" D c #DA0202",
" E c #DB0202",
" F c #D42F30",
" G c #D81516",
" H c #C3595B",
" I c #C2A49F",
" J c #D62424",
" K c #DA0607",
" L c #D14244",
" M c #DB0404",
" N c #D90909",
" O c #A10101",
" P c #CA6B6D",
" Q c #070101",
" R c #3F000C",
" S c #CD0202",
" T c #DB0203",
" U c #D90C0C",
" V c #CE5556",
" W c #C0B2AD",
" X c #C7BAC7",
" Y c #C59591",
" Z c #D41E1E",
" & c #CE0203",
"0 c #A1246B",
"00 c #6F42C7",
"01 c #604BE2",
"02 c #9D2774",
"03 c #D80409",
"04 c #B40202",
"05 c #AE3C48",
"06 c #8E687A",
"07 c #AFA5A9",
"08 c #C49397",
"09 c #D04546",
"0a c #CB0202",
"0b c #DA0305",
"0c c #D60409",
"0d c #A91F5D",
"0e c #300101",
"0f c #BEB4B8",
"0g c #8E8A8E",
"0h c #79869E",
"0i c #B49194",
"0j c #C77D7F",
"0k c #D41A1B",
"0l c #783CB5",
"0m c #5552F7",
"0n c #AEAEB6",
"0o c #B19B9F",
"0p c #CC6163",
"0q c #CC0202",
"0r c #DA0A0A",
"0s c #932D85",
"0t c #5155FF",
"0u c #C16263",
"0v c #D33432",
"0w c #D90707",
"0x c #C50F29",
"0y c #6449DC",
"0z c #B6AEB6",
"0A c #CFC7CF",
"0B c #B58D91",
"0C c #CF0202",
"0D c #B21B4C",
"0E c #1F0101",
"0F c #C80202",
"0G c #6847D4",
"0H c #BA0202",
"0I c #D4060F",
"0J c #86349C",
"0K c #C11130",
"0L c #D5070F",
"0M c #773EB8",
"0N c #202496",
"0O c #252291",
"0P c #541A6D",
"0Q c #CE050D",
"0R c #D10202",
"0S c #5C4DE9",
"0T c #CC0B1E",
"0U c #D70509",
"0V c #8335A0",
"0W c #9696AE",
"0X c #511A6E",
"0Y c #CD050E",
"0Z c #D90B0B",
"0& c #400101",
"1 c #6B44CD",
"10 c #D4070F",
"11 c #CE091A",
"12 c #7992B6",
"13 c #717986",
"14 c #3F1E7D",
"15 c #CE040C",
"16 c #DA0909",
"17 c #BA7B7E",
"18 c #250101",
"19 c #D30202",
"1a c #D51919",
"1b c #D81010",
"1c c #CF4644",
"1d c #C49894",
"1e c #690101",
"1f c #D80B0C",
"1g c #B97D80",
"1h c #DA0203",
"1i c #8B0101",
"1j c #060010",
"1k c #B48F92",
"1l c #D60202",
"1m c #BEB1B5",
"1n c #D71918",
"1o c #DA0B0B",
"1p c #C49194",
"1q c #B19C9F",
"1r c #CE2222",
"1s c #7A0101",
"1t c #CB6467",
"1u c #DC0404",
"1v c #DC0303",
"1w c #D33435",
"1x c #FCEAEA",
"1y c #C35C5E",
"1z c #DA0404",
"1A c #D90808",
"1B c #D81616",
"1C c #D20202",
"1D c #570101",
"1E c #9F9599",
"1F c #CC3839",
"1G c #CB6967",
"1H c #970101",
"1I c #B78587",
"1J c #BB0101",
"1K c #B48D91",
"1L c #FBE9E9",
"1M c #D9100F",
"1N c #D40202",
"1O c #3E0101",
"1P c #C04444",
"1Q c #D80202",
"1R c #AB777A",
"1S c #8D0202",
"1T c #9F0101",
"1U c #D41919",
"1V c #D51617",
"1W c #867488",
"1X c #D70607",
"1Y c #D40B0C",
"1Z c #7C0101",
"1& c #C0252C",
"2 c #DA0304",
"20 c #8186A7",
"21 c #B8595B",
"22 c #B78487",
"23 c #B9787B",
"24 c #CF6B72",
"25 c #CF3031",
"26 c #D80A0A",
"27 c #CE0202",
"28 c #D21F20",
"29 c #D51112",
"2a c #D02728",
"2b c #CF2E2F",
"2c c #DA0303",
"2d c #B48E91",
"2e c #DA0505",
"2f c #BE4749",
"2g c #5E0101",
"2h c #B46163",
"2i c #AC7578",
"2j c #310101",
"2k c #CE2122",
"2l c #C33E40",
"2m c #C50202",
"2n c #D90202",
"2o c #600101",
"2p c #C63537",
"2q c #C94445",
"2r c #A69EA6",
"2s c #7F7D93",
"2t c #CF1215",
"2u c #CA191D",
"2v c #CA2C2D",
"2w c #DA0707",
"2x c #D60F0F",
"2y c #C43C3D",
"2z c #A58589",
"2A c #A97C7F",
"2B c #CE2223",
"2C c #A68589",
"2D c #A97D80",
"2E c #B59093",
"2F c #A09296",
"2G c #9E999D",
" 0",
" 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 2",
" 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 2",
" 1 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 2",
" 3 0 3 0 4 1 0 3 3 1 3 0 4 1 0 3 3 1 3 0 4 1 0 3 3 1 3 0 4 1 0 3 3 1 3 0 4 5 6 7 8 5 3 0 4 1 0 3 3 1 3 0 3 1 2",
" 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 9 a b c d e f g h 1 0 1 0 1 0 1 0 0 1 0 0 2",
" 3 0 3 0 3 0 3 0 3 i j k l m n o p 1 3 0 3 0 3 0 3 0 3 0 3 0 3 q r s t f f f f f f u 3 0 3 0 3 0 3 1 3 0 3 0 2",
" 0 1 0 1 0 3 0 0 1 v w f f f f x y 0 1 0 1 z z z z z z z z A B C D E E E E f f f f u 1 0 1 3 1 0 1 0 0 1 0 3 2",
" 3 0 4 1 3 0 3 1 4 F f f f f f E E G H q z 0 1 0 1 0 1 0 I J f f f f f f f E f f K h 3 0 3 0 4 0 3 0 4 0 3 0 2",
" 0 1 0 3 0 1 0 3 0 L M f f f E f E f f N O P A z 2 z Q R S T E T E T E T f E f U V W 0 3 1 0 1 3 1 0 1 3 0 1 2",
" 3 0 3 0 3 X 4 1 3 Y Z f f E f f E f f f E f &0 00010203 f f f f f f f E t040506 p X 3 0 4 0 3 0 3 1 3 0 3 0 2",
" 0 3 0 1 0 3 1 3 00708090a f f E f E E f E f E f f0b f f f f f f f0c0d0e0f 20g0h 0 3 1 0 1 3 0 3 0 3 0 0 1 3 2",
" 3 0 3 0 4 0 3 0 3 0 4 Q0i0j04 f f f E E E E E E f f f f f f f f0k0l0m z 1 20h0h0n 0 3 0 3 0 3 0 4 1 3 1 3 0 2",
" 0 3 X 3 0 3 0 3 0 3 1 z 1 z 00o0p0q f f f f E E f f f f f f0r0s W0t0t z 0 z0h0h 0 3 0 3 1 3 X 3 0 3 0 3 0 3 2",
" 3 1 3 1 3 0 3 0 3 0 3 z z 0 3 0 z W0u0v0w E f E f f f f f f0x0y 30t0t z 1 z0h0h0z 0 3 0 4 0 3 1 3 0 3 0 4 1 2",
" 3 3 0 3 3 30A 3 3 3 0 3 z 3 z z z z 00B0C f f E f f f f f f f0D 10t0t 2 0 z0h0h 3 3 0 3 3 3 0 3 3 3 X 3 3 3 2",
" 3 0 3 0 3 0 4 0 3 0 3 0 3 z 3 0 3 00E0F f f f E f f f f f f f f0G0t0t z 1 z 40h 3 0 3 1 3 0 3 0 3 0 3 0 3 0 2",
" 3 3 3 3 3 3 3 3 3 3 3 3 3 z z z z0E0H f f f f E0I0J0K f f f f f0L0M0m z 0 z0h0h 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2",
" 3 0 3 0 3 0 3 0 3 X 3 0 3 z0N0O0P0Q E f f f f0R0G0t0S0T f f f f f0U0V z 1 20h0W 3 0 3 0 3 0 4 1 3 0 3 0 3 0 2",
" 3 3 3 3 3 3 3 3 3 3 3 3 3 z0N0X0Y f E f f f0Z0&0t0t0t1 10 f f f f f11 z 0 z1213 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2",
" 3 3 3 0 3 3 3 0 3 3 3 0 3 z1415 f f E f f1617 Q z z z z1819 E E E E E Q 1 z0h0h0n 3 3 0 3 3 3 0 3 3 3 0 3 3 2",
" 3 3 3 3 3 3 3 3 3 3 3 3 3 A1a f f f E f1b17 3 z 1 1 1 1 11c f f f f f1d 0 z0h0h 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2",
" 3 3 3 3 3 3 3 3 3 3 3 3 31e f f f f E1f1g p 3 z z 2 z 2 z0&1h E E E T1i1j z z z 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2",
" 3 3 3 3 3 3 3 3 3 3 3 31k19 f f f f1l17 3 z 0 z 1 0 0 1 01m1n f f f f1o1p 1 0 0 z 3 3 3 3 3 3 3 3 3 3 3 3 3 2",
" 4 3 3 3 4 3 3 3 4 3 31q1r E f f f f1s p z 3 3 z 0 1 0 11t1u f f1v f1w1x 1 0 z0h 3 3 4 3 3 3 4 3 3 3 4 3 2",
" 3 3 3 3 3 3 3 3 3 3 31y1z E f f f1A A 3 3 z 3 z 1 0 0 1 0 0 W1B E E E E1C1D 0 0 z0h0h 3 3 3 3 3 3 3 3 3 3 3 2",
" 3 3 4 3 4 3 4 3 3 31E0k f E f E f1F z 3 z 3 4 z 0 1 0 1 0 1 01G M E E f E1H Q 1 z0h0h0z 4 3 4 3 3 3 4 3 4 3 2",
" 3 3 3 3 3 3 3 3 3 31I1z f E f f1J1K z 3 3 z 3 z 0 1 0 0 01L1M f E E E1N1O z z0h0h 3 3 3 3 3 3 3 3 3 3 3 2",
" 4 3 4 3 4 3 4 3 4 31P f f E f1Q1R 3 z 3 z 3 4 z z z z z z z z z1S D E E E E1T z0h0h0h 3 4 3 4 3 4 3 4 3 4 3 2",
" 3 3 3 3 3 3 3 3 3 31U f f E f1V Q 3 z 3 3 3 3 z0h0h0h0h0h0h0h0h1W1X f f f f1Y12130W0h 3 3 3 3 3 3 3 3 3 3 3 2",
" 4 3 4 3 4 3 4 3 41q1z f f E f1Z 4 3 z 3 4 3 z z0h0h0h0W13120h0h0g1& f f f f2 201312 4 3 4 3 4 3 4 3 4 3 4 3 2",
" 3 4 3 3 3 4 3 3 321 f f f E f22 z 4 z 3 3 z0h z z z z z z z z 20n23 f f f f f24 3 4 3 3 3 4 3 3 3 4 3 3 3 4 2",
" 4 3 4 3 4 3 4 3 425 f f f E26 Q 4 3 z 3 z0h0h z 4 0 0 0 3 0 z z z Q27 E E f f281E 3 4 3 4 3 4 3 4 3 4 3 4 3 2",
" 3 4 3 4 3 4 3 4 329 f f f E2a 4 3 4 z z0h0h0h0h z z z z z z z 3 0 02b f f E f2c2d 4 3 4 3 4 3 4 3 4 3 4 3 4 2",
" 4 3 4 3 4 3 4 31E2e f f f E2f 3 4 3 z0h0h0W130z 4 z z z z 0 z z z z2g E E E E f2h 3 4 3 4 3 4 3 4 3 4 3 4 3 2",
" 4 4 3 4 4 4 3 42i f f f f E2j z z z0W1312130n 4 4 4 z z z z z z z z A f E E E E2k 4 3 4 4 4 3 4 4 4 3 4 4 4 2",
" 4 3 4 3 4 3 4 32l f f f f f1E0h0h0h0h0h0h0z0W 3 4 3 40h z z z z z z z2m E E E E2n 3 4 3 4 3 4 3 4 3 4 3 4 3 2",
" 4 4 4 4 4 4 4 42k f f f f0w 40h0h0h0h0h 4 4 4 4 4 4 4 40h0h0h0h0h0h z2o E E E E E0h 4 4 4 4 4 4 4 4 4 4 4 4 2",
" 4 3 4 3 4 3 4 32p2e f f M2q 4 32r 3 40n 4 3 4 3 4 3 4 0 4 3 4 X 4 30h2s2t f f f2u0h0h 3 4 3 4 3 4 3 4 3 4 3 2",
" 4 4 4 4 4 4 4 42i2v2w2x2y2z 4 4 4 42r 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 42A2B f2B2A 42r 4 4 4 4 4 4 4 4 4 4 4 2",
" 4 4 4 3 4 4 4 31E2C2D2E2F2G 4 3 4 4 4 3 4 4 4 3 4 4 4 3 4 4 4 3 4 4 4 3 4 4 4 3 4 4 4 3 4 4 4 3 4 4 4 3 4 4 2",
" 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 2",
" 4 3 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 3 4 4 4 4 2",
" 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 2",
" 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 2",
" 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2"};
"56 46 264 2",
" c #FFFFFF",
". c #BEBABE",
"+ c #BEC3BE",
"@ c #000011",
"# c #AEAAAE",
"$ c #9E9A9E",
"% c #010101",
"& c #79869E",
"* c #C7BAC7",
"= c #5155FF",
"- c #5558FC",
"; c #6A66E3",
"> c #5F3C3B",
", c #C67175",
"' c #623841",
") c #949194",
"! c #BEBFBB",
"~ c #BA7F82",
"{ c #C97173",
"] c #431C1D",
"^ c #241D1D",
"/ c #ADAAAE",
"( c #6E5EDE",
"_ c #BD8587",
": c #A25A94",
"< c #C2344A",
"[ c #DA0909",
"} c #DB0302",
"| c #D51617",
"1 c #9A8B98",
"2 c #AEAEB6",
"3 c #C07B7E",
"4 c #D81111",
"5 c #DA0707",
"6 c #D71314",
"7 c #D13434",
"8 c #C49094",
"9 c #C0BCB8",
"0 c #0D0D0D",
"a c #5558FE",
"b c #5449BC",
"c c #A2484A",
"d c #CF1D26",
"e c #DC0000",
"f c #DD0000",
"g c #A1848F",
"h c #CE5456",
"i c #DC0101",
"j c #D01717",
"k c #943857",
"l c #4B1A1A",
"m c #524ACB",
"n c #4C4FEE",
"o c #4A4DE5",
"p c #7D57A6",
"q c #D71F26",
"r c #DB0000",
"s c #DC0100",
"t c #E20200",
"u c #E10000",
"v c #E00201",
"w c #D90707",
"x c #A13C3C",
"y c #868EA1",
"z c #B6AEB6",
"A c #CFC7CF",
"B c #452F2E",
"C c #C92B2B",
"D c #DE0101",
"E c #DF0809",
"F c #B80E1A",
"G c #7D308D",
"H c #6E3FBA",
"I c #7F2C85",
"J c #C70102",
"K c #DE0000",
"L c #DD0302",
"M c #DE0203",
"N c #B00E28",
"O c #AC2945",
"P c #6C0E18",
"Q c #B4949B",
"R c #222020",
"S c #A6989C",
"T c #A67578",
"U c #9D3234",
"V c #C90D0D",
"W c #E50B0B",
"X c #E50202",
"Y c #E40304",
"Z c #E40303",
"` c #DF0303",
" . c #DB0303",
".. c #D90306",
"+. c #CE1723",
"@. c #753FC5",
"#. c #5449DC",
"$. c #5459F3",
"%. c #100C0D",
"&. c #48459B",
"*. c #63376A",
"=. c #B6374A",
"-. c #D1171C",
";. c #DB0202",
">. c #DE0202",
",. c #9F206C",
"'. c #6660EB",
"). c #202496",
"!. c #202495",
"~. c #343798",
"{. c #B48083",
"]. c #D80101",
"^. c #DC0303",
"/. c #DF0100",
"(. c #DE0200",
"_. c #DD0202",
":. c #B31143",
"<. c #645CEB",
"[. c #9696AE",
"}. c #1F2390",
"|. c #867274",
"1. c #BB1C1D",
"2. c #E40101",
"3. c #AF1F58",
"4. c #C51539",
"5. c #E30202",
"6. c #DC0201",
"7. c #A62566",
"8. c #5255FE",
"9. c #7992B6",
"0. c #717986",
"a. c #8E6C81",
"b. c #C40505",
"c. c #E10100",
"d. c #930000",
"e. c #0D040A",
"f. c #200610",
"g. c #B30307",
"h. c #E20102",
"i. c #DD0001",
"j. c #891034",
"k. c #080309",
"l. c #010103",
"m. c #9B7795",
"n. c #D80B16",
"o. c #E30201",
"p. c #DB0201",
"q. c #C84848",
"r. c #938D8A",
"s. c #887B78",
"t. c #D11111",
"u. c #E00202",
"v. c #EE0100",
"w. c #4D6A15",
"x. c #ADA9AD",
"y. c #28080B",
"z. c #DD0D11",
"A. c #DC0102",
"B. c #9F3435",
"C. c #322D2E",
"D. c #060707",
"E. c #77312F",
"F. c #8F2926",
"G. c #010111",
"H. c #B0A6AA",
"I. c #B30807",
"J. c #C66265",
"K. c #292728",
"L. c #B5A7AA",
"M. c #D60B0B",
"N. c #CF0303",
"O. c #A89595",
"P. c #A19CA0",
"Q. c #C35557",
"R. c #E00101",
"S. c #9E1717",
"T. c #A9A2A6",
"U. c #BFC4BF",
"V. c #CB6B6C",
"W. c #DF0000",
"X. c #E35A59",
"Y. c #BFC0BC",
"Z. c #B28C90",
"`. c #E80A0A",
" + c #370C0D",
".+ c #C6BEBB",
"++ c #E12F2E",
"@+ c #DE0303",
"#+ c #D60000",
"$+ c #260000",
"%+ c #121213",
"&+ c #C05B5C",
"*+ c #963334",
"=+ c #A6A1A5",
"-+ c #BBB8BC",
";+ c #B05956",
">+ c #E40202",
",+ c #AE1414",
"'+ c #040101",
")+ c #AFA7AB",
"!+ c #D30F0F",
"~+ c #DC0202",
"{+ c #CC0203",
"]+ c #95898C",
"^+ c #040404",
"/+ c #BDB9BD",
"(+ c #D0C9CB",
"_+ c #D8171A",
":+ c #261C23",
"<+ c #513436",
"[+ c #E10101",
"}+ c #AE4042",
"|+ c #131212",
"1+ c #090909",
"2+ c #812A2D",
"3+ c #60333C",
"4+ c #C05658",
"5+ c #E60303",
"6+ c #986365",
"7+ c #766775",
"8+ c #E30606",
"9+ c #D12829",
"0+ c #82899D",
"a+ c #B72223",
"b+ c #DD0101",
"c+ c #D20607",
"d+ c #A79194",
"e+ c #928B8F",
"f+ c #AF1113",
"g+ c #DB0101",
"h+ c #DA0404",
"i+ c #9C8387",
"j+ c #D01E1F",
"k+ c #E10202",
"l+ c #A50E0E",
"m+ c #A49DA1",
"n+ c #ADADB5",
"o+ c #882C2D",
"p+ c #EA0101",
"q+ c #BD6063",
"r+ c #ADAEB6",
"s+ c #D90708",
"t+ c #A9292A",
"u+ c #1D0203",
"v+ c #D90102",
"w+ c #BE454A",
"x+ c #CF2121",
"y+ c #D51313",
"z+ c #603A3B",
"A+ c #080808",
"B+ c #B4B1B6",
"C+ c #BB6065",
"D+ c #DB0807",
"E+ c #5C3035",
"F+ c #AE9598",
"G+ c #AC8083",
"H+ c #AE989C",
"I+ c #080707",
"J+ c #050506",
"K+ c #141011",
"L+ c #453133",
"M+ c #453333",
"N+ c #090808",
"O+ c #A69EA6",
" . ",
" . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + @ ",
" + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . @ ",
" + . . + . . . + . . . + . . . + . . . + . . . + . . . + . . . + . . . + . . . + . . . + . . . + . . . + . . @ ",
" # . # . $ + . # # + # . $ + . # # + # . $ + . # # + # . $ + . # # + # . $ + . # # + # . $ + . # # + # . # + @ ",
" . + . + . + . + . . + . + . + . + . . + . + . + . . + . + . + . + . . + . + . + . . + . + . + . + . . + . . @ ",
" # . # . # . # . # . # . # . # . # + # . # . # . # . # . # . # . # + # . # . # . # . # . # . # . # + # . # . @ ",
" . + . + . # . . + . + . + # . + . . + . + % % % % % % % % % % % % % % % % # . . + . + . + # + . + . . + . # @ ",
" # . $ + # . # + $ . # . # . $ % % . # . % . + . + . + . + . + . + . . + . % # . $ . # . # . $ . # . $ . # . @ ",
" . + . # . + . # . . + # . + % # % + . # % . % % @ % % @ % @ % @ % @ % @ . % & # . + . # + . + # + . + # . + @ ",
" # . # . # * $ + # + # . # % # . % . # . % + @ = = = = = = = = = = = = % + % & & # * # . $ . # . # + # . # . @ ",
" . # . + . # + # . # . . % # . % + % % + % . % = = = = = = = + = + - ; > , ' ) & . # + . + # . # . # . . + # @ ",
" # . # . $ . # . # . $ % # . % ! ~ { ] ^ % % % % = = = = = = / ( _ : < [ } | 1 & 2 . # . # . # . $ + # + # . @ ",
" . # * # . # . # . # + % + % . 3 4 5 6 7 8 9 0 % = = = = a b c d e f f e f f g & . # . # + # * # . # . # . # @ ",
" # + # + # . # . # . # % % . # h e i e e e j k l m n = o p q r e s t u v w x y & z . # . $ . # + # . # . $ + @ ",
" # # . # # # A # # # . # % # % B C D e f e e f E F G H I J K L f M N O P Q R & & # # . # # # . # # # * # # # @ ",
" # . # . # . $ . # . # . # % # . S T U V W e e e u X Y Z ` ...+.@.#.$.% + % $ & # . # + # . # . # . # . # . @ ",
" # # # # # # # # # # # # # % % % % % %.&.*.=.-. .;.;. . . .>.,.'.= = = % . % & & # # # # # # # # # # # # # # @ ",
" # . # . # . # . # * # . # % ).).).).% ).!.~.{.].^.;./.(. ._.:.<.= = = % + @ & [.# . # . # . $ + # . # . # . @ ",
" # # # # # # # # # # # # # % ).).).).% ).}.|.1.` } 2.3.4.5.} 6.7.8.= = % . % 9.0.# # # # # # # # # # # # # # @ ",
" # # # . # # # . # # # . # % ).).).).% ).a.b.c. .e d.e.f.g.h.} i.j.k.% % + % & & 2 # # . # # # . # # # . # # @ ",
" # # # # # # # # # # # # # % # # # # l.m.n.o.p.K q.r.+ + s.t.u.6.v.w.+ + . % & & # # # # # # # # # # # # # # @ ",
" # # # # # # # # # # # # # % # # # x.y.z./.A.K B.C.@ % @ D.E.r .u F.G.% @ % % % # # # # # # # # # # # # # # @ ",
" # # # # # # # # # # # # # % # # # H.I.c. .r J.K.+ . . + . L.M.i _.N.O.. . + . . % # # # # # # # # # # # # # @ ",
" $ # # # $ # # # $ # # # $ % # # P.Q.R. .X S.T.% . + . U.V.e ;.W.X.Y.. + . % & # # $ # # # $ # # # $ # @ ",
" # # # # # # # # # # # # # % # # Z.^.i i `. +# % + . . + . . .+++r @+#+$+% % . . % & & # # # # # # # # # # # @ ",
" # # $ # $ # $ # # # $ # $ % $ %+&+K ;.K *+=+$ % . + . + . + -+;+e ;.>+,+'+% % + % & & z $ # $ # # # $ # $ # @ ",
" # # # # # # # # # # # # # % # )+!+i ~+{+]+^+# % . + . . /+(+_+i ~+W.:+% % % % & & # # # # # # # # # # # @ ",
" $ # $ # $ # $ # $ # $ # $ % $ <+e .[+}+|+# $ % % % % % % % % 1+2+K .W.3+% % % & & & # $ # $ # $ # $ # $ # @ ",
" # # # # # # # # # # # # # % # 4+f ;.5+6+# # # % & & & & & & & & 7+8+;.e 9+0+& 9.0.[.& # # # # # # # # # # # @ ",
" $ # $ # $ # $ # $ # $ # $ % $ a+f b+c+d+$ # % % & & & [.0.9.& & e+f+[+g+h+i+0.9.0.9.$ # $ # $ # $ # $ # $ # @ ",
" # $ # # # $ # # # $ # # # % # j+f k+l+m+# % & % % % % % % % % @ n+o+p+;.f q+r+* # $ # # # $ # # # $ # # # $ @ ",
" $ # $ # $ # $ # $ # $ # $ % $ s+s W.t+/ % & & % $ . . . # . % % % u+v+W.u w+$ # $ # $ # $ # $ # $ # $ # $ # @ ",
" # $ # $ # $ # $ # $ # $ # % # x+f y+z+A+& & & & % % % % % % % # . B+C+b+D+E+# $ # $ # $ # $ # $ # $ # $ # $ @ ",
" $ # $ # $ # $ # $ # $ # $ % $ F+G+H+I+& & [.0.z $ % % % % . % % % J+K+L+M+N+% # $ # $ # $ # $ # $ # $ # $ # @ ",
" $ $ # $ $ $ # $ $ $ # $ $ % % % % % [.0.9.0.2 $ $ $ % % % % % % % % % $ % % % % $ $ # $ $ $ # $ $ $ # $ $ $ @ ",
" $ # $ # $ # $ # $ # $ # $ # $ & & & & & & z [.# $ # $ & % % % % % % % % % % % % % # $ # $ # $ # $ # $ # $ # @ ",
" $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ & & & & & $ $ $ $ $ $ $ $ & & & & & & % % % % % % % & $ $ $ $ $ $ $ $ $ $ $ $ @ ",
" $ # $ # $ # $ # $ # $ # $ # $ # O+# $ 2 $ # $ # $ # $ . $ # $ * $ # & & & & & & & & & # $ # $ # $ # $ # $ # @ ",
" $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ O+$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ O+$ $ $ $ $ $ $ $ $ $ $ @ ",
" $ $ $ # $ $ $ # $ $ $ # $ $ $ # $ $ $ # $ $ $ # $ $ $ # $ $ $ # $ $ $ # $ $ $ # $ $ $ # $ $ $ # $ $ $ # $ $ @ ",
" $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ @ ",
" $ # $ $ $ $ $ $ $ # $ $ $ $ $ $ $ # $ $ $ $ $ $ $ # $ $ $ $ $ $ $ # $ $ $ $ $ $ $ # $ $ $ $ $ $ $ # $ $ $ $ @ ",
" $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ @ ",
" $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ @ ",
"+ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ "};

View file

@ -21,12 +21,17 @@
#include "wizard_pages.h"
#include "bootloaders.h"
#include <wx/regex.h>
#include <wx/tokenzr.h>
/////// Bootplatform page ///////////////////////////////////77
wxBootPlatformPage::wxBootPlatformPage(wxWizard *parent) : wxWizardPageSimple(parent)
{
wxBoxSizer* WxBoxSizer1 = new wxBoxSizer(wxVERTICAL);
wxStaticText* WxStaticText1 = new wxStaticText(this, wxID_ANY,
_("Please select the model of audio device that you would like to"
wxT("Please select the model of audio device that you would like to"
"\ninstall the Rockbox Bootloader on from the list below:"));
WxBoxSizer1->Add(WxStaticText1,0,wxGROW | wxALL,5);
@ -61,12 +66,12 @@ wxBootPlatformPage::wxBootPlatformPage(wxWizard *parent) : wxWizardPageSimple(pa
wxWizardPage * wxBootPlatformPage::GetNext() const
{
if(gv->curbootloadermethod != "fwpatcher"&& gv->curbootloadermethod != "ipodpatcher")
if(gv->curbootloadermethod != wxT("fwpatcher")&& gv->curbootloadermethod != wxT("ipodpatcher"))
{
if(wxWizardPageSimple::GetNext()->GetNext() != NULL) // not iriver hx0 and ipod, skip one page
return wxWizardPageSimple::GetNext()->GetNext();
}
else if(gv->curbootloadermethod == "ipodpatcher")
else if(gv->curbootloadermethod == wxT("ipodpatcher"))
{
if(wxWizardPageSimple::GetNext()->GetNext() != NULL)
if(wxWizardPageSimple::GetNext()->GetNext()->GetNext() != NULL)
@ -83,8 +88,8 @@ bool wxBootPlatformPage::TransferDataFromWindow()
{
if (BootPlatformListBox->GetSelection() == wxNOT_FOUND )
{
WARN_DIALOG(_("You must select an audio device type before proceeding"),
_("Select Platform"));
WARN_DIALOG(wxT("You must select an audio device type before proceeding"),
wxT("Select Platform"));
return false;
} else
{
@ -98,13 +103,13 @@ bool wxBootPlatformPage::TransferDataFromWindow()
return true;
}
}
//// Plattfor Page //////////////////////////
wxPlatformPage::wxPlatformPage(wxWizard *parent) : wxWizardPageSimple(parent)
{
wxBoxSizer* WxBoxSizer1 = new wxBoxSizer(wxVERTICAL);
wxStaticText* WxStaticText1 = new wxStaticText(this, wxID_ANY,
_("Please select the model of audio device that you would like to"
wxT("Please select the model of audio device that you would like to"
"\ninstall Rockbox on from the list below:"));
WxBoxSizer1->Add(WxStaticText1,0,wxGROW | wxALL,5);
@ -124,17 +129,274 @@ bool wxPlatformPage::TransferDataFromWindow()
{
if (PlatformListBox->GetSelection() == wxNOT_FOUND )
{
WARN_DIALOG(_("You must select an audio device type before proceeding"),
_("Select Platform"));
WARN_DIALOG(wxT("You must select an audio device type before proceeding"),
wxT("Select Platform"));
return false;
} else
{
gv->curplatnum = PlatformListBox->GetSelection();
gv->curplat = gv->plat_id[gv->curplatnum];
gv->curresolution = gv->plat_resolution[gv->curplatnum];
return true;
}
}
//////////////// ThemeImage Dialog /////////////////
BEGIN_EVENT_TABLE(wxThemeImageDialog,wxDialog)
EVT_PAINT(wxThemeImageDialog::OnPaint)
END_EVENT_TABLE();
wxThemeImageDialog::wxThemeImageDialog(wxWindow* parent,wxWindowID id,wxString title,wxBitmap bmp) :
wxDialog(parent, id, title)
{
wxBoxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
m_bitmap = bmp;
sizerTop->SetMinSize(m_bitmap.GetWidth(),m_bitmap.GetHeight());
SetSizer(sizerTop);
sizerTop->SetSizeHints(this);
sizerTop->Fit(this);
}
void wxThemeImageDialog::OnPaint(wxPaintEvent& WXUNUSED(event))
{
wxPaintDC dc( this );
dc.DrawBitmap( m_bitmap, 0, 0, true /* use mask */ );
}
////////////////// Themes page ////////////////////////
BEGIN_EVENT_TABLE(wxThemesPage,wxWizardPageSimple)
EVT_WIZARD_PAGE_CHANGED (wxID_ANY, wxThemesPage::OnPageShown)
EVT_WIZARD_PAGE_CHANGING (wxID_ANY, wxThemesPage::OnWizardPageChanging)
EVT_LISTBOX (ID_LISTBOX,wxThemesPage::OnListBox)
EVT_BUTTON (ID_PREVIEW_BTN, wxThemesPage::OnPreviewBtn)
EVT_CHECKBOX (ID_INSTALLCHECKBOX, wxThemesPage::OnCheckBox)
END_EVENT_TABLE();
wxThemesPage::wxThemesPage(wxWizard *parent) : wxWizardPageSimple(parent)
{
m_parent = parent;
wxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);
wxStaticText* WxStaticText1 = new wxStaticText(this, wxID_ANY,
wxT("Please select the Theme you would like to"
"\ninstall on your Device from the list below:"));
mainSizer->Add(WxStaticText1,0,wxGROW | wxALL,5);
// create theme listbox
wxArrayString list;
for(int i = 0; i< 35;i++)
list.Add("");
ThemesListBox= new wxListBox(this, ID_LISTBOX, wxDefaultPosition,
wxDefaultSize,list, wxLB_SINGLE);
mainSizer->Add(ThemesListBox,10,wxGROW | wxALL,5);
// create groupbox
wxStaticBox* groupbox= new wxStaticBox(this,wxID_ANY,wxT("Selected Theme:"));
wxBoxSizer* styleSizer = new wxStaticBoxSizer( groupbox, wxVERTICAL );
mainSizer->Add(styleSizer,11,wxGROW | wxALL,5);
// horizontal sizer
wxBoxSizer* wxBoxSizer2 = new wxBoxSizer(wxHORIZONTAL);
styleSizer->Add(wxBoxSizer2,0,wxGROW | wxALL,0);
// preview button
m_previewBtn = new wxButton(this, ID_PREVIEW_BTN, wxT("Preview"),
wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator,
wxT("PreviewBtn"));
wxBoxSizer2->Add(m_previewBtn,0,wxGROW | wxALL,5);
// checkbox for Install
m_InstallCheckBox= new wxCheckBox(this,ID_INSTALLCHECKBOX,wxT("Install")
,wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator,
wxT("InstallCheckbox"));
wxBoxSizer2->Add(m_InstallCheckBox,0,wxGROW | wxALL,5);
// horizontal sizer
wxBoxSizer* wxBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
styleSizer->Add(wxBoxSizer3,0,wxGROW | wxALL,0);
// File size
wxStaticText* size= new wxStaticText(this,wxID_ANY,wxT("Filesize:"));
wxBoxSizer3->Add(size,0,wxGROW | wxALL,5);
m_size= new wxStaticText(this,wxID_ANY,wxT(""));
wxBoxSizer3->Add(m_size,0,wxGROW | wxALL,5);
// Description
wxStaticText* desc= new wxStaticText(this,wxID_ANY,wxT("Description:"));
styleSizer->Add(desc,0,wxGROW | wxALL,5);
m_desc= new wxStaticText(this,wxID_ANY,wxT(""));
styleSizer->Add(m_desc,0,wxGROW | wxALL,5);
SetSizer(mainSizer);
mainSizer->Fit(this);
}
bool wxThemesPage::TransferDataFromWindow()
{
gv->themesToInstall.Clear();
for(int i=0; i < m_installTheme.GetCount(); i++)
{
if(m_installTheme[i])
{
gv->themesToInstall.Add(m_Themes_path[i]);
}
}
return true;
}
void wxThemesPage::OnWizardPageChanging(wxWizardEvent& event)
{
if(event.GetDirection()) // going forwards in the Wizard
{
if(gv->themesToInstall.GetCount() == 0)
{
WARN_DIALOG(wxT("You have not selected a Theme to Install"), wxT("Select a Theme"));
event.Veto();
}
}
}
void wxThemesPage::OnCheckBox(wxCommandEvent& event)
{
int index = ThemesListBox->GetSelection(); //get Index
if(index == wxNOT_FOUND)
return;
m_installTheme[index]= ! m_installTheme[index]; // Toggle install
}
void wxThemesPage::OnListBox(wxCommandEvent& event)
{
int index = ThemesListBox->GetSelection(); //get Index
if(index == wxNOT_FOUND)
return;
m_desc->SetLabel(m_Themes_desc[index]); //set Desc
m_desc->Wrap(270); // wrap desc
m_size->SetLabel(m_Themes_size[index]+wxT(" kb")); //set file size
m_InstallCheckBox->SetValue(m_installTheme[index]); // set the install checkbox
this->GetSizer()->Layout();
}
void wxThemesPage::OnPreviewBtn(wxCommandEvent& event)
{
int index = ThemesListBox->GetSelection();
if(index == wxNOT_FOUND)
return;
wxString src,dest;
int pos = m_Themes_image[index].Find('/',true);
wxString filename = m_Themes_image[index](pos+1,m_Themes_image[index].Length());
dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "%s"),
gv->stdpaths->GetUserDataDir().c_str(),gv->curresolution.c_str());
if(!wxDirExists(dest))
wxMkdir(dest);
//this is a URL no PATH_SEP
src.Printf("%s/data/%s/%s",gv->themes_url.c_str(),gv->curresolution.c_str(),filename.c_str());
dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "%s" PATH_SEP "%s"),
gv->stdpaths->GetUserDataDir().c_str(),gv->curresolution.c_str(),filename.c_str());
if(DownloadURL(src, dest))
{
MESG_DIALOG(wxT("Unable to download image."));
return;
}
wxBitmap bmp;
bmp.LoadFile(dest,wxBITMAP_TYPE_PNG);
wxThemeImageDialog dlg(this,wxID_ANY,wxT("Preview"),bmp);
dlg.ShowModal();
}
void wxThemesPage::OnPageShown(wxWizardEvent& event)
{
// clear Theme info
m_Themes.Clear();
m_Themes_image.Clear();
m_Themes_path.Clear();
m_Themes_desc.Clear();
m_Themes_size.Clear();
m_installTheme.Clear();
m_desc->SetLabel(wxT(""));
m_size->SetLabel(wxT(""));
m_InstallCheckBox->SetValue(false);
//get correct Themes list
wxString src,dest,err;
src.Printf("%srbutil.php?res=%s",gv->themes_url.c_str(),gv->curresolution.c_str());
dest.Printf(wxT("%s" PATH_SEP "download" PATH_SEP "%s.list"),
gv->stdpaths->GetUserDataDir().c_str(),gv->curresolution.c_str());
if(DownloadURL(src, dest))
{
MESG_DIALOG(wxT("Unable to download themes list."));
return;
}
//read and parse Themes list
wxString themelistraw;
wxFFile themefile;
if(!themefile.Open(dest)) //open file
{
MESG_DIALOG(wxT("Unable to open themes list."));
return;
}
if(!themefile.ReadAll(&themelistraw)) //read complete file
{
MESG_DIALOG(wxT("Unable to read themes list."));
return;
}
wxRegEx reAll(wxT("<body >(.+)</body>")); //extract body part
if(! reAll.Matches(themelistraw))
{
MESG_DIALOG(wxT("Themes list is in wrong Format."));
return;
}
wxString lines = reAll.GetMatch(themelistraw,1);
// prepare text
lines.Replace(wxT("<br />"),wxT(""),true); //replace <br /> with nothing
lines.Replace(wxT("\n"),wxT(""),true); //replace \n with nothing
lines.Trim(true); //strip WS at end
lines.Trim(false); //strip WS at beginning
wxStringTokenizer tkz(lines,wxT("|")); //tokenize it
while ( tkz.HasMoreTokens() ) // read all entrys
{
m_Themes.Add(tkz.GetNextToken()); //Theme name
m_Themes_path.Add(tkz.GetNextToken()); //Theme path
m_Themes_size.Add(tkz.GetNextToken()); //File size
m_Themes_image.Add(tkz.GetNextToken()); //Screenshot
m_Themes_desc.Add(tkz.GetNextToken()); //Description
m_installTheme.Add(false); //Theme should be installed ?
}
// set ThemeList
ThemesListBox->Set(m_Themes);
}
//////////////////// Ipod Locaction Page /////////////////////////////
BEGIN_EVENT_TABLE(wxIpodLocationPage,wxWizardPageSimple)
EVT_BUTTON (ID_IPODLOCATION_BTN, wxIpodLocationPage::OnIpodLocationBtn)
EVT_WIZARD_PAGE_CHANGING(wxID_ANY, wxIpodLocationPage::OnWizardPageChanging)
@ -178,7 +440,7 @@ wxIpodLocationPage::wxIpodLocationPage(wxWizard* parent) : wxWizardPageSimple(pa
wxWizardPage* wxIpodLocationPage::GetPrev() const
{
if(gv->curbootloadermethod == "ipodpatcher") //if ipod, skip previous
if(gv->curbootloadermethod == wxT("ipodpatcher")) //if ipod, skip previous
{
if(wxWizardPageSimple::GetPrev()->GetPrev() != NULL)
return wxWizardPageSimple::GetPrev()->GetPrev();
@ -190,13 +452,13 @@ void wxIpodLocationPage::OnWizardPageChanging(wxWizardEvent& event)
{
if(event.GetDirection()) // going forwards in the Wizard
{
if(gv->curbootloadermethod=="ipodpatcher")
if(gv->curbootloadermethod==wxT("ipodpatcher"))
{
if(IpodLocationText->GetLabel() == "no Ipod found" ||
IpodLocationText->GetLabel() =="More than 1 Ipod found" ||
IpodLocationText->GetLabel() =="")
if(IpodLocationText->GetLabel() == wxT("no Ipod found") ||
IpodLocationText->GetLabel() ==wxT("More than 1 Ipod found") ||
IpodLocationText->GetLabel() ==wxT(""))
{
WARN_DIALOG(_("No valid ipod found!"), _("Select Location"));
WARN_DIALOG(wxT("No valid ipod found!"), wxT("Select Location"));
event.Veto(); //stop pagechanging
}
}
@ -205,27 +467,27 @@ void wxIpodLocationPage::OnWizardPageChanging(wxWizardEvent& event)
void wxIpodLocationPage::OnIpodLocationBtn(wxCommandEvent& event)
{
wxLogVerbose("=== begin wxIpodLocationPage::OnIpodLocationBtn");
wxLogVerbose(wxT("=== begin wxIpodLocationPage::OnIpodLocationBtn"));
struct ipod_t ipod;
int n = ipod_scan(&ipod);
gv->curbootloader="";
gv->curbootloader=wxT("");
if(n == 0)
IpodLocationText->SetLabel("no Ipod found");
IpodLocationText->SetLabel(wxT("no Ipod found"));
else if( n==1)
{
gv->curbootloader="bootloader-";
gv->curbootloader=wxT("bootloader-");
gv->curbootloader.Append(ipod.targetname);
IpodLocationText->SetLabel(ipod.modelstr);
}
else
IpodLocationText->SetLabel("More than 1 Ipod found");
IpodLocationText->SetLabel(wxT("More than 1 Ipod found"));
if(ipod.macpod)
IpodLocationExtraText->SetLabel("This Ipod is a Mac formated Ipod\n"
IpodLocationExtraText->SetLabel(wxT("This Ipod is a Mac formated Ipod\n"
"Rockbox will not work on this.\n"
"You have to convert it first to Fat32");
wxLogVerbose("=== end wxIpodLocationPage::OnIpodLocationBtn");
"You have to convert it first to Fat32"));
wxLogVerbose(wxT("=== end wxIpodLocationPage::OnIpodLocationBtn"));
}
@ -251,7 +513,7 @@ wxBootLocationPage::wxBootLocationPage(wxWizard* parent) : wxWizardPageSimple(pa
WxBoxSizer1->Add(WxBoxSizer3,0,
wxGROW | wxALIGN_CENTER_VERTICAL | wxALL, 5);
if (gv->curdestdir == wxT("")) gv->curdestdir = _("<none>");
if (gv->curdestdir == wxT("")) gv->curdestdir = wxT("<none>");
BootLocationText = new wxStaticText(this, wxID_ANY, gv->curdestdir,
wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
WxBoxSizer3->Add(BootLocationText,1,
@ -269,7 +531,7 @@ wxBootLocationPage::wxBootLocationPage(wxWizard* parent) : wxWizardPageSimple(pa
wxWizardPage* wxBootLocationPage::GetPrev() const
{
if(gv->curbootloadermethod != "fwpatcher")
if(gv->curbootloadermethod != wxT("fwpatcher"))
{
if(wxWizardPageSimple::GetPrev()->GetPrev() != NULL)
return wxWizardPageSimple::GetPrev()->GetPrev();
@ -281,7 +543,7 @@ wxWizardPage* wxBootLocationPage::GetPrev() const
wxWizardPage* wxBootLocationPage::GetNext() const
{
if(gv->curbootloadermethod == "ipodpatcher")
if(gv->curbootloadermethod == wxT("ipodpatcher"))
{
return wxWizardPageSimple::GetNext(); // if ipod then this is not the last page
}
@ -294,8 +556,8 @@ void wxBootLocationPage::OnWizardPageChanging(wxWizardEvent& event)
{
if(!wxDirExists(BootLocationText->GetLabel()))
{
WARN_DIALOG(_("You have not selected a valid location for your audio "
"device"), _("Select Location"));
WARN_DIALOG(wxT("You have not selected a valid location for your audio "
"device"), wxT("Select Location"));
event.Veto();
}
@ -313,13 +575,13 @@ bool wxBootLocationPage::TransferDataFromWindow()
void wxBootLocationPage::OnBootLocationBtn(wxCommandEvent& event)
{
const wxString& temp = wxDirSelector(
_("Please select the location of your audio device"), gv->curdestdir);
wxLogVerbose("=== begin wxBootLocationPage::OnBootLocationBtn(event)");
wxT("Please select the location of your audio device"), gv->curdestdir);
wxLogVerbose(wxT("=== begin wxBootLocationPage::OnBootLocationBtn(event)"));
if (!temp.empty())
{
BootLocationText->SetLabel(temp);
}
wxLogVerbose("=== end wxBootLocationPage::OnBootLocationBtn");
wxLogVerbose(wxT("=== end wxBootLocationPage::OnBootLocationBtn"));
}
@ -368,8 +630,8 @@ void wxFirmwareLocationPage::OnWizardPageChanging(wxWizardEvent& event)
{
if( !wxFileExists(gv->curfirmware))
{
WARN_DIALOG(_("You have not selected a valid location for the firmware "
"file"), _("Select File"));
WARN_DIALOG(wxT("You have not selected a valid location for the firmware "
"file"), wxT("Select File"));
event.Veto();
}
}
@ -379,8 +641,8 @@ void wxFirmwareLocationPage::OnWizardPageChanging(wxWizardEvent& event)
void wxFirmwareLocationPage::OnFirmwareFilenameBtn(wxCommandEvent& event)
{
wxString temp = wxFileSelector(
_("Please select the location of the original Firmware"), gv->curdestdir,"","","*.hex");
wxLogVerbose("=== begin wxFirmwareLocationPage::OnFirmwareFilenameBtn(event)");
wxT("Please select the location of the original Firmware"), gv->curdestdir,"","","*.hex");
wxLogVerbose(wxT("=== begin wxFirmwareLocationPage::OnFirmwareFilenameBtn(event)"));
if (!temp.empty())
{
gv->curfirmware=temp;
@ -391,7 +653,7 @@ void wxFirmwareLocationPage::OnFirmwareFilenameBtn(wxCommandEvent& event)
}
FirmwareLocationFilename->SetLabel(temp);
}
wxLogVerbose("=== end wxFirmwareLocationPage::OnFirmwareFilenameBtn");
wxLogVerbose(wxT("=== end wxFirmwareLocationPage::OnFirmwareFilenameBtn"));
}
BEGIN_EVENT_TABLE(wxLocationPage,wxWizardPageSimple)
@ -413,7 +675,7 @@ wxLocationPage::wxLocationPage(wxWizard* parent) : wxWizardPageSimple(parent)
WxBoxSizer1->Add(WxBoxSizer3,0,
wxGROW | wxALIGN_CENTER_VERTICAL | wxALL, 5);
if (gv->curdestdir == wxT("")) gv->curdestdir = _("<none>");
if (gv->curdestdir == wxT("")) gv->curdestdir = wxT("<none>");
LocationText = new wxStaticText(this, wxID_ANY, gv->curdestdir,
wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
WxBoxSizer3->Add(LocationText,1,
@ -436,8 +698,8 @@ void wxLocationPage::OnWizardPageChanging(wxWizardEvent& event)
{
if(!wxDirExists(LocationText->GetLabel()))
{
WARN_DIALOG(_("You have not selected a valid location for your audio "
"device"), _("Select Location"));
WARN_DIALOG(wxT("You have not selected a valid location for your audio "
"device"), wxT("Select Location"));
event.Veto();
}
}
@ -452,13 +714,13 @@ bool wxLocationPage::TransferDataFromWindow()
void wxLocationPage::OnLocationBtn(wxCommandEvent& event)
{
const wxString& temp = wxDirSelector(
_("Please select the location of your audio device"), gv->curdestdir);
wxLogVerbose("=== begin wxLocationPage::OnLocationBtn(event)");
wxT("Please select the location of your audio device"), gv->curdestdir);
wxLogVerbose(wxT("=== begin wxLocationPage::OnLocationBtn(event)"));
if (!temp.empty())
{
LocationText->SetLabel(temp);
}
wxLogVerbose("=== end wxLocationPage::OnLocationBtn");
wxLogVerbose(wxT("=== end wxLocationPage::OnLocationBtn"));
}
BEGIN_EVENT_TABLE(wxBuildPage,wxWizardPageSimple)
@ -479,17 +741,17 @@ wxBuildPage::wxBuildPage(wxWizard *parent) : wxWizardPageSimple(parent)
WxBoxSizer1->Add(WxStaticText1,0,wxGROW | wxALL,5);
wxArrayString* array = new wxArrayString();
buf.Printf(_("Rockbox stable version (%s)") , gv->last_release.c_str());
buf.Printf(wxT("Rockbox stable version (%s)") , gv->last_release.c_str());
array->Add(buf);
array->Add(_("Archived Build"));
array->Add(_("Current Build "));
array->Add(wxT("Archived Build"));
array->Add(wxT("Current Build "));
BuildRadioBox = new wxRadioBox(this, ID_BUILD_BOX, _("Version"),
BuildRadioBox = new wxRadioBox(this, ID_BUILD_BOX, wxT("Version"),
wxDefaultPosition, wxDefaultSize, *array, 0, wxRA_SPECIFY_ROWS);
WxBoxSizer1->Add(BuildRadioBox, 0, wxGROW | wxALL, 5);
delete array;
wxStaticBox* WxStaticBox1 = new wxStaticBox(this, wxID_ANY, _("Details:"));
wxStaticBox* WxStaticBox1 = new wxStaticBox(this, wxID_ANY, wxT("Details:"));
wxStaticBoxSizer* WxStaticBoxSizer2 = new wxStaticBoxSizer(WxStaticBox1,
wxVERTICAL);
DetailText = new wxStaticText(this, wxID_ANY, wxT(""));
@ -497,13 +759,13 @@ wxBuildPage::wxBuildPage(wxWizard *parent) : wxWizardPageSimple(parent)
WxStaticBoxSizer2->Add(DetailText, 1, wxGROW | wxALL, 5);
wxStaticText* WxStaticText2 = new wxStaticText(this, wxID_ANY,
_("Rockbox Utility stores copies of Rockbox it has downloaded on the\n"
wxT("Rockbox Utility stores copies of Rockbox it has downloaded on the\n"
"local hard disk to save network traffic. If your local copy is\n"
"no longer working, tick this box to download a fresh copy.") );
WxBoxSizer1->Add(WxStaticText2, 0 , wxALL, 5);
NoCacheCheckBox = new wxCheckBox(this, wxID_ANY,
_("Don't use locally cached copies of Rockbox") );
wxT("Don't use locally cached copies of Rockbox") );
WxBoxSizer1->Add(NoCacheCheckBox, 0, wxALL, 5);
SetSizer(WxBoxSizer1);
@ -577,7 +839,7 @@ wxFullUninstallPage::wxFullUninstallPage(wxWizard* parent) :
wxBoxSizer* WxBoxSizer1 = new wxBoxSizer(wxVERTICAL);
wxStaticText* WxStaticText1 = new wxStaticText(this, wxID_ANY,
_("Rockbox Utility normally uninstalls Rockbox using an uninstall\n"
wxT("Rockbox Utility normally uninstalls Rockbox using an uninstall\n"
"file created during installation. This means that when Rockbox is\n"
"uninstalled all your configuration files are preserved. However,\n"
"you can also perform a full uninstall, which will completely\n"
@ -588,7 +850,7 @@ wxFullUninstallPage::wxFullUninstallPage(wxWizard* parent) :
WxBoxSizer1->Add(WxStaticText1,0,wxGROW | wxALL,5);
FullCheckBox = new wxCheckBox(this, wxID_ANY,
_("Perform a full uninstall"));
wxT("Perform a full uninstall"));
WxBoxSizer1->Add(FullCheckBox, 0, wxALL, 5);
SetSizer(WxBoxSizer1);

View file

@ -24,6 +24,60 @@
#include "rbutil.h"
////// Dialog for Preview of Theme //////////////
class wxThemeImageDialog : public wxDialog
{
private:
DECLARE_EVENT_TABLE()
public:
wxThemeImageDialog(wxWindow* parent,wxWindowID id,wxString title,wxBitmap bmp);
void OnPaint(wxPaintEvent& WXUNUSED(event));
private:
wxBitmap m_bitmap;
};
class wxThemesPage : public wxWizardPageSimple
{
private:
DECLARE_EVENT_TABLE()
public:
enum {
ID_PREVIEW_BTN = 1000,
ID_LISTBOX = 1001,
ID_INSTALLCHECKBOX = 1002,
};
public:
wxThemesPage(wxWizard *parent);
virtual bool TransferDataFromWindow(void);
void OnPageShown(wxWizardEvent& event);
void OnPreviewBtn(wxCommandEvent& event);
void OnListBox(wxCommandEvent& event);
void OnCheckBox(wxCommandEvent& event);
void OnWizardPageChanging(wxWizardEvent& event);
public:
wxListBox* ThemesListBox;
wxButton* m_previewBtn;
wxStaticText* m_desc;
wxStaticText* m_size;
wxCheckBox* m_InstallCheckBox;
wxArrayString m_Themes;
wxArrayString m_Themes_path;
wxArrayString m_Themes_image;
wxArrayString m_Themes_desc;
wxArrayString m_Themes_size;
wxArrayInt m_installTheme;
};
class wxBootPlatformPage : public wxWizardPageSimple
{
public: