From 1769783dc7e10358c5c34650f34375c9295a674f Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Mon, 30 Oct 2023 22:49:32 +0200 Subject: [PATCH] Add about menu --- CMakeLists.txt | 6 +-- docs/img/rstarstruck_icon.png | Bin 0 -> 9132 bytes include/panda_qt/about_window.hpp | 12 ++++++ include/panda_qt/main_window.hpp | 3 ++ src/panda_qt/about_window.cpp | 62 ++++++++++++++++++++++++++++++ src/panda_qt/main_window.cpp | 14 ++++++- 6 files changed, 92 insertions(+), 5 deletions(-) create mode 100644 docs/img/rstarstruck_icon.png create mode 100644 include/panda_qt/about_window.hpp create mode 100644 src/panda_qt/about_window.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a718fbb..c202f80c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -185,8 +185,8 @@ set(RENDERER_SW_SOURCE_FILES src/core/renderer_sw/renderer_sw.cpp) # Frontend source files 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) + set(FRONTEND_SOURCE_FILES src/panda_qt/main.cpp src/panda_qt/screen.cpp src/panda_qt/main_window.cpp src/panda_qt/about_window.cpp) + set(FRONTEND_HEADER_FILES include/panda_qt/screen.hpp include/panda_qt/main_window.hpp include/panda_qt/about_window.hpp) source_group("Source Files\\Qt" FILES ${FRONTEND_SOURCE_FILES}) source_group("Header Files\\Qt" FILES ${FRONTEND_HEADER_FILES}) @@ -429,7 +429,7 @@ if(ENABLE_QT_GUI) qt_add_resources(Alber "app_images" PREFIX "/" FILES - docs/img/rsob_icon.png + docs/img/rsob_icon.png docs/img/rstarstruck_icon.png ) else() target_compile_definitions(Alber PUBLIC "PANDA3DS_FRONTEND_SDL=1") diff --git a/docs/img/rstarstruck_icon.png b/docs/img/rstarstruck_ic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*_1n*Vzn6UoTu9q77o*azO>E`e2DJV1xURtpKyoFPX z{r82N74+pAHr|?)`qF9Iq|5c0&N^jx165p3Onp~f+2VBi*PP|GHjOV{I;IOY*m$j! zv{Bf+e?N1bO^r6|E z@s`+Gzi^x0>`m))&9D5ADTvWfzU8oElgQ2XL;3}Yr(M3+>^(l|%DrI0T`wO5=Fh%% zV*aj0HVWtF9D3}&K|R_jy^58CqKI{yY&)K_h>D%w9)wf<)d&{Z*ErAqg#8mV(!#zay+)-w9@pl^2^KG z<&+qUE+6vNF_1Be>h`u=CNHorDtg8WQPuzp?&b}9%3KTb`O0hm{yckl)e(QW@*P`t z$+Rb&X?{u53ZmXB^GuhjxOOIQ>E;+ltRAByIn=kWLUKLm86Zmh^@jqtCv@dGv zX4^`{kAK?yz3suCkSViPU)BB?BmN~M@se9%Qq}Am2ECE7cR%aS`?CGVg-3^trQ0MA ztnNKs&Mcl2WU>6g^IbVQZjb1T=Oo9N#W=1sDmcb*}v5F-uH6fZMje<_BUqA z?GJI6KVSKjJNuK(frMpBjqiHJmLK{&dwJDQng3aBg7*@fWH!5O-d~-%!+p^L2H#bi z4mT%@Bz#^d@YkZ%wAE^#oCb$v*}jyTV|$+ka+u57M!wm#=g^~5AN@K09lJF1v(K;l ZQ|F#P-J|$<4FdxMgQu&X%Q~loCIBN%_Dlc( literal 0 HcmV?d00001 diff --git a/include/panda_qt/about_window.hpp b/include/panda_qt/about_window.hpp new file mode 100644 index 00000000..78812d14 --- /dev/null +++ b/include/panda_qt/about_window.hpp @@ -0,0 +1,12 @@ +#pragma once + +#include +#include +#include + +class AboutWindow : public QDialog { + Q_OBJECT + + public: + AboutWindow(QWidget* parent = nullptr); +}; \ No newline at end of file diff --git a/include/panda_qt/main_window.hpp b/include/panda_qt/main_window.hpp index 31fb1e0d..a50ee9a1 100644 --- a/include/panda_qt/main_window.hpp +++ b/include/panda_qt/main_window.hpp @@ -12,6 +12,7 @@ #include #include "emulator.hpp" +#include "panda_qt/about_window.hpp" #include "panda_qt/screen.hpp" #include "services/hid.hpp" @@ -56,6 +57,7 @@ class MainWindow : public QMainWindow { std::vector messageQueue; ScreenWidget screen; + AboutWindow* aboutWindow; QComboBox* themeSelect = nullptr; QMenuBar* menuBar = nullptr; @@ -65,6 +67,7 @@ class MainWindow : public QMainWindow { void emuThreadMainLoop(); void selectROM(); void dumpRomFS(); + void showAboutMenu(); void sendMessage(const EmulatorMessage& message); void dispatchMessage(const EmulatorMessage& message); diff --git a/src/panda_qt/about_window.cpp b/src/panda_qt/about_window.cpp new file mode 100644 index 00000000..6f799c23 --- /dev/null +++ b/src/panda_qt/about_window.cpp @@ -0,0 +1,62 @@ +#include "panda_qt/about_window.hpp" + +#include +#include +#include +#include + +// Based on https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/DolphinQt/AboutDialog.cpp + +AboutWindow::AboutWindow(QWidget* parent) : QDialog(parent) { + resize(200, 200); + + setWindowTitle(tr("About Panda3DS")); + setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); + + const QString text = + QStringLiteral(R"( +

