From 332fbcfff184b98f8e6a521e7b8e834d89414177 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Tue, 7 May 2024 23:55:32 +0300 Subject: [PATCH] Qt: Add patching errors --- CMakeLists.txt | 2 +- docs/img/rpog_icon.png | Bin 0 -> 26925 bytes include/panda_qt/patch_window.hpp | 10 +++++++ src/panda_qt/patch_window.cpp | 45 ++++++++++++++++++++++++++---- 4 files changed, 51 insertions(+), 6 deletions(-) create mode 100644 docs/img/rpog_icon.png diff --git a/CMakeLists.txt b/CMakeLists.txt index dca69d6b..88ad6aeb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -486,7 +486,7 @@ if(NOT BUILD_HYDRA_CORE) qt_add_resources(AlberCore "app_images" PREFIX "/" FILES - docs/img/rsob_icon.png docs/img/rstarstruck_icon.png + docs/img/rsob_icon.png docs/img/rstarstruck_icon.png docs/img/rpog_icon.png ) else() set(FRONTEND_SOURCE_FILES src/panda_sdl/main.cpp src/panda_sdl/frontend_sdl.cpp src/panda_sdl/mappings.cpp) diff --git a/docs/img/rpog_icon.png b/docs/img/rpog_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..b5426aed8a19dd97e2727087a0e44494574fab2f GIT binary patch literal 26925 zcmV*JKxV&*P)004R> z004l5008;`004mK004C`008P>0026e000+ooVrmw00006VoOIv0RI600RN!9r;`8x zXdp>MK~#9!?EQJLrs;Xs3I3k#UBC6LxmQ+|N+nfUk}b=!Y>br#L)#5DW=RF~h9{ba z0S1QdiCLOpP}a;uH#7|sm}xVZZW!oj1C?XkUa$chD}}ttTC9>)rP^~pdG>F8_h*?u z-cz!?TVMyv_=(7%Ok*7JShPAxOXj?5)_c*r&DDIBTT>XQX}; z*njKmw{sK_-g?b%t$+8HcNw}Z{(gknXpop^;ApAUJ^#5JJDRO7WOMJhp21 zHjDTPkNC;GIsfRwgr7b8ehP5^rr*?WtzZ9A9|=KUyL#0=T=Ico!uJj$dERy2hTw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^{>Ts_`tm8PQ1I}TwWyaW@44`kfg(x2RblY-(fS!-P{6R-f#wm) zUj)~wc8<#Nw;9#|`oDCI0yBTSL@<$WrhZ1t@}MCqe2lM%jaH23Ck7%ac%jd>E7=wN zm?1m05Fuw6ap~AJ@3UGxj%zJ_ELFJ=Y}8NY!>~Y1vYQY{G>Z7zKITDqdlB2=n|kZo zwX6SNx>PRlcsa`SYp>PYyY{pF;*$_f?+(86iJ$6BRD2y-9Mb_`-wq=s7&qR)NzooC zoqA+f9QHlyW)H9g!TK>K+2x{X66;(mmraQ>!THtmwa^KruXyMeNJjtND#C{PBzw&7 zMs+c>rLK-$aL{>dp>ZMMwpzHmaL|pj^MsGFe~8Q$^%PPU|6yK^!KO5&x;{EXr;Z>p z=|tB+);rA7vQy=O30Wrx>&SflR_wQ|3s4a0?CiaAWD_kCi zIR1)0)9JbK+YF6T%e-XlZ_DrP=AqgSRHK=(IkB91CsvtF$?t+i+h8_h8}hA!N2e28 zlDOienK>Lxx*XbpcKR++Mub5GBkw81vW24dt##=Q9|$ka1OER5e$aQ6 m!U915`vy;YXKN47PtLCYf6N +#include #include #include @@ -13,6 +14,15 @@ class PatchWindow final : public QWidget { ~PatchWindow() = default; private: + // Show a message box + // Title: Title of the message box to display + // Message: Message to display + // Icon: The type of icon (error, warning, information, etc) to display + // IconPath: If non-null, then a path to an icon in our assets to display on the OK button + void displayMessage( + const QString& title, const QString& message, QMessageBox::Icon icon = QMessageBox::Icon::Warning, const char* iconPath = nullptr + ); + std::filesystem::path inputPath = ""; std::filesystem::path patchPath = ""; diff --git a/src/panda_qt/patch_window.cpp b/src/panda_qt/patch_window.cpp index 98983865..de5cd277 100644 --- a/src/panda_qt/patch_window.cpp +++ b/src/panda_qt/patch_window.cpp @@ -1,7 +1,9 @@ #include "panda_qt/patch_window.hpp" +#include #include #include +#include #include #include #include @@ -64,15 +66,20 @@ PatchWindow::PatchWindow(QWidget* parent) : QWidget(parent, Qt::Window) { connect(applyPatchButton, &QPushButton::clicked, this, [this]() { if (inputPath.empty() || patchPath.empty()) { - printf("Pls set paths properly"); + displayMessage(tr("Paths not provided correctly"), tr("Please provide paths for both the input file and the patch file")); return; } - auto path = QFileDialog::getSaveFileName(this, tr("Select file"), QString::fromStdU16String(inputPath.u16string()), tr("All files (*.*)")); + // std::filesystem::path only has += and not + for reasons unknown to humanity + auto defaultPath = inputPath.parent_path() / inputPath.stem(); + defaultPath += "-patched"; + defaultPath += inputPath.extension(); + + auto path = QFileDialog::getSaveFileName(this, tr("Select file"), QString::fromStdU16String(defaultPath.u16string()), tr("All files (*.*)")); std::filesystem::path outputPath = std::filesystem::path(path.toStdU16String()); if (outputPath.empty()) { - printf("Pls set paths properly"); + displayMessage(tr("No output path"), tr("No path was provided for the output file, no patching was done")); return; } @@ -87,7 +94,7 @@ PatchWindow::PatchWindow(QWidget* parent) : QWidget(parent, Qt::Window) { } else if (extension == ".bps") { patchType = Hips::PatchType::BPS; } else { - printf("Unknown patch format\n"); + displayMessage(tr("Unknown patch format"), tr("Unknown format for patch file. Currently IPS, UPS and BPS are supported")); return; } @@ -96,7 +103,7 @@ PatchWindow::PatchWindow(QWidget* parent) : QWidget(parent, Qt::Window) { IOFile patch(patchPath, "rb"); if (!input.isOpen() || !patch.isOpen()) { - printf("Failed to open input or patch file.\n"); + displayMessage(tr("Failed to open input files"), tr("Make sure they're in a directory Panda3DS has access to")); return; } @@ -119,5 +126,33 @@ PatchWindow::PatchWindow(QWidget* parent) : QWidget(parent, Qt::Window) { IOFile output(outputPath, "wb"); output.writeBytes(bytes.data(), bytes.size()); } + + switch (result) { + case Hips::Result::Success: + displayMessage( + tr("Patching Success"), tr("Your file was patched successfully."), QMessageBox::Icon::Information, ":/docs/img/rpog_icon.png" + ); + break; + + case Hips::Result::ChecksumMismatch: + displayMessage( + tr("Checksum mismatch"), + tr("Patch was applied successfully but a checksum mismatch was detected. The input or output files might not be correct") + ); + break; + + default: displayMessage(tr("Patching error"), tr("An error occured while patching")); break; + } }); +} + +void PatchWindow::PatchWindow::displayMessage(const QString& title, const QString& message, QMessageBox::Icon icon, const char* iconPath) { + QMessageBox messageBox(icon, title, message); + QAbstractButton* button = messageBox.addButton(tr("OK"), QMessageBox::ButtonRole::YesRole); + + if (iconPath != nullptr) { + button->setIcon(QIcon(iconPath)); + } + + messageBox.exec(); } \ No newline at end of file