From 74e806810dc1b6dd2e2c6ea3386c004e7da5ad2d Mon Sep 17 00:00:00 2001 From: Yukariin Date: Fri, 7 Apr 2017 02:12:15 +0400 Subject: [PATCH] [WIP] Update Qt interface (#2336) * Fix rpcs3qt Linux build * Files clean up * Add base MainWindow class * Add slot stubs * Update MainWindow::DecryptSPRXLibraries * Add SettingsDialog base class and tab stubs * Add CoreTab base layout * Add compile guards * Minor fixes * Add GraphicsTab base layout * Add OK button signal * Remove QML stuff * Fix indentation * Add AudioTab base layout * Add InputTab base layout * Fix layouts * Add MiscTab base layout * Fix layouts * Add NetworkingTab base layout * Add SystemTab base layout * Fix button layout in SettingsDialog * Make SettingsDialog resizable * Add base dock widget stubs * Add very base PadSettingsDialog layout * Add combo box entries * Abb LogFrame base layout * Fix indent * Abb GameListFrame base layout * Minor fixes * Add AutoPauseSettingsDialog base layout --- rpcs3/rpcs3qt/AutoPauseSettingsDialog.cpp | 49 +++ rpcs3/rpcs3qt/AutoPauseSettingsDialog.h | 14 + rpcs3/rpcs3qt/audiotab.cpp | 44 +++ rpcs3/rpcs3qt/audiotab.h | 18 ++ rpcs3/rpcs3qt/coretab.cpp | 83 +++++ rpcs3/rpcs3qt/coretab.h | 23 ++ rpcs3/rpcs3qt/debuggerframe.cpp | 10 + rpcs3/rpcs3qt/debuggerframe.h | 14 + rpcs3/rpcs3qt/gamelistframe.cpp | 20 ++ rpcs3/rpcs3qt/gamelistframe.h | 18 ++ rpcs3/rpcs3qt/graphicstab.cpp | 147 +++++++++ rpcs3/rpcs3qt/graphicstab.h | 18 ++ rpcs3/rpcs3qt/inputtab.cpp | 90 ++++++ rpcs3/rpcs3qt/inputtab.h | 18 ++ rpcs3/rpcs3qt/logframe.cpp | 38 +++ rpcs3/rpcs3qt/logframe.h | 25 ++ rpcs3/rpcs3qt/main.cpp | 15 +- rpcs3/rpcs3qt/mainwindow.cpp | 362 ++++++++++++++++++++++ rpcs3/rpcs3qt/mainwindow.h | 69 +++++ rpcs3/rpcs3qt/misctab.cpp | 32 ++ rpcs3/rpcs3qt/misctab.h | 18 ++ rpcs3/rpcs3qt/networkingtab.cpp | 36 +++ rpcs3/rpcs3qt/networkingtab.h | 18 ++ rpcs3/rpcs3qt/padsettingsdialog.cpp | 107 +++++++ rpcs3/rpcs3qt/padsettingsdialog.h | 14 + rpcs3/rpcs3qt/rpcs3qt.pro | 6 +- rpcs3/rpcs3qt/settingsdialog.cpp | 49 +++ rpcs3/rpcs3qt/settingsdialog.h | 18 ++ rpcs3/rpcs3qt/systemtab.cpp | 55 ++++ rpcs3/rpcs3qt/systemtab.h | 18 ++ 30 files changed, 1434 insertions(+), 12 deletions(-) create mode 100644 rpcs3/rpcs3qt/AutoPauseSettingsDialog.cpp create mode 100644 rpcs3/rpcs3qt/AutoPauseSettingsDialog.h create mode 100644 rpcs3/rpcs3qt/audiotab.cpp create mode 100644 rpcs3/rpcs3qt/audiotab.h create mode 100644 rpcs3/rpcs3qt/coretab.cpp create mode 100644 rpcs3/rpcs3qt/coretab.h create mode 100644 rpcs3/rpcs3qt/debuggerframe.cpp create mode 100644 rpcs3/rpcs3qt/debuggerframe.h create mode 100644 rpcs3/rpcs3qt/gamelistframe.cpp create mode 100644 rpcs3/rpcs3qt/gamelistframe.h create mode 100644 rpcs3/rpcs3qt/graphicstab.cpp create mode 100644 rpcs3/rpcs3qt/graphicstab.h create mode 100644 rpcs3/rpcs3qt/inputtab.cpp create mode 100644 rpcs3/rpcs3qt/inputtab.h create mode 100644 rpcs3/rpcs3qt/logframe.cpp create mode 100644 rpcs3/rpcs3qt/logframe.h create mode 100644 rpcs3/rpcs3qt/mainwindow.cpp create mode 100644 rpcs3/rpcs3qt/mainwindow.h create mode 100644 rpcs3/rpcs3qt/misctab.cpp create mode 100644 rpcs3/rpcs3qt/misctab.h create mode 100644 rpcs3/rpcs3qt/networkingtab.cpp create mode 100644 rpcs3/rpcs3qt/networkingtab.h create mode 100644 rpcs3/rpcs3qt/padsettingsdialog.cpp create mode 100644 rpcs3/rpcs3qt/padsettingsdialog.h create mode 100644 rpcs3/rpcs3qt/settingsdialog.cpp create mode 100644 rpcs3/rpcs3qt/settingsdialog.h create mode 100644 rpcs3/rpcs3qt/systemtab.cpp create mode 100644 rpcs3/rpcs3qt/systemtab.h diff --git a/rpcs3/rpcs3qt/AutoPauseSettingsDialog.cpp b/rpcs3/rpcs3qt/AutoPauseSettingsDialog.cpp new file mode 100644 index 0000000000..c3e7aff73b --- /dev/null +++ b/rpcs3/rpcs3qt/AutoPauseSettingsDialog.cpp @@ -0,0 +1,49 @@ +#ifdef QT_UI + +#include +#include +#include +#include + +#include "AutoPauseSettingsDialog.h" + +AutoPauseSettingsDialog::AutoPauseSettingsDialog(QWidget *parent) : QDialog(parent) +{ + QLabel *desc = new QLabel(tr("To use auto pause: enter the ID(s) of a function or a system call.\nRestart of the game is required to apply. You can enable/disable this in the settings.")); + + QTableWidget *pauseList = new QTableWidget; + pauseList->setColumnCount(2); + pauseList->setHorizontalHeaderItem(0, new QTableWidgetItem(tr("Call ID"))); + pauseList->setHorizontalHeaderItem(1, new QTableWidgetItem(tr("Type"))); + + QPushButton *clearButton = new QPushButton(tr("Clear")); + + QPushButton *reloadButton = new QPushButton(tr("Reload")); + + QPushButton *saveButton = new QPushButton(tr("Save")); + connect(saveButton, &QAbstractButton::clicked, this, &QDialog::accept); + + QPushButton *cancelButton = new QPushButton(tr("Cancel")); + cancelButton->setDefault(true); + connect(cancelButton, &QAbstractButton::clicked, this, &QWidget::close); + + QHBoxLayout *buttonsLayout = new QHBoxLayout; + buttonsLayout->addWidget(clearButton); + buttonsLayout->addWidget(reloadButton); + buttonsLayout->addStretch(); + buttonsLayout->addWidget(saveButton); + buttonsLayout->addWidget(cancelButton); + + QVBoxLayout *mainLayout = new QVBoxLayout; + mainLayout->addWidget(desc); + mainLayout->addWidget(pauseList); + mainLayout->addLayout(buttonsLayout); + setLayout(mainLayout); + + setMinimumSize(QSize(400, 360)); + + setWindowTitle(tr("Auto Pause Manager")); +} + +#endif // QT_UI + diff --git a/rpcs3/rpcs3qt/AutoPauseSettingsDialog.h b/rpcs3/rpcs3qt/AutoPauseSettingsDialog.h new file mode 100644 index 0000000000..387c52c740 --- /dev/null +++ b/rpcs3/rpcs3qt/AutoPauseSettingsDialog.h @@ -0,0 +1,14 @@ +#ifndef AUTOPAUSESETTINGSDIALOG_H +#define AUTOPAUSESETTINGSDIALOG_H + +#include + +class AutoPauseSettingsDialog : public QDialog +{ + Q_OBJECT + +public: + explicit AutoPauseSettingsDialog(QWidget *parent = 0); +}; + +#endif // AUTOPAUSESETTINGSDIALOG_H diff --git a/rpcs3/rpcs3qt/audiotab.cpp b/rpcs3/rpcs3qt/audiotab.cpp new file mode 100644 index 0000000000..2643e8a804 --- /dev/null +++ b/rpcs3/rpcs3qt/audiotab.cpp @@ -0,0 +1,44 @@ +#ifdef QT_UI + +#include +#include +#include +#include +#include + +#include "audiotab.h" + +AudioTab::AudioTab(QWidget *parent) : QWidget(parent) +{ + // Audio Out + QGroupBox *audioOut = new QGroupBox(tr("Audio Out")); + + QComboBox *audioOutBox = new QComboBox; + audioOutBox->addItem(tr("Null")); +#ifdef _WIN32 + audioOutBox->addItem(tr("XAudio2")); +#endif // _WIN32 + audioOutBox->addItem(tr("OpenAL")); + + QVBoxLayout *audioOutVbox = new QVBoxLayout; + audioOutVbox->addWidget(audioOutBox); + audioOut->setLayout(audioOutVbox); + + // Checkboxes + QCheckBox *audioDump = new QCheckBox(tr("Dump to file")); + QCheckBox *conv = new QCheckBox(tr("Convert to 16 bit")); + + // Main layout + QVBoxLayout *vbox = new QVBoxLayout; + vbox->addWidget(audioOut); + vbox->addWidget(audioDump); + vbox->addWidget(conv); + vbox->addStretch(); + + QHBoxLayout *hbox = new QHBoxLayout; + hbox->addLayout(vbox); + hbox->addStretch(); + setLayout(hbox); +} + +#endif // QT_UI diff --git a/rpcs3/rpcs3qt/audiotab.h b/rpcs3/rpcs3qt/audiotab.h new file mode 100644 index 0000000000..fe4d3f8967 --- /dev/null +++ b/rpcs3/rpcs3qt/audiotab.h @@ -0,0 +1,18 @@ +#ifndef AUDIOTAB_H +#define AUDIOTAB_H + +#include + +class AudioTab : public QWidget +{ + Q_OBJECT + +public: + explicit AudioTab(QWidget *parent = 0); + +signals: + +public slots: +}; + +#endif // AUDIOTAB_H diff --git a/rpcs3/rpcs3qt/coretab.cpp b/rpcs3/rpcs3qt/coretab.cpp new file mode 100644 index 0000000000..99d14b25b9 --- /dev/null +++ b/rpcs3/rpcs3qt/coretab.cpp @@ -0,0 +1,83 @@ +#ifdef QT_UI + +#include +#include +#include +#include +#include +#include + +#include "coretab.h" + +CoreTab::CoreTab(QWidget *parent) : QWidget(parent) +{ + // PPU Decoder + QGroupBox *ppuDecoder = new QGroupBox(tr("PPU Decoder")); + + QRadioButton *ppuRadio1 = new QRadioButton(tr("Interpreter (precise)")); + QRadioButton *ppuRadio2 = new QRadioButton(tr("Interpreter (fast)")); + QRadioButton *ppuRadio3 = new QRadioButton(tr("Recompiler (LLVM)")); + + QVBoxLayout *ppuVbox = new QVBoxLayout; + ppuVbox->addWidget(ppuRadio1); + ppuVbox->addWidget(ppuRadio2); + ppuVbox->addWidget(ppuRadio3); + ppuDecoder->setLayout(ppuVbox); + + // SPU Decoder + QGroupBox *spuDecoder = new QGroupBox(tr("SPU Decoder")); + + QRadioButton *spuRadio1 = new QRadioButton(tr("Interpreter (precise)")); + QRadioButton *spuRadio2 = new QRadioButton(tr("Interpreter (fast)")); + QRadioButton *spuRadio3 = new QRadioButton(tr("Recompiler (ASMJIT)")); + QRadioButton *spuRadio4 = new QRadioButton(tr("Recompiler (LLVM)")); + spuRadio4->setEnabled(false); // TODO + + QVBoxLayout *spuVbox = new QVBoxLayout; + spuVbox->addWidget(spuRadio1); + spuVbox->addWidget(spuRadio2); + spuVbox->addWidget(spuRadio3); + spuVbox->addWidget(spuRadio4); + spuDecoder->setLayout(spuVbox); + + // Checkboxes + QCheckBox *hookStFunc = new QCheckBox(tr("Hook static functions")); + QCheckBox *loadLiblv2 = new QCheckBox(tr("Load liblv2.sprx only")); + + // Load libraries + QGroupBox *lle = new QGroupBox(tr("Load libraries")); + + lleList = new QListWidget; + searchBox = new QLineEdit; + connect(searchBox, &QLineEdit::textChanged, this, &CoreTab::OnSearchBoxTextChanged); + + QVBoxLayout *lleVbox = new QVBoxLayout; + lleVbox->addWidget(lleList); + lleVbox->addWidget(searchBox); + lle->setLayout(lleVbox); + + // Main layout + QVBoxLayout *vbox = new QVBoxLayout; + vbox->addWidget(ppuDecoder); + vbox->addWidget(spuDecoder); + vbox->addWidget(hookStFunc); + vbox->addWidget(loadLiblv2); + vbox->addStretch(); + + QHBoxLayout *hbox = new QHBoxLayout; + hbox->addLayout(vbox); + hbox->addWidget(lle); + setLayout(hbox); +} + +void CoreTab::OnSearchBoxTextChanged() +{ + if (searchBox->text().isEmpty()) + qDebug() << "Empty!"; + + lleList->clear(); + + QString searchTerm = searchBox->text().toLower(); +} + +#endif // QT_UI diff --git a/rpcs3/rpcs3qt/coretab.h b/rpcs3/rpcs3qt/coretab.h new file mode 100644 index 0000000000..41fbdd1384 --- /dev/null +++ b/rpcs3/rpcs3qt/coretab.h @@ -0,0 +1,23 @@ +#ifndef CORETAB_H +#define CORETAB_H + +#include +#include +#include + +class CoreTab : public QWidget +{ + Q_OBJECT + +public: + explicit CoreTab(QWidget *parent = 0); + +private slots: + void OnSearchBoxTextChanged(); + +private: + QListWidget *lleList; + QLineEdit *searchBox; +}; + +#endif // CORETAB_H diff --git a/rpcs3/rpcs3qt/debuggerframe.cpp b/rpcs3/rpcs3qt/debuggerframe.cpp new file mode 100644 index 0000000000..64499eb7da --- /dev/null +++ b/rpcs3/rpcs3qt/debuggerframe.cpp @@ -0,0 +1,10 @@ +#ifdef QT_UI + +#include "debuggerframe.h" + +DebuggerFrame::DebuggerFrame(QWidget *parent) : QDockWidget(tr("Debugger"), parent) +{ + +} + +#endif // QT_UI diff --git a/rpcs3/rpcs3qt/debuggerframe.h b/rpcs3/rpcs3qt/debuggerframe.h new file mode 100644 index 0000000000..94d111890f --- /dev/null +++ b/rpcs3/rpcs3qt/debuggerframe.h @@ -0,0 +1,14 @@ +#ifndef DEBUGGERFRAME_H +#define DEBUGGERFRAME_H + +#include + +class DebuggerFrame : public QDockWidget +{ + Q_OBJECT + +public: + explicit DebuggerFrame(QWidget *parent = 0); +}; + +#endif // DEBUGGERFRAME_H diff --git a/rpcs3/rpcs3qt/gamelistframe.cpp b/rpcs3/rpcs3qt/gamelistframe.cpp new file mode 100644 index 0000000000..1221634298 --- /dev/null +++ b/rpcs3/rpcs3qt/gamelistframe.cpp @@ -0,0 +1,20 @@ +#ifdef QT_UI + +#include "gamelistframe.h" + +GameListFrame::GameListFrame(QWidget *parent) : QDockWidget(tr("Game List"), parent) +{ + gameList = new QTableWidget(this); + gameList->setColumnCount(7); + gameList->setHorizontalHeaderItem(0, new QTableWidgetItem(tr("Icon"))); + gameList->setHorizontalHeaderItem(1, new QTableWidgetItem(tr("Name"))); + gameList->setHorizontalHeaderItem(2, new QTableWidgetItem(tr("Serial"))); + gameList->setHorizontalHeaderItem(3, new QTableWidgetItem(tr("FW"))); + gameList->setHorizontalHeaderItem(4, new QTableWidgetItem(tr("Version"))); + gameList->setHorizontalHeaderItem(5, new QTableWidgetItem(tr("Category"))); + gameList->setHorizontalHeaderItem(6, new QTableWidgetItem(tr("Path"))); + + setWidget(gameList); +} + +#endif // QT_UI diff --git a/rpcs3/rpcs3qt/gamelistframe.h b/rpcs3/rpcs3qt/gamelistframe.h new file mode 100644 index 0000000000..0e83d8ff44 --- /dev/null +++ b/rpcs3/rpcs3qt/gamelistframe.h @@ -0,0 +1,18 @@ +#ifndef GAMELISTFRAME_H +#define GAMELISTFRAME_H + +#include +#include + +class GameListFrame : public QDockWidget +{ + Q_OBJECT + +public: + explicit GameListFrame(QWidget *parent = 0); + +private: + QTableWidget *gameList; +}; + +#endif // GAMELISTFRAME_H diff --git a/rpcs3/rpcs3qt/graphicstab.cpp b/rpcs3/rpcs3qt/graphicstab.cpp new file mode 100644 index 0000000000..d0798cd993 --- /dev/null +++ b/rpcs3/rpcs3qt/graphicstab.cpp @@ -0,0 +1,147 @@ +#ifdef QT_UI + +#include +#include +#include +#include +#include + +#ifdef _MSC_VER +#include +#undef GetHwnd +#include +#include +#include +#endif + +#include "graphicstab.h" + +GraphicsTab::GraphicsTab(QWidget *parent) : QWidget(parent) +{ + // Render + QGroupBox *render = new QGroupBox(tr("Render")); + + QComboBox *renderBox = new QComboBox; + renderBox->addItem(tr("Null")); + renderBox->addItem(tr("Opengl")); +#ifdef _MSC_VER + renderBox->addItem(tr("D3D12")); +#endif // _MSC_VER +#ifdef _WIN32 + renderBox->addItem(tr("Vulkan")); +#endif // _WIN32 + + QVBoxLayout *renderVbox = new QVBoxLayout; + renderVbox->addWidget(renderBox); + render->setLayout(renderVbox); + + // Resolution + QGroupBox *res = new QGroupBox(tr("Resolution")); + + QComboBox *resBox = new QComboBox; + resBox->addItem(tr("1920x1080")); + resBox->addItem(tr("1280x720")); + resBox->addItem(tr("720x480")); + resBox->addItem(tr("1600x1080")); + resBox->addItem(tr("1440x1080")); + resBox->addItem(tr("1280x1080")); + resBox->addItem(tr("960x1080")); + + QVBoxLayout *resVbox = new QVBoxLayout; + resVbox->addWidget(resBox); + res->setLayout(resVbox); + + // D3D Adapter + QGroupBox *d3dAdapter = new QGroupBox(tr("D3D Adapter")); + + QComboBox *d3dAdapterBox = new QComboBox; + + QVBoxLayout *d3dAdapterVbox = new QVBoxLayout; + d3dAdapterVbox->addWidget(d3dAdapterBox); + d3dAdapter->setLayout(d3dAdapterVbox); + + // Aspect ratio + QGroupBox *aspect = new QGroupBox(tr("Aspect ratio")); + + QComboBox *aspectBox = new QComboBox; + aspectBox->addItem(tr("4x3")); + aspectBox->addItem(tr("16x9")); + + QVBoxLayout *aspectVbox = new QVBoxLayout; + aspectVbox->addWidget(aspectBox); + aspect->setLayout(aspectVbox); + + // Frame limit + QGroupBox *frameLimit = new QGroupBox(tr("Frame limit")); + + QComboBox *frameLimitBox = new QComboBox; + frameLimitBox->addItem(tr("Off")); + frameLimitBox->addItem(tr("50")); + frameLimitBox->addItem(tr("60")); + frameLimitBox->addItem(tr("30")); + frameLimitBox->addItem(tr("Auto")); + + QVBoxLayout *frameLimitVbox = new QVBoxLayout; + frameLimitVbox->addWidget(frameLimitBox); + frameLimit->setLayout(frameLimitVbox); + + // Checkboxes + QCheckBox *dumpColor = new QCheckBox(tr("Write Color Buffers")); + QCheckBox *readColor = new QCheckBox(tr("Read Color Buffers")); + QCheckBox *dumpDepth = new QCheckBox(tr("Write Depth Buffer")); + QCheckBox *readDepth = new QCheckBox(tr("Read Depth Buffer")); + QCheckBox *glLegacyBuffers = new QCheckBox(tr("Use Legacy OpenGL Buffers")); + QCheckBox *debugOutput = new QCheckBox(tr("Debug Output")); + QCheckBox *debugOverlay = new QCheckBox(tr("Debug Overlay")); + QCheckBox *logProg = new QCheckBox(tr("Log shader programs")); + QCheckBox *vsync = new QCheckBox(tr("VSync")); + + // Main layout + QVBoxLayout *vbox1 = new QVBoxLayout; + vbox1->addWidget(render); + vbox1->addWidget(res); + vbox1->addWidget(d3dAdapter); + vbox1->addWidget(aspect); + vbox1->addWidget(frameLimit); + + QVBoxLayout *vbox2 = new QVBoxLayout; + vbox2->addWidget(dumpColor); + vbox2->addWidget(readColor); + vbox2->addWidget(dumpDepth); + vbox2->addWidget(readDepth); + vbox2->addWidget(glLegacyBuffers); + vbox2->addWidget(debugOutput); + vbox2->addWidget(debugOverlay); + vbox2->addWidget(logProg); + vbox2->addWidget(vsync); + vbox2->addStretch(); + + QHBoxLayout *hbox = new QHBoxLayout; + hbox->addLayout(vbox1); + hbox->addLayout(vbox2); + setLayout(hbox); + +#ifdef _MSC_VER + Microsoft::WRL::ComPtr dxgi_factory; + + if (SUCCEEDED(CreateDXGIFactory(IID_PPV_ARGS(&dxgi_factory)))) + { + Microsoft::WRL::ComPtr adapter; + + for (UINT id = 0; dxgi_factory->EnumAdapters(id, adapter.ReleaseAndGetAddressOf()) != DXGI_ERROR_NOT_FOUND; id++) + { + DXGI_ADAPTER_DESC desc; + adapter->GetDesc(&desc); + d3dAdapterBox->addItem(QString::fromWCharArray(desc.Description)); + } + + //pads.emplace_back(std::make_unique(cfg_location{ "Video", "D3D12", "Adapter" }, cbox_gs_d3d_adapter)); + } + else +#endif + { + d3dAdapter->setEnabled(false); + } +} + +#endif // QT_UI diff --git a/rpcs3/rpcs3qt/graphicstab.h b/rpcs3/rpcs3qt/graphicstab.h new file mode 100644 index 0000000000..d8383dcaaf --- /dev/null +++ b/rpcs3/rpcs3qt/graphicstab.h @@ -0,0 +1,18 @@ +#ifndef GRAPHICSTAB_H +#define GRAPHICSTAB_H + +#include + +class GraphicsTab : public QWidget +{ + Q_OBJECT + +public: + explicit GraphicsTab(QWidget *parent = 0); + +signals: + +public slots: +}; + +#endif // GRAPHICSTAB_H diff --git a/rpcs3/rpcs3qt/inputtab.cpp b/rpcs3/rpcs3qt/inputtab.cpp new file mode 100644 index 0000000000..1a51b8c145 --- /dev/null +++ b/rpcs3/rpcs3qt/inputtab.cpp @@ -0,0 +1,90 @@ +#ifdef QT_UI + +#include +#include +#include +#include + +#include "inputtab.h" + +InputTab::InputTab(QWidget *parent) : QWidget(parent) +{ + // Pad Handler + QGroupBox *padHandler = new QGroupBox(tr("Pad Handler")); + + QComboBox *padHandlerBox = new QComboBox; + padHandlerBox->addItem(tr("Null")); + padHandlerBox->addItem(tr("Keyboard")); +#ifdef _MSC_VER + padHandlerBox->addItem(tr("XInput")); +#endif // _MSC_VER + + QVBoxLayout *padHandlerVbox = new QVBoxLayout; + padHandlerVbox->addWidget(padHandlerBox); + padHandler->setLayout(padHandlerVbox); + + // Keyboard Handler + QGroupBox *keyboardHandler = new QGroupBox(tr("Keyboard Handler")); + + QComboBox *keyboardHandlerBox = new QComboBox; + keyboardHandlerBox->addItem(tr("Null")); + keyboardHandlerBox->addItem(tr("Basic")); + + QVBoxLayout *keyboardHandlerVbox = new QVBoxLayout; + keyboardHandlerVbox->addWidget(keyboardHandlerBox); + keyboardHandler->setLayout(keyboardHandlerVbox); + + // Mouse Handler + QGroupBox *mouseHandler = new QGroupBox(tr("Mouse Handler")); + + QComboBox *mouseHandlerBox = new QComboBox; + mouseHandlerBox->addItem(tr("Null")); + mouseHandlerBox->addItem(tr("Basic")); + + QVBoxLayout *mouseHandlerVbox = new QVBoxLayout; + mouseHandlerVbox->addWidget(mouseHandlerBox); + mouseHandler->setLayout(mouseHandlerVbox); + + // Camera + QGroupBox *camera = new QGroupBox(tr("Camera")); + + QComboBox *cameraBox = new QComboBox; + cameraBox->addItem(tr("Null")); + cameraBox->addItem(tr("Fake")); + + QVBoxLayout *cameraVbox = new QVBoxLayout; + cameraVbox->addWidget(cameraBox); + camera->setLayout(cameraVbox); + + // Camera type + QGroupBox *cameraType = new QGroupBox(tr("Camera type")); + + QComboBox *cameraTypeBox = new QComboBox; + cameraTypeBox->addItem(tr("Unknown")); + cameraTypeBox->addItem(tr("EyeToy")); + cameraTypeBox->addItem(tr("PS Eye")); + cameraTypeBox->addItem(tr("UVC 1.1")); + + QVBoxLayout *cameraTypeVbox = new QVBoxLayout; + cameraTypeVbox->addWidget(cameraTypeBox); + cameraType->setLayout(cameraTypeVbox); + + // Main layout + QVBoxLayout *vbox1 = new QVBoxLayout; + vbox1->addWidget(padHandler); + vbox1->addWidget(keyboardHandler); + vbox1->addWidget(mouseHandler); + vbox1->addStretch(); + + QVBoxLayout *vbox2 = new QVBoxLayout; + vbox2->addWidget(camera); + vbox2->addWidget(cameraType); + vbox2->addStretch(); + + QHBoxLayout *hbox = new QHBoxLayout; + hbox->addLayout(vbox1); + hbox->addLayout(vbox2); + setLayout(hbox); +} + +#endif // QT_UI diff --git a/rpcs3/rpcs3qt/inputtab.h b/rpcs3/rpcs3qt/inputtab.h new file mode 100644 index 0000000000..0c400758c7 --- /dev/null +++ b/rpcs3/rpcs3qt/inputtab.h @@ -0,0 +1,18 @@ +#ifndef INPUTTAB_H +#define INPUTTAB_H + +#include + +class InputTab : public QWidget +{ + Q_OBJECT + +public: + explicit InputTab(QWidget *parent = 0); + +signals: + +public slots: +}; + +#endif // INPUTTAB_H diff --git a/rpcs3/rpcs3qt/logframe.cpp b/rpcs3/rpcs3qt/logframe.cpp new file mode 100644 index 0000000000..79f7fb7a54 --- /dev/null +++ b/rpcs3/rpcs3qt/logframe.cpp @@ -0,0 +1,38 @@ +#ifdef QT_UI + +#include "logframe.h" + +LogFrame::LogFrame(QWidget *parent) : QDockWidget(tr("Log"), parent) +{ + tabWidget = new QTabWidget; + + log = new QTextEdit(tabWidget); + QPalette logPalette = log->palette(); + logPalette.setColor(QPalette::Base, Qt::black); + log->setPalette(logPalette); + log->setReadOnly(true); + + tty = new QTextEdit(tabWidget); + QPalette ttyPalette = log->palette(); + ttyPalette.setColor(QPalette::Base, Qt::black); + ttyPalette.setColor(QPalette::Text, Qt::white); + tty->setPalette(ttyPalette); + tty->setReadOnly(true); + + tabWidget->addTab(log, tr("Log")); + tabWidget->addTab(tty, tr("TTY")); + + setWidget(tabWidget); + + // Check for updates every ~10 ms + QTimer *timer = new QTimer(this); + connect(timer, &QTimer::timeout, this, &LogFrame::Update); + timer->start(10); +} + +void LogFrame::Update() +{ + +} + +#endif // QT_UI diff --git a/rpcs3/rpcs3qt/logframe.h b/rpcs3/rpcs3qt/logframe.h new file mode 100644 index 0000000000..fc40814727 --- /dev/null +++ b/rpcs3/rpcs3qt/logframe.h @@ -0,0 +1,25 @@ +#ifndef LOGFRAME_H +#define LOGFRAME_H + +#include +#include +#include +#include + +class LogFrame : public QDockWidget +{ + Q_OBJECT + +public: + explicit LogFrame(QWidget *parent = 0); + +private slots: + void Update(); + +private: + QTabWidget *tabWidget; + QTextEdit *log; + QTextEdit *tty; +}; + +#endif // LOGFRAME_H diff --git a/rpcs3/rpcs3qt/main.cpp b/rpcs3/rpcs3qt/main.cpp index 570f92a3f1..831afd2265 100644 --- a/rpcs3/rpcs3qt/main.cpp +++ b/rpcs3/rpcs3qt/main.cpp @@ -1,18 +1,19 @@ // Qt5.2+ frontend implementation for rpcs3. Known to work on Windows, Linux, Mac // by Sacha Refshauge #ifdef QT_UI -#include -#include -#include "glviewer.h" +#include + +#include "mainwindow.h" int main(int argc, char *argv[]) { - QGuiApplication app(argc, argv); + QApplication app(argc, argv); - qmlRegisterType("GLViewer", 1, 0, "GLViewer"); - QQmlApplicationEngine engine(QUrl("qrc:/qml/main.qml")); + MainWindow mainWin; + mainWin.show(); return app.exec(); } -#endif + +#endif // QT_UI diff --git a/rpcs3/rpcs3qt/mainwindow.cpp b/rpcs3/rpcs3qt/mainwindow.cpp new file mode 100644 index 0000000000..b55c299faf --- /dev/null +++ b/rpcs3/rpcs3qt/mainwindow.cpp @@ -0,0 +1,362 @@ +#ifdef QT_UI + +#include +#include +#include +#include +#include +#include +#include + +#include "gamelistframe.h" +#include "debuggerframe.h" +#include "logframe.h" +#include "settingsdialog.h" +#include "padsettingsdialog.h" +#include "AutoPauseSettingsDialog.h" +#include "mainwindow.h" + +MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) +{ + CreateActions(); + CreateMenus(); + CreateDockWindows(); + + setGeometry(0, 0, 900, 600); + setWindowTitle("RPCS3 v"); +} + +MainWindow::~MainWindow() +{ +} + +void MainWindow::BootElf() +{ + bool stopped = false; + + QFileDialog dlg(this, "Select (S)ELF", "", "(S)ELF files (*BOOT.BIN *.elf *.self);;" + "ELF files (BOOT.BIN *.elf);;" + "SELF files (EBOOT.BIN *.self);;" + "BOOT files (*BOOT.BIN);;" + "BIN files (*.bin);;" + "All files (*.*)"); + dlg.setAcceptMode(QFileDialog::AcceptOpen); + dlg.setFileMode(QFileDialog::ExistingFile); + + if (dlg.exec() == QDialog::Rejected) + { + qDebug() << "Rejected!"; + return; + } +} + +void MainWindow::BootGame() +{ + bool stopped = false; + + QFileDialog dlg(this, "Select game folder"); + dlg.setAcceptMode(QFileDialog::AcceptOpen); + dlg.setFileMode(QFileDialog::Directory); + dlg.setOptions(QFileDialog::ShowDirsOnly); + + if (dlg.exec() == QDialog::Rejected) + { + qDebug() << "Rejected!"; + return; + } +} + +void MainWindow::InstallPkg() +{ + QFileDialog dlg(this, "Select PKG", "", "PKG files (*.pkg);;All files (*.*)"); + dlg.setAcceptMode(QFileDialog::AcceptOpen); + dlg.setFileMode(QFileDialog::ExistingFile); + + if (dlg.exec() == QDialog::Rejected) + { + qDebug() << "Rejected!"; + return; + } +} + +void MainWindow::Pause() +{ + qDebug() << "MainWindow::Pause()"; +} + +void MainWindow::Stop() +{ + qDebug() << "MainWindow::Stop()"; +} + +void MainWindow::SendOpenSysMenu() +{ + qDebug() << "MainWindow::SendOpenSysMenu()"; +} + +void MainWindow::SendExit() +{ + qDebug() << "MainWindow::SendExit()"; +} + +void MainWindow::Settings() +{ + SettingsDialog dlg(this); + dlg.exec(); +} + +void MainWindow::PadSettings() +{ + PadSettingsDialog dlg(this); + dlg.exec(); +} + +void MainWindow::AutoPauseSettings() +{ + AutoPauseSettingsDialog dlg(this); + dlg.exec(); +} + +void MainWindow::VFSManager() +{ + qDebug() << "MainWindow::VFSManager()"; +} + +void MainWindow::VHDDManager() +{ + qDebug() << "MainWindow::VHDDManager()"; +} + +void MainWindow::SaveData() +{ + qDebug() << "MainWindow::SaveData()"; +} + +void MainWindow::ELFCompiler() +{ + qDebug() << "MainWindow::ELFCompiler()"; +} + +void MainWindow::CgDisasm() +{ + qDebug() << "MainWindow::CgDisasm()"; +} + +void MainWindow::KernelExplorer() +{ + qDebug() << "MainWindow::KernelExplorer()"; +} + +void MainWindow::MemoryViewer() +{ + qDebug() << "MainWindow::MemoryViewer()"; +} + +void MainWindow::RSXDebugger() +{ + qDebug() << "MainWindow::RSXDebugger()"; +} + +void MainWindow::StringSearch() +{ + qDebug() << "MainWindow::StringSearch()"; +} + +void MainWindow::DecryptSPRXLibraries() +{ + QFileDialog dlg(this, "Select SPRX files", "", "SPRX files (*.sprx)"); + dlg.setAcceptMode(QFileDialog::AcceptOpen); + dlg.setFileMode(QFileDialog::ExistingFiles); + + if (dlg.exec() == QDialog::Rejected) + { + return; + } + + QStringList modules = dlg.selectedFiles(); + + qDebug() << "Decrypting SPRX libraries..."; + + for (QString& module : modules) + { + qDebug() << module; + } + + qDebug() << "Finished decrypting all SPRX libraries."; +} + +void MainWindow::About() +{ + QString translatedTextAboutCaption; + translatedTextAboutCaption = tr( + "

RPCS3

" + "

A PlayStation 3 emulator and debugger.
" + "RPCS3 Version: VER_STUB

"); + QString translatedTextAboutText; + translatedTextAboutText = tr( + "

Developers: DH, AlexAltea, Hykem, Oil, Nekotekina, elisha464, Bigpet, vlj

" + "

Thanks: BlackDaemon, Aishou, krofna, xsacha

" + "

Please see " + "GitHub, " + "Website, " + "Forum or " + "Patreon" + " for more information.

" + ).arg("github.com/RPCS3", + "rpcs3.net", + "www.emunewz.net/forum/forumdisplay.php?fid=172", + "www.patreon.com/Nekotekina"); + + QMessageBox about(this); + about.setStyleSheet("QLabel{min-width: 500px;}"); // ¯\_(ツ)_/¯ + about.setWindowTitle(tr("About RPCS3")); + about.setText(translatedTextAboutCaption); + about.setInformativeText(translatedTextAboutText); + + about.exec(); +} + +void MainWindow::CreateActions() +{ + bootElfAct = new QAction(tr("Boot (S)ELF file"), this); + connect(bootElfAct, &QAction::triggered, this, &MainWindow::BootElf); + + bootGameAct = new QAction(tr("Boot &game"), this); + connect(bootGameAct, &QAction::triggered, this, &MainWindow::BootGame); + + bootInstallAct = new QAction(tr("&Install PKG"), this); + connect(bootInstallAct, &QAction::triggered, this, &MainWindow::InstallPkg); + + exitAct = new QAction(tr("E&xit"), this); + exitAct->setShortcuts(QKeySequence::Quit); + exitAct->setStatusTip(tr("Exit the application")); + connect(exitAct, &QAction::triggered, this, &QWidget::close); + + sysPauseAct = new QAction(tr("&Pause"), this); + sysPauseAct->setEnabled(false); + connect(sysPauseAct, &QAction::triggered, this, &MainWindow::Pause); + + sysStopAct = new QAction(tr("&Stop"), this); + sysStopAct->setShortcut(tr("Ctrl+S")); + sysStopAct->setEnabled(false); + connect(sysStopAct, &QAction::triggered, this, &MainWindow::Stop); + + sysSendOpenMenuAct = new QAction(tr("Send &open system menu cmd"), this); + sysSendOpenMenuAct->setEnabled(false); + connect(sysSendOpenMenuAct, &QAction::triggered, this, &MainWindow::SendOpenSysMenu); + + sysSendExitAct = new QAction(tr("Send &exit cmd"), this); + sysSendExitAct->setEnabled(false); + connect(sysSendExitAct, &QAction::triggered, this, &MainWindow::SendExit); + + confSettingsAct = new QAction(tr("&Settings"), this); + connect(confSettingsAct, &QAction::triggered, this, &MainWindow::Settings); + + confPadAct = new QAction(tr("&PAD Settings"), this); + connect(confPadAct, &QAction::triggered, this, &MainWindow::PadSettings); + + confAutopauseManagerAct = new QAction(tr("&Auto Pause Settings"), this); + connect(confAutopauseManagerAct, &QAction::triggered, this, &MainWindow::AutoPauseSettings); + + confVfsManagerAct = new QAction(tr("Virtual &File System Manager"), this); + confVfsManagerAct->setEnabled(false); + connect(confVfsManagerAct, &QAction::triggered, this, &MainWindow::VFSManager); + + confVhddManagerAct = new QAction(tr("Virtual &HDD Manager"), this); + confVhddManagerAct->setEnabled(false); + connect(confVhddManagerAct, &QAction::triggered, this, &MainWindow::VHDDManager); + + confSavedataManagerAct = new QAction(tr("Save &Data Utility"), this); + confSavedataManagerAct->setEnabled(false); + connect(confSavedataManagerAct, &QAction::triggered, this, &MainWindow::SaveData); + + toolsCompilerAct = new QAction(tr("&ELF Compiler"), this); + toolsCompilerAct->setEnabled(false); + connect(toolsCompilerAct, &QAction::triggered, this, &MainWindow::ELFCompiler); + + toolsCgDisasmAct = new QAction(tr("&Cg Disasm"), this); + toolsCgDisasmAct->setEnabled(false); + connect(toolsCgDisasmAct, &QAction::triggered, this, &MainWindow::CgDisasm); + + toolsKernelExplorerAct = new QAction(tr("&Kernel Explorer"), this); + toolsKernelExplorerAct->setEnabled(false); + connect(toolsKernelExplorerAct, &QAction::triggered, this, &MainWindow::KernelExplorer); + + toolsMemoryViewerAct = new QAction(tr("&Memory Viewer"), this); + toolsMemoryViewerAct->setEnabled(false); + connect(toolsMemoryViewerAct, &QAction::triggered, this, &MainWindow::MemoryViewer); + + toolsRsxDebuggerAct = new QAction(tr("&RSX Debugger"), this); + toolsRsxDebuggerAct->setEnabled(false); + connect(toolsRsxDebuggerAct, &QAction::triggered, this, &MainWindow::RSXDebugger); + + toolsStringSearchAct = new QAction(tr("&String Search"), this); + toolsStringSearchAct->setEnabled(false); + connect(toolsStringSearchAct, &QAction::triggered, this, &MainWindow::StringSearch); + + toolsSecryptSprxLibsAct = new QAction(tr("&Decrypt SPRX libraries"), this); + connect(toolsSecryptSprxLibsAct, &QAction::triggered, this, &MainWindow::DecryptSPRXLibraries); + + aboutAct = new QAction(tr("&About"), this); + aboutAct->setStatusTip(tr("Show the application's About box")); + connect(aboutAct, &QAction::triggered, this, &MainWindow::About); + + aboutQtAct = new QAction(tr("About &Qt"), this); + aboutQtAct->setStatusTip(tr("Show the Qt library's About box")); + connect(aboutQtAct, &QAction::triggered, qApp, &QApplication::aboutQt); +} + +void MainWindow::CreateMenus() +{ + QMenu *bootMenu = menuBar()->addMenu(tr("&Boot")); + bootMenu->addAction(bootElfAct); + bootMenu->addAction(bootGameAct); + bootMenu->addSeparator(); + bootMenu->addAction(bootInstallAct); + bootMenu->addSeparator(); + bootMenu->addAction(exitAct); + + QMenu *sysMenu = menuBar()->addMenu(tr("&System")); + sysMenu->addAction(sysPauseAct); + sysMenu->addAction(sysStopAct); + sysMenu->addSeparator(); + sysMenu->addAction(sysSendOpenMenuAct); + sysMenu->addAction(sysSendExitAct); + + QMenu *confMenu = menuBar()->addMenu(tr("&Config")); + confMenu->addAction(confSettingsAct); + confMenu->addAction(confPadAct); + confMenu->addSeparator(); + confMenu->addAction(confAutopauseManagerAct); + confMenu->addSeparator(); + confMenu->addAction(confVfsManagerAct); + confMenu->addAction(confVhddManagerAct); + confMenu->addAction(confSavedataManagerAct); + + QMenu *toolsMenu = menuBar()->addMenu(tr("&Tools")); + toolsMenu->addAction(toolsCompilerAct); + toolsMenu->addAction(toolsCgDisasmAct); + toolsMenu->addAction(toolsKernelExplorerAct); + toolsMenu->addAction(toolsMemoryViewerAct); + toolsMenu->addAction(toolsRsxDebuggerAct); + toolsMenu->addAction(toolsStringSearchAct); + toolsMenu->addSeparator(); + toolsMenu->addAction(toolsSecryptSprxLibsAct); + + QMenu *helpMenu = menuBar()->addMenu(tr("&Help")); + helpMenu->addAction(aboutAct); + helpMenu->addAction(aboutQtAct); +} + +void MainWindow::CreateDockWindows() +{ + GameListFrame *gameList = new GameListFrame(this); + DebuggerFrame *debugger = new DebuggerFrame(this); + LogFrame *log = new LogFrame(this); + + addDockWidget(Qt::LeftDockWidgetArea, gameList); + addDockWidget(Qt::LeftDockWidgetArea, log); + addDockWidget(Qt::RightDockWidgetArea, debugger); +} + +#endif // QT_UI diff --git a/rpcs3/rpcs3qt/mainwindow.h b/rpcs3/rpcs3qt/mainwindow.h new file mode 100644 index 0000000000..4a50716c13 --- /dev/null +++ b/rpcs3/rpcs3qt/mainwindow.h @@ -0,0 +1,69 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + explicit MainWindow(QWidget *parent = 0); + ~MainWindow(); + +signals: + +private slots: + void BootElf(); + void BootGame(); + void InstallPkg(); + void Pause(); + void Stop(); + void SendOpenSysMenu(); + void SendExit(); + void Settings(); + void PadSettings(); + void AutoPauseSettings(); + void VFSManager(); + void VHDDManager(); + void SaveData(); + void ELFCompiler(); + void CgDisasm(); + void KernelExplorer(); + void MemoryViewer(); + void RSXDebugger(); + void StringSearch(); + void DecryptSPRXLibraries(); + void About(); + +private: + void CreateActions(); + void CreateMenus(); + void CreateDockWindows(); + + QAction *bootElfAct; + QAction *bootGameAct; + QAction *bootInstallAct; + QAction *sysPauseAct; + QAction *sysStopAct; + QAction *sysSendOpenMenuAct; + QAction *sysSendExitAct; + QAction *confSettingsAct; + QAction *confPadAct; + QAction *confAutopauseManagerAct; + QAction *confVfsManagerAct; + QAction *confVhddManagerAct; + QAction *confSavedataManagerAct; + QAction *toolsCompilerAct; + QAction *toolsCgDisasmAct; + QAction *toolsKernelExplorerAct; + QAction *toolsMemoryViewerAct; + QAction *toolsRsxDebuggerAct; + QAction *toolsStringSearchAct; + QAction *toolsSecryptSprxLibsAct; + QAction *exitAct; + QAction *aboutAct; + QAction *aboutQtAct; +}; + +#endif // MAINWINDOW_H diff --git a/rpcs3/rpcs3qt/misctab.cpp b/rpcs3/rpcs3qt/misctab.cpp new file mode 100644 index 0000000000..74d609c485 --- /dev/null +++ b/rpcs3/rpcs3qt/misctab.cpp @@ -0,0 +1,32 @@ +#ifdef QT_UI + +#include +#include +#include +#include + +#include "misctab.h" + +MiscTab::MiscTab(QWidget *parent) : QWidget(parent) +{ + // Checkboxes + QCheckBox *exitOnStop = new QCheckBox(tr("Exit RPCS3 when process finishes")); + QCheckBox *alwaysStart = new QCheckBox(tr("Always start after boot")); + QCheckBox *apSystemcall = new QCheckBox(tr("Auto Pause at System Call")); + QCheckBox *apFunctioncall = new QCheckBox(tr("Auto Pause at Function Call")); + + // Main layout + QVBoxLayout *vbox = new QVBoxLayout; + vbox->addWidget(exitOnStop); + vbox->addWidget(alwaysStart); + vbox->addWidget(apSystemcall); + vbox->addWidget(apFunctioncall); + vbox->addStretch(1); + + QHBoxLayout *hbox = new QHBoxLayout; + hbox->addLayout(vbox); + hbox->addStretch(1); + setLayout(hbox); +} + +#endif // QT_UI diff --git a/rpcs3/rpcs3qt/misctab.h b/rpcs3/rpcs3qt/misctab.h new file mode 100644 index 0000000000..a7f715f7ab --- /dev/null +++ b/rpcs3/rpcs3qt/misctab.h @@ -0,0 +1,18 @@ +#ifndef MISCTAB_H +#define MISCTAB_H + +#include + +class MiscTab : public QWidget +{ + Q_OBJECT + +public: + explicit MiscTab(QWidget *parent = 0); + +signals: + +public slots: +}; + +#endif // MISCTAB_H diff --git a/rpcs3/rpcs3qt/networkingtab.cpp b/rpcs3/rpcs3qt/networkingtab.cpp new file mode 100644 index 0000000000..702b1219e5 --- /dev/null +++ b/rpcs3/rpcs3qt/networkingtab.cpp @@ -0,0 +1,36 @@ +#ifdef QT_UI + +#include +#include +#include +#include + +#include "networkingtab.h" + +NetworkingTab::NetworkingTab(QWidget *parent) : QWidget(parent) +{ + // Connection status + QGroupBox *netStatus = new QGroupBox(tr("Connection status")); + + QComboBox *netStatusBox = new QComboBox; + netStatusBox->addItem(tr("Disconnected")); + netStatusBox->addItem(tr("Connecting")); + netStatusBox->addItem(tr("Obtaining IP")); + netStatusBox->addItem(tr("IP obtained")); + + QVBoxLayout *netStatusVbox = new QVBoxLayout; + netStatusVbox->addWidget(netStatusBox); + netStatus->setLayout(netStatusVbox); + + // Main layout + QVBoxLayout *vbox = new QVBoxLayout; + vbox->addWidget(netStatus); + vbox->addStretch(); + + QHBoxLayout *hbox = new QHBoxLayout; + hbox->addLayout(vbox); + hbox->addStretch(); + setLayout(hbox); +} + +#endif // QT_UI diff --git a/rpcs3/rpcs3qt/networkingtab.h b/rpcs3/rpcs3qt/networkingtab.h new file mode 100644 index 0000000000..1c4e6f10fa --- /dev/null +++ b/rpcs3/rpcs3qt/networkingtab.h @@ -0,0 +1,18 @@ +#ifndef NETWORKINGTAB_H +#define NETWORKINGTAB_H + +#include + +class NetworkingTab : public QWidget +{ + Q_OBJECT + +public: + explicit NetworkingTab(QWidget *parent = 0); + +signals: + +public slots: +}; + +#endif // NETWORKINGTAB_H diff --git a/rpcs3/rpcs3qt/padsettingsdialog.cpp b/rpcs3/rpcs3qt/padsettingsdialog.cpp new file mode 100644 index 0000000000..b78f382048 --- /dev/null +++ b/rpcs3/rpcs3qt/padsettingsdialog.cpp @@ -0,0 +1,107 @@ +#ifdef QT_UI + +#include +#include +#include +#include +#include + +#include "padsettingsdialog.h" + +PadSettingsDialog::PadSettingsDialog(QWidget *parent) : QDialog(parent) +{ + // Left Analog Stick + QGroupBox *roundStickL = new QGroupBox(tr("Left Analog Stick")); + + // D-Pad + QGroupBox *roundPadControls = new QGroupBox(tr("D-Pad")); + + // Left Shifts + QGroupBox *roundPadShiftsL = new QGroupBox(tr("Left Shifts")); + QGroupBox *roundPadL1 = new QGroupBox(tr("L1")); + QGroupBox *roundPadL2 = new QGroupBox(tr("L2")); + QGroupBox *roundPadL3 = new QGroupBox(tr("L3")); + + QVBoxLayout *roundPadShiftsLVbox = new QVBoxLayout; + roundPadShiftsLVbox->addWidget(roundPadL1); + roundPadShiftsLVbox->addWidget(roundPadL2); + roundPadShiftsLVbox->addWidget(roundPadL3); + roundPadShiftsL->setLayout(roundPadShiftsLVbox); + + // Start / Select + QGroupBox *roundPadSystem = new QGroupBox(tr("System")); + QGroupBox *roundPadSelect = new QGroupBox(tr("Select")); + QGroupBox *roundPadStart = new QGroupBox(tr("Start")); + + QVBoxLayout *roundPadSystemVbox = new QVBoxLayout; + roundPadSystemVbox->addWidget(roundPadSelect); + roundPadSystemVbox->addWidget(roundPadStart); + roundPadSystem->setLayout(roundPadSystemVbox); + + // Right Shifts + QGroupBox *roundPadShiftsR = new QGroupBox(tr("Right Shifts")); + QGroupBox *roundPadR1 = new QGroupBox(tr("R1")); + QGroupBox *roundPadR2 = new QGroupBox(tr("R2")); + QGroupBox *roundPadR3 = new QGroupBox(tr("R3")); + + QVBoxLayout *roundPadShiftsRVbox = new QVBoxLayout; + roundPadShiftsRVbox->addWidget(roundPadR1); + roundPadShiftsRVbox->addWidget(roundPadR2); + roundPadShiftsRVbox->addWidget(roundPadR3); + roundPadShiftsR->setLayout(roundPadShiftsRVbox); + + // Action buttons + QGroupBox *roundPadButtons = new QGroupBox(tr("Buttons")); + QGroupBox *roundPadSquare = new QGroupBox(tr("Square")); + QGroupBox *roundPadCross = new QGroupBox(tr("Cross")); + QGroupBox *roundPadCircle = new QGroupBox(tr("Circle")); + QGroupBox *roundPadTriangle = new QGroupBox(tr("Triangle")); + + QHBoxLayout *roundPadButtonsHbox = new QHBoxLayout; + roundPadButtonsHbox->addWidget(roundPadSquare); + roundPadButtonsHbox->addWidget(roundPadCircle); + + QVBoxLayout *roundPadButtonsVbox = new QVBoxLayout; + roundPadButtonsVbox->addWidget(roundPadTriangle); + roundPadButtonsVbox->addLayout(roundPadButtonsHbox); + roundPadButtonsVbox->addWidget(roundPadCross); + roundPadButtons->setLayout(roundPadButtonsVbox); + + // Right Analog Stick + QGroupBox *roundStickR = new QGroupBox(tr("Right Analog Stick")); + + // Buttons + QPushButton *defaultButton = new QPushButton(tr("By default")); + + QPushButton *okButton = new QPushButton(tr("OK")); + connect(okButton, &QAbstractButton::clicked, this, &QDialog::accept); + + QPushButton *cancelButton = new QPushButton(tr("Cancel")); + cancelButton->setDefault(true); + connect(cancelButton, &QAbstractButton::clicked, this, &QWidget::close); + + // Main layout + QHBoxLayout *hbox1 = new QHBoxLayout; + hbox1->addWidget(roundStickL); + hbox1->addWidget(roundPadControls); + hbox1->addWidget(roundPadShiftsL); + hbox1->addWidget(roundPadSystem); + hbox1->addWidget(roundPadShiftsR); + hbox1->addWidget(roundPadButtons); + hbox1->addWidget(roundStickR); + + QHBoxLayout *hbox2 = new QHBoxLayout; + hbox2->addWidget(defaultButton); + hbox2->addStretch(); + hbox2->addWidget(okButton); + hbox2->addWidget(cancelButton); + + QVBoxLayout *vbox = new QVBoxLayout; + vbox->addLayout(hbox1); + vbox->addLayout(hbox2); + setLayout(vbox); + + setWindowTitle(tr("PAD Settings")); +} + +#endif // QT_UI diff --git a/rpcs3/rpcs3qt/padsettingsdialog.h b/rpcs3/rpcs3qt/padsettingsdialog.h new file mode 100644 index 0000000000..9aed1f5216 --- /dev/null +++ b/rpcs3/rpcs3qt/padsettingsdialog.h @@ -0,0 +1,14 @@ +#ifndef PADSETTINGS_H +#define PADSETTINGS_H + +#include + +class PadSettingsDialog : public QDialog +{ + Q_OBJECT + +public: + explicit PadSettingsDialog(QWidget *parent = 0); +}; + +#endif // PADSETTINGS_H diff --git a/rpcs3/rpcs3qt/rpcs3qt.pro b/rpcs3/rpcs3qt/rpcs3qt.pro index 733ca4c25a..b3e81ce4fb 100644 --- a/rpcs3/rpcs3qt/rpcs3qt.pro +++ b/rpcs3/rpcs3qt/rpcs3qt.pro @@ -1,5 +1,5 @@ # Qt5.2+ project for rpcs3. Works on Windows, Linux and Mac OSX -QT += gui opengl quick +QT += gui opengl quick widgets CONFIG += c++11 TARGET = rpcs3-qt @@ -16,9 +16,5 @@ DEFINES += QT_UI # Installation path # target.path = -OTHER_FILES += $$P/rpcs3qt/qml/* - -RESOURCES += $$P/rpcs3qt/qml.qrc - # This line is needed for Qt 5.5 or higher win32:LIBS += opengl32.lib diff --git a/rpcs3/rpcs3qt/settingsdialog.cpp b/rpcs3/rpcs3qt/settingsdialog.cpp new file mode 100644 index 0000000000..545e899caf --- /dev/null +++ b/rpcs3/rpcs3qt/settingsdialog.cpp @@ -0,0 +1,49 @@ +#ifdef QT_UI + +#include +#include +#include + +#include "coretab.h" +#include "graphicstab.h" +#include "audiotab.h" +#include "inputtab.h" +#include "misctab.h" +#include "networkingtab.h" +#include "systemtab.h" +#include "settingsdialog.h" + +SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent) +{ + tabWidget = new QTabWidget; + tabWidget->addTab(new CoreTab(this), tr("Core")); + tabWidget->addTab(new GraphicsTab(this), tr("Graphics")); + tabWidget->addTab(new AudioTab(this), tr("Audio")); + tabWidget->addTab(new InputTab(this), tr("Input / Output")); + tabWidget->addTab(new MiscTab(this), tr("Misc")); + tabWidget->addTab(new NetworkingTab(this), tr("Networking")); + tabWidget->addTab(new SystemTab(this), tr("System")); + + QPushButton *okButton = new QPushButton(tr("OK")); + connect(okButton, &QAbstractButton::clicked, this, &QDialog::accept); + + QPushButton *cancelButton = new QPushButton(tr("Cancel")); + cancelButton->setDefault(true); + connect(cancelButton, &QAbstractButton::clicked, this, &QWidget::close); + + QHBoxLayout *buttonsLayout = new QHBoxLayout; + buttonsLayout->addStretch(); + buttonsLayout->addWidget(okButton); + buttonsLayout->addWidget(cancelButton); + + QVBoxLayout *mainLayout = new QVBoxLayout; + mainLayout->addWidget(tabWidget); + mainLayout->addLayout(buttonsLayout); + setLayout(mainLayout); + + cancelButton->setFocus(); + + setWindowTitle(tr("Settings")); +} + +#endif // QT_UI diff --git a/rpcs3/rpcs3qt/settingsdialog.h b/rpcs3/rpcs3qt/settingsdialog.h new file mode 100644 index 0000000000..d60ab9cc93 --- /dev/null +++ b/rpcs3/rpcs3qt/settingsdialog.h @@ -0,0 +1,18 @@ +#ifndef SETTINGSDIALOG_H +#define SETTINGSDIALOG_H + +#include +#include + +class SettingsDialog : public QDialog +{ + Q_OBJECT + +public: + explicit SettingsDialog(QWidget *parent = 0); + +private: + QTabWidget *tabWidget; +}; + +#endif // SETTINGSDIALOG_H diff --git a/rpcs3/rpcs3qt/systemtab.cpp b/rpcs3/rpcs3qt/systemtab.cpp new file mode 100644 index 0000000000..d5ca455b4d --- /dev/null +++ b/rpcs3/rpcs3qt/systemtab.cpp @@ -0,0 +1,55 @@ +#ifdef QT_UI + +#include +#include +#include +#include +#include + +#include "systemtab.h" + +SystemTab::SystemTab(QWidget *parent) : QWidget(parent) +{ + // Language + QGroupBox *sysLang = new QGroupBox(tr("Language")); + + QComboBox *sysLangBox = new QComboBox; + sysLangBox->addItem(tr("Japanese")); + sysLangBox->addItem(tr("English (US)")); + sysLangBox->addItem(tr("French")); + sysLangBox->addItem(tr("Spanish")); + sysLangBox->addItem(tr("German")); + sysLangBox->addItem(tr("Italian")); + sysLangBox->addItem(tr("Dutch")); + sysLangBox->addItem(tr("Portuguese (PT)")); + sysLangBox->addItem(tr("Russian")); + sysLangBox->addItem(tr("Korean")); + sysLangBox->addItem(tr("Chinese (Trad.)")); + sysLangBox->addItem(tr("Chinese (Simp.)")); + sysLangBox->addItem(tr("Finnish")); + sysLangBox->addItem(tr("Swedish")); + sysLangBox->addItem(tr("Danish")); + sysLangBox->addItem(tr("Norwegian")); + sysLangBox->addItem(tr("Polish")); + sysLangBox->addItem(tr("English (UK)")); + + QVBoxLayout *sysLangVbox = new QVBoxLayout; + sysLangVbox->addWidget(sysLangBox); + sysLang->setLayout(sysLangVbox); + + // Checkboxes + QCheckBox *enableHostRoot = new QCheckBox(tr("Enable /host_root/")); + + // Main layout + QVBoxLayout *vbox = new QVBoxLayout; + vbox->addWidget(enableHostRoot); + vbox->addWidget(sysLang); + vbox->addStretch(); + + QHBoxLayout *hbox = new QHBoxLayout; + hbox->addLayout(vbox); + hbox->addStretch(); + setLayout(hbox); +} + +#endif // QT_UI diff --git a/rpcs3/rpcs3qt/systemtab.h b/rpcs3/rpcs3qt/systemtab.h new file mode 100644 index 0000000000..3c6c5b4466 --- /dev/null +++ b/rpcs3/rpcs3qt/systemtab.h @@ -0,0 +1,18 @@ +#ifndef SYSTEMTAB_H +#define SYSTEMTAB_H + +#include + +class SystemTab : public QWidget +{ + Q_OBJECT + +public: + explicit SystemTab(QWidget *parent = 0); + +signals: + +public slots: +}; + +#endif // SYSTEMTAB_H