From ed88fe9658f4adb855494f1d0870005744e94b3b Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Sun, 4 Mar 2012 21:01:11 +0100 Subject: [PATCH] revision 36 - release candidate --- Makefile | 2 +- NEWS | 11 +- mkfilelist | 11 + revisions | 37 +++ source/Menus/menu_main.cpp | 4 +- source/Menus/menu_settings_file.cpp | 4 +- source/Menus/menu_settings_font.cpp | 2 +- source/Menus/menu_settings_language.cpp | 2 +- source/Menus/menu_settings_theme.cpp | 2 +- source/Network/network.cpp | 2 +- source/Network/update.cpp | 10 +- source/Prompts/prompt_font_download.cpp | 2 +- source/Prompts/prompt_language_download.cpp | 2 +- source/Prompts/prompt_theme_download.cpp | 52 ++-- source/Tools/FontSystem.cpp | 6 +- source/Tools/TakeScreenshot.cpp | 6 +- source/Tools/load.cpp | 4 +- source/Tools/save.cpp | 6 +- source/Tools/theme.cpp | 10 +- source/Tools/translate.cpp | 14 +- source/ZipFile.cpp | 328 -------------------- source/ZipFile.h | 64 ---- svnrev/svnrev.sh | 4 +- updates | 204 ++++++++++++ 24 files changed, 327 insertions(+), 462 deletions(-) mode change 100644 => 120000 NEWS create mode 100755 mkfilelist create mode 100644 revisions delete mode 100644 source/ZipFile.cpp delete mode 100644 source/ZipFile.h create mode 100644 updates diff --git a/Makefile b/Makefile index b55042c..d105c48 100644 --- a/Makefile +++ b/Makefile @@ -45,7 +45,7 @@ LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map -Wl,--section-start,.init=0x8 #--------------------------------------------------------------------------------- # any extra libraries we wish to link with the project #--------------------------------------------------------------------------------- -LIBS := -ldi -lpng -lz -lfat -lntfs -lwiiuse -lbte -lasnd -logc -lvorbisidec -lfreetype -lmxml -lext2fs -lzip +LIBS := -ldi -lpng -lz -lfat -lntfs -lwiiuse -lbte -lasnd -logc -lvorbisidec -lfreetype -lmxml -lext2fs #--------------------------------------------------------------------------------- # list of directories containing libraries, this must be the top level containing # include and lib diff --git a/NEWS b/NEWS deleted file mode 100644 index 9897538..0000000 --- a/NEWS +++ /dev/null @@ -1,10 +0,0 @@ -Version 36: -- HBF is now OpenSource! -- Added license-text of GNU GPL v2 -- Added support for EXT2/3/4 -- Adjusted download paths - -TODO Version 36: -- Adjust update paths -- Unpack theme .zip files -- ? diff --git a/NEWS b/NEWS new file mode 120000 index 0000000..814a515 --- /dev/null +++ b/NEWS @@ -0,0 +1 @@ +updates \ No newline at end of file diff --git a/mkfilelist b/mkfilelist new file mode 100755 index 0000000..34f53e7 --- /dev/null +++ b/mkfilelist @@ -0,0 +1,11 @@ +ARC=$1 +THM=$(basename $1 .zip) + +unp -U $1 + +cd $THM/ + +for i in $(ls -1 *.png *.xml); do \ + echo "$THM/file:$i" >> temp ; \ + cat temp | tr "\n" "+" > filelist ; \ +done diff --git a/revisions b/revisions new file mode 100644 index 0000000..aaa9a0f --- /dev/null +++ b/revisions @@ -0,0 +1,37 @@ +36- +35- +34- +33- +32- +31- +30- +29- +28- +27- +26- +25- +24- +23- +22- +21- +20- +19- +18- +17- +16- +15- +14- +13- +12- +11- +10- +9- +8- +7- +6- +5- +4- +3- +2- +1- +end diff --git a/source/Menus/menu_main.cpp b/source/Menus/menu_main.cpp index d0c783e..5a3a62e 100644 --- a/source/Menus/menu_main.cpp +++ b/source/Menus/menu_main.cpp @@ -159,7 +159,7 @@ int MenuMain() LogoHomebrewFilterImg.SetPosition(30, 420); LogoHomebrewFilterImg.SetScale(0.65); - GuiText ownerTxt("hamachi-mp", 18, (GXColor){Theme.owner_1, Theme.owner_2, Theme.owner_3, 255}); + GuiText ownerTxt("Nano", 18, (GXColor){Theme.owner_1, Theme.owner_2, Theme.owner_3, 255}); ownerTxt.SetAlignment(ALIGN_RIGHT, ALIGN_TOP); ownerTxt.SetPosition(-35,430); @@ -1103,4 +1103,4 @@ int MenuMain() mainWindow->Remove(&Apps); mainWindow->Remove(&w); return menu; -} \ No newline at end of file +} diff --git a/source/Menus/menu_settings_file.cpp b/source/Menus/menu_settings_file.cpp index f99cc36..150cb1e 100644 --- a/source/Menus/menu_settings_file.cpp +++ b/source/Menus/menu_settings_file.cpp @@ -389,7 +389,7 @@ int MenuSettingsFile() sprintf (Options.theme, options.value[THEME]); DefaultTheme(); if(stricmp(Options.theme, tr("STANDARD")) != 0) - theme(Settings.device_dat + ":/config/Homebrew Filter/themes/" + Options.theme + "/"); + theme(Settings.device_dat + ":/config/HBF/themes/" + Options.theme + "/"); // Cursor und Hintergrund ändern #ifdef HW_RVL pointer = new GuiImageData(Theme.player_point); @@ -445,7 +445,7 @@ int MenuSettingsFile() if(stricmp(Options.language, tr("STANDARD")) == 0) translate(); else - ini_Open(check_path(Settings.device_dat + ":/config/Homebrew Filter/languages/") + Options.language + ".lang"); + ini_Open(check_path(Settings.device_dat + ":/config/HBF/languages/") + Options.language + ".lang"); /*********************************************************************/ AvailableCategory.categories[0] = tr(Settings.category_name_all); diff --git a/source/Menus/menu_settings_font.cpp b/source/Menus/menu_settings_font.cpp index 12a5cb9..b2e414f 100644 --- a/source/Menus/menu_settings_font.cpp +++ b/source/Menus/menu_settings_font.cpp @@ -46,7 +46,7 @@ int MenuSettingsFont() DIR *dirHandle; struct dirent * dirEntry; - dirHandle = opendir(check_path(Settings.device_dat + ":/config/Homebrew Filter/Fonts").c_str()); + dirHandle = opendir(check_path(Settings.device_dat + ":/config/HBF/Fonts").c_str()); if (dirHandle) { while (0 != (dirEntry = readdir(dirHandle))) { diff --git a/source/Menus/menu_settings_language.cpp b/source/Menus/menu_settings_language.cpp index 413f30d..f53a227 100644 --- a/source/Menus/menu_settings_language.cpp +++ b/source/Menus/menu_settings_language.cpp @@ -46,7 +46,7 @@ int MenuSettingsLanguage() DIR *dirHandle; struct dirent * dirEntry; - dirHandle = opendir(check_path(Settings.device_dat + ":/config/Homebrew Filter/Languages").c_str()); + dirHandle = opendir(check_path(Settings.device_dat + ":/config/HBF/Languages").c_str()); if (dirHandle) { while (0 != (dirEntry = readdir(dirHandle))) diff --git a/source/Menus/menu_settings_theme.cpp b/source/Menus/menu_settings_theme.cpp index b537972..1d2b878 100644 --- a/source/Menus/menu_settings_theme.cpp +++ b/source/Menus/menu_settings_theme.cpp @@ -46,7 +46,7 @@ int MenuSettingsTheme() DIR *dirHandle; struct dirent * dirEntry; - dirHandle = opendir(check_path(Settings.device_dat + ":/config/Homebrew Filter/Themes").c_str()); + dirHandle = opendir(check_path(Settings.device_dat + ":/config/HBF/Themes").c_str()); if (dirHandle) { while (0 != (dirEntry = readdir(dirHandle))) { diff --git a/source/Network/network.cpp b/source/Network/network.cpp index 9d22594..72e7dac 100644 --- a/source/Network/network.cpp +++ b/source/Network/network.cpp @@ -54,7 +54,7 @@ void CheckVersion(void) { if(Settings.checkrev == -1) { - struct block file = downloadfile("http://hamachi-mp.bplaced.net/Downloads/wii/Homebrew_Filter/version.txt"); + struct block file = downloadfile("http://download.tuxfamily.org/hbf/DOL/revisions"); if (file.data != NULL) { revs = (char*)file.data; diff --git a/source/Network/update.cpp b/source/Network/update.cpp index 315d77b..87e5956 100644 --- a/source/Network/update.cpp +++ b/source/Network/update.cpp @@ -12,7 +12,7 @@ bool readrev = true; string CheckNewVersions() { string revs = "error"; - struct block file = downloadfile("http://hamachi-mp.bplaced.net/Downloads/wii/Homebrew_Filter/version.txt"); + struct block file = downloadfile("http://download.tuxfamily.org/hbf/DOL/revisions"); if (file.data != NULL) { revs = (char*)file.data; @@ -24,7 +24,7 @@ string CheckNewVersions() string NewVersionsText() { string text = "error"; - struct block file = downloadfile("http://hamachi-mp.bplaced.net/Downloads/wii/Homebrew_Filter/version_text.txt"); + struct block file = downloadfile("http://download.tuxfamily.org/hbf/DOL/updates"); if (file.data != NULL) { text = (char*)file.data; @@ -38,9 +38,9 @@ string new_update(string rev, string filename) { char url[100]; if(rev == "Beta") - sprintf(url, "http://hamachi-mp.bplaced.net/Downloads/wii/Homebrew_Filter/Beta/%s", filename.c_str()); + sprintf(url, "http://download.tuxfamily.org/hbf/DOL//Beta/%s", filename.c_str()); else - sprintf(url, "http://hamachi-mp.bplaced.net/Downloads/wii/Homebrew_Filter/rev%s/%s", rev.c_str(), filename.c_str()); + sprintf(url, "http://download.tuxfamily.org/hbf/DOL/rev%s/%s", rev.c_str(), filename.c_str()); file = downloadfile(url); if (file.data && file.size > 0) @@ -73,7 +73,7 @@ void update(string filename) { if (file.data && file.size > 0) { - FILE * data = fopen((Settings.device_dat + ":/config/Homebrew Filter/"+ filename).c_str(), "wb"); + FILE * data = fopen((Settings.device_dat + ":/config/HBF/"+ filename).c_str(), "wb"); if(data) { fwrite(file.data, 1, file.size, data); diff --git a/source/Prompts/prompt_font_download.cpp b/source/Prompts/prompt_font_download.cpp index 52e918b..35bf4fb 100644 --- a/source/Prompts/prompt_font_download.cpp +++ b/source/Prompts/prompt_font_download.cpp @@ -90,7 +90,7 @@ void fontDownload(string fontname) struct block file = downloadfile(buffer); if (file.data && file.size > 0 && folder_exists()) { - FILE * data = fopen((Settings.device_dat + ":/config/Homebrew Filter/Fonts/"+ fontname).c_str(), "wb"); + FILE * data = fopen((Settings.device_dat + ":/config/HBF/Fonts/"+ fontname).c_str(), "wb"); if(data) { fwrite(file.data, 1, file.size, data); diff --git a/source/Prompts/prompt_language_download.cpp b/source/Prompts/prompt_language_download.cpp index 389d876..3e6ef1a 100644 --- a/source/Prompts/prompt_language_download.cpp +++ b/source/Prompts/prompt_language_download.cpp @@ -90,7 +90,7 @@ void languageDownload(string languagename) struct block file = downloadfile(buffer); if (file.data && file.size > 0 && folder_exists()) { - FILE * data = fopen((Settings.device_dat + ":/config/Homebrew Filter/Languages/"+ languagename).c_str(), "wb"); + FILE * data = fopen((Settings.device_dat + ":/config/HBF/Languages/"+ languagename).c_str(), "wb"); if(data) { fwrite(file.data, 1, file.size, data); diff --git a/source/Prompts/prompt_theme_download.cpp b/source/Prompts/prompt_theme_download.cpp index c5f719d..9d78b51 100644 --- a/source/Prompts/prompt_theme_download.cpp +++ b/source/Prompts/prompt_theme_download.cpp @@ -11,9 +11,8 @@ #include "Network/network.h" #include "Network/update.h" #include "Network/http.h" -#include "ZipFile.h" -/*** Extern variables ***/ +#/*** Extern variables ***/ extern GuiWindow * mainWindow; /*** Extern functions ***/ @@ -86,30 +85,45 @@ void themeDownload(string themename) ResumeGui(); char buffer[100]; - msgTxt.SetText(themename.c_str()); - sprintf(buffer, "http://www.nanolx.org/hbf/Themes/%s", themename.c_str()); - struct block file = downloadfile(buffer); - if (file.data && file.size > 0) - { - FILE * data = fopen((Settings.device_dat + ":/config/Homebrew Filter/Themes/" + themename + ".zip").c_str(), "wb"); - if(data) - { - fwrite(file.data, 1, file.size, data); - fclose(data); - } - } - - if(file.data) - free(file.data); + sprintf(buffer, "http://www.nanolx.org/hbf/Themes/%s/filelist", themename.c_str()); - ZipFile *zipfile = new ZipFile((Settings.device_dat + ":/config/Homebrew Filter/Themes/" + themename + ".zip").c_str()); - zipfile->ExtractAll((Settings.device_dat + ":/config/Homebrew Filter/Themes/").c_str()); + struct block file = downloadfile(buffer); + if (file.data != NULL) + { + string source_themes = (char*)file.data; + + vector themes; + + while(1) + { + if((signed)source_themes.find(themename.c_str()) == -1) + break; + + source_themes.erase(0, source_themes.find(themename.c_str()) + themename.length() +6); + themes.push_back(source_themes.substr(0, source_themes.find("+"))); + + source_themes.erase(0, source_themes.find("+")); + + } + + for(int i = 0; i < (signed)themes.size(); i++) + { + msgTxt.SetText(themes[i].c_str()); + if(new_theme(themename, themes[i]) != "NULL") + update("Themes/"+ themename + "/" + themes[i]); + } + + free(file.data); + } + + msgTxt.SetText(""); downloadTxt.SetText(tr("finished")); promptWindow.Append(&btn1); + while(stop) { usleep(100); diff --git a/source/Tools/FontSystem.cpp b/source/Tools/FontSystem.cpp index 84c71f0..38fd530 100644 --- a/source/Tools/FontSystem.cpp +++ b/source/Tools/FontSystem.cpp @@ -72,7 +72,7 @@ float GetFontScale() void SetFont() { - SetupDefaultFont((check_path(Settings.device_dat + ":/config/Homebrew Filter/fonts/") + Options.font).c_str()); + SetupDefaultFont((check_path(Settings.device_dat + ":/config/HBF/fonts/") + Options.font).c_str()); SetFontScale( (float)51 / (float)fontSystem->getWidth(charToWideChar("a"), 100) ); // 51 -> breite von "a" mit standart schrift } @@ -83,7 +83,7 @@ bool font_folder_exists() { DIR *pDir; - pDir = opendir(check_path(Settings.device_dat + ":/config/Homebrew Filter/Fonts").c_str()); + pDir = opendir(check_path(Settings.device_dat + ":/config/HBF/Fonts").c_str()); if(pDir != NULL) { @@ -92,7 +92,7 @@ bool font_folder_exists() } else { - if (mkdir((Settings.device_dat + ":/config/Homebrew Filter/Fonts").c_str(), 0777) != -1) + if (mkdir((Settings.device_dat + ":/config/HBF/Fonts").c_str(), 0777) != -1) { closedir (pDir); return true; diff --git a/source/Tools/TakeScreenshot.cpp b/source/Tools/TakeScreenshot.cpp index 601ce52..2b0c660 100644 --- a/source/Tools/TakeScreenshot.cpp +++ b/source/Tools/TakeScreenshot.cpp @@ -15,7 +15,7 @@ void Screenshot() bool Exists = false; folder_exists(); - pDir = opendir(check_path(Settings.device_dat + ":/config/Homebrew Filter/Screenshots").c_str()); + pDir = opendir(check_path(Settings.device_dat + ":/config/HBF/Screenshots").c_str()); if(pDir != NULL) { @@ -23,14 +23,14 @@ void Screenshot() closedir (pDir); } else - if(mkdir((Settings.device_dat + ":/config/Homebrew Filter/Screenshots").c_str(), 777) != -1) + if(mkdir((Settings.device_dat + ":/config/HBF/Screenshots").c_str(), 777) != -1) Exists = true; if(Exists) { while(!stop) { - sprintf (temp, "%s/%i.png", check_path(Settings.device_dat + ":/config/Homebrew Filter/Screenshots").c_str(), i); + sprintf (temp, "%s/%i.png", check_path(Settings.device_dat + ":/config/HBF/Screenshots").c_str(), i); FILE * f= fopen (temp,"r"); if (!f) stop = true; diff --git a/source/Tools/load.cpp b/source/Tools/load.cpp index 3792c48..9371c43 100644 --- a/source/Tools/load.cpp +++ b/source/Tools/load.cpp @@ -53,13 +53,13 @@ void load() if (get_setting(source, "theme") != "") { sprintf (Options.theme, get_setting(source, "theme").c_str()); - theme(check_path(Settings.device_dat + ":/config/Homebrew Filter/themes/") + Options.theme + "/"); + theme(check_path(Settings.device_dat + ":/config/HBF/themes/") + Options.theme + "/"); } if(get_setting(source, "language") != "") { sprintf (Options.language, get_setting(source, "language").c_str()); - ini_Open(check_path(Settings.device_dat + ":/config/Homebrew Filter/languages/") + Options.language + ".lang"); + ini_Open(check_path(Settings.device_dat + ":/config/HBF/languages/") + Options.language + ".lang"); AvailableCategory.categories[0] = tr(Settings.category_name_all); } diff --git a/source/Tools/save.cpp b/source/Tools/save.cpp index 2f3cbb3..e443eba 100644 --- a/source/Tools/save.cpp +++ b/source/Tools/save.cpp @@ -24,7 +24,7 @@ bool folder_exists() if(pDir != NULL) { - pDir = opendir(check_path(Settings.device_dat + ":/config/Homebrew Filter").c_str()); + pDir = opendir(check_path(Settings.device_dat + ":/config/HBF").c_str()); if(pDir != NULL) { closedir (pDir); @@ -32,7 +32,7 @@ bool folder_exists() } else { - if (mkdir((Settings.device_dat + ":/config/Homebrew Filter").c_str(), 0777) != -1) + if (mkdir((Settings.device_dat + ":/config/HBF").c_str(), 0777) != -1) return true; } } @@ -40,7 +40,7 @@ bool folder_exists() { if (mkdir((Settings.device_dat + ":/config").c_str(), 0777) != -1) { - if (mkdir((Settings.device_dat + ":/config/Homebrew Filter").c_str(), 0777) != -1) + if (mkdir((Settings.device_dat + ":/config/HBF").c_str(), 0777) != -1) return true; } } diff --git a/source/Tools/theme.cpp b/source/Tools/theme.cpp index 3f70257..f0459c7 100644 --- a/source/Tools/theme.cpp +++ b/source/Tools/theme.cpp @@ -324,11 +324,11 @@ bool theme_folder_exists(string theme) DIR *pDir; folder_exists(); - pDir = opendir(check_path(Settings.device_dat + ":/config/Homebrew Filter/Themes").c_str()); + pDir = opendir(check_path(Settings.device_dat + ":/config/HBF/Themes").c_str()); if(pDir != NULL) { - pDir = opendir(check_path(Settings.device_dat + ":/config/Homebrew Filter/Themes/" + theme).c_str()); + pDir = opendir(check_path(Settings.device_dat + ":/config/HBF/Themes/" + theme).c_str()); if(pDir != NULL) { closedir (pDir); @@ -336,7 +336,7 @@ bool theme_folder_exists(string theme) } else { - if (mkdir((Settings.device_dat + ":/config/Homebrew Filter/Themes/" + theme).c_str(), 0777) != -1) + if (mkdir((Settings.device_dat + ":/config/HBF/Themes/" + theme).c_str(), 0777) != -1) { closedir (pDir); return true; @@ -345,9 +345,9 @@ bool theme_folder_exists(string theme) } else { - if (mkdir((Settings.device_dat + ":/config/Homebrew Filter/Themes").c_str(), 0777) != -1) + if (mkdir((Settings.device_dat + ":/config/HBF/Themes").c_str(), 0777) != -1) { - if (mkdir((Settings.device_dat + ":/config/Homebrew Filter/Themes/" + theme).c_str(), 0777) != -1) + if (mkdir((Settings.device_dat + ":/config/HBF/Themes/" + theme).c_str(), 0777) != -1) { closedir (pDir); return true; diff --git a/source/Tools/translate.cpp b/source/Tools/translate.cpp index bbc3697..14bc2dc 100644 --- a/source/Tools/translate.cpp +++ b/source/Tools/translate.cpp @@ -69,15 +69,15 @@ const char* tr(string translate) void translate() { if(CONF_GetLanguage() == JAPANESE) - ini_Open(check_path(Settings.device_dat + ":/config/Homebrew Filter/languages/") + "japanese.lang"); + ini_Open(check_path(Settings.device_dat + ":/config/HBF/languages/") + "japanese.lang"); else if(CONF_GetLanguage() == ENGLISH) - ini_Open(check_path(Settings.device_dat + ":/config/Homebrew Filter/languages/") + "english.lang"); + ini_Open(check_path(Settings.device_dat + ":/config/HBF/languages/") + "english.lang"); else if(CONF_GetLanguage() == GERMAN) - ini_Open(check_path(Settings.device_dat + ":/config/Homebrew Filter/languages/") + "german.lang"); + ini_Open(check_path(Settings.device_dat + ":/config/HBF/languages/") + "german.lang"); else if(CONF_GetLanguage() == FRENCH) - ini_Open(check_path(Settings.device_dat + ":/config/Homebrew Filter/languages/") + "french.lang"); + ini_Open(check_path(Settings.device_dat + ":/config/HBF/languages/") + "french.lang"); else if(CONF_GetLanguage() == SPANISH) - ini_Open(check_path(Settings.device_dat + ":/config/Homebrew Filter/languages/") + "spanish.lang"); + ini_Open(check_path(Settings.device_dat + ":/config/HBF/languages/") + "spanish.lang"); } bool language_folder_exists() @@ -87,7 +87,7 @@ bool language_folder_exists() { DIR *pDir; - pDir = opendir(check_path(Settings.device_dat + ":/config/Homebrew Filter/Languages").c_str()); + pDir = opendir(check_path(Settings.device_dat + ":/config/HBF/Languages").c_str()); if(pDir != NULL) { @@ -96,7 +96,7 @@ bool language_folder_exists() } else { - if (mkdir((Settings.device_dat + ":/config/Homebrew Filter/Languages").c_str(), 0777) != -1) + if (mkdir((Settings.device_dat + ":/config/HBF/Languages").c_str(), 0777) != -1) { closedir (pDir); return true; diff --git a/source/ZipFile.cpp b/source/ZipFile.cpp deleted file mode 100644 index b965885..0000000 --- a/source/ZipFile.cpp +++ /dev/null @@ -1,328 +0,0 @@ -/**************************************************************************** - * Copyright (C) 2009-2011 Dimok - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - ****************************************************************************/ -#include -#include -#include -#include -#include - -//#include "../Prompts/ProgressWindow.h" -//#include "../Prompts/PromptWindows.h" -//#include "../Language/gettext.h" -//#include "../Tools/ShowError.h" -#include "ZipFile.h" - - -ZipFile::ZipFile(const char *filepath, short mode) -{ - if(!filepath) - return; - - ZipFilePath = filepath; - OpenMode = mode; - zFile = 0; - uzFile = 0; - - if(OpenMode == ZipFile::OPEN || OpenMode == ZipFile::APPEND) - { - uzFile = unzOpen(ZipFilePath.c_str()); - if(uzFile) - this->LoadList(); - } -} - -ZipFile::~ZipFile() -{ - ClearList(); - if(uzFile) - unzClose(uzFile); - if(zFile) - zipClose(zFile, NULL); -} - -bool ZipFile::SwitchMode(short mode) -{ - if(mode == ZipFile::OPEN) - { - if(zFile) - { - zipClose(zFile, NULL); - zFile = 0; - } - - if(!uzFile) - uzFile = unzOpen(ZipFilePath.c_str()); - - return (uzFile != 0); - } - else if(mode == ZipFile::CREATE || mode == ZipFile::APPEND) - { - if(uzFile) - { - unzClose(uzFile); - uzFile = 0; - } - - if(!zFile) - zFile = zipOpen(ZipFilePath.c_str(), mode); - - return (zFile != 0); - } - - return false; -} - -void ZipFile::ClearList() -{ - for(u32 i = 0; i < ZipStructure.size(); i++) - { - if(ZipStructure[i]->filename) - delete [] ZipStructure[i]->filename; - - if(ZipStructure[i]) - delete ZipStructure[i]; - } - - ZipStructure.clear(); - std::vector().swap(ZipStructure); -} - -bool ZipFile::LoadList() -{ - ClearList(); - - if(!SwitchMode(ZipFile::OPEN)) - return false; - - int ret = unzGoToFirstFile(uzFile); - if(ret != UNZ_OK) - return false; - - char filename[1024]; - unz_file_info cur_file_info; - RealArchiveItemCount = 0; - - do - { - if(unzGetCurrentFileInfo(uzFile, &cur_file_info, filename, sizeof(filename), NULL, 0, NULL, 0) == UNZ_OK) - { - bool isDir = false; - if(filename[strlen(filename)-1] == '/') - { - isDir = true; - filename[strlen(filename)-1] = '\0'; - } - - int strlength = strlen(filename)+1; - - ArchiveFileStruct * CurArcFile = new ArchiveFileStruct; - CurArcFile->filename = new char[strlength]; - strcpy(CurArcFile->filename, filename); - CurArcFile->length = cur_file_info.uncompressed_size; - CurArcFile->comp_length = cur_file_info.compressed_size; - CurArcFile->isdir = isDir; - CurArcFile->fileindex = RealArchiveItemCount; - CurArcFile->ModTime = (u64) cur_file_info.dosDate; - CurArcFile->archiveType = ZIP; - - ZipStructure.push_back(CurArcFile); - } - ++RealArchiveItemCount; - } - while(unzGoToNextFile(uzFile) == UNZ_OK); - - PathControl(); - - return true; -} - -ArchiveFileStruct * ZipFile::GetFileStruct(int ind) -{ - if(ind < 0 || ind >= (int) ZipStructure.size()) - return NULL; - - return ZipStructure[ind]; -} - -bool ZipFile::SeekFile(int ind) -{ - if(ind < 0 || ind >= (int) ZipStructure.size()) - return false; - - if(!SwitchMode(ZipFile::OPEN)) - return false; - - int ret = unzGoToFirstFile(uzFile); - if(ret != UNZ_OK) - return false; - - while(ind > 0) - { - if(unzGoToNextFile(uzFile) != UNZ_OK) - return false; - - --ind; - } - - return true; -} - -void ZipFile::CheckMissingPath(const char * path) -{ - if(!path) - return; - - u32 i = 0; - for(i = 0; i < ZipStructure.size(); i++) - { - if(strcasecmp(ZipStructure[i]->filename, path) == 0) - break; - } - - if(i == ZipStructure.size()) - { - int strlength = strlen(path)+1; - ArchiveFileStruct * CurArcFile = new ArchiveFileStruct; - CurArcFile->filename = new char[strlength]; - strcpy(CurArcFile->filename, path); - CurArcFile->length = 0; - CurArcFile->comp_length = 0; - CurArcFile->isdir = true; - CurArcFile->fileindex = ZipStructure.size(); - CurArcFile->ModTime = 0; - CurArcFile->archiveType = ZIP; - - ZipStructure.push_back(CurArcFile); - } -} - -void ZipFile::PathControl() -{ - char missingpath[1024]; - - for(u32 n = 0; n < ZipStructure.size(); n++) - { - const char * filepath = ZipStructure[n]->filename; - int strlength = strlen(filepath); - - for(int i = 0; i < strlength; i++) - { - if(filepath[i] == '/') - CheckMissingPath(missingpath); - - missingpath[i] = filepath[i]; - missingpath[i+1] = '\0'; - } - } -} - -int ZipFile::ExtractAll(const char *dest) -{ - if(!SwitchMode(OPEN)) - return -1; - - bool Stop = false; - - u32 blocksize = 1024*70; - void *buffer = malloc(blocksize); - - if(!buffer) - return -5; - - char writepath[1024]; - char filename[1024]; - memset(writepath, 0, sizeof(writepath)); - memset(filename, 0, sizeof(filename)); - - unz_file_info cur_file_info; - - int ret = unzGoToFirstFile(uzFile); - if(ret != UNZ_OK) - { - free(buffer); - return -6; - } - - while(!Stop) - { - if(unzGetCurrentFileInfo(uzFile, &cur_file_info, filename, sizeof(filename), NULL, 0, NULL, 0) != UNZ_OK) - { - Stop = true; - } - - if(!Stop && filename[strlen(filename)-1] != '/') - { - u64 uncompressed_size = cur_file_info.uncompressed_size; - - u64 done = 0; - char *pointer = NULL; - - ret = unzOpenCurrentFile(uzFile); - - snprintf(writepath, sizeof(writepath), "%s/%s", dest, filename); - - pointer = strrchr(writepath, '/'); - int position = pointer-writepath+2; - - char temppath[strlen(writepath)]; - snprintf(temppath, position, "%s", writepath); - - //CreateSubfolder(temppath); - - if(ret == UNZ_OK) - { - FILE *pfile = fopen(writepath, "wb"); - if(!pfile) - { - free(buffer); - fclose(pfile); - unzCloseCurrentFile(uzFile); - return -8; - } - - do - { - if(uncompressed_size - done < blocksize) - blocksize = uncompressed_size - done; - - ret = unzReadCurrentFile(uzFile, buffer, blocksize); - - if(ret == 0) - break; - - fwrite(buffer, 1, blocksize, pfile); - - done += ret; - - } while(done < uncompressed_size); - - fclose(pfile); - unzCloseCurrentFile(uzFile); - } - } - if(unzGoToNextFile(uzFile) != UNZ_OK) - { - Stop = true; - } - } - - free(buffer); - buffer = NULL; - - return 1; -} - diff --git a/source/ZipFile.h b/source/ZipFile.h deleted file mode 100644 index db16875..0000000 --- a/source/ZipFile.h +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** - * Copyright (C) 2009-2011 Dimok - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - ****************************************************************************/ -#ifndef _ZIPFILE_H_ -#define _ZIPFILE_H_ - -#include -#include -#include -#include - -#include "ArchiveStruct.h" - -class ZipFile -{ - public: - //!Constructor - ZipFile(const char *filepath, short mode = ZipFile::OPEN); - //!Destructor - ~ZipFile(); - //!Get the archive file structure - ArchiveFileStruct * GetFileStruct(int fileIndx); - //!Extract all files from a zip file to a directory - int ExtractAll(const char *dest); - //!Find a file inside the zip and return if it is existent or not - bool FindFile(const char *filename); - //!Load/Reload of the full item list in the zip - bool LoadList(); - //!Enum for opening modes - enum - { - CREATE = 0, - OPEN, - APPEND, - }; - private: - bool SeekFile(int ind); - void PathControl(); - void CheckMissingPath(const char * path); - void ClearList(); - bool SwitchMode(short mode); - - zipFile zFile; - unzFile uzFile; - short OpenMode; - int RealArchiveItemCount; - std::string ZipFilePath; - std::vector ZipStructure; -}; - -#endif diff --git a/svnrev/svnrev.sh b/svnrev/svnrev.sh index c831bd6..37c373b 100755 --- a/svnrev/svnrev.sh +++ b/svnrev/svnrev.sh @@ -8,7 +8,7 @@ cat < "$PWD"/meta.xml.boot Homebrew Filter - Christopher Roy Bratusek
+ Christopher Roy Bratusek (Nano)
hamachi-mp
r$rev_new @@ -22,7 +22,7 @@ cat < "$PWD"/meta.xml.installer Homebrew Filter Installer - Christopher Roy Bratusek
+ Christopher Roy Bratusek (Nano)
hamachi-mp
r$rev_new diff --git a/updates b/updates new file mode 100644 index 0000000..a6d41f1 --- /dev/null +++ b/updates @@ -0,0 +1,204 @@ +//rev36: +- HBF is now OpenSource! +- Added license-text of GNU GPL v2 +- Added support for EXT2/3/4 +- Adjusted download paths +- added mkfilelist helper +- compiled with devkitPPC 24 and libogc 1.8.8 +- new Fonts available for download: +- FinalFrontier +- FreqModClear +- Iwona-Regular +- QumpellkaNo12 +- Zekton + +//rev35: +- individuelle Anpassung an den Bildschirm überarbeitet +- anzeigen von GC Apps in Kategorien +- letzte Version + +//rev34: +- TCP-Bug beseitigt +- meta.xml kann direkt bearbeitet werden +- automatische Netzwerk Initialisierung beim Start (de)aktivierbar +- Update-Info (de)aktivierbar +- Navigationstasten können getauscht werden (PLUS/MINUS und LINKS/RECHTS) + +//rev33: +- übertragen von Apps an die Wii per wiiload +- Fehler beim entfernen von der SD-Karte und USB-Geräten behoben + +//rev32: +- HBF installer eingeführt +- Sprachen müssen jetzt seperat runtergeladen werden wie bei Fonts und Themes +- Fehler beim Sortieren von SD und USB behoben +- Einstellungen werden im NAND gespeichert +- Löschen der Einstellungen ist über die Datenverwaltung möglich + +//rev31: +- NTFS Unterstützung +- GameCube Apps Unterstützung ( Ordner "gc_apps" ) +- zuletzt benutztes Gerät wird gespeichert ( SD/USB ) +- Funktion fürs alphabetische Sortieren in einer Kategorie. ( Taste 1 ) +- Verschieben von Apps mit gehaltener B Taste +- leicht überarbeitete Gui ( Menü und Passwort ) +- Gleichzeitiges Anzeigen von Programmen auf SD und USB +- Config speichern auf SD oder USB + +PS: +für GC Apps muss ein kompatibles cMIOS installiert sein + +//rev30: +- Fehler in der Navigation beim Theme-download behoben +- Sprachen überarbeitet +- Japanisch eingefügt +- Download und Auswahl von Schriftarten möglich + +//rev29: +- starten von BootMii integriert + +//rev28: +- Kein Code/Stack-Dump mehr mit dem Wii-Pointer +- HOME-Button ruft Menü zum Beenden auf +- Fehler beim Starten von Applikationen in der Gitteransicht behoben +- Position der Buttons "Laden" und "Einfügen/Entfernen" getauscht +- Letzte Katergorie beim Einfügen einer Applikation wird temporär gespeichert + +//rev27: +- Wii Pointer Code Dump beseitigt +- Arguments-Tag eingeführt +- interner Forwarder geändert +- fehlender USB-Support für gestartete Apps behoben +-> WiiXplorer, WiiMC, ... + +//rev26: +- Themes erweitert +- Startkategorie eingeführt +- Schnellstart eingeführt für Apps +- Anzeigefehler beim löschen einer Katgorie behoben +- Fehler beim Speichern des Standard Start-IOS +- Kindersicherung + +//rev25: +- Fehler behoben beim Anzeigen der Beschreibung von Apps +- Löschen von Apps von SD und USB +- libogc 1.8.5 -> libogc 1.8.4 +- Info, wenn Update verfügbat ist + +//rev24: +- Fehler bei der Auswahl im Themedownload behoben +- Fehler beim Abbrechen im Update-Menü behoben + +//rev23: +- Navigation in der Grid-Ansicht überarbeitet +- Fehler beim speichern von einem erneut geänderten Start-IOS behoben +- Fehler bei der Auswahl zum verschieben der Apps behoben +- Position und Seite des zuletzt gestarteten App wird gespeichert + +//rev22: +- Start-IOS Auswahl wird gespeichert (Ordnername) +- Themes downloadbar +- Icon-Position in der 5er Ansicht korrigiert + +//rev21: +- neuer Forwarder mit IOS 58 und HW_AHBPROT +- IOS Anzeige auf was der HBF läuft wird unter Info angezeigt +- Start IOS Auswahl für ein App + +//rev20: +- automatische Netzwerk Initialisierung beim Start +- Rückkehr zum HBF, wenn einen Forwarder mit der Titel ID "HBF0" installiert ist ( beta ) + +//rev19: +- Design leicht geändert +- Beenden Button eingefügt + +//rev18: +- Fehler beim kopieren in Kategorien behoben + +//rev17: +- Fehler beim erstellen von Kategorien behoben +- Kategorien löschen überarbeitet + +//rev16: +- Apps auflisten von USB-Geräten +- Neuauflistung der Apps beim wechseln von SD-Karte und USB-Gerät + +//rev15: +- Anzeigen von unkategorisierten Apps +- Info zur Rev beim Online-Update +- HBC Channel -> Version, Coder, Beschreibung hinzugefügt + +//rev14: +- Gitter-Ansicht hinzugefügt ( Taste 2 ) +- Wii-Reset-Button -> Rückkehr ins Wii-Menü +- Wii-Power-Button -> Schaltet die Wii Aus bzw. in den Standby +- HomeBrew Channel in die Liste der Apps mit eingefügt +- mit der Home Taste zurück zum HomeBrew Channel wurde entfernt + +//rev13: +- Anpassung an den Bildschirm möglich ( beta ) + +//rev12: +- Sprachen angepasst ( bei manchen Sonderzeichen wurde das Wort abgetrennt ) +- neue Sprachen hinzugefügt ( french.lang, portuguese.lang, spanish.lang ) +- Update menü überarbeitet ( Auswahl der Rev möglich ) + +//rev11: +- fehler beim übergeben des Verzeichnissnamens behoben ( z.B. BootMii Configuration Editor v2.6 ) +- schnelleres einlesen der Kategorien +- paar Schönheitsfehler beseitigt + +//rev10: +- update funktion eingebaut +- probleme beim laden behoben (priiloader, forwarder, wiiload, exploit) +- "kategorien.dat" wurde zu "categories.dat" +- pfade geändert von settings.xml, categories.dat -> "Root/Config/Homebrew Filter/" + +//rev9: +- englische Sprache hinzugefügt +- Screenshot erstellen ( 1 + 2 gleichzeitig drücken ) + +//rev8: +- wegen total verlust neu gecodet +- lange Beschreibung +- Kategorien verschieben +- neue Einstellmöglichkeiten + +//rev7: +- Themes können nun ausgewählt werden +- Design angepasst + +//rev6: +- eigene Themes +-> muss im Ordner vom HBF sein "Themes/default" +-> bsp: (sd:/apps/Homebrew Filter/Themes/default) + +//rev5: +- kategorie umbenennen +- Fehler mit der Breite des App-Namen behoben ( Dank an Dimok ) + +//rev4: +- apps verschieben + +//rev3: +- Pfeile navigieren eingefügt + +//rev2: +- bugfixes + +//rev1: +- erste Veröffentlichung + +//rev_Beta: +- beta test +- NTFS Unterstützung +- GameCube Apps Unterstützung ( Ordner "gc_apps" ) +- zuletzt benutztes Gerät wird gespeichert ( SD/USB ) +- Funktion fürs alphabetische Sortieren in einer Kategorie. ( Taste 1 ) +- Verschieben von Apps mit gedrückter B Taste +- leicht überarbeitete Gui ( Menü und Passwort ) +- Gleichzeitiges Anzeigen von Programmen auf SD und USB +- Config speichern auf SD oder USB + +end