Set up icons

This commit is contained in:
wheremyfoodat 2023-10-07 23:15:43 +03:00
parent 6ae8d084b4
commit 0421eae7ae
4 changed files with 21 additions and 7 deletions

View file

@ -182,7 +182,7 @@ set(RENDERER_SW_SOURCE_FILES src/core/renderer_sw/renderer_sw.cpp)
if(ENABLE_QT_GUI)
set(FRONTEND_SOURCE_FILES src/panda_qt/main.cpp src/panda_qt/screen.cpp src/panda_qt/main_window.cpp)
set(FRONTEND_HEADER_FILES include/panda_qt/screen.hpp include/panda_qt/main_window.hpp)
source_group("Source Files\\Qt" FILES ${FRONTEND_SOURCE_FILES})
source_group("Header Files\\Qt" FILES ${FRONTEND_HEADER_FILES})
include_directories(${Qt6Gui_PRIVATE_INCLUDE_DIRS})
@ -414,6 +414,12 @@ if(ENABLE_QT_GUI)
target_link_libraries(Alber PRIVATE OpenGL::OpenGL OpenGL::EGL OpenGL::GLX)
endif()
endif()
qt_add_resources(Alber "app_images"
PREFIX "/"
FILES
docs/img/rsob_icon.png
)
else()
target_compile_definitions(Alber PUBLIC "PANDA3DS_FRONTEND_SDL=1")
endif()

BIN
docs/img/rsob_icon.png Normal file

Binary file not shown.

After

(image error) Size: 14 KiB

View file

@ -1,5 +1,7 @@
#include "emulator.hpp"
#include <glad/gl.h>
#include <fstream>
#ifdef _WIN32
#include <windows.h>
@ -583,7 +585,7 @@ void Emulator::updateDiscord() {
void Emulator::updateDiscord() {}
#endif
static void printNode(const RomFS::RomFSNode& node, const char* romFSBase, const std::filesystem::path& path) {
static void dumpRomFSNode(const RomFS::RomFSNode& node, const char* romFSBase, const std::filesystem::path& path) {
for (auto& file : node.files) {
const auto p = path / file->name;
std::ofstream outFile(p);
@ -599,7 +601,7 @@ static void printNode(const RomFS::RomFSNode& node, const char* romFSBase, const
std::filesystem::create_directories(newPath, ec);
if (!ec) {
printNode(*directory, romFSBase, newPath);
dumpRomFSNode(*directory, romFSBase, newPath);
}
}
}
@ -638,7 +640,7 @@ RomFS::DumpingResult Emulator::dumpRomFS(const std::filesystem::path& path) {
}
std::unique_ptr<RomFSNode> node = parseRomFSTree((uintptr_t)&romFS[0], size);
printNode(*node, (const char*) &romFS[0], path);
dumpRomFSNode(*node, (const char*)&romFS[0], path);
return DumpingResult::Success;
}

View file

@ -209,11 +209,17 @@ void MainWindow::dumpRomFS() {
switch (res) {
case RomFS::DumpingResult::Success: break; // Yay!
case RomFS::DumpingResult::InvalidFormat:
QMessageBox::warning(
this, tr("Invalid format for RomFS dumping"), tr("The currently loaded app is not in a format that supports RomFS!")
case RomFS::DumpingResult::InvalidFormat: {
QMessageBox messageBox(
QMessageBox::Icon::Warning, tr("Invalid format for RomFS dumping"),
tr("The currently loaded app is not in a format that supports RomFS")
);
QAbstractButton* button = messageBox.addButton(tr("OK"), QMessageBox::ButtonRole::YesRole);
button->setIcon(QIcon(":/docs/img/rsob_icon.png"));
messageBox.exec();
break;
}
case RomFS::DumpingResult::NoRomFS:
QMessageBox::warning(this, tr("No RomFS found"), tr("No RomFS partition was found in the loaded app"));