Compare commits
53 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c6625e137d | |||
| 0ad7e1d715 | |||
| 1f8d5be9a7 | |||
| 21673affbb | |||
| a0a1255ef3 | |||
| 206a5ec7f6 | |||
| 8661273568 | |||
| 6aed340831 | |||
| f7bfb6aea1 | |||
| c5ae117cf8 | |||
| a1c9dc3f12 | |||
| 0f3e70706d | |||
| 722ca67b87 | |||
| 981897df8c | |||
| 3a066dfc03 | |||
| 870481e34e | |||
| 9f5f2334d7 | |||
| 330a66c81c | |||
| 92b4d4dc32 | |||
| 531fab51be | |||
| 3f027fad63 | |||
| 6eb46dd63c | |||
| 70830ae016 | |||
| 8a88a736ad | |||
| d580d2be9a | |||
| 0e3fc0e981 | |||
| 4907b2dd32 | |||
| 3ad2a5760e | |||
| e474a09642 | |||
| f5296c9f79 | |||
| f8e1ed3920 | |||
| 9aeca88946 | |||
| 3961c066be | |||
| 4aeb3da6eb | |||
| bf9e370ddd | |||
| 7c72fa98fd | |||
| 0824586db9 | |||
| 8a22c6d929 | |||
| 8f76619d7d | |||
| d94d9fc5d7 | |||
| 38312f8add | |||
| d52b1e1b5a | |||
| 06c9d9b826 | |||
| 20a669dbbb | |||
| 68c8c431a2 | |||
| d6b1fdfa7b | |||
| 6ac9208c7f | |||
| fdcfaf3fad | |||
| dd08dfafc8 | |||
| 22a019abb1 | |||
| e112ae75eb | |||
| 0de1073094 | |||
| 18a1a6afe6 |
@@ -9,11 +9,14 @@ jobs:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: hendrikmuhs/ccache-action@v1.2.5
|
||||
with:
|
||||
key: Linux
|
||||
- name: Install Packages
|
||||
run: |
|
||||
sudo apt-get -qq update
|
||||
sudo apt-get upgrade
|
||||
sudo apt-get -y install cmake libhidapi-dev libsamplerate0-dev libspeex-dev libminizip-dev libsdl2-dev libfreetype6-dev libgl1-mesa-dev libglu1-mesa-dev pkg-config zlib1g-dev binutils-dev libspeexdsp-dev qtbase5-dev libqt5svg5-dev build-essential nasm git zip
|
||||
sudo apt-get -y install cmake libhidapi-dev libsamplerate0-dev libspeex-dev libminizip-dev libsdl2-dev libfreetype6-dev libgl1-mesa-dev libglu1-mesa-dev pkg-config zlib1g-dev binutils-dev libspeexdsp-dev qt6-base-dev libqt6svg6-dev build-essential nasm git zip
|
||||
- name: Prepare Environment
|
||||
run: |
|
||||
echo "GIT_REVISION=$(git describe --tags --always)" >> $GITHUB_ENV
|
||||
@@ -32,6 +35,9 @@ jobs:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: hendrikmuhs/ccache-action@v1.2.5
|
||||
with:
|
||||
key: Windows
|
||||
- uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
path-type: inherit
|
||||
@@ -45,7 +51,7 @@ jobs:
|
||||
mingw-w64-x86_64-libpng
|
||||
mingw-w64-x86_64-SDL2
|
||||
mingw-w64-x86_64-jasper
|
||||
mingw-w64-x86_64-qt5
|
||||
mingw-w64-x86_64-qt6
|
||||
mingw-w64-x86_64-SDL2
|
||||
mingw-w64-x86_64-hidapi
|
||||
mingw-w64-x86_64-speexdsp
|
||||
@@ -53,6 +59,7 @@ jobs:
|
||||
mingw-w64-x86_64-python3-pip
|
||||
mingw-w64-x86_64-python3-pyopenssl
|
||||
mingw-w64-x86_64-nasm
|
||||
mingw-w64-x86_64-minizip
|
||||
git
|
||||
- name: Prepare Environment
|
||||
run: |
|
||||
@@ -62,6 +69,9 @@ jobs:
|
||||
- name: Build RMG (Portable)
|
||||
run: ./Source/Script/Build.sh Release
|
||||
shell: msys2 {0}
|
||||
- name: Download Styles
|
||||
run: ./Source/Script/DownloadStyles.sh
|
||||
shell: msys2 {0}
|
||||
- name: Create Installer
|
||||
run: .\Build\Release\Source\Installer\CreateInstaller.bat
|
||||
- name: Upload RMG (Portable)
|
||||
|
||||
@@ -7,6 +7,8 @@ option(PORTABLE_INSTALL "Portable Installation" ON)
|
||||
option(NO_GIT_CLONE "Disables git clone usage for 3rdParty dependencies" OFF)
|
||||
option(UPDATER "Enables updater" ${PORTABLE_INSTALL})
|
||||
option(DISCORD_RPC "Enables Discord Rich Presence" ON)
|
||||
option(USE_QT5 "Enables Qt5 instead of Qt6 (will be removed in the future)" OFF)
|
||||
option(USE_CCACHE "Enables usage of ccache when ccache has been found" ON)
|
||||
|
||||
project(RMG)
|
||||
|
||||
@@ -19,6 +21,15 @@ execute_process(
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
if (USE_CCACHE)
|
||||
find_program(CCACHE_FOUND ccache)
|
||||
if (CCACHE_FOUND)
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
||||
else(CCACHE_FOUND)
|
||||
set(USE_CCACHE OFF)
|
||||
endif(CCACHE_FOUND)
|
||||
endif(USE_CCACHE)
|
||||
|
||||
if (NOT PORTABLE_INSTALL AND (WIN32 OR MSYS))
|
||||
message(WARNING "Not-Portable build not supported on windows, re-enabling PORTABLE_INSTALL!")
|
||||
set(PORTABLE_INSTALL ON)
|
||||
@@ -48,6 +59,14 @@ else()
|
||||
set(ICON_INSTALL_PATH "share/icons/hicolor/scalable/apps/")
|
||||
endif()
|
||||
|
||||
if (USE_QT5)
|
||||
set(QT_VERSION "Qt5")
|
||||
set(USE_QT6 OFF)
|
||||
else(USE_QT5)
|
||||
set(QT_VERSION "Qt6")
|
||||
set(USE_QT6 ON)
|
||||
endif(USE_QT5)
|
||||
|
||||
add_subdirectory(Source/3rdParty)
|
||||
|
||||
add_subdirectory(Source/RMG-Core)
|
||||
@@ -75,7 +94,7 @@ endif()
|
||||
install(FILES ${MUPEN64PLUSCORE_LIB}
|
||||
DESTINATION ${CORE_INSTALL_PATH}
|
||||
)
|
||||
install(FILES ${MUPEN64PLUSCORE_INI} Data/font.ttf Data/stylesheet.qss
|
||||
install(FILES ${MUPEN64PLUSCORE_INI} Data/font.ttf
|
||||
DESTINATION ${DATA_INSTALL_PATH}
|
||||
)
|
||||
file(GLOB GENERATED_CHEAT_FILES ${CMAKE_SOURCE_DIR}/Data/Cheats/Generated/*.cht)
|
||||
|
||||
@@ -11,8 +11,8 @@ license=('GPLv3')
|
||||
provides=("$_pkgname")
|
||||
conflicts=("$_pkgname")
|
||||
|
||||
depends=("hidapi" "libsamplerate" "minizip" "sdl2" "zlib" "freetype2" "qt5-base" "qt5-svg")
|
||||
makedepends=("git" "pkg-config" "nasm" "cmake" "rustup")
|
||||
depends=("hidapi" "libsamplerate" "minizip" "sdl2" "zlib" "freetype2" "qt6-base" "qt6-svg")
|
||||
makedepends=("git" "pkg-config" "nasm" "cmake" "cargo")
|
||||
|
||||
source=("git+https://github.com/Rosalie241/${_pkgname}.git")
|
||||
sha256sums=('SKIP')
|
||||
|
||||
|
After Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 206 KiB After Width: | Height: | Size: 368 KiB |
|
After Width: | Height: | Size: 102 KiB |
|
Before Width: | Height: | Size: 119 KiB After Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 47 KiB |
@@ -18,13 +18,40 @@
|
||||
<caption>During A Game</caption>
|
||||
<image type="source">https://github.com/Rosalie241/RMG/raw/master/Package/Screenshots/InGame.png</image>
|
||||
</screenshot>
|
||||
<screenshot type="default">
|
||||
<caption>Cheats</caption>
|
||||
<image type="source">https://github.com/Rosalie241/RMG/raw/master/Package/Screenshots/Cheats.png</image>
|
||||
</screenshot>
|
||||
<screenshot type="default">
|
||||
<caption>Settings</caption>
|
||||
<image type="source">https://github.com/Rosalie241/RMG/raw/master/Package/Screenshots/Settings.png</image>
|
||||
</screenshot>
|
||||
<screenshot type="default">
|
||||
<caption>Input Settings</caption>
|
||||
<image type="source">https://github.com/Rosalie241/RMG/raw/master/Package/Screenshots/InputSettings.png</image>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
<description/>
|
||||
<releases>
|
||||
<release version="v0.2.5" date="2022-12-14" type="stable">
|
||||
<description>
|
||||
<p>Changes:</p>
|
||||
<ul>
|
||||
<li>Fix incorrect controller being selected in RMG-Input when having 2 controllers with the same name</li>
|
||||
<li>Fix some UI elements being enabled while the 'Controller Is Plugged In' checkbox is disabled in RMG-Input</li>
|
||||
<li>Fix extra padding being added when having a controller selected and opening RMG-Input</li>
|
||||
<li>Fix creating a new profile in GLideN64</li>
|
||||
<li>Add Z-Trigger visualization in RMG-Input</li>
|
||||
<li>Remove Debugger checkbox in the settings dialog because it did nothing</li>
|
||||
<li>Remove About buttons in the plugin tab of the settings dialog because it did nothing</li>
|
||||
<li>Implement close button on all dialogs</li>
|
||||
<li>Implement custom style support (for Windows only)</li>
|
||||
<li>Implement the ability to remove/reset the main profile in RMG-Input</li>
|
||||
<li>Rename Interface tab in settings dialog to User Interface</li>
|
||||
<li>Migrate to Qt6 (currently the flatpak will remain Qt5)</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release version="v0.2.4" date="2022-12-08" type="stable">
|
||||
<description>
|
||||
<p>Changes:</p>
|
||||
|
||||
@@ -24,6 +24,17 @@ else(WIN32)
|
||||
set(CORE_FILE "libmupen64plus.so")
|
||||
endif(WIN32)
|
||||
|
||||
set(BASE_CMAKE_CONFIGURE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER})
|
||||
if (USE_CCACHE)
|
||||
set(CMAKE_CONFIGURE_ARGS ${BASE_CMAKE_CONFIGURE_ARGS} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache)
|
||||
set(MAKE_CC_COMPILER "ccache ${CMAKE_C_COMPILER}")
|
||||
set(MAKE_CXX_COMPILER "ccache ${CMAKE_CXX_COMPILER}")
|
||||
else(USE_CCACHE)
|
||||
set(CMAKE_CONFIGURE_ARGS ${BASE_CMAKE_CONFIGURE_ARGS})
|
||||
set(MAKE_CC_COMPILER "${CMAKE_C_COMPILER}")
|
||||
set(MAKE_CXX_COMPILER "${CMAKE_CXX_COMPILER}")
|
||||
endif(USE_CCACHE)
|
||||
|
||||
if(NOT NO_GIT_CLONE)
|
||||
set(MUPEN64PLUSCORE_URL "https://github.com/mupen64plus/mupen64plus-core")
|
||||
set(MUPEN64PLUSCORE_TAG "ba9a52483052248b67c324e3fd0e073b807bbea4")
|
||||
@@ -44,13 +55,13 @@ if(NOT NO_GIT_CLONE)
|
||||
set(MUPEN64PLUS_INPUT_GCA_TAG "21639fb13dfa797a7c0949ffd9bbda9a3456fc69")
|
||||
|
||||
set(MUPEN64PLUS_GFX_ANGRYLION_URL "https://github.com/Rosalie241/angrylion-rdp-plus")
|
||||
set(MUPEN64PLUS_GFX_ANGRYLION_TAG "9d71074f6b71750e99ad06a713f28a9c32ad15cb")
|
||||
set(MUPEN64PLUS_GFX_ANGRYLION_TAG "88c3f64d64811c7407d1f54502012fa67c67ebe8")
|
||||
|
||||
set(MUPEN64PLUS_GFX_GLIDEN64_URL "https://github.com/gonetz/GLideN64")
|
||||
set(MUPEN64PLUS_GFX_GLIDEN64_TAG "ff47414c2bd6e572872e9148b2f3e1dbc83e5fee")
|
||||
set(MUPEN64PLUS_GFX_GLIDEN64_URL "https://github.com/Rosalie241/GLideN64")
|
||||
set(MUPEN64PLUS_GFX_GLIDEN64_TAG "27a64b83559c7f0ef89de79996fc9d1702637da9")
|
||||
|
||||
set(MUPEN64PLUS_GFX_PARALLEL_URL "https://github.com/Rosalie241/parallel-rdp-standalone")
|
||||
set(MUPEN64PLUS_GFX_PARALLEL_TAG "693f607728aca78d94ba5d45b0ce119b4ccbcd8c")
|
||||
set(MUPEN64PLUS_GFX_PARALLEL_TAG "471253703c0e1fc84454708d5dd7bba2743ee66a")
|
||||
|
||||
set(DISCORD_RPC_URL "https://github.com/discord/discord-rpc")
|
||||
set(DISCORD_RPC_TAG "963aa9f3e5ce81a4682c6ca3d136cddda614db33")
|
||||
@@ -65,7 +76,7 @@ ExternalProject_Add(mupen64plus-core
|
||||
GIT_REPOSITORY ${MUPEN64PLUSCORE_URL}
|
||||
GIT_TAG ${MUPEN64PLUSCORE_TAG}
|
||||
|
||||
BUILD_COMMAND make all OSD=0 NEW_DYNAREC=1 TARGET=${CORE_FILE} DEBUG=$<CONFIG:Debug> KEYBINDINGS=0
|
||||
BUILD_COMMAND make all OSD=0 NEW_DYNAREC=1 TARGET=${CORE_FILE} DEBUG=$<CONFIG:Debug> KEYBINDINGS=0 CC=${MAKE_CC_COMPILER} CXX=${MAKE_CXX_COMPILER}
|
||||
BUILD_IN_SOURCE False
|
||||
|
||||
BINARY_DIR ${M64P_CORE_DIR}/projects/unix
|
||||
@@ -84,7 +95,7 @@ ExternalProject_Add(mupen64plus-rsp-cxd4
|
||||
GIT_REPOSITORY ${MUPEN64PLUS_RSP_CXD4_URL}
|
||||
GIT_TAG ${MUPEN64PLUS_RSP_CXD4_TAG}
|
||||
|
||||
BUILD_COMMAND make all APIDIR=${APIDIR} DEBUG=$<CONFIG:Debug> POSTFIX=
|
||||
BUILD_COMMAND make all APIDIR=${APIDIR} DEBUG=$<CONFIG:Debug> POSTFIX= CC=${MAKE_CC_COMPILER} CXX=${MAKE_CXX_COMPILER}
|
||||
BUILD_IN_SOURCE False
|
||||
|
||||
BINARY_DIR ${THIRDPARTY_DIR}/mupen64plus-rsp-cxd4/projects/unix
|
||||
@@ -102,7 +113,7 @@ ExternalProject_Add(mupen64plus-rsp-hle
|
||||
GIT_REPOSITORY ${MUPEN64PLUS_RSP_HLE_URL}
|
||||
GIT_TAG ${MUPEN64PLUS_RSP_HLE_TAG}
|
||||
|
||||
BUILD_COMMAND make all APIDIR=${APIDIR} DEBUG=$<CONFIG:Debug>
|
||||
BUILD_COMMAND make all APIDIR=${APIDIR} DEBUG=$<CONFIG:Debug> CC=${MAKE_CC_COMPILER} CXX=${MAKE_CXX_COMPILER}
|
||||
BUILD_IN_SOURCE False
|
||||
|
||||
BINARY_DIR ${THIRDPARTY_DIR}/mupen64plus-rsp-hle/projects/unix
|
||||
@@ -135,7 +146,7 @@ ExternalProject_Add(mupen64plus-input-raphnetraw
|
||||
GIT_REPOSITORY ${MUPEN64PLUS_INPUT_RAPHNET_URL}
|
||||
GIT_TAG ${MUPEN64PLUS_INPUT_RAPHNET_TAG}
|
||||
|
||||
BUILD_COMMAND make all APIDIR=${APIDIR} DEBUG=$<CONFIG:Debug>
|
||||
BUILD_COMMAND make all APIDIR=${APIDIR} DEBUG=$<CONFIG:Debug> CC=${MAKE_CC_COMPILER} CXX=${MAKE_CXX_COMPILER}
|
||||
BUILD_IN_SOURCE False
|
||||
|
||||
BINARY_DIR ${THIRDPARTY_DIR}/mupen64plus-input-raphnetraw/projects/unix
|
||||
@@ -184,7 +195,7 @@ ExternalProject_Add(mupen64plus-video-angrylion-plus
|
||||
INSTALL_COMMAND ""
|
||||
|
||||
BUILD_IN_SOURCE True
|
||||
CMAKE_ARGS -DBUILD_MUPEN64PLUS=ON -DBUILD_PROJECT64=OFF -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
CMAKE_ARGS -DBUILD_MUPEN64PLUS=ON -DBUILD_PROJECT64=OFF -DUSE_QT5=${USE_QT5} ${CMAKE_CONFIGURE_ARGS}
|
||||
|
||||
BUILD_BYPRODUCTS ${THIRDPARTY_DIR}/mupen64plus-video-angrylion-plus/mupen64plus-video-angrylion-plus.${SO_EXT}
|
||||
DEPENDS mupen64plus-core
|
||||
@@ -199,7 +210,7 @@ ExternalProject_Add(mupen64plus-video-GLideN64
|
||||
INSTALL_COMMAND ""
|
||||
|
||||
BUILD_IN_SOURCE False
|
||||
CMAKE_ARGS -DMUPENPLUSAPI=ON -DMUPENPLUSAPI_GLIDENUI=ON -DUSE_SYSTEM_LIBS=ON -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
CMAKE_ARGS -DMUPENPLUSAPI=ON -DMUPENPLUSAPI_GLIDENUI=ON -DGLIDENUI_QT6=${USE_QT6} -DUSE_SYSTEM_LIBS=ON ${CMAKE_CONFIGURE_ARGS}
|
||||
|
||||
SOURCE_SUBDIR ./src/
|
||||
BINARY_DIR ${GLIDEN64_BUILD_DIR}
|
||||
@@ -218,7 +229,7 @@ ExternalProject_Add(mupen64plus-video-parallel
|
||||
INSTALL_COMMAND ""
|
||||
|
||||
BUILD_IN_SOURCE True
|
||||
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
CMAKE_ARGS -DUSE_QT5=${USE_QT5} ${CMAKE_CONFIGURE_ARGS}
|
||||
|
||||
BUILD_BYPRODUCTS ${THIRDPARTY_DIR}/mupen64plus-video-parallel/mupen64plus-video-parallel.${SO_EXT}
|
||||
DEPENDS mupen64plus-core
|
||||
@@ -234,7 +245,7 @@ if (DISCORD_RPC)
|
||||
INSTALL_COMMAND ""
|
||||
|
||||
BUILD_IN_SOURCE True
|
||||
CMAKE_ARGS -DBUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||
CMAKE_ARGS -DBUILD_EXAMPLES=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON ${CMAKE_CONFIGURE_ARGS}
|
||||
|
||||
BUILD_BYPRODUCTS ${THIRDPARTY_DIR}/discord-rpc/src/libdiscord-rpc.a
|
||||
)
|
||||
|
||||
@@ -7,7 +7,7 @@ set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
|
||||
find_package(Qt5 COMPONENTS Gui Widgets Core REQUIRED)
|
||||
find_package(${QT_VERSION} COMPONENTS Gui Widgets Core REQUIRED)
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(SDL2 REQUIRED sdl2)
|
||||
@@ -36,7 +36,7 @@ target_link_libraries(RMG-Audio
|
||||
${SDL2_LIBRARIES}
|
||||
${SPEEX_LIBRARIES}
|
||||
${SAMPLERATE_LIBRARIES}
|
||||
Qt5::Gui Qt5::Widgets
|
||||
${QT_VERSION}::Gui ${QT_VERSION}::Widgets
|
||||
)
|
||||
|
||||
target_include_directories(RMG-Audio PRIVATE
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
using namespace UserInterface;
|
||||
|
||||
MainDialog::MainDialog(QWidget* parent) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint)
|
||||
MainDialog::MainDialog(QWidget* parent) : QDialog(parent)
|
||||
{
|
||||
this->setupUi(this);
|
||||
this->setWindowIcon(QIcon(":Resource/RMG.png"));
|
||||
|
||||
@@ -33,6 +33,7 @@ set(RMG_CORE_SOURCES
|
||||
SaveState.cpp
|
||||
Callback.cpp
|
||||
Plugins.cpp
|
||||
Version.cpp
|
||||
Cheats.cpp
|
||||
VidExt.cpp
|
||||
Video.cpp
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "RomHeader.hpp"
|
||||
#include "Callback.hpp"
|
||||
#include "Plugins.hpp"
|
||||
#include "Version.hpp"
|
||||
#include "Cheats.hpp"
|
||||
#include "Error.hpp"
|
||||
#include "Unzip.hpp"
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "Directories.hpp"
|
||||
#include "Config.hpp"
|
||||
#include "Error.hpp"
|
||||
#include "Core.hpp"
|
||||
#include "Config.hpp"
|
||||
#include "m64p/Api.hpp"
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "Settings.hpp"
|
||||
|
||||
#include "Directories.hpp"
|
||||
#include "Config.hpp"
|
||||
#include "Version.hpp"
|
||||
#include "m64p/Api.hpp"
|
||||
#include "Error.hpp"
|
||||
#include "m64p/api/m64p_types.h"
|
||||
@@ -161,6 +161,9 @@ static l_Setting get_setting(SettingsID settingId)
|
||||
case SettingsID::GUI_AutomaticFullscreen:
|
||||
setting = {SETTING_SECTION_GUI, "AutomaticFullscreen", false};
|
||||
break;
|
||||
case SettingsID::GUI_Style:
|
||||
setting = {SETTING_SECTION_GUI, "Style", ""};
|
||||
break;
|
||||
case SettingsID::GUI_CheckForUpdates:
|
||||
setting = {SETTING_SECTION_GUI, "CheckForUpdates", true};
|
||||
break;
|
||||
@@ -168,7 +171,7 @@ static l_Setting get_setting(SettingsID settingId)
|
||||
setting = {SETTING_SECTION_GUI, "DiscordRpc", true};
|
||||
break;
|
||||
case SettingsID::GUI_Version:
|
||||
setting = {SETTING_SECTION_GUI, "Version", CORE_VERSION};
|
||||
setting = {SETTING_SECTION_GUI, "Version", CoreGetVersion()};
|
||||
break;
|
||||
|
||||
case SettingsID::Core_GFX_Plugin:
|
||||
@@ -957,7 +960,7 @@ bool CoreSettingsUpgrade(void)
|
||||
|
||||
// we don't need to do anything
|
||||
// when the core version and the settings version match
|
||||
if (settingsVersion == CORE_VERSION)
|
||||
if (settingsVersion == CoreGetVersion())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -996,7 +999,7 @@ bool CoreSettingsUpgrade(void)
|
||||
}
|
||||
|
||||
// save core version
|
||||
CoreSettingsSetValue(SettingsID::GUI_Version, std::string(CORE_VERSION));
|
||||
CoreSettingsSetValue(SettingsID::GUI_Version, CoreGetVersion());
|
||||
CoreSettingsSave();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ enum class SettingsID
|
||||
GUI_PauseEmulationOnFocusLoss,
|
||||
GUI_ResumeEmulationOnFocus,
|
||||
GUI_AutomaticFullscreen,
|
||||
GUI_Style,
|
||||
GUI_CheckForUpdates,
|
||||
GUI_DiscordRpc,
|
||||
GUI_Version,
|
||||
|
||||
@@ -7,10 +7,14 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
QTableView
|
||||
#include "Version.hpp"
|
||||
#include "Config.hpp"
|
||||
|
||||
//
|
||||
// Exported Functions
|
||||
//
|
||||
|
||||
std::string CoreGetVersion(void)
|
||||
{
|
||||
border: none;
|
||||
color: #0096d3;
|
||||
selection-color: #FFFFFF;
|
||||
selection-background-color: #0096d3;
|
||||
return std::string(CORE_VERSION);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef CORE_VERSION_HPP
|
||||
#define CORE_VERSION_HPP
|
||||
|
||||
#include <string>
|
||||
|
||||
// returns the current RMG-Core version (as string)
|
||||
std::string CoreGetVersion(void);
|
||||
|
||||
#endif // CORE_VERSION_HPP
|
||||
@@ -8,7 +8,7 @@ set(CMAKE_AUTOUIC ON)
|
||||
# disable lib prefix
|
||||
set(CMAKE_SHARED_LIBRARY_PREFIX "")
|
||||
|
||||
find_package(Qt5 COMPONENTS Gui Widgets Core Svg REQUIRED)
|
||||
find_package(${QT_VERSION} COMPONENTS Gui Widgets Core Svg REQUIRED)
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(SDL2 REQUIRED sdl2)
|
||||
@@ -41,4 +41,4 @@ target_include_directories(RMG-Input PRIVATE
|
||||
${SDL2_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
target_link_libraries(RMG-Input Qt5::Gui Qt5::Widgets Qt5::Svg)
|
||||
target_link_libraries(RMG-Input ${QT_VERSION}::Gui ${QT_VERSION}::Widgets ${QT_VERSION}::Svg)
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
using namespace UserInterface;
|
||||
|
||||
MainDialog::MainDialog(QWidget* parent, Thread::SDLThread* sdlThread) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint)
|
||||
MainDialog::MainDialog(QWidget* parent, Thread::SDLThread* sdlThread) : QDialog(parent)
|
||||
{
|
||||
this->setupUi(this);
|
||||
this->setWindowIcon(QIcon(":Resource/RMG.png"));
|
||||
|
||||
@@ -28,7 +28,7 @@ private:
|
||||
QString deviceName;
|
||||
int deviceNum;
|
||||
|
||||
bool operator== (inputDevice_t other)
|
||||
bool operator== (inputDevice_t other) const
|
||||
{
|
||||
return other.deviceNum == deviceNum &&
|
||||
other.deviceName == deviceName;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
style="clip-rule:evenodd;fill-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2"
|
||||
id="svg21"
|
||||
sodipodi:docname="Controller.svg"
|
||||
inkscape:version="1.1 (c68e22c387, 2021-05-23)"
|
||||
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
@@ -23,15 +23,17 @@
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
showgrid="false"
|
||||
inkscape:zoom="0.28240146"
|
||||
inkscape:cx="-426.69751"
|
||||
inkscape:cy="3454.3023"
|
||||
inkscape:zoom="0.070600365"
|
||||
inkscape:cx="6019.7989"
|
||||
inkscape:cy="1600.5583"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1017"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg21" />
|
||||
inkscape:current-layer="layer2"
|
||||
inkscape:showpageshadow="2"
|
||||
inkscape:deskcolor="#d1d1d1" />
|
||||
<path
|
||||
id="Dark-Grey-Background"
|
||||
serif:id="Dark Grey Background"
|
||||
@@ -111,4 +113,39 @@
|
||||
style="fill:#ec3f21"
|
||||
id="circle18" />
|
||||
</g>
|
||||
</svg>
|
||||
<g
|
||||
id="layer2"
|
||||
inkscape:label="Z-Button"
|
||||
style="display:inline;opacity:1;stroke-width:1;stroke-dasharray:none;paint-order:markers stroke fill"
|
||||
transform="matrix(50.366966,0,0,50.366966,3240.0678,-579.56452)"><g
|
||||
id="layer2-0"
|
||||
inkscape:label="Z-Button"
|
||||
style="clip-rule:evenodd;display:inline;fill-rule:evenodd;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:2;stroke-dasharray:none;paint-order:markers stroke fill"><rect
|
||||
style="clip-rule:evenodd;display:inline;opacity:1;fill:#5c5c5c;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.999999;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:markers stroke fill;image-rendering:auto"
|
||||
id="rect1917-0-4"
|
||||
width="11.478539"
|
||||
height="16.72587"
|
||||
x="-32.517441"
|
||||
y="86.256668"
|
||||
ry="3.4675589"
|
||||
inkscape:label="btnZ-outline"
|
||||
class="theme-button"
|
||||
ojd-button="Z" /><rect
|
||||
style="display:inline;opacity:1;fill:#bcbdbf;fill-opacity:1;stroke:none;stroke-width:0.960842;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:markers stroke fill;image-rendering:auto"
|
||||
id="rect1917-8"
|
||||
width="10.956328"
|
||||
height="16.177647"
|
||||
x="-32.225891"
|
||||
y="86.523468"
|
||||
ry="3.3539019"
|
||||
inkscape:label="btnZ"
|
||||
class="theme-button"
|
||||
ojd-button="Z" /><g
|
||||
aria-label="Z"
|
||||
style="font-style:normal;font-weight:normal;font-size:5.73478px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;clip-rule:evenodd;display:inline;opacity:1;fill:#56575b;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.751267;stroke-linejoin:round;stroke-miterlimit:2;stroke-dasharray:none;paint-order:markers stroke fill"
|
||||
id="text1921-7"
|
||||
transform="matrix(1.3310888,0,0,1.3310888,-67.459296,-40.853038)"><path
|
||||
d="m 28.805176,99.685474 h 3.514231 v 0.652446 l -2.242948,2.71338 h 2.307352 v 0.81485 h -3.64304 v -0.65244 l 2.242948,-2.71338 h -2.178543 z"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';fill:#56575b;fill-opacity:1;stroke-width:0.751267;stroke-dasharray:none;paint-order:markers stroke fill"
|
||||
id="path2008-2"
|
||||
inkscape:connector-curvature="0" /></g></g></g></svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 14 KiB |
@@ -8,7 +8,7 @@
|
||||
style="clip-rule:evenodd;fill-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2"
|
||||
id="svg21"
|
||||
sodipodi:docname="Controller_NoAnalogStick.svg"
|
||||
inkscape:version="1.1 (c4e8f9ed74, 2021-05-24)"
|
||||
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
@@ -23,15 +23,17 @@
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
showgrid="false"
|
||||
inkscape:zoom="0.14120073"
|
||||
inkscape:cx="2549.5619"
|
||||
inkscape:cy="3325.0536"
|
||||
inkscape:zoom="0.099843994"
|
||||
inkscape:cx="2829.4141"
|
||||
inkscape:cy="3475.4219"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1007"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-height="1017"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg21" />
|
||||
inkscape:current-layer="svg21"
|
||||
inkscape:showpageshadow="2"
|
||||
inkscape:deskcolor="#d1d1d1" />
|
||||
<path
|
||||
id="Dark-Grey-Background"
|
||||
serif:id="Dark Grey Background"
|
||||
@@ -101,4 +103,36 @@
|
||||
style="fill:#ec3f21"
|
||||
id="circle18" />
|
||||
</g>
|
||||
</svg>
|
||||
<g
|
||||
id="layer2"
|
||||
inkscape:label="Z-Button"
|
||||
style="display:inline;opacity:1;stroke-width:1;stroke-dasharray:none;paint-order:markers stroke fill"
|
||||
transform="matrix(50.366966,0,0,50.366966,3240.0678,-579.56452)"><rect
|
||||
style="clip-rule:evenodd;display:inline;opacity:1;fill:#5c5c5c;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.999999;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:markers stroke fill;image-rendering:auto"
|
||||
id="rect1917-0"
|
||||
width="11.478539"
|
||||
height="16.72587"
|
||||
x="-32.517441"
|
||||
y="86.256668"
|
||||
ry="3.4675589"
|
||||
inkscape:label="btnZ-outline"
|
||||
class="theme-button"
|
||||
ojd-button="Z" /><rect
|
||||
style="display:inline;opacity:1;fill:#bcbdbf;fill-opacity:1;stroke:none;stroke-width:0.960842;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:markers stroke fill;image-rendering:auto"
|
||||
id="rect1917"
|
||||
width="10.956328"
|
||||
height="16.177647"
|
||||
x="-32.225891"
|
||||
y="86.523468"
|
||||
ry="3.3539019"
|
||||
inkscape:label="btnZ"
|
||||
class="theme-button"
|
||||
ojd-button="Z" /><g
|
||||
aria-label="Z"
|
||||
style="font-style:normal;font-weight:normal;font-size:5.73478px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;clip-rule:evenodd;display:inline;opacity:1;fill:#56575b;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.751267;stroke-linejoin:round;stroke-miterlimit:2;stroke-dasharray:none;paint-order:markers stroke fill"
|
||||
id="text1921"
|
||||
transform="matrix(1.3310888,0,0,1.3310888,-67.459296,-40.853038)"><path
|
||||
d="m 28.805176,99.685474 h 3.514231 v 0.652446 l -2.242948,2.71338 h 2.307352 v 0.81485 h -3.64304 v -0.65244 l 2.242948,-2.71338 h -2.178543 z"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:sans-serif;-inkscape-font-specification:'sans-serif Bold';fill:#56575b;fill-opacity:1;stroke-width:0.751267;stroke-dasharray:none;paint-order:markers stroke fill"
|
||||
id="path2008"
|
||||
inkscape:connector-curvature="0" /></g></g></svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 14 KiB |
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
width="6939.9795"
|
||||
height="6772.564"
|
||||
viewBox="0 0 6939.9795 6772.564"
|
||||
version="1.1"
|
||||
xml:space="preserve"
|
||||
style="clip-rule:evenodd;fill-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2"
|
||||
id="svg21"
|
||||
sodipodi:docname="Controller_Pressed_ZTrigger.svg"
|
||||
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"><defs
|
||||
id="defs25" /><sodipodi:namedview
|
||||
id="namedview23"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
showgrid="false"
|
||||
inkscape:zoom="0.099843994"
|
||||
inkscape:cx="2468.8516"
|
||||
inkscape:cy="3856.0156"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1017"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg21"
|
||||
inkscape:showpageshadow="2"
|
||||
inkscape:deskcolor="#d1d1d1" />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<g
|
||||
style="clip-rule:evenodd;fill-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2"
|
||||
id="g5916"
|
||||
transform="matrix(1.0882331,0,0,1.0882331,512.32815,1416.6572)"><circle
|
||||
style="opacity:0.62;fill:#ececec;fill-rule:evenodd;stroke-width:0.280377"
|
||||
id="path42"
|
||||
cx="1267.6501"
|
||||
cy="2546.3296"
|
||||
r="180.5985" /></g></svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
@@ -15,6 +15,7 @@
|
||||
<file>Resource/Controller_Pressed_Start.svg</file>
|
||||
<file>Resource/Controller_Pressed_LeftTrigger.svg</file>
|
||||
<file>Resource/Controller_Pressed_RightTrigger.svg</file>
|
||||
<file>Resource/Controller_Pressed_ZTrigger.svg</file>
|
||||
<file>Resource/RMG.png</file>
|
||||
<file>Resource/Info.ico</file>
|
||||
</qresource>
|
||||
|
||||
@@ -125,6 +125,7 @@ void ControllerImageWidget::paintEvent(QPaintEvent *event)
|
||||
{ N64ControllerButton::CButtonRight, ":Resource/Controller_Pressed_CButtonRight.svg" },
|
||||
{ N64ControllerButton::LeftTrigger, ":Resource/Controller_Pressed_LeftTrigger.svg" },
|
||||
{ N64ControllerButton::RightTrigger, ":Resource/Controller_Pressed_RightTrigger.svg" },
|
||||
{ N64ControllerButton::ZTrigger, ":Resource/Controller_Pressed_ZTrigger.svg" }
|
||||
};
|
||||
|
||||
static const QString baseImageUri = ":Resource/Controller_NoAnalogStick.svg";
|
||||
|
||||
@@ -58,6 +58,7 @@ ControllerWidget::ControllerWidget(QWidget* parent, EventFilter* eventFilter) :
|
||||
{ N64ControllerButton::CButtonRight, this->cbuttonRightButton },
|
||||
{ N64ControllerButton::LeftTrigger, this->leftTriggerButton },
|
||||
{ N64ControllerButton::RightTrigger, this->rightTriggerButton },
|
||||
{ N64ControllerButton::ZTrigger, this->zTriggerButton }
|
||||
});
|
||||
|
||||
this->joystickWidgetMappings.append(
|
||||
@@ -121,7 +122,7 @@ ControllerWidget::ControllerWidget(QWidget* parent, EventFilter* eventFilter) :
|
||||
this->setupButtonWidgets.append(button);
|
||||
}
|
||||
|
||||
|
||||
this->on_controllerPluggedCheckBox_toggled(false);
|
||||
this->initializeButtons();
|
||||
}
|
||||
|
||||
@@ -292,6 +293,13 @@ void ControllerWidget::CheckInputDeviceSettings()
|
||||
std::string deviceName = CoreSettingsGetStringValue(SettingsID::Input_DeviceName, section);
|
||||
int deviceNum = CoreSettingsGetIntValue(SettingsID::Input_DeviceNum, section);
|
||||
|
||||
// do nothing when input device combobox
|
||||
// is empty
|
||||
if (this->inputDeviceComboBox->count() == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// clear (not found) devices first
|
||||
int notFoundIndex = this->inputDeviceComboBox->findText("(not found)", Qt::MatchFlag::MatchEndsWith);
|
||||
if (notFoundIndex != -1)
|
||||
@@ -302,11 +310,11 @@ void ControllerWidget::CheckInputDeviceSettings()
|
||||
|
||||
int deviceNameIndex = this->inputDeviceComboBox->findText(QString::fromStdString(deviceName), Qt::MatchFlag::MatchStartsWith);
|
||||
int deviceNumIndex = this->inputDeviceComboBox->findData(deviceNum);
|
||||
|
||||
if ((deviceNameIndex == deviceNumIndex) &&
|
||||
(deviceNameIndex != -1))
|
||||
|
||||
if ((deviceNumIndex != -1) &&
|
||||
(this->inputDeviceComboBox->itemText(deviceNumIndex).startsWith(QString::fromStdString(deviceName))))
|
||||
{ // full match
|
||||
this->inputDeviceComboBox->setCurrentIndex(deviceNameIndex);
|
||||
this->inputDeviceComboBox->setCurrentIndex(deviceNumIndex);
|
||||
}
|
||||
else if (deviceNameIndex != -1)
|
||||
{ // name only match
|
||||
@@ -363,7 +371,7 @@ void ControllerWidget::on_profileComboBox_currentIndexChanged(int value)
|
||||
// reload settings from section
|
||||
this->LoadSettings(this->getCurrentSettingsSection());
|
||||
// reload input device settings
|
||||
CheckInputDeviceSettings();
|
||||
this->CheckInputDeviceSettings();
|
||||
}
|
||||
|
||||
void ControllerWidget::on_inputDeviceComboBox_currentIndexChanged(int value)
|
||||
@@ -446,11 +454,15 @@ void ControllerWidget::on_removeProfileButton_clicked()
|
||||
if (this->profileComboBox->currentIndex() == 0)
|
||||
{
|
||||
QMessageBox messageBox(this);
|
||||
messageBox.setIcon(QMessageBox::Icon::Critical);
|
||||
messageBox.setWindowTitle("Error");
|
||||
messageBox.setText("Cannot remove main profile!");
|
||||
messageBox.addButton(QMessageBox::Ok);
|
||||
messageBox.exec();
|
||||
messageBox.setIcon(QMessageBox::Icon::Warning);
|
||||
messageBox.setText("Are you sure you want to reset the main profile?");
|
||||
messageBox.addButton(QMessageBox::Yes);
|
||||
messageBox.addButton(QMessageBox::No);
|
||||
if (messageBox.exec() == QMessageBox::Yes)
|
||||
{
|
||||
this->SaveDefaultSettings();
|
||||
this->LoadSettings(this->getCurrentSettingsSection());
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -911,6 +923,8 @@ void ControllerWidget::LoadSettings(QString sectionQString)
|
||||
|
||||
buttonSetting.button->SetInputData(type, data, extraData, QString::fromStdString(name));
|
||||
}
|
||||
|
||||
this->on_controllerPluggedCheckBox_toggled(this->IsPluggedIn());
|
||||
}
|
||||
|
||||
void ControllerWidget::SaveDefaultSettings()
|
||||
|
||||
@@ -5,10 +5,10 @@ set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
|
||||
find_package(Qt5 COMPONENTS Gui Widgets Core REQUIRED)
|
||||
find_package(${QT_VERSION} COMPONENTS Gui Widgets Core OpenGL REQUIRED)
|
||||
|
||||
if (UPDATER)
|
||||
find_package(Qt5 COMPONENTS Network REQUIRED)
|
||||
find_package(${QT_VERSION} COMPONENTS Network REQUIRED)
|
||||
add_definitions(-DUPDATER)
|
||||
endif(UPDATER)
|
||||
|
||||
@@ -19,8 +19,6 @@ endif(DISCORD_RPC)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(SDL2 REQUIRED sdl2)
|
||||
|
||||
configure_file(Config.hpp.in Config.hpp)
|
||||
|
||||
set(RMG_SOURCES
|
||||
UserInterface/MainWindow.cpp
|
||||
UserInterface/Widget/RomBrowserWidget.cpp
|
||||
@@ -70,7 +68,6 @@ endif()
|
||||
|
||||
target_link_libraries(RMG
|
||||
RMG-Core
|
||||
${SDL2_LIBRARIES}
|
||||
)
|
||||
|
||||
target_include_directories(RMG PRIVATE
|
||||
@@ -80,9 +77,9 @@ target_include_directories(RMG PRIVATE
|
||||
${SDL2_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
target_link_libraries(RMG Qt5::Gui Qt5::Widgets)
|
||||
target_link_libraries(RMG ${QT_VERSION}::Gui ${QT_VERSION}::Widgets ${QT_VERSION}::OpenGL)
|
||||
|
||||
if (UPDATER)
|
||||
target_link_libraries(RMG Qt5::Network)
|
||||
target_link_libraries(RMG ${QT_VERSION}::Network)
|
||||
endif(UPDATER)
|
||||
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
#ifndef CONFIG_HPP
|
||||
#define CONFIG_HPP
|
||||
|
||||
#define WINDOW_TITLE "Rosalie's Mupen GUI (${GIT_VERSION})"
|
||||
#define VERSION_STR "${GIT_VERSION}"
|
||||
|
||||
#endif // CONFIG_HPP
|
||||
@@ -9,13 +9,13 @@
|
||||
*/
|
||||
#include "AboutDialog.hpp"
|
||||
|
||||
#include "Config.hpp"
|
||||
#include <RMG-Core/Core.hpp>
|
||||
|
||||
using namespace UserInterface::Dialog;
|
||||
|
||||
AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint)
|
||||
AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent)
|
||||
{
|
||||
this->setupUi(this);
|
||||
|
||||
this->versionLabel->setText(QString("RMG %1").arg(VERSION_STR));
|
||||
this->versionLabel->setText(QString("RMG %1").arg(QString::fromStdString(CoreGetVersion())));
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
using namespace UserInterface::Dialog;
|
||||
|
||||
AddCheatDialog::AddCheatDialog(QWidget *parent) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint)
|
||||
AddCheatDialog::AddCheatDialog(QWidget *parent) : QDialog(parent)
|
||||
{
|
||||
this->setupUi(this);
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ Q_DECLARE_METATYPE(CoreCheat);
|
||||
|
||||
using namespace UserInterface::Dialog;
|
||||
|
||||
CheatsDialog::CheatsDialog(QWidget *parent) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint)
|
||||
CheatsDialog::CheatsDialog(QWidget *parent) : QDialog(parent)
|
||||
{
|
||||
qRegisterMetaType<CoreCheat>();
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ Q_DECLARE_METATYPE(CoreCheatOption);
|
||||
|
||||
using namespace UserInterface::Dialog;
|
||||
|
||||
ChooseCheatOptionDialog::ChooseCheatOptionDialog(CoreCheat cheat, QWidget *parent) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint)
|
||||
ChooseCheatOptionDialog::ChooseCheatOptionDialog(CoreCheat cheat, QWidget *parent) : QDialog(parent)
|
||||
{
|
||||
qRegisterMetaType<CoreCheatOption>();
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
using namespace UserInterface::Dialog;
|
||||
|
||||
DownloadUpdateDialog::DownloadUpdateDialog(QWidget *parent, QUrl url, QString filename) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint)
|
||||
DownloadUpdateDialog::DownloadUpdateDialog(QWidget *parent, QUrl url, QString filename) : QDialog(parent)
|
||||
{
|
||||
this->setupUi(this);
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
using namespace UserInterface::Dialog;
|
||||
|
||||
InstallUpdateDialog::InstallUpdateDialog(QWidget *parent, QString installationDirectory, QString temporaryDirectory, QString filename) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint)
|
||||
InstallUpdateDialog::InstallUpdateDialog(QWidget *parent, QString installationDirectory, QString temporaryDirectory, QString filename) : QDialog(parent)
|
||||
{
|
||||
this->setupUi(this);
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
using namespace UserInterface::Dialog;
|
||||
|
||||
RomInfoDialog::RomInfoDialog(QString file, QWidget *parent) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint)
|
||||
RomInfoDialog::RomInfoDialog(QString file, QWidget *parent) : QDialog(parent)
|
||||
{
|
||||
this->setupUi(this);
|
||||
|
||||
|
||||
@@ -13,206 +13,201 @@
|
||||
<property name="windowTitle">
|
||||
<string>ROM Information</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
<string>ROM Information</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>ROM Name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="romNameLineEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>File Name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="fileNameLineEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Location:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="locationLineEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>MD5:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="md5LineEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>CRC1:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="crc1LineEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>CRC2</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="crc2LineEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>112</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>ROM Name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="romNameLineEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>File Name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="fileNameLineEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Location:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="locationLineEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>MD5:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="md5LineEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>CRC1:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="crc1LineEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>CRC2</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="crc2LineEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
|
||||
@@ -14,10 +14,11 @@
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
#include <QDirIterator>
|
||||
|
||||
using namespace UserInterface::Dialog;
|
||||
|
||||
SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint)
|
||||
SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent)
|
||||
{
|
||||
this->setupUi(this);
|
||||
|
||||
@@ -43,7 +44,7 @@ SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent, Qt::WindowSyst
|
||||
|
||||
pluginList = CoreGetAllPlugins();
|
||||
|
||||
for (int i = 0; i < 11; i++)
|
||||
for (int i = 0; i < 12; i++)
|
||||
{
|
||||
this->reloadSettings(i);
|
||||
}
|
||||
@@ -62,10 +63,14 @@ SettingsDialog::SettingsDialog(QWidget *parent) : QDialog(parent, Qt::WindowSyst
|
||||
// aren't defined, hide the tab
|
||||
// with the settings for those
|
||||
#ifndef UPDATER
|
||||
this->innerInterfaceTabWidget->removeTab(2);
|
||||
this->innerInterfaceTabWidget->removeTab(3);
|
||||
#endif // !UPDATER
|
||||
#endif // !DISCORD_RPC
|
||||
|
||||
#ifndef _WIN32
|
||||
this->innerInterfaceTabWidget->removeTab(2);
|
||||
#endif
|
||||
|
||||
int width = CoreSettingsGetIntValue(SettingsID::GUI_SettingsDialogWidth);
|
||||
int height = CoreSettingsGetIntValue(SettingsID::GUI_SettingsDialogHeight);
|
||||
|
||||
@@ -147,6 +152,8 @@ void SettingsDialog::restoreDefaults(int stackedWidgetIndex)
|
||||
loadDefaultInterfaceRomBrowserSettings();
|
||||
break;
|
||||
case 10:
|
||||
loadDefaultInterfaceStyleSettings();
|
||||
case 11:
|
||||
loadDefaultInterfaceMiscSettings();
|
||||
break;
|
||||
}
|
||||
@@ -188,6 +195,9 @@ void SettingsDialog::reloadSettings(int stackedWidgetIndex)
|
||||
loadInterfaceRomBrowserSettings();
|
||||
break;
|
||||
case 10:
|
||||
loadInterfaceStyleSettings();
|
||||
break;
|
||||
case 11:
|
||||
loadInterfaceMiscSettings();
|
||||
break;
|
||||
}
|
||||
@@ -213,7 +223,7 @@ void SettingsDialog::loadCoreSettings(void)
|
||||
|
||||
this->coreCpuEmulatorComboBox->setCurrentIndex(cpuEmulator);
|
||||
this->coreRandomizeTimingCheckBox->setChecked(randomizeInterrupt);
|
||||
this->coreDebuggerCheckBox->setChecked(debugger);
|
||||
//this->coreDebuggerCheckBox->setChecked(debugger);
|
||||
|
||||
this->coreOverrideGameSettingsGroup->setChecked(overrideGameSettings);
|
||||
|
||||
@@ -373,6 +383,11 @@ void SettingsDialog::loadInterfaceRomBrowserSettings(void)
|
||||
this->romSearchLimitSpinBox->setValue(CoreSettingsGetIntValue(SettingsID::RomBrowser_MaxItems));
|
||||
}
|
||||
|
||||
void SettingsDialog::loadInterfaceStyleSettings(void)
|
||||
{
|
||||
this->commonInterfaceStyleSettings(0);
|
||||
}
|
||||
|
||||
void SettingsDialog::loadInterfaceMiscSettings(void)
|
||||
{
|
||||
this->checkForUpdatesCheckBox->setChecked(CoreSettingsGetBoolValue(SettingsID::GUI_CheckForUpdates));
|
||||
@@ -399,7 +414,7 @@ void SettingsDialog::loadDefaultCoreSettings(void)
|
||||
|
||||
this->coreCpuEmulatorComboBox->setCurrentIndex(cpuEmulator);
|
||||
this->coreRandomizeTimingCheckBox->setChecked(randomizeInterrupt);
|
||||
this->coreDebuggerCheckBox->setChecked(debugger);
|
||||
//this->coreDebuggerCheckBox->setChecked(debugger);
|
||||
|
||||
this->coreOverrideGameSettingsGroup->setChecked(overrideGameSettings);
|
||||
|
||||
@@ -496,6 +511,11 @@ void SettingsDialog::loadDefaultInterfaceRomBrowserSettings(void)
|
||||
this->romSearchLimitSpinBox->setValue(CoreSettingsGetDefaultIntValue(SettingsID::RomBrowser_MaxItems));
|
||||
}
|
||||
|
||||
void SettingsDialog::loadDefaultInterfaceStyleSettings(void)
|
||||
{
|
||||
this->commonInterfaceStyleSettings(1);
|
||||
}
|
||||
|
||||
void SettingsDialog::loadDefaultInterfaceMiscSettings(void)
|
||||
{
|
||||
this->checkForUpdatesCheckBox->setChecked(CoreSettingsGetDefaultBoolValue(SettingsID::GUI_CheckForUpdates));
|
||||
@@ -519,6 +539,7 @@ void SettingsDialog::saveSettings(void)
|
||||
this->saveHotkeySettings();
|
||||
this->saveInterfaceEmulationSettings();
|
||||
this->saveInterfaceRomBrowserSettings();
|
||||
this->saveInterfaceStyleSettings();
|
||||
this->saveInterfaceMiscSettings();
|
||||
}
|
||||
|
||||
@@ -529,12 +550,12 @@ void SettingsDialog::saveCoreSettings(void)
|
||||
int cpuEmulator = this->coreCpuEmulatorComboBox->currentIndex();
|
||||
int siDmaDuration = this->coreSiDmaDurationSpinBox->value();
|
||||
bool randomizeInterrupt = this->coreRandomizeTimingCheckBox->isChecked();
|
||||
bool debugger = this->coreDebuggerCheckBox->isChecked();
|
||||
//bool debugger = this->coreDebuggerCheckBox->isChecked();
|
||||
bool overrideGameSettings = this->coreOverrideGameSettingsGroup->isChecked();
|
||||
|
||||
CoreSettingsSetValue(SettingsID::CoreOverlay_CPU_Emulator, cpuEmulator);
|
||||
CoreSettingsSetValue(SettingsID::CoreOverlay_RandomizeInterrupt, randomizeInterrupt);
|
||||
CoreSettingsSetValue(SettingsID::CoreOverlay_EnableDebugger, debugger);
|
||||
//CoreSettingsSetValue(SettingsID::CoreOverlay_EnableDebugger, debugger);
|
||||
CoreSettingsSetValue(SettingsID::Core_OverrideGameSpecificSettings, overrideGameSettings);
|
||||
|
||||
if (!overrideGameSettings)
|
||||
@@ -678,6 +699,11 @@ void SettingsDialog::saveInterfaceRomBrowserSettings(void)
|
||||
CoreSettingsSetValue(SettingsID::RomBrowser_MaxItems, this->romSearchLimitSpinBox->value());
|
||||
}
|
||||
|
||||
void SettingsDialog::saveInterfaceStyleSettings(void)
|
||||
{
|
||||
CoreSettingsSetValue(SettingsID::GUI_Style, this->styleComboBox->currentData().toString().toStdString());
|
||||
}
|
||||
|
||||
void SettingsDialog::saveInterfaceMiscSettings(void)
|
||||
{
|
||||
CoreSettingsSetValue(SettingsID::GUI_CheckForUpdates, this->checkForUpdatesCheckBox->isChecked());
|
||||
@@ -796,11 +822,55 @@ void SettingsDialog::commonPluginSettings(int action)
|
||||
}
|
||||
}
|
||||
|
||||
void SettingsDialog::commonInterfaceStyleSettings(int action)
|
||||
{
|
||||
this->styleComboBox->clear();
|
||||
this->styleComboBox->addItem("None", "");
|
||||
|
||||
QString currentStyle = action == 0 ?
|
||||
QString::fromStdString(CoreSettingsGetStringValue(SettingsID::GUI_Style)) :
|
||||
QString::fromStdString(CoreSettingsGetDefaultStringValue(SettingsID::GUI_Style));
|
||||
|
||||
QString directory;
|
||||
directory = QString::fromStdString(CoreGetSharedDataDirectory().string());
|
||||
directory += "\\Styles\\";
|
||||
|
||||
QStringList filter;
|
||||
filter << "*.qss";
|
||||
|
||||
bool styleFound = false;
|
||||
QDirIterator stylesDirectoryIter(directory, filter, QDir::Files, QDirIterator::NoIteratorFlags);
|
||||
while (stylesDirectoryIter.hasNext())
|
||||
{
|
||||
QString filePath = stylesDirectoryIter.next();
|
||||
QFileInfo fileInfo(filePath);
|
||||
|
||||
this->styleComboBox->addItem(fileInfo.baseName(), filePath);
|
||||
if (filePath == currentStyle)
|
||||
{
|
||||
styleFound = true;
|
||||
this->styleComboBox->setCurrentText(fileInfo.baseName());
|
||||
}
|
||||
}
|
||||
|
||||
if (currentStyle.isEmpty())
|
||||
{
|
||||
this->styleComboBox->setCurrentText("None");
|
||||
styleFound = true;
|
||||
}
|
||||
|
||||
if (!styleFound)
|
||||
{
|
||||
this->styleComboBox->addItem("", "");
|
||||
this->styleComboBox->setCurrentText("");
|
||||
}
|
||||
}
|
||||
|
||||
void SettingsDialog::hideEmulationInfoText(void)
|
||||
{
|
||||
QHBoxLayout *layouts[] = {this->emulationInfoLayout_0, this->emulationInfoLayout_1,
|
||||
this->emulationInfoLayout_2, this->emulationInfoLayout_3,
|
||||
this->emulationInfoLayout_9, this->emulationInfoLayout_13};
|
||||
this->emulationInfoLayout_9};
|
||||
|
||||
for (const auto &layout : layouts)
|
||||
{
|
||||
@@ -838,6 +908,40 @@ void SettingsDialog::chooseIPLRom(QLineEdit *lineEdit)
|
||||
lineEdit->setText(file);
|
||||
}
|
||||
|
||||
bool SettingsDialog::applyPluginSettings(void)
|
||||
{
|
||||
// attempt to apply plugin settings when emulation
|
||||
// isn't running, when it fails, show the user the error and
|
||||
// don't allow the user to save invalid settings
|
||||
if (!CoreIsEmulationPaused() && !CoreIsEmulationRunning())
|
||||
{
|
||||
if (!CoreApplyPluginSettings())
|
||||
{
|
||||
QMessageBox msgBox(this);
|
||||
msgBox.setIcon(QMessageBox::Icon::Critical);
|
||||
msgBox.setWindowTitle("Error");
|
||||
msgBox.setText("CoreApplyPluginSettings() Failed");
|
||||
msgBox.setDetailedText(QString::fromStdString(CoreGetError()));
|
||||
msgBox.addButton(QMessageBox::Ok);
|
||||
msgBox.exec();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void SettingsDialog::closeEvent(QCloseEvent* event)
|
||||
{
|
||||
if (this->applyPluginSettings())
|
||||
{
|
||||
event->accept();
|
||||
}
|
||||
else
|
||||
{
|
||||
event->ignore();
|
||||
}
|
||||
}
|
||||
|
||||
void SettingsDialog::on_buttonBox_clicked(QAbstractButton *button)
|
||||
{
|
||||
QPushButton *pushButton = (QPushButton *)button;
|
||||
@@ -853,22 +957,9 @@ void SettingsDialog::on_buttonBox_clicked(QAbstractButton *button)
|
||||
this->saveSettings();
|
||||
}
|
||||
|
||||
// attempt to apply plugin settings when emulation
|
||||
// isn't running, when it fails, show the user the error and
|
||||
// don't allow the user to save invalid settings
|
||||
if (!CoreIsEmulationPaused() && !CoreIsEmulationRunning())
|
||||
if (!this->applyPluginSettings())
|
||||
{
|
||||
if (!CoreApplyPluginSettings())
|
||||
{
|
||||
QMessageBox msgBox(this);
|
||||
msgBox.setIcon(QMessageBox::Icon::Critical);
|
||||
msgBox.setWindowTitle("Error");
|
||||
msgBox.setText("CoreApplyPluginSettings() Failed");
|
||||
msgBox.setDetailedText(QString::fromStdString(CoreGetError()));
|
||||
msgBox.addButton(QMessageBox::Ok);
|
||||
msgBox.exec();
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@ class SettingsDialog : public QDialog, private Ui::SettingsDialog
|
||||
void loadHotkeySettings(void);
|
||||
void loadInterfaceEmulationSettings(void);
|
||||
void loadInterfaceRomBrowserSettings(void);
|
||||
void loadInterfaceStyleSettings(void);
|
||||
void loadInterfaceMiscSettings(void);
|
||||
|
||||
void loadDefaultCoreSettings(void);
|
||||
@@ -73,6 +74,7 @@ class SettingsDialog : public QDialog, private Ui::SettingsDialog
|
||||
void loadDefaultHotkeySettings(void);
|
||||
void loadDefaultInterfaceEmulationSettings(void);
|
||||
void loadDefaultInterfaceRomBrowserSettings(void);
|
||||
void loadDefaultInterfaceStyleSettings(void);
|
||||
void loadDefaultInterfaceMiscSettings(void);
|
||||
|
||||
void saveSettings(void);
|
||||
@@ -86,16 +88,23 @@ class SettingsDialog : public QDialog, private Ui::SettingsDialog
|
||||
void saveHotkeySettings(void);
|
||||
void saveInterfaceEmulationSettings(void);
|
||||
void saveInterfaceRomBrowserSettings(void);
|
||||
void saveInterfaceStyleSettings(void);
|
||||
void saveInterfaceMiscSettings(void);
|
||||
|
||||
void commonHotkeySettings(int);
|
||||
void commonPluginSettings(int);
|
||||
void commonInterfaceStyleSettings(int);
|
||||
|
||||
void hideEmulationInfoText(void);
|
||||
|
||||
void chooseDirectory(QLineEdit *);
|
||||
void chooseIPLRom(QLineEdit *);
|
||||
|
||||
bool applyPluginSettings(void);
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent* event) Q_DECL_OVERRIDE;
|
||||
|
||||
private slots:
|
||||
void on_buttonBox_clicked(QAbstractButton *);
|
||||
|
||||
|
||||
@@ -195,13 +195,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="coreDebuggerCheckBox">
|
||||
<property name="text">
|
||||
<string>Debugger</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_7">
|
||||
<property name="orientation">
|
||||
@@ -626,13 +619,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_10">
|
||||
<property name="text">
|
||||
<string>About</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -661,13 +647,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_9">
|
||||
<property name="text">
|
||||
<string>About</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -696,13 +675,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_11">
|
||||
<property name="text">
|
||||
<string>About</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -737,13 +709,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_12">
|
||||
<property name="text">
|
||||
<string>About</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -829,13 +794,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_16">
|
||||
<property name="text">
|
||||
<string>About</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -855,13 +813,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_15">
|
||||
<property name="text">
|
||||
<string>About</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -881,13 +832,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_14">
|
||||
<property name="text">
|
||||
<string>About</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -916,13 +860,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_13">
|
||||
<property name="text">
|
||||
<string>About</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -1780,7 +1717,7 @@
|
||||
</widget>
|
||||
<widget class="QWidget" name="interfaceTab">
|
||||
<attribute name="title">
|
||||
<string>Interface</string>
|
||||
<string>User Interface</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_34">
|
||||
<item>
|
||||
@@ -1792,7 +1729,7 @@
|
||||
<attribute name="title">
|
||||
<string>Emulation Window</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="hideCursorCheckBox">
|
||||
<property name="text">
|
||||
@@ -1872,13 +1809,55 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="emulationInfoLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_85">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="SettingsDialog.qrc">:/newPrefix/Resource/Info.ico</pixmap>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_86">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="midLineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Changes will be applied on next emulation run</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::PlainText</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_2">
|
||||
<attribute name="title">
|
||||
<string>ROM Browser</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="searchSubDirectoriesCheckbox">
|
||||
<property name="text">
|
||||
@@ -1922,11 +1901,87 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_4">
|
||||
<attribute name="title">
|
||||
<string>Styles</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Custom Style</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="styleComboBox"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_9">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="emulationInfoLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_87">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="SettingsDialog.qrc">:/newPrefix/Resource/Info.ico</pixmap>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_89">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="midLineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Changes will be applied on next application run</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::PlainText</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_3">
|
||||
<attribute name="title">
|
||||
<string>Miscellaneous</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_8">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkForUpdatesCheckBox">
|
||||
<property name="text">
|
||||
@@ -1954,52 +2009,52 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="emulationInfoLayout_5">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_90">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="SettingsDialog.qrc">:/newPrefix/Resource/Info.ico</pixmap>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_91">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="midLineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Changes will be applied on next application run</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::PlainText</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="emulationInfoLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_85">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="SettingsDialog.qrc">:/newPrefix/Resource/Info.ico</pixmap>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_86">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="midLineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Changes will be applied on next emulation run</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::PlainText</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
using namespace UserInterface::Dialog;
|
||||
|
||||
UpdateDialog::UpdateDialog(QWidget *parent, QJsonObject jsonObject) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint)
|
||||
UpdateDialog::UpdateDialog(QWidget *parent, QJsonObject jsonObject) : QDialog(parent)
|
||||
{
|
||||
this->setupUi(this);
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include "UserInterface/EventFilter.hpp"
|
||||
#include "Utilities/QtKeyToSdl2Key.hpp"
|
||||
#include "Callbacks.hpp"
|
||||
#include "Config.hpp"
|
||||
#include "VidExt.hpp"
|
||||
|
||||
#include <RMG-Core/Core.hpp>
|
||||
@@ -46,7 +45,7 @@ MainWindow::~MainWindow()
|
||||
{
|
||||
}
|
||||
|
||||
bool MainWindow::Init(QGuiApplication* app)
|
||||
bool MainWindow::Init(QApplication* app)
|
||||
{
|
||||
if (!CoreInit())
|
||||
{
|
||||
@@ -60,7 +59,7 @@ bool MainWindow::Init(QGuiApplication* app)
|
||||
}
|
||||
|
||||
this->ui_Init();
|
||||
this->ui_Setup();
|
||||
this->ui_Setup(app);
|
||||
|
||||
this->ui_Actions_Init();
|
||||
this->ui_Actions_Connect();
|
||||
@@ -162,12 +161,11 @@ void MainWindow::ui_Init(void)
|
||||
&MainWindow::on_EventFilter_FileDropped);
|
||||
}
|
||||
|
||||
void MainWindow::ui_Setup(void)
|
||||
void MainWindow::ui_Setup(QApplication* app)
|
||||
{
|
||||
this->ui_Stylesheet_Setup();
|
||||
this->ui_Stylesheet_Setup(app);
|
||||
|
||||
this->setWindowIcon(this->ui_Icon);
|
||||
this->setWindowTitle(WINDOW_TITLE);
|
||||
this->setCentralWidget(this->ui_Widgets);
|
||||
|
||||
QString geometry;
|
||||
@@ -194,22 +192,38 @@ void MainWindow::ui_Setup(void)
|
||||
this->setFocusPolicy(Qt::FocusPolicy::StrongFocus);
|
||||
this->installEventFilter(this->ui_EventFilter);
|
||||
this->ui_Widget_OpenGL->installEventFilter(this->ui_EventFilter);
|
||||
|
||||
this->ui_WindowTitle = "Rosalie's Mupen GUI (";
|
||||
this->ui_WindowTitle += QString::fromStdString(CoreGetVersion());
|
||||
this->ui_WindowTitle += ")";
|
||||
|
||||
this->setWindowTitle(this->ui_WindowTitle);
|
||||
}
|
||||
|
||||
void MainWindow::ui_Stylesheet_Setup(void)
|
||||
void MainWindow::ui_Stylesheet_Setup(QApplication* app)
|
||||
{
|
||||
QString stylesheetFile;
|
||||
stylesheetFile = QString::fromStdString(CoreGetSharedDataDirectory().string());
|
||||
stylesheetFile += "/stylesheet.qss";
|
||||
QString fallbackStyleSheet = "QTableView { border: none; color: #0096d3; selection-color: #FFFFFF; selection-background-color: #0096d3; }";
|
||||
|
||||
QFile stylesheet(stylesheetFile);
|
||||
#ifndef _WIN32
|
||||
this->setStyleSheet(fallbackStyleSheet);
|
||||
#else // _WIN32
|
||||
QString styleFilePath = QString::fromStdString(CoreSettingsGetStringValue(SettingsID::GUI_Style));
|
||||
QFile styleFile(styleFilePath);
|
||||
|
||||
if (!stylesheet.open(QIODevice::ReadOnly))
|
||||
if (styleFilePath.isEmpty() || !styleFile.exists())
|
||||
{
|
||||
this->setStyleSheet(fallbackStyleSheet);
|
||||
return;
|
||||
}
|
||||
|
||||
this->setStyleSheet(stylesheet.readAll());
|
||||
if (!styleFile.open(QIODevice::ReadOnly))
|
||||
{
|
||||
this->setStyleSheet(fallbackStyleSheet);
|
||||
return;
|
||||
}
|
||||
|
||||
app->setStyleSheet(styleFile.readAll());
|
||||
#endif // _WIN32
|
||||
}
|
||||
|
||||
void MainWindow::ui_MessageBox(QString title, QString text, QString details = "")
|
||||
@@ -237,7 +251,7 @@ void MainWindow::ui_InEmulation(bool inEmulation, bool isPaused)
|
||||
|
||||
if (!settings.GoodName.empty())
|
||||
{
|
||||
this->setWindowTitle(QString::fromStdString(settings.GoodName) + QString(" - ") + QString(WINDOW_TITLE));
|
||||
this->setWindowTitle(QString::fromStdString(settings.GoodName) + QString(" - ") + this->ui_WindowTitle);
|
||||
}
|
||||
|
||||
this->ui_Widgets->setCurrentIndex(1);
|
||||
@@ -245,7 +259,7 @@ void MainWindow::ui_InEmulation(bool inEmulation, bool isPaused)
|
||||
}
|
||||
else if (!this->ui_NoSwitchToRomBrowser)
|
||||
{
|
||||
this->setWindowTitle(QString(WINDOW_TITLE));
|
||||
this->setWindowTitle(this->ui_WindowTitle);
|
||||
this->ui_Widgets->setCurrentIndex(0);
|
||||
this->ui_LoadGeometry();
|
||||
}
|
||||
@@ -479,7 +493,6 @@ void MainWindow::emulationThread_Launch(QString cartRom, QString diskRom)
|
||||
this->ui_HideCursorInEmulation = CoreSettingsGetBoolValue(SettingsID::GUI_HideCursorInEmulation);
|
||||
this->ui_HideCursorInFullscreenEmulation = CoreSettingsGetBoolValue(SettingsID::GUI_HideCursorInFullscreenEmulation);
|
||||
|
||||
this->ui_Widget_OpenGL->SetAllowResizing(this->ui_AllowManualResizing);
|
||||
this->ui_Widget_OpenGL->SetHideCursor(this->ui_HideCursorInEmulation);
|
||||
|
||||
this->emulationThread->SetRomFile(cartRom);
|
||||
@@ -860,7 +873,7 @@ void MainWindow::on_networkAccessManager_Finished(QNetworkReply* reply)
|
||||
QJsonDocument jsonDocument = QJsonDocument::fromJson(reply->readAll());
|
||||
QJsonObject jsonObject = jsonDocument.object();
|
||||
|
||||
QString currentVersion = QString(VERSION_STR);
|
||||
QString currentVersion = QString::fromStdString(CoreGetVersion());
|
||||
QString latestVersion = jsonObject.value("tag_name").toString();
|
||||
|
||||
reply->deleteLater();
|
||||
@@ -1399,7 +1412,7 @@ void MainWindow::on_VidExt_Init(void)
|
||||
|
||||
void MainWindow::on_VidExt_SetupOGL(QSurfaceFormat format, QThread* thread)
|
||||
{
|
||||
this->ui_Widget_OpenGL->MoveToThread(thread);
|
||||
this->ui_Widget_OpenGL->MoveContextToThread(thread);
|
||||
this->ui_Widget_OpenGL->setFormat(format);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include <QAction>
|
||||
#include <QCloseEvent>
|
||||
#include <QMainWindow>
|
||||
#include <QOpenGLWidget>
|
||||
#include <QSettings>
|
||||
#include <QStackedWidget>
|
||||
#include <QGuiApplication>
|
||||
@@ -44,7 +43,7 @@ class MainWindow : public QMainWindow
|
||||
MainWindow(void);
|
||||
~MainWindow(void);
|
||||
|
||||
bool Init(QGuiApplication*);
|
||||
bool Init(QApplication*);
|
||||
void OpenROM(QString, QString, bool);
|
||||
|
||||
private:
|
||||
@@ -117,11 +116,13 @@ class MainWindow : public QMainWindow
|
||||
|
||||
int ui_GamesharkButtonTimerId = 0;
|
||||
|
||||
QString ui_WindowTitle;
|
||||
|
||||
void closeEvent(QCloseEvent *) Q_DECL_OVERRIDE;
|
||||
|
||||
void ui_Init();
|
||||
void ui_Setup();
|
||||
void ui_Stylesheet_Setup();
|
||||
void ui_Setup(QApplication*);
|
||||
void ui_Stylesheet_Setup(QApplication*);
|
||||
void ui_MessageBox(QString, QString, QString);
|
||||
void ui_InEmulation(bool, bool);
|
||||
void ui_SaveGeometry(void);
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "OGLWidget.hpp"
|
||||
|
||||
#include <RMG-Core/Core.hpp>
|
||||
@@ -6,51 +15,40 @@ using namespace UserInterface::Widget;
|
||||
|
||||
OGLWidget::OGLWidget(QWidget *parent)
|
||||
{
|
||||
this->parent = parent;
|
||||
this->timerId = 0;
|
||||
this->widgetParent = parent;
|
||||
this->setSurfaceType(QWindow::OpenGLSurface);
|
||||
this->openGLcontext = new QOpenGLContext();
|
||||
}
|
||||
|
||||
OGLWidget::~OGLWidget(void)
|
||||
{
|
||||
this->openGLcontext->deleteLater();
|
||||
}
|
||||
|
||||
void OGLWidget::MoveToThread(QThread *thread)
|
||||
void OGLWidget::MoveContextToThread(QThread* thread)
|
||||
{
|
||||
this->doneCurrent();
|
||||
|
||||
this->context()->create();
|
||||
|
||||
this->context()->moveToThread(thread);
|
||||
this->GetContext()->doneCurrent();
|
||||
this->GetContext()->create();
|
||||
this->GetContext()->moveToThread(thread);
|
||||
}
|
||||
|
||||
void OGLWidget::SetAllowResizing(bool value)
|
||||
QOpenGLContext* OGLWidget::GetContext()
|
||||
{
|
||||
this->allowResizing = value;
|
||||
return this->openGLcontext;
|
||||
}
|
||||
|
||||
void OGLWidget::SetHideCursor(bool value)
|
||||
void OGLWidget::SetHideCursor(bool hide)
|
||||
{
|
||||
this->setCursor(value ? Qt::BlankCursor : Qt::ArrowCursor);
|
||||
this->setCursor(hide ? Qt::BlankCursor : Qt::ArrowCursor);
|
||||
}
|
||||
|
||||
QWidget *OGLWidget::GetWidget(void)
|
||||
{
|
||||
QWidget *widget = QWidget::createWindowContainer(this);
|
||||
widget->setParent(this->parent);
|
||||
return widget;
|
||||
}
|
||||
|
||||
void OGLWidget::exposeEvent(QExposeEvent *)
|
||||
{
|
||||
return QWidget::createWindowContainer(this, this->widgetParent);
|
||||
}
|
||||
|
||||
void OGLWidget::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
QOpenGLWindow::resizeEvent(event);
|
||||
|
||||
if (!this->allowResizing)
|
||||
return;
|
||||
|
||||
if (this->timerId != 0)
|
||||
{
|
||||
this->killTimer(this->timerId);
|
||||
@@ -61,8 +59,8 @@ void OGLWidget::resizeEvent(QResizeEvent *event)
|
||||
|
||||
// account for HiDPI scaling
|
||||
// see https://github.com/Rosalie241/RMG/issues/2
|
||||
this->width = event->size().width() * this->devicePixelRatioF();
|
||||
this->height = event->size().height() * this->devicePixelRatioF();
|
||||
this->width = event->size().width() * this->devicePixelRatio();
|
||||
this->height = event->size().height() * this->devicePixelRatio();
|
||||
}
|
||||
|
||||
void OGLWidget::timerEvent(QTimerEvent *event)
|
||||
@@ -72,5 +70,4 @@ void OGLWidget::timerEvent(QTimerEvent *event)
|
||||
// remove current timer
|
||||
this->killTimer(this->timerId);
|
||||
this->timerId = 0;
|
||||
this->requestActivate();
|
||||
}
|
||||
|
||||
@@ -1,40 +1,49 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef OGLWIDGET_HPP
|
||||
#define OGLWIDGET_HPP
|
||||
|
||||
#include <QOpenGLWidget>
|
||||
#include <QOpenGLWindow>
|
||||
#include <QResizeEvent>
|
||||
#include <QThread>
|
||||
#include <QResizeEvent>
|
||||
#include <QWindow>
|
||||
#include <QTimerEvent>
|
||||
#include <QOpenGLContext>
|
||||
#include <QWidget>
|
||||
|
||||
namespace UserInterface
|
||||
{
|
||||
namespace Widget
|
||||
{
|
||||
class OGLWidget : public QOpenGLWindow
|
||||
class OGLWidget : public QWindow
|
||||
{
|
||||
public:
|
||||
OGLWidget(QWidget *);
|
||||
~OGLWidget(void);
|
||||
|
||||
void MoveToThread(QThread *);
|
||||
void SetAllowResizing(bool);
|
||||
void SetHideCursor(bool);
|
||||
void MoveContextToThread(QThread* thread);
|
||||
QOpenGLContext* GetContext();
|
||||
|
||||
void SetHideCursor(bool hide);
|
||||
|
||||
QWidget *GetWidget(void);
|
||||
|
||||
protected:
|
||||
void exposeEvent(QExposeEvent *) Q_DECL_OVERRIDE;
|
||||
void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE;
|
||||
void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE;
|
||||
|
||||
private:
|
||||
QWidget *parent;
|
||||
bool allowResizing = false;
|
||||
int width;
|
||||
int height;
|
||||
int timerId;
|
||||
QWidget* widgetParent = nullptr;
|
||||
QOpenGLContext* openGLcontext = nullptr;
|
||||
int width = 0;
|
||||
int height = 0;
|
||||
int timerId = 0;
|
||||
};
|
||||
} // namespace Widget
|
||||
} // namespace UserInterface
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "RomBrowserWidget.hpp"
|
||||
#include "Config.hpp"
|
||||
#include "ColumnID.hpp"
|
||||
#include "UserInterface/Dialog/CheatsDialog.hpp"
|
||||
|
||||
|
||||
@@ -36,12 +36,12 @@ static void VidExt_OglSetup(void)
|
||||
{
|
||||
l_EmuThread->on_VidExt_SetupOGL(l_SurfaceFormat, QThread::currentThread());
|
||||
|
||||
while (!l_OGLWidget->isValid())
|
||||
while (!l_OGLWidget->GetContext()->isValid())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
l_OGLWidget->makeCurrent();
|
||||
l_OGLWidget->GetContext()->makeCurrent(l_OGLWidget);
|
||||
l_VidExtSetup = true;
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ static m64p_error VidExt_Init(void)
|
||||
|
||||
static m64p_error VidExt_Quit(void)
|
||||
{
|
||||
l_OGLWidget->MoveToThread(QApplication::instance()->thread());
|
||||
l_OGLWidget->MoveContextToThread(QApplication::instance()->thread());
|
||||
l_EmuThread->on_VidExt_Quit();
|
||||
l_VidExtSetup = false;
|
||||
|
||||
@@ -119,7 +119,7 @@ static m64p_error VidExt_SetMode(int Width, int Height, int BitsPerPixel, int Sc
|
||||
|
||||
static m64p_function VidExt_GLGetProc(const char *Proc)
|
||||
{
|
||||
return l_OGLWidget->context()->getProcAddress(Proc);
|
||||
return l_OGLWidget->GetContext()->getProcAddress(Proc);
|
||||
}
|
||||
|
||||
static m64p_error VidExt_GLSetAttr(m64p_GLattr Attr, int Value)
|
||||
@@ -253,8 +253,8 @@ static m64p_error VidExt_GLSwapBuf(void)
|
||||
return M64ERR_UNSUPPORTED;
|
||||
}
|
||||
|
||||
l_OGLWidget->context()->swapBuffers(l_OGLWidget);
|
||||
l_OGLWidget->context()->makeCurrent(l_OGLWidget);
|
||||
l_OGLWidget->GetContext()->swapBuffers(l_OGLWidget);
|
||||
l_OGLWidget->GetContext()->makeCurrent(l_OGLWidget);
|
||||
|
||||
return M64ERR_SUCCESS;
|
||||
}
|
||||
@@ -294,7 +294,7 @@ static m64p_error VidExt_ResizeWindow(int Width, int Height)
|
||||
|
||||
static uint32_t VidExt_GLGetDefaultFramebuffer(void)
|
||||
{
|
||||
return l_OGLWidget->context()->defaultFramebufferObject();
|
||||
return l_OGLWidget->GetContext()->defaultFramebufferObject();
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -8,13 +8,14 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include <UserInterface/MainWindow.hpp>
|
||||
#include <Config.hpp>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QCommandLineParser>
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
|
||||
#include <RMG-Core/Core.hpp>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
@@ -24,7 +25,7 @@ int main(int argc, char **argv)
|
||||
QDir::setCurrent(app.applicationDirPath());
|
||||
|
||||
QCoreApplication::setApplicationName("Rosalie's Mupen GUI");
|
||||
QCoreApplication::setApplicationVersion(VERSION_STR);
|
||||
QCoreApplication::setApplicationVersion(QString::fromStdString(CoreGetVersion()));
|
||||
|
||||
// setup commandline parser
|
||||
QCommandLineParser parser;
|
||||
|
||||
@@ -38,7 +38,7 @@ do
|
||||
done < <(find "$bin_dir" -name "*.$ext")
|
||||
done
|
||||
|
||||
windeployqt "$exe"
|
||||
windeployqt-qt6 "$exe"
|
||||
|
||||
# needed by Qt at runtime
|
||||
cp "$path/libcrypto-1_1-x64.dll" "$bin_dir/"
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
script_dir="$(dirname "$0")"
|
||||
toplvl_dir="$(realpath "$script_dir/../../")"
|
||||
tmp_dir="$toplvl_dir/Build/RMG-Dark-Style/"
|
||||
target_styles_dir="$toplvl_dir/Bin/Release/Data/Styles/"
|
||||
|
||||
mkdir -p "$target_styles_dir"
|
||||
rm -rf "$tmp_dir"
|
||||
|
||||
git clone https://github.com/Rosalie241/Dolphin-Dark-Mode/ "$tmp_dir" -b RMG
|
||||
|
||||
cp -r "$tmp_dir/Data/Styles"/* "$target_styles_dir/"
|
||||