* Updated download URLs to use sourceforge repository.

* Updated language file URL to download correct revision.
This commit is contained in:
cyan06 2015-08-15 15:21:54 +00:00
parent 991e48c398
commit 56d1cc69ce
6 changed files with 43 additions and 19 deletions

View File

@ -2,8 +2,8 @@
<app version="1"> <app version="1">
<name> USB Loader GX</name> <name> USB Loader GX</name>
<coder>USB Loader GX Team</coder> <coder>USB Loader GX Team</coder>
<version>3.0 r1255</version> <version>3.0 r1256</version>
<release_date>20150814142358</release_date> <release_date>20150815150707</release_date>
<!-- // remove this line to enable arguments <!-- // remove this line to enable arguments
<arguments> <arguments>
<arg>--ios=250</arg> <arg>--ios=250</arg>
@ -33,8 +33,10 @@ Libogc/Devkit: Shagkur and Wintermute
FreeTypeGX: Armin Tamzarian. FreeTypeGX: Armin Tamzarian.
Links: Links:
USB Loader GX Project Page and Support Site: USB Loader GX Project Page
http://code.google.com/p/usbloader-gui/ https://sourceforge.net/projects/usbloadergx/
Support Site:
http://gbatemp.net/index.php?showtopic=149922
Help Website: Help Website:
http://usbloadergx.koureio.net/ http://usbloadergx.koureio.net/
WiiTDB Site: WiiTDB Site:

View File

@ -1,6 +1,7 @@
/**************************************************************************** /****************************************************************************
* languagefile updater * languagefile updater
* for USB Loader GX *giantpune* * for USB Loader GX *giantpune*
* 2015 Cyan
***************************************************************************/ ***************************************************************************/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -19,10 +20,11 @@
#include "prompts/ProgressWindow.h" #include "prompts/ProgressWindow.h"
#include "utils/ShowError.h" #include "utils/ShowError.h"
#include "gecko.h" #include "gecko.h"
#include "svnrev.h"
static const char * LanguageFilesURL = "http://usbloader-gui.googlecode.com/svn/trunk/Languages/"; static const char * LanguageFilesURL = "http://svn.code.sf.net/p/usbloadergx/code/trunk/Languages/";
int DownloadAllLanguageFiles() int DownloadAllLanguageFiles(int revision)
{ {
if(!CreateSubfolder(Settings.languagefiles_path)) if(!CreateSubfolder(Settings.languagefiles_path))
{ {
@ -40,6 +42,11 @@ int DownloadAllLanguageFiles()
URL_List LinkList(LanguageFilesURL); URL_List LinkList(LanguageFilesURL);
int listsize = LinkList.GetURLCount(); int listsize = LinkList.GetURLCount();
int files_downloaded = 0; int files_downloaded = 0;
char target[6];
if(revision > 0)
snprintf(target, sizeof(target), "%d", revision);
else
snprintf(target, sizeof(target), "%s", GetRev());
ShowProgress(tr("Updating Language Files:"), 0, 0, 0, listsize, false, true); ShowProgress(tr("Updating Language Files:"), 0, 0, 0, listsize, false, true);
@ -60,7 +67,7 @@ int DownloadAllLanguageFiles()
ShowProgress(tr("Updating Language Files:"), 0, filename, i, listsize, false, true); ShowProgress(tr("Updating Language Files:"), 0, filename, i, listsize, false, true);
snprintf(fullURL, sizeof(fullURL), "%s%s", LanguageFilesURL, filename); snprintf(fullURL, sizeof(fullURL), "%s%s?p=%s", LanguageFilesURL, filename, target);
struct block file = downloadfile(fullURL); struct block file = downloadfile(fullURL);
if (file.data) if (file.data)
@ -80,6 +87,12 @@ int DownloadAllLanguageFiles()
ProgressStop(); ProgressStop();
// reload current language file
if(Settings.language_path[0] != 0)
Settings.LoadLanguage(Settings.language_path, CONSOLE_DEFAULT);
else
Settings.LoadLanguage(NULL, CONSOLE_DEFAULT);
return files_downloaded; return files_downloaded;
} }
@ -118,7 +131,7 @@ int UpdateLanguageFiles()
//build the URL, save path, and download each file and save it //build the URL, save path, and download each file and save it
for(int i = 0; i < Dir.GetFilecount(); ++i) for(int i = 0; i < Dir.GetFilecount(); ++i)
{ {
snprintf(codeurl, sizeof(codeurl), "%s%s", LanguageFilesURL, Dir.GetFilename(i)); snprintf(codeurl, sizeof(codeurl), "%s%s?p=%s", LanguageFilesURL, Dir.GetFilename(i), GetRev());
snprintf(savepath, sizeof(savepath), "%s/%s", Settings.languagefiles_path, Dir.GetFilename(i)); snprintf(savepath, sizeof(savepath), "%s/%s", Settings.languagefiles_path, Dir.GetFilename(i));
struct block file = downloadfile(codeurl); struct block file = downloadfile(codeurl);
@ -141,6 +154,12 @@ int UpdateLanguageFiles()
ProgressStop(); ProgressStop();
// reload current language file
if(Settings.language_path[0] != 0)
Settings.LoadLanguage(Settings.language_path, CONSOLE_DEFAULT);
else
Settings.LoadLanguage(NULL, CONSOLE_DEFAULT);
// return the number of files we updated // return the number of files we updated
return done; return done;
} }

View File

@ -14,6 +14,6 @@
//! returns -2 if it can't find any .lang files in the path //! returns -2 if it can't find any .lang files in the path
//! return -1 if there is no network connection //! return -1 if there is no network connection
int UpdateLanguageFiles(); int UpdateLanguageFiles();
int DownloadAllLanguageFiles(); int DownloadAllLanguageFiles(int target = 0);
#endif #endif

View File

@ -170,7 +170,7 @@ int UpdateGameTDB()
static void UpdateIconPng() static void UpdateIconPng()
{ {
char iconpath[200]; char iconpath[200];
struct block file = downloadfile("http://usbloader-gui.googlecode.com/svn/branches/updates/icon.png"); struct block file = downloadfile("http://svn.code.sf.net/p/usbloadergx/code/branches/updates/icon.png");
if (file.data != NULL) if (file.data != NULL)
{ {
snprintf(iconpath, sizeof(iconpath), "%sicon.png", Settings.update_path); snprintf(iconpath, sizeof(iconpath), "%sicon.png", Settings.update_path);
@ -187,7 +187,8 @@ static void UpdateIconPng()
static void UpdateMetaXml() static void UpdateMetaXml()
{ {
char xmlpath[200]; char xmlpath[200];
struct block file = downloadfile("http://usbloader-gui.googlecode.com/svn/branches/updates/meta.xml"); struct block file = downloadfile("http://svn.code.sf.net/p/usbloadergx/code/branches/updates/meta.xml");
// if not working, use this url form: http://sourceforge.net/p/usbloadergx/code/1254/tree//branches/updates/meta.xml?format=raw
if (file.data != NULL) if (file.data != NULL)
{ {
snprintf(xmlpath, sizeof(xmlpath), "%smeta.xml", Settings.update_path); snprintf(xmlpath, sizeof(xmlpath), "%smeta.xml", Settings.update_path);
@ -210,9 +211,9 @@ int CheckUpdate()
int currentrev = atoi(GetRev()); int currentrev = atoi(GetRev());
#ifdef FULLCHANNEL #ifdef FULLCHANNEL
struct block file = downloadfile( "http://usbloader-gui.googlecode.com/svn/branches/updates/update_wad.txt" ); struct block file = downloadfile( "http://svn.code.sf.net/p/usbloadergx/code/branches/updates/update_wad.txt" );
#else #else
struct block file = downloadfile("http://usbloader-gui.googlecode.com/svn/branches/updates/update_dol.txt"); struct block file = downloadfile("http://svn.code.sf.net/p/usbloadergx/code/branches/updates/update_dol.txt");
#endif #endif
if (file.data != NULL) if (file.data != NULL)
@ -234,9 +235,9 @@ static int ApplicationDownload(void)
int currentrev = atoi(GetRev()); int currentrev = atoi(GetRev());
#ifdef FULLCHANNEL #ifdef FULLCHANNEL
struct block file = downloadfile( "http://usbloader-gui.googlecode.com/svn/branches/updates/update_wad.txt" ); struct block file = downloadfile( "http://svn.code.sf.net/p/usbloadergx/code/branches/updates/update_wad.txt" );
#else #else
struct block file = downloadfile("http://usbloader-gui.googlecode.com/svn/branches/updates/update_dol.txt"); struct block file = downloadfile("http://svn.code.sf.net/p/usbloadergx/code/branches/updates/update_dol.txt");
#endif #endif
if (file.data != NULL) if (file.data != NULL)
@ -321,7 +322,7 @@ static int ApplicationDownload(void)
UpdateIconPng(); UpdateIconPng();
UpdateMetaXml(); UpdateMetaXml();
UpdateGameTDB(); UpdateGameTDB();
DownloadAllLanguageFiles(); DownloadAllLanguageFiles(newrev);
} }
if(update_error) if(update_error)

View File

@ -389,7 +389,7 @@ void WindowCredits()
currentTxt->SetFont(creditsFont, creditsFontSize); currentTxt->SetFont(creditsFont, creditsFontSize);
txt.push_back(currentTxt); txt.push_back(currentTxt);
currentTxt = new GuiText("http://code.google.com/p/usbloader-gui/", 20, ( GXColor ) {255, 255, 255, 255}); currentTxt = new GuiText("http://sourceforge.net/p/usbloadergx/", 20, ( GXColor ) {255, 255, 255, 255});
currentTxt->SetAlignment(ALIGN_LEFT, ALIGN_TOP); currentTxt->SetAlignment(ALIGN_LEFT, ALIGN_TOP);
currentTxt->SetPosition(160, y); currentTxt->SetPosition(160, y);
currentTxt->SetFont(creditsFont, creditsFontSize); currentTxt->SetFont(creditsFont, creditsFontSize);

View File

@ -76,8 +76,10 @@ Libogc/Devkit: Shagkur and Wintermute
FreeTypeGX: Armin Tamzarian. FreeTypeGX: Armin Tamzarian.
Links: Links:
USB Loader GX Project Page and Support Site: USB Loader GX Project Page
http://code.google.com/p/usbloader-gui/ https://sourceforge.net/projects/usbloadergx/
Support Site:
http://gbatemp.net/index.php?showtopic=149922
Help Website: Help Website:
http://usbloadergx.koureio.net/ http://usbloadergx.koureio.net/
WiiTDB Site: WiiTDB Site: