mirror of
https://github.com/hax4dazy/TinWoo.git
synced 2025-02-09 19:25:05 +01:00
show percentage & refresh freespace during install
This commit is contained in:
parent
f127ddd7dc
commit
0b7f2dc624
@ -132,13 +132,17 @@ namespace tin::install::nsp
|
||||
}
|
||||
inst::ui::instPage::setInstBarPerc(100);
|
||||
|
||||
inst::ui::instPage::setInstInfoText("inst.info_page.top_info0"_lang + ncaFileName + "...");
|
||||
//inst::ui::instPage::setInstInfoText("inst.info_page.top_info0"_lang + ncaFileName + "...");
|
||||
inst::ui::instPage::setInstBarPerc(0);
|
||||
while (!bufferedPlaceholderWriter.IsPlaceholderComplete() && !stopThreadsHttpNsp)
|
||||
{
|
||||
int installProgress = (int)(((double)bufferedPlaceholderWriter.GetSizeWrittenToPlaceholder() / (double)bufferedPlaceholderWriter.GetTotalDataSize()) * 100.0);
|
||||
|
||||
inst::ui::instPage::setInstBarPerc((double)installProgress);
|
||||
//
|
||||
std::stringstream x;
|
||||
x << (int)(installProgress);
|
||||
inst::ui::instPage::setInstInfoText("inst.info_page.top_info0"_lang + ncaFileName + " " + x.str() + "%");
|
||||
}
|
||||
inst::ui::instPage::setInstBarPerc(100);
|
||||
|
||||
|
@ -137,7 +137,7 @@ namespace tin::install::xci
|
||||
u64 totalSizeMB = bufferedPlaceholderWriter.GetTotalDataSize() / 1000000;
|
||||
#endif
|
||||
|
||||
inst::ui::instPage::setInstInfoText("inst.info_page.top_info0"_lang + ncaFileName + "...");
|
||||
//inst::ui::instPage::setInstInfoText("inst.info_page.top_info0"_lang + ncaFileName + "...");
|
||||
inst::ui::instPage::setInstBarPerc(0);
|
||||
while (!bufferedPlaceholderWriter.IsPlaceholderComplete() && !stopThreadsHttpXci)
|
||||
{
|
||||
@ -147,6 +147,10 @@ namespace tin::install::xci
|
||||
LOG_DEBUG("> Install Progress: %lu/%lu MB (%i%s)\r", installSizeMB, totalSizeMB, installProgress, "%");
|
||||
#endif
|
||||
inst::ui::instPage::setInstBarPerc((double)installProgress);
|
||||
//
|
||||
std::stringstream x;
|
||||
x << (int)(installProgress);
|
||||
inst::ui::instPage::setInstInfoText("inst.info_page.top_info0"_lang + ncaFileName + " " + x.str() + "%");
|
||||
}
|
||||
inst::ui::instPage::setInstBarPerc(100);
|
||||
|
||||
|
@ -127,7 +127,7 @@ namespace tin::install::nsp
|
||||
std::thread audioThread(inst::util::playAudio, audioPath);
|
||||
std::string information = "romfs:/images/icons/information.png";
|
||||
if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/theme.json") && std::filesystem::exists(inst::config::appDir + "icons_others.information"_theme)) {
|
||||
information = inst::config::appDir + "icons_others.good"_theme;
|
||||
information = inst::config::appDir + "icons_others.information"_theme;
|
||||
}
|
||||
int rc = inst::ui::mainApp->CreateShowDialog("inst.nca_verify.title"_lang, "inst.nca_verify.desc"_lang, { "common.cancel"_lang, "inst.nca_verify.opt1"_lang }, false, information);
|
||||
audioThread.join();
|
||||
|
@ -120,7 +120,7 @@ namespace tin::install::xci
|
||||
std::thread audioThread(inst::util::playAudio, audioPath);
|
||||
std::string information = "romfs:/images/icons/information.png";
|
||||
if (inst::config::useTheme && std::filesystem::exists(inst::config::appDir + "/theme/theme.json") && std::filesystem::exists(inst::config::appDir + "icons_others.information"_theme)) {
|
||||
information = inst::config::appDir + "icons_others.good"_theme;
|
||||
information = inst::config::appDir + "icons_others.information"_theme;
|
||||
}
|
||||
int rc = inst::ui::mainApp->CreateShowDialog("inst.nca_verify.title"_lang, "inst.nca_verify.desc"_lang, { "common.cancel"_lang, "inst.nca_verify.opt1"_lang }, false, information);
|
||||
audioThread.join();
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include "nx/nca_writer.h"
|
||||
#include "ui/instPage.hpp"
|
||||
#include "util/lang.hpp"
|
||||
#include <sstream>
|
||||
|
||||
namespace tin::install::nsp
|
||||
{
|
||||
@ -38,7 +39,7 @@ namespace tin::install::nsp
|
||||
|
||||
try
|
||||
{
|
||||
inst::ui::instPage::setInstInfoText("inst.info_page.top_info0"_lang + ncaFileName + "...");
|
||||
//inst::ui::instPage::setInstInfoText("inst.info_page.top_info0"_lang + ncaFileName + "...");
|
||||
inst::ui::instPage::setInstBarPerc(0);
|
||||
while (fileOff < ncaSize)
|
||||
{
|
||||
@ -47,6 +48,10 @@ namespace tin::install::nsp
|
||||
if (fileOff % (0x400000 * 3) == 0) {
|
||||
LOG_DEBUG("> Progress: %lu/%lu MB (%d%s)\r", (fileOff / 1000000), (ncaSize / 1000000), (int)(progress * 100.0), "%");
|
||||
inst::ui::instPage::setInstBarPerc((double)(progress * 100.0));
|
||||
//
|
||||
std::stringstream x;
|
||||
x << (int)(progress * 100.0);
|
||||
inst::ui::instPage::setInstInfoText("inst.info_page.top_info0"_lang + ncaFileName + " " + x.str() + "%");
|
||||
}
|
||||
|
||||
if (fileOff + readSize >= ncaSize) readSize = ncaSize - fileOff;
|
||||
|
@ -38,7 +38,7 @@ namespace tin::install::xci
|
||||
|
||||
try
|
||||
{
|
||||
inst::ui::instPage::setInstInfoText("inst.info_page.top_info0"_lang + ncaFileName + "...");
|
||||
//inst::ui::instPage::setInstInfoText("inst.info_page.top_info0"_lang + ncaFileName + "...");
|
||||
inst::ui::instPage::setInstBarPerc(0);
|
||||
while (fileOff < ncaSize)
|
||||
{
|
||||
@ -47,6 +47,10 @@ namespace tin::install::xci
|
||||
if (fileOff % (0x400000 * 3) == 0) {
|
||||
LOG_DEBUG("> Progress: %lu/%lu MB (%d%s)\r", (fileOff / 1000000), (ncaSize / 1000000), (int)(progress * 100.0), "%");
|
||||
inst::ui::instPage::setInstBarPerc((double)(progress * 100.0));
|
||||
//
|
||||
std::stringstream x;
|
||||
x << (int)(progress * 100.0);
|
||||
inst::ui::instPage::setInstInfoText("inst.info_page.top_info0"_lang + ncaFileName + " " + x.str() + "%");
|
||||
}
|
||||
|
||||
if (fileOff + readSize >= ncaSize) readSize = ncaSize - fileOff;
|
||||
|
@ -163,7 +163,7 @@ namespace tin::install::nsp
|
||||
u64 totalSizeMB = bufferedPlaceholderWriter.GetTotalDataSize() / 1000000;
|
||||
#endif
|
||||
|
||||
inst::ui::instPage::setInstInfoText("inst.info_page.top_info0"_lang + ncaFileName + "...");
|
||||
//inst::ui::instPage::setInstInfoText("inst.info_page.top_info0"_lang + ncaFileName + "...");
|
||||
inst::ui::instPage::setInstBarPerc(0);
|
||||
while (!bufferedPlaceholderWriter.IsPlaceholderComplete() && !stopThreadsUsbNsp)
|
||||
{
|
||||
@ -173,6 +173,10 @@ namespace tin::install::nsp
|
||||
LOG_DEBUG("> Install Progress: %lu/%lu MB (%i%s)\r", installSizeMB, totalSizeMB, installProgress, "%");
|
||||
#endif
|
||||
inst::ui::instPage::setInstBarPerc((double)installProgress);
|
||||
//
|
||||
std::stringstream x;
|
||||
x << (int)(installProgress);
|
||||
inst::ui::instPage::setInstInfoText("inst.info_page.top_info0"_lang + ncaFileName + " " + x.str() + "%");
|
||||
}
|
||||
inst::ui::instPage::setInstBarPerc(100);
|
||||
|
||||
|
@ -162,7 +162,7 @@ namespace tin::install::xci
|
||||
u64 totalSizeMB = bufferedPlaceholderWriter.GetTotalDataSize() / 1000000;
|
||||
#endif
|
||||
|
||||
inst::ui::instPage::setInstInfoText("inst.info_page.top_info0"_lang + ncaFileName + "...");
|
||||
//inst::ui::instPage::setInstInfoText("inst.info_page.top_info0"_lang + ncaFileName + "...");
|
||||
inst::ui::instPage::setInstBarPerc(0);
|
||||
while (!bufferedPlaceholderWriter.IsPlaceholderComplete() && !stopThreadsUsbXci)
|
||||
{
|
||||
@ -172,6 +172,10 @@ namespace tin::install::xci
|
||||
LOG_DEBUG("> Install Progress: %lu/%lu MB (%i%s)\r", installSizeMB, totalSizeMB, installProgress, "%");
|
||||
#endif
|
||||
inst::ui::instPage::setInstBarPerc((double)installProgress);
|
||||
//
|
||||
std::stringstream x;
|
||||
x << (int)(installProgress);
|
||||
inst::ui::instPage::setInstInfoText("inst.info_page.top_info0"_lang + ncaFileName + " " + x.str() + "%");
|
||||
}
|
||||
inst::ui::instPage::setInstBarPerc(100);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user