mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-06-03 12:27:21 +12:00
Qt: Add file patcher
This commit is contained in:
parent
70f443b06e
commit
66bcf384f3
9 changed files with 206 additions and 2 deletions
21
include/panda_qt/ellided_label.hpp
Normal file
21
include/panda_qt/ellided_label.hpp
Normal file
|
@ -0,0 +1,21 @@
|
|||
#pragma once
|
||||
#include <QFontMetrics>
|
||||
#include <QLabel>
|
||||
#include <QString>
|
||||
#include <QWidget>
|
||||
|
||||
class EllidedLabel : public QLabel {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit EllidedLabel(Qt::TextElideMode elideMode = Qt::ElideLeft, QWidget* parent = nullptr);
|
||||
explicit EllidedLabel(QString text, Qt::TextElideMode elideMode = Qt::ElideLeft, QWidget* parent = nullptr);
|
||||
void setText(QString text);
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent* event);
|
||||
|
||||
private:
|
||||
void updateText();
|
||||
QString m_text;
|
||||
Qt::TextElideMode m_elideMode;
|
||||
};
|
|
@ -17,6 +17,7 @@
|
|||
#include "panda_qt/about_window.hpp"
|
||||
#include "panda_qt/cheats_window.hpp"
|
||||
#include "panda_qt/config_window.hpp"
|
||||
#include "panda_qt/patch_window.hpp"
|
||||
#include "panda_qt/screen.hpp"
|
||||
#include "panda_qt/text_editor.hpp"
|
||||
#include "services/hid.hpp"
|
||||
|
@ -90,13 +91,14 @@ class MainWindow : public QMainWindow {
|
|||
std::mutex messageQueueMutex;
|
||||
std::vector<EmulatorMessage> messageQueue;
|
||||
|
||||
QMenuBar* menuBar = nullptr;
|
||||
InputMappings keyboardMappings;
|
||||
ScreenWidget screen;
|
||||
AboutWindow* aboutWindow;
|
||||
ConfigWindow* configWindow;
|
||||
CheatsWindow* cheatsEditor;
|
||||
TextEditorWindow* luaEditor;
|
||||
QMenuBar* menuBar = nullptr;
|
||||
PatchWindow* patchWindow;
|
||||
|
||||
// We use SDL's game controller API since it's the sanest API that supports as many controllers as possible
|
||||
SDL_GameController* gameController = nullptr;
|
||||
|
@ -110,6 +112,7 @@ class MainWindow : public QMainWindow {
|
|||
void dumpRomFS();
|
||||
void openLuaEditor();
|
||||
void openCheatsEditor();
|
||||
void openPatchWindow();
|
||||
void showAboutMenu();
|
||||
void initControllers();
|
||||
void pollControllers();
|
||||
|
|
21
include/panda_qt/patch_window.hpp
Normal file
21
include/panda_qt/patch_window.hpp
Normal file
|
@ -0,0 +1,21 @@
|
|||
#pragma once
|
||||
#include <QLabel>
|
||||
#include <QWidget>
|
||||
#include <filesystem>
|
||||
|
||||
#include "panda_qt/ellided_label.hpp"
|
||||
|
||||
class PatchWindow final : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
PatchWindow(QWidget* parent = nullptr);
|
||||
~PatchWindow() = default;
|
||||
|
||||
private:
|
||||
std::filesystem::path inputPath = "";
|
||||
std::filesystem::path patchPath = "";
|
||||
|
||||
EllidedLabel* inputPathLabel = nullptr;
|
||||
EllidedLabel* patchPathLabel = nullptr;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue