From 1ebb4df70ebec3a397efbad311f7a43cdf9d6902 Mon Sep 17 00:00:00 2001 From: Rosalie Wanders Date: Sun, 4 Oct 2020 15:44:22 +0200 Subject: [PATCH] work --- Source/3rdParty/CMakeLists.txt | 6 ++- Source/RMG/CMakeLists.txt | 1 + .../UserInterface/Dialog/SettingsDialog.cpp | 38 +++++++++++++++++++ .../UserInterface/Dialog/SettingsDialog.hpp | 32 ++++++++++++++++ Source/RMG/UserInterface/MainWindow.cpp | 4 ++ Source/RMG/UserInterface/MainWindow.hpp | 7 +++- Source/Script/Build.sh | 4 +- 7 files changed, 87 insertions(+), 5 deletions(-) create mode 100644 Source/RMG/UserInterface/Dialog/SettingsDialog.cpp create mode 100644 Source/RMG/UserInterface/Dialog/SettingsDialog.hpp diff --git a/Source/3rdParty/CMakeLists.txt b/Source/3rdParty/CMakeLists.txt index bda28e9e..af143ade 100644 --- a/Source/3rdParty/CMakeLists.txt +++ b/Source/3rdParty/CMakeLists.txt @@ -94,7 +94,11 @@ if (MSYS) else() set(GLIDEN64_LIB "${GLIDEN64_BUILD_DIR}/plugin/${CMAKE_BUILD_TYPE}/mupen64plus-video-GLideN64.${SO_EXT}") endif() -file(GLOB GLIDENUI_TRANSLATIONS "${GLIDEN64_DIR}/translations/release/*.qm") + +set(GLIDENUI_TRANSLATIONS_LANGS "de;es;fr;it;ja;pl;pt_BR") +foreach(LANG ${GLIDENUI_TRANSLATIONS_LANGS}) + list(APPEND GLIDENUI_TRANSLATIONS "${GLIDEN64_DIR}/translations/release/gliden64_${LANG}.qm") +endforeach() ExternalProject_Add(mupen64plus-video-GLideN64 SOURCE_DIR mupen64plus-video-GLideN64 diff --git a/Source/RMG/CMakeLists.txt b/Source/RMG/CMakeLists.txt index 4c097aaa..0af8dac3 100644 --- a/Source/RMG/CMakeLists.txt +++ b/Source/RMG/CMakeLists.txt @@ -15,6 +15,7 @@ set(RMG_SOURCES UserInterface/MainWindow.cpp UserInterface/Widget/RomBrowserWidget.cpp UserInterface/Widget/OGLWidget.cpp + UserInterface/Dialog/SettingsDialog.cpp UserInterface/NoFocusDelegate.cpp UserInterface/UIResources.rc UserInterface/UIResources.qrc diff --git a/Source/RMG/UserInterface/Dialog/SettingsDialog.cpp b/Source/RMG/UserInterface/Dialog/SettingsDialog.cpp new file mode 100644 index 00000000..29456030 --- /dev/null +++ b/Source/RMG/UserInterface/Dialog/SettingsDialog.cpp @@ -0,0 +1,38 @@ +#include "SettingsDialog.hpp" + +using namespace UserInterface::Dialog; + +SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint) +{ + this->ui_Init(); + this->ui_Setup(); +} + +void SettingsDialog::ui_Init(void) +{ + this->ui_Layout = new QHBoxLayout(this); + this->ui_TreeWidget = new QTreeWidget(this); +} + +void SettingsDialog::ui_Setup(void) +{ + this->setWindowTitle("Settings"); + + QStringList list; + list.append("Core"); + list.append("Plugins"); + list.append("ROM Selection"); + + QList list2; + + for (int i = 0; i < list.size(); i++) + list2.append(new QTreeWidgetItem(QStringList() << list.at(i))); + + this->ui_TreeWidget->addTopLevelItems(list2); + this->ui_TreeWidget->setHeaderLabel("Settings"); + list2.at(0)->setSelected(true); + + this->ui_Layout->addWidget(this->ui_TreeWidget); + + this->setLayout(this->ui_Layout); +} diff --git a/Source/RMG/UserInterface/Dialog/SettingsDialog.hpp b/Source/RMG/UserInterface/Dialog/SettingsDialog.hpp new file mode 100644 index 00000000..78fbbe3c --- /dev/null +++ b/Source/RMG/UserInterface/Dialog/SettingsDialog.hpp @@ -0,0 +1,32 @@ +#ifndef SETTINGSDIALOG_HPP +#define SETTINGSDIALOG_HPP + +#include +#include +#include +#include +#include + +namespace UserInterface +{ + namespace Dialog + { + class SettingsDialog : public QDialog + { + public: + SettingsDialog(QWidget *parent); + + private: + QHBoxLayout* ui_Layout; + QTreeWidget* ui_TreeWidget; + + void ui_Init(void); + void ui_Setup(void); + + void model_Init(void); + void model_Setup(void); + }; + } // namespace Dialog +} // namespace UserInterface + +#endif // SETTINGSDIALOG_HPP \ No newline at end of file diff --git a/Source/RMG/UserInterface/MainWindow.cpp b/Source/RMG/UserInterface/MainWindow.cpp index 24a657df..f04609b9 100644 --- a/Source/RMG/UserInterface/MainWindow.cpp +++ b/Source/RMG/UserInterface/MainWindow.cpp @@ -90,6 +90,8 @@ void MainWindow::ui_Init(void) { this->ui_Icon = QIcon(":Icons/RMG.png"); + this->ui_SettingsDialog = new Dialog::SettingsDialog(this); + this->ui_Widgets = new QStackedWidget(); this->ui_Widget_RomBrowser = new Widget::RomBrowserWidget(); this->ui_Widget_OpenGL = new Widget::OGLWidget(); @@ -663,6 +665,8 @@ void MainWindow::on_Action_Options_ConfigControl(void) void MainWindow::on_Action_Options_Settings(void) { + this->ui_SettingsDialog->show(); + this->ui_SettingsDialog->exec(); } void MainWindow::on_Action_Help_Support(void) diff --git a/Source/RMG/UserInterface/MainWindow.hpp b/Source/RMG/UserInterface/MainWindow.hpp index 6a2cd347..cb64eb9b 100644 --- a/Source/RMG/UserInterface/MainWindow.hpp +++ b/Source/RMG/UserInterface/MainWindow.hpp @@ -10,9 +10,10 @@ #ifndef MAINWINDOW_HPP #define MAINWINDOW_HPP -#include "../Thread/EmulationThread.hpp" +#include "Dialog/SettingsDialog.hpp" #include "Widget/RomBrowserWidget.hpp" #include "Widget/OGLWidget.hpp" +#include "../Thread/EmulationThread.hpp" #include "../Globals.hpp" #include @@ -39,6 +40,8 @@ namespace UserInterface Thread::EmulationThread *emulationThread; + Dialog::SettingsDialog *ui_SettingsDialog; + QStackedWidget *ui_Widgets; Widget::OGLWidget *ui_Widget_OpenGL; Widget::RomBrowserWidget *ui_Widget_RomBrowser; @@ -141,7 +144,7 @@ namespace UserInterface void on_RomBrowser_Selected(QString); void on_VidExt_Init(void); - void on_VidExt_SetupOGL(QSurfaceFormat, QThread*); + void on_VidExt_SetupOGL(QSurfaceFormat, QThread *); void on_VidExt_SetMode(int, int, int, int, int); void on_VidExt_SetModeWithRate(int, int, int, int, int, int); void on_VidExt_ResizeWindow(int, int); diff --git a/Source/Script/Build.sh b/Source/Script/Build.sh index c1090c9b..b67af928 100755 --- a/Source/Script/Build.sh +++ b/Source/Script/Build.sh @@ -6,9 +6,9 @@ toplvl_dir="$(realpath "$script_dir/../../")" build_config="${1:-Debug}" build_dir="$toplvl_dir/Build/$build_config" install_dir="$toplvl_dir/Bin/$build_config" -generator="${2:-Unix Makefiles}" -threads="${3:-$(nproc)}" +threads="${2:-$(nproc)}" +generator="Unix Makefiles" msys2="0" mkdir -p "$build_dir"