shadPS4/src/qt_gui/pkg_viewer.h
Vinicius Rangel 0f4bcd8c83
Rewrite Save Data & Impl Save Data Dialog (#824)
* core: Rewrite PSF parser & add encoder

add .sfo hex pattern to /scripts

* core/fs: allow to mount path as read-only

* common: Add CString wrapper to handle native null-terminated strings

* SaveData: rewrite to implement full functionality

* mock value for SYSTEM_VER

* SavaData: backup features

* SavaData: SaveDataMemory features

* imgui Ref-counted textures

- has a background thread to decode textures

* imgui: rework gamepad navigation

* PSF: fixed psf not using enum class for PSFEntryFmt (was a standard old ugly enum)

- Add null check to CString when itself is used in a nullable field

* SaveDataDialog implementation

- Fix Mounting/Unmounting check of SaveInstance
2024-09-20 12:34:19 +03:00

62 lines
No EOL
1.6 KiB
C++

// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <QFileDialog>
#include <QMenuBar>
#include <QStatusBar>
#include "common/io_file.h"
#include "core/file_format/pkg.h"
#include "core/file_format/pkg_type.h"
#include "core/file_format/psf.h"
#include "game_info.h"
#include "game_list_utils.h"
#include "gui_context_menus.h"
class PKGViewer : public QMainWindow {
Q_OBJECT
public:
explicit PKGViewer(
std::shared_ptr<GameInfoClass> game_info_get, QWidget* parent,
std::function<void(std::filesystem::path, int, int)> InstallDragDropPkg = nullptr);
~PKGViewer();
void OpenPKGFolder();
void CheckPKGFolders();
void ProcessPKGInfo();
private:
GuiContextMenus m_gui_context_menus;
PKG package;
PSF psf;
PKGHeader pkgheader;
PKGEntry entry;
PSFHeader header;
char pkgTitleID[9];
std::vector<u8> pkg;
u64 pkgSize = 0;
std::unordered_map<std::string, std::string> map_strings;
std::unordered_map<std::string, u32> map_integers;
u32_be pkg_content_flag;
std::shared_ptr<GameInfoClass> m_game_info;
GameListUtils game_list_util;
// Status bar
QStatusBar* statusBar;
std::vector<std::pair<int, QString>> appTypes = {
{0, "FULL APP"},
{1, "UPGRADABLE"},
{2, "DEMO"},
{3, "FREEMIUM"},
};
QStringList m_full_pkg_list;
QStringList m_pkg_app_list;
QStringList m_pkg_patch_list;
QStringList m_pkg_list;
QStringList dir_list;
std::vector<std::string> dir_list_std;
QTreeWidget* treeWidget = nullptr;
};