Display Percentage on Installing & Extracting.

Also add progressbar for Installing & convert `cia.c` to `cia.cpp` for `new`.
This commit is contained in:
StackZ
2020-04-28 14:35:42 +02:00
parent 59dda01f00
commit 7d8fb7eb5d
7 changed files with 231 additions and 188 deletions
+7 -6
View File
@@ -24,6 +24,7 @@
* reasonable ways as different from the original version.
*/
#include "cia.hpp"
#include "download.hpp"
#include "extract.hpp"
#include "fileBrowse.hpp"
@@ -35,12 +36,8 @@
#include <fstream>
#include <unistd.h>
extern "C" {
#include "cia.h"
}
extern bool showProgressBar;
extern bool progressBarType;
extern int progressBarType;
extern char progressBarMsg[128];
extern int filesExtracted;
@@ -110,8 +107,12 @@ Result ScriptHelper::removeFile(std::string file, std::string message) {
// Install a file.
void ScriptHelper::installFile(std::string file, std::string message) {
Msg::DisplayMsg(message);
snprintf(progressBarMsg, sizeof(progressBarMsg), message.c_str());
showProgressBar = true;
progressBarType = 2;
Threads::create((ThreadFunc)displayProgressBar);
installCia(file.c_str());
showProgressBar = false;
}
// Extract Files.