From 6c26fd6f084912e945df380bc0687b914ed59b81 Mon Sep 17 00:00:00 2001 From: TheFloW Date: Tue, 6 Sep 2016 18:16:29 +0200 Subject: [PATCH] Added 'Extracting' text and file list refresh when keeping FTP in background. --- main.c | 21 ++++++++++++++++++++- package_installer.c | 13 +++++++++++-- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index b055db0..48e1462 100644 --- a/main.c +++ b/main.c @@ -708,9 +708,27 @@ void contextMenuCtrl() { } case MENU_ENTRY_PASTE: - initMessageDialog(MESSAGE_DIALOG_PROGRESS_BAR, language_container[copy_mode == COPY_MODE_MOVE ? MOVING : COPYING]); + { + int copy_text = 0; + + switch (copy_mode) { + case COPY_MODE_NORMAL: + copy_text = COPYING; + break; + + case COPY_MODE_MOVE: + copy_text = MOVING; + break; + + case COPY_MODE_EXTRACT: + copy_text = EXTRACTING; + break; + } + + initMessageDialog(MESSAGE_DIALOG_PROGRESS_BAR, language_container[copy_text]); dialog_step = DIALOG_STEP_PASTE; break; + } case MENU_ENTRY_DELETE: { @@ -852,6 +870,7 @@ int dialogSteps() { case DIALOG_STEP_FTP: if (msg_result == MESSAGE_DIALOG_RESULT_YES) { + refresh = 1; dialog_step = DIALOG_STEP_NONE; } else if (msg_result == MESSAGE_DIALOG_RESULT_NO) { powerUnlock(); diff --git a/package_installer.c b/package_installer.c index 45e0b7f..2b320b8 100644 --- a/package_installer.c +++ b/package_installer.c @@ -214,7 +214,9 @@ int installPackage(char *file) { } int install_thread(SceSize args_size, InstallArguments *args) { + int res; SceUID thid = -1; + char path[MAX_PATH_LENGTH]; // Lock power timers powerLock(); @@ -228,15 +230,22 @@ int install_thread(SceSize args_size, InstallArguments *args) { sceIoMkdir(PACKAGE_PARENT, 0777); // Open archive - int res = archiveOpen(args->file); + res = archiveOpen(args->file); if (res < 0) { closeWaitDialog(); errorDialog(res); goto EXIT; } + // Check for param.sfo + snprintf(path, MAX_PATH_LENGTH, "%s/sce_sys/param.sfo", args->file); + if (archiveFileGetstat(path, NULL) < 0) { + closeWaitDialog(); + errorDialog(-2); + goto EXIT; + } + // Check permissions - char path[MAX_PATH_LENGTH]; snprintf(path, MAX_PATH_LENGTH, "%s/eboot.bin", args->file); SceUID fd = archiveFileOpen(path, SCE_O_RDONLY, 0); if (fd >= 0) {