diff --git a/src/frontend/qt_sdl/CMakeLists.txt b/src/frontend/qt_sdl/CMakeLists.txt index 1ec01b10..1c17bad7 100644 --- a/src/frontend/qt_sdl/CMakeLists.txt +++ b/src/frontend/qt_sdl/CMakeLists.txt @@ -11,6 +11,7 @@ SET(SOURCES_QT_SDL WifiSettingsDialog.cpp InterfaceSettingsDialog.cpp ROMInfoDialog.cpp + TitleManagerDialog.cpp Input.cpp LAN_PCap.cpp LAN_Socket.cpp diff --git a/src/frontend/qt_sdl/TitleManagerDialog.cpp b/src/frontend/qt_sdl/TitleManagerDialog.cpp new file mode 100644 index 00000000..8f96db6e --- /dev/null +++ b/src/frontend/qt_sdl/TitleManagerDialog.cpp @@ -0,0 +1,45 @@ +/* + Copyright 2016-2021 Arisotura + + This file is part of melonDS. + + melonDS is free software: you can redistribute it and/or modify it under + the terms of the GNU General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + melonDS is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with melonDS. If not, see http://www.gnu.org/licenses/. +*/ + +#include +#include + +#include "types.h" +#include "Platform.h" +#include "Config.h" +#include "PlatformConfig.h" + +#include "TitleManagerDialog.h" +#include "ui_TitleManagerDialog.h" + + +TitleManagerDialog* TitleManagerDialog::currentDlg = nullptr; + + +TitleManagerDialog::TitleManagerDialog(QWidget* parent) : QDialog(parent), ui(new Ui::TitleManagerDialog) +{ + ui->setupUi(this); + setAttribute(Qt::WA_DeleteOnClose); + + // +} + +TitleManagerDialog::~TitleManagerDialog() +{ + delete ui; +} diff --git a/src/frontend/qt_sdl/TitleManagerDialog.h b/src/frontend/qt_sdl/TitleManagerDialog.h new file mode 100644 index 00000000..7cb88387 --- /dev/null +++ b/src/frontend/qt_sdl/TitleManagerDialog.h @@ -0,0 +1,60 @@ +/* + Copyright 2016-2021 Arisotura + + This file is part of melonDS. + + melonDS is free software: you can redistribute it and/or modify it under + the terms of the GNU General Public License as published by the Free + Software Foundation, either version 3 of the License, or (at your option) + any later version. + + melonDS is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with melonDS. If not, see http://www.gnu.org/licenses/. +*/ + +#ifndef TITLEMANAGERDIALOG_H +#define TITLEMANAGERDIALOG_H + +#include + +namespace Ui { class TitleManagerDialog; } +class TitleManagerDialog; + +class TitleManagerDialog : public QDialog +{ + Q_OBJECT + +public: + explicit TitleManagerDialog(QWidget* parent); + ~TitleManagerDialog(); + + static TitleManagerDialog* currentDlg; + static TitleManagerDialog* openDlg(QWidget* parent) + { + if (currentDlg) + { + currentDlg->activateWindow(); + return currentDlg; + } + + currentDlg = new TitleManagerDialog(parent); + currentDlg->open(); + return currentDlg; + } + static void closeDlg() + { + currentDlg = nullptr; + } + +private slots: + // shit + +private: + Ui::TitleManagerDialog* ui; +}; + +#endif // TITLEMANAGERDIALOG_H diff --git a/src/frontend/qt_sdl/TitleManagerDialog.ui b/src/frontend/qt_sdl/TitleManagerDialog.ui new file mode 100644 index 00000000..51cb330f --- /dev/null +++ b/src/frontend/qt_sdl/TitleManagerDialog.ui @@ -0,0 +1,60 @@ + + + TitleManagerDialog + + + + 0 + 0 + 608 + 466 + + + + DSi title manager - melonDS + + + + 6 + + + 6 + + + 6 + + + 6 + + + + + + + piss + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + diff --git a/src/frontend/qt_sdl/main.cpp b/src/frontend/qt_sdl/main.cpp index 4a59b2fd..09e8201f 100644 --- a/src/frontend/qt_sdl/main.cpp +++ b/src/frontend/qt_sdl/main.cpp @@ -58,6 +58,7 @@ #include "WifiSettingsDialog.h" #include "InterfaceSettingsDialog.h" #include "ROMInfoDialog.h" +#include "TitleManagerDialog.h" #include "types.h" #include "version.h" @@ -1379,6 +1380,12 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent) menu->addSeparator(); actROMInfo = menu->addAction("ROM info"); connect(actROMInfo, &QAction::triggered, this, &MainWindow::onROMInfo); + + // TODO: menu item should be disabled: + // * if no DSi NAND is specified + // * if something is running (even paused) + actTitleManager = menu->addAction("Manage DSi titles"); + connect(actTitleManager, &QAction::triggered, this, &MainWindow::onOpenTitleManager); } { QMenu* menu = menubar->addMenu("Config"); @@ -2391,6 +2398,11 @@ void MainWindow::onROMInfo() ROMInfoDialog* dlg = ROMInfoDialog::openDlg(this); } +void MainWindow::onOpenTitleManager() +{ + TitleManagerDialog* dlg = TitleManagerDialog::openDlg(this); +} + void MainWindow::onOpenEmuSettings() { emuThread->emuPause(); diff --git a/src/frontend/qt_sdl/main.h b/src/frontend/qt_sdl/main.h index 4d570a31..a218a9a6 100644 --- a/src/frontend/qt_sdl/main.h +++ b/src/frontend/qt_sdl/main.h @@ -236,6 +236,7 @@ private slots: void onSetupCheats(); void onCheatsDialogFinished(int res); void onROMInfo(); + void onOpenTitleManager(); void onOpenEmuSettings(); void onEmuSettingsDialogFinished(int res); @@ -313,6 +314,7 @@ public: QAction* actEnableCheats; QAction* actSetupCheats; QAction* actROMInfo; + QAction* actTitleManager; QAction* actEmuSettings; QAction* actInputConfig;