Panda3DS

+ +

+%ABOUT_PANDA3DS%
+%SUPPORT%
+

+ +

+%AUTHORS% +

+)") + .replace(QStringLiteral("%ABOUT_PANDA3DS%"), tr("Panda3DS is a free and open source Nintendo 3DS emulator, for Windows, MacOS and Linux")) + .replace(QStringLiteral("%SUPPORT%"), tr("Visit panda3ds.com for help with Panda3DS and links to our official support sites.")) + .replace( + QStringLiteral("%AUTHORS%"), tr("Panda3DS is developed by volunteers in their spare time. Below is a list of some of these" + " volunteers who've agreed to be listed here, in no particular order.
If you think you should be " + "listed here too, please inform us

" + "- Peach (wheremyfoodat)
" + "- noumidev
" + "- liuk707
" + "- Wunk
" + "- marysaka
" + "- Sky
" + "- merryhime
" + "- TGP17
") + ); + + QLabel* textLabel = new QLabel(text); + textLabel->setTextInteractionFlags(Qt::TextBrowserInteraction); + textLabel->setOpenExternalLinks(true); + + QLabel* logo = new QLabel(); + logo->setPixmap(QPixmap(":/docs/img/rstarstruck_icon.png")); + logo->setContentsMargins(30, 0, 30, 0); + + QVBoxLayout* mainLayout = new QVBoxLayout; + QHBoxLayout* hLayout = new QHBoxLayout; + + setLayout(mainLayout); + mainLayout->addLayout(hLayout); + + hLayout->setAlignment(Qt::AlignLeft); + hLayout->addWidget(logo); + hLayout->addWidget(textLabel); +} \ No newline at end of file diff --git a/src/panda_qt/main_window.cpp b/src/panda_qt/main_window.cpp index 33e27a0d..804dc63a 100644 --- a/src/panda_qt/main_window.cpp +++ b/src/panda_qt/main_window.cpp @@ -20,7 +20,6 @@ MainWindow::MainWindow(QApplication* app, QWidget* parent) : QMainWindow(parent) auto fileMenu = menuBar->addMenu(tr("File")); auto emulationMenu = menuBar->addMenu(tr("Emulation")); auto toolsMenu = menuBar->addMenu(tr("Tools")); - auto helpMenu = menuBar->addMenu(tr("Help")); auto aboutMenu = menuBar->addMenu(tr("About")); // Create and bind actions for them @@ -37,6 +36,9 @@ MainWindow::MainWindow(QApplication* app, QWidget* parent) : QMainWindow(parent) auto dumpRomFSAction = toolsMenu->addAction(tr("Dump RomFS")); connect(dumpRomFSAction, &QAction::triggered, this, &MainWindow::dumpRomFS); + auto aboutAction = aboutMenu->addAction(tr("About Panda3DS")); + connect(aboutAction, &QAction::triggered, this, &MainWindow::showAboutMenu); + // Set up theme selection setTheme(Theme::Dark); themeSelect = new QComboBox(this); @@ -50,6 +52,9 @@ MainWindow::MainWindow(QApplication* app, QWidget* parent) : QMainWindow(parent) themeSelect->show(); connect(themeSelect, &QComboBox::currentIndexChanged, this, [&](int index) { setTheme(static_cast(index)); }); + // Set up misc objects + aboutWindow = new AboutWindow(nullptr); + emu = new Emulator(); emu->setOutputSize(screen.surfaceWidth, screen.surfaceHeight); @@ -136,6 +141,7 @@ MainWindow::~MainWindow() { delete emu; delete menuBar; + delete aboutWindow; delete themeSelect; } @@ -215,7 +221,6 @@ void MainWindow::setTheme(Theme theme) { break; } - case Theme::System: { qApp->setPalette(this->style()->standardPalette()); qApp->setStyle(QStyleFactory::create("WindowsVista")); @@ -260,6 +265,11 @@ void MainWindow::dumpRomFS() { } } +void MainWindow::showAboutMenu() { + AboutWindow about(this); + about.exec(); +} + void MainWindow::dispatchMessage(const EmulatorMessage& message) { switch (message.type) { case MessageType::LoadROM: