From 5980aa1e51edf2261746acf10f7d9be0406caaed Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 29 Jul 2019 16:06:33 -0400 Subject: yuzu/CMakeLists: Remove qt5_wrap_ui macro usage We can simply enable CMAKE_AUTOUIC and let CMake take care of handling the UI code generation for targets. As part of letting CMake automatically handle the header file parsing, we must not name includes with "ui_*" unless they're related to the output of the Qt UIC compiler. Because of this, we need to rename ui_settings, given it would conflict with this restriction. --- src/yuzu/CMakeLists.txt | 55 +++++++-------- src/yuzu/configuration/config.cpp | 2 +- src/yuzu/configuration/configure_debug.cpp | 2 +- src/yuzu/configuration/configure_gamelist.cpp | 2 +- src/yuzu/configuration/configure_general.cpp | 2 +- src/yuzu/configuration/configure_input_simple.cpp | 2 +- src/yuzu/configuration/configure_per_general.cpp | 2 +- src/yuzu/configuration/configure_web.cpp | 2 +- src/yuzu/debugger/console.cpp | 2 +- src/yuzu/game_list.cpp | 2 +- src/yuzu/game_list_p.h | 2 +- src/yuzu/game_list_worker.cpp | 2 +- src/yuzu/hotkeys.cpp | 2 +- src/yuzu/main.cpp | 2 +- src/yuzu/ui_settings.cpp | 15 ---- src/yuzu/ui_settings.h | 86 ----------------------- src/yuzu/uisettings.cpp | 15 ++++ src/yuzu/uisettings.h | 86 +++++++++++++++++++++++ 18 files changed, 139 insertions(+), 144 deletions(-) delete mode 100644 src/yuzu/ui_settings.cpp delete mode 100644 src/yuzu/ui_settings.h create mode 100644 src/yuzu/uisettings.cpp create mode 100644 src/yuzu/uisettings.h diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txt index 3dc0e47d0..f051e17b4 100644 --- a/src/yuzu/CMakeLists.txt +++ b/src/yuzu/CMakeLists.txt @@ -1,5 +1,6 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules) @@ -7,6 +8,7 @@ add_executable(yuzu Info.plist about_dialog.cpp about_dialog.h + aboutdialog.ui applets/error.cpp applets/error.h applets/profile_select.cpp @@ -17,42 +19,59 @@ add_executable(yuzu applets/web_browser.h bootmanager.cpp bootmanager.h + compatdb.ui compatibility_list.cpp compatibility_list.h configuration/config.cpp configuration/config.h + configuration/configure.ui configuration/configure_audio.cpp configuration/configure_audio.h + configuration/configure_audio.ui configuration/configure_debug.cpp configuration/configure_debug.h + configuration/configure_debug.ui configuration/configure_dialog.cpp configuration/configure_dialog.h configuration/configure_gamelist.cpp configuration/configure_gamelist.h + configuration/configure_gamelist.ui configuration/configure_general.cpp configuration/configure_general.h + configuration/configure_general.ui configuration/configure_graphics.cpp configuration/configure_graphics.h + configuration/configure_graphics.ui configuration/configure_hotkeys.cpp configuration/configure_hotkeys.h + configuration/configure_hotkeys.ui configuration/configure_input.cpp configuration/configure_input.h + configuration/configure_input.ui configuration/configure_input_player.cpp configuration/configure_input_player.h + configuration/configure_input_player.ui configuration/configure_input_simple.cpp configuration/configure_input_simple.h + configuration/configure_input_simple.ui configuration/configure_mouse_advanced.cpp configuration/configure_mouse_advanced.h + configuration/configure_mouse_advanced.ui + configuration/configure_per_general.cpp + configuration/configure_per_general.h + configuration/configure_per_general.ui configuration/configure_profile_manager.cpp configuration/configure_profile_manager.h + configuration/configure_profile_manager.ui configuration/configure_system.cpp configuration/configure_system.h - configuration/configure_per_general.cpp - configuration/configure_per_general.h + configuration/configure_system.ui configuration/configure_touchscreen_advanced.cpp configuration/configure_touchscreen_advanced.h + configuration/configure_touchscreen_advanced.ui configuration/configure_web.cpp configuration/configure_web.h + configuration/configure_web.ui debugger/graphics/graphics_breakpoint_observer.cpp debugger/graphics/graphics_breakpoint_observer.h debugger/graphics/graphics_breakpoints.cpp @@ -72,12 +91,14 @@ add_executable(yuzu game_list_worker.h loading_screen.cpp loading_screen.h + loading_screen.ui hotkeys.cpp hotkeys.h main.cpp main.h - ui_settings.cpp - ui_settings.h + main.ui + uisettings.cpp + uisettings.h util/limitable_input_dialog.cpp util/limitable_input_dialog.h util/sequence_dialog/sequence_dialog.cpp @@ -89,44 +110,18 @@ add_executable(yuzu yuzu.rc ) -set(UIS - aboutdialog.ui - configuration/configure.ui - configuration/configure_audio.ui - configuration/configure_debug.ui - configuration/configure_gamelist.ui - configuration/configure_general.ui - configuration/configure_graphics.ui - configuration/configure_hotkeys.ui - configuration/configure_input.ui - configuration/configure_input_player.ui - configuration/configure_input_simple.ui - configuration/configure_mouse_advanced.ui - configuration/configure_per_general.ui - configuration/configure_profile_manager.ui - configuration/configure_system.ui - configuration/configure_touchscreen_advanced.ui - configuration/configure_web.ui - compatdb.ui - loading_screen.ui - main.ui -) - file(GLOB COMPAT_LIST ${PROJECT_BINARY_DIR}/dist/compatibility_list/compatibility_list.qrc ${PROJECT_BINARY_DIR}/dist/compatibility_list/compatibility_list.json) file(GLOB_RECURSE ICONS ${PROJECT_SOURCE_DIR}/dist/icons/*) file(GLOB_RECURSE THEMES ${PROJECT_SOURCE_DIR}/dist/qt_themes/*) -qt5_wrap_ui(UI_HDRS ${UIS}) target_sources(yuzu PRIVATE ${COMPAT_LIST} ${ICONS} ${THEMES} - ${UI_HDRS} - ${UIS} ) if (APPLE) diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index b7f3fdf75..5d0fb3f9f 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp @@ -11,7 +11,7 @@ #include "core/hle/service/hid/controllers/npad.h" #include "input_common/main.h" #include "yuzu/configuration/config.h" -#include "yuzu/ui_settings.h" +#include "yuzu/uisettings.h" Config::Config() { // TODO: Don't hardcode the path; let the frontend decide where to put the config files. diff --git a/src/yuzu/configuration/configure_debug.cpp b/src/yuzu/configuration/configure_debug.cpp index 9a13bb797..d8d2c44f7 100644 --- a/src/yuzu/configuration/configure_debug.cpp +++ b/src/yuzu/configuration/configure_debug.cpp @@ -12,7 +12,7 @@ #include "ui_configure_debug.h" #include "yuzu/configuration/configure_debug.h" #include "yuzu/debugger/console.h" -#include "yuzu/ui_settings.h" +#include "yuzu/uisettings.h" ConfigureDebug::ConfigureDebug(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureDebug) { ui->setupUi(this); diff --git a/src/yuzu/configuration/configure_gamelist.cpp b/src/yuzu/configuration/configure_gamelist.cpp index d1724ba89..daedbc33e 100644 --- a/src/yuzu/configuration/configure_gamelist.cpp +++ b/src/yuzu/configuration/configure_gamelist.cpp @@ -9,7 +9,7 @@ #include "core/settings.h" #include "ui_configure_gamelist.h" #include "yuzu/configuration/configure_gamelist.h" -#include "yuzu/ui_settings.h" +#include "yuzu/uisettings.h" namespace { constexpr std::array default_icon_sizes{ diff --git a/src/yuzu/configuration/configure_general.cpp b/src/yuzu/configuration/configure_general.cpp index 7a6e921cd..75fcbfea3 100644 --- a/src/yuzu/configuration/configure_general.cpp +++ b/src/yuzu/configuration/configure_general.cpp @@ -6,7 +6,7 @@ #include "core/settings.h" #include "ui_configure_general.h" #include "yuzu/configuration/configure_general.h" -#include "yuzu/ui_settings.h" +#include "yuzu/uisettings.h" ConfigureGeneral::ConfigureGeneral(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureGeneral) { diff --git a/src/yuzu/configuration/configure_input_simple.cpp b/src/yuzu/configuration/configure_input_simple.cpp index 864803ea3..cb856a312 100644 --- a/src/yuzu/configuration/configure_input_simple.cpp +++ b/src/yuzu/configuration/configure_input_simple.cpp @@ -9,7 +9,7 @@ #include "yuzu/configuration/configure_input.h" #include "yuzu/configuration/configure_input_player.h" #include "yuzu/configuration/configure_input_simple.h" -#include "yuzu/ui_settings.h" +#include "yuzu/uisettings.h" namespace { diff --git a/src/yuzu/configuration/configure_per_general.cpp b/src/yuzu/configuration/configure_per_general.cpp index 90336e235..d7f259f12 100644 --- a/src/yuzu/configuration/configure_per_general.cpp +++ b/src/yuzu/configuration/configure_per_general.cpp @@ -23,7 +23,7 @@ #include "yuzu/configuration/config.h" #include "yuzu/configuration/configure_input.h" #include "yuzu/configuration/configure_per_general.h" -#include "yuzu/ui_settings.h" +#include "yuzu/uisettings.h" #include "yuzu/util/util.h" ConfigurePerGameGeneral::ConfigurePerGameGeneral(QWidget* parent, u64 title_id) diff --git a/src/yuzu/configuration/configure_web.cpp b/src/yuzu/configuration/configure_web.cpp index 5a70ef168..336b062b3 100644 --- a/src/yuzu/configuration/configure_web.cpp +++ b/src/yuzu/configuration/configure_web.cpp @@ -9,7 +9,7 @@ #include "core/telemetry_session.h" #include "ui_configure_web.h" #include "yuzu/configuration/configure_web.h" -#include "yuzu/ui_settings.h" +#include "yuzu/uisettings.h" ConfigureWeb::ConfigureWeb(QWidget* parent) : QWidget(parent), ui(std::make_unique()) { diff --git a/src/yuzu/debugger/console.cpp b/src/yuzu/debugger/console.cpp index 320898f6a..207ff4d58 100644 --- a/src/yuzu/debugger/console.cpp +++ b/src/yuzu/debugger/console.cpp @@ -10,7 +10,7 @@ #include "common/logging/backend.h" #include "yuzu/debugger/console.h" -#include "yuzu/ui_settings.h" +#include "yuzu/uisettings.h" namespace Debugger { void ToggleConsole() { diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp index 1885587af..d18b96519 100644 --- a/src/yuzu/game_list.cpp +++ b/src/yuzu/game_list.cpp @@ -23,7 +23,7 @@ #include "yuzu/game_list_p.h" #include "yuzu/game_list_worker.h" #include "yuzu/main.h" -#include "yuzu/ui_settings.h" +#include "yuzu/uisettings.h" GameListSearchField::KeyReleaseEater::KeyReleaseEater(GameList* gamelist) : gamelist{gamelist} {} diff --git a/src/yuzu/game_list_p.h b/src/yuzu/game_list_p.h index 0b458ef48..ece534dd6 100644 --- a/src/yuzu/game_list_p.h +++ b/src/yuzu/game_list_p.h @@ -19,7 +19,7 @@ #include "common/common_types.h" #include "common/logging/log.h" #include "common/string_util.h" -#include "yuzu/ui_settings.h" +#include "yuzu/uisettings.h" #include "yuzu/util/util.h" /** diff --git a/src/yuzu/game_list_worker.cpp b/src/yuzu/game_list_worker.cpp index 4f30e9147..77f358630 100644 --- a/src/yuzu/game_list_worker.cpp +++ b/src/yuzu/game_list_worker.cpp @@ -29,7 +29,7 @@ #include "yuzu/game_list.h" #include "yuzu/game_list_p.h" #include "yuzu/game_list_worker.h" -#include "yuzu/ui_settings.h" +#include "yuzu/uisettings.h" namespace { diff --git a/src/yuzu/hotkeys.cpp b/src/yuzu/hotkeys.cpp index 4582e7f21..d4e97fa16 100644 --- a/src/yuzu/hotkeys.cpp +++ b/src/yuzu/hotkeys.cpp @@ -7,7 +7,7 @@ #include #include #include "yuzu/hotkeys.h" -#include "yuzu/ui_settings.h" +#include "yuzu/uisettings.h" HotkeyRegistry::HotkeyRegistry() = default; HotkeyRegistry::~HotkeyRegistry() = default; diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index ae21f4753..f9c1c5e46 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -100,7 +100,7 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual #include "yuzu/hotkeys.h" #include "yuzu/loading_screen.h" #include "yuzu/main.h" -#include "yuzu/ui_settings.h" +#include "yuzu/uisettings.h" #ifdef USE_DISCORD_PRESENCE #include "yuzu/discord_impl.h" diff --git a/src/yuzu/ui_settings.cpp b/src/yuzu/ui_settings.cpp deleted file mode 100644 index 4bdc302e0..000000000 --- a/src/yuzu/ui_settings.cpp +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2016 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#include "ui_settings.h" - -namespace UISettings { - -const Themes themes{{ - {"Default", "default"}, - {"Dark", "qdarkstyle"}, -}}; - -Values values = {}; -} // namespace UISettings diff --git a/src/yuzu/ui_settings.h b/src/yuzu/ui_settings.h deleted file mode 100644 index a62cd6911..000000000 --- a/src/yuzu/ui_settings.h +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2016 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include -#include -#include -#include -#include -#include -#include "common/common_types.h" - -namespace UISettings { - -using ContextualShortcut = std::pair; - -struct Shortcut { - QString name; - QString group; - ContextualShortcut shortcut; -}; - -using Themes = std::array, 2>; -extern const Themes themes; - -struct Values { - QByteArray geometry; - QByteArray state; - - QByteArray renderwindow_geometry; - - QByteArray gamelist_header_state; - - QByteArray microprofile_geometry; - bool microprofile_visible; - - bool single_window_mode; - bool fullscreen; - bool display_titlebar; - bool show_filter_bar; - bool show_status_bar; - - bool confirm_before_closing; - bool first_start; - - bool select_user_on_boot; - - // Discord RPC - bool enable_discord_presence; - - u16 screenshot_resolution_factor; - - QString roms_path; - QString symbols_path; - QString screenshot_path; - QString game_directory_path; - bool game_directory_deepscan; - QStringList recent_files; - - QString theme; - - // Shortcut name - std::vector shortcuts; - - uint32_t callout_flags; - - // logging - bool show_console; - - // Controllers - int profile_index; - - // Game List - bool show_unknown; - bool show_add_ons; - uint32_t icon_size; - uint8_t row_1_text_id; - uint8_t row_2_text_id; - std::atomic_bool is_game_list_reload_pending{false}; - bool cache_game_list; -}; - -extern Values values; -} // namespace UISettings diff --git a/src/yuzu/uisettings.cpp b/src/yuzu/uisettings.cpp new file mode 100644 index 000000000..7f7d247a3 --- /dev/null +++ b/src/yuzu/uisettings.cpp @@ -0,0 +1,15 @@ +// Copyright 2016 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include "yuzu/uisettings.h" + +namespace UISettings { + +const Themes themes{{ + {"Default", "default"}, + {"Dark", "qdarkstyle"}, +}}; + +Values values = {}; +} // namespace UISettings diff --git a/src/yuzu/uisettings.h b/src/yuzu/uisettings.h new file mode 100644 index 000000000..a62cd6911 --- /dev/null +++ b/src/yuzu/uisettings.h @@ -0,0 +1,86 @@ +// Copyright 2016 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include +#include +#include +#include +#include +#include +#include "common/common_types.h" + +namespace UISettings { + +using ContextualShortcut = std::pair; + +struct Shortcut { + QString name; + QString group; + ContextualShortcut shortcut; +}; + +using Themes = std::array, 2>; +extern const Themes themes; + +struct Values { + QByteArray geometry; + QByteArray state; + + QByteArray renderwindow_geometry; + + QByteArray gamelist_header_state; + + QByteArray microprofile_geometry; + bool microprofile_visible; + + bool single_window_mode; + bool fullscreen; + bool display_titlebar; + bool show_filter_bar; + bool show_status_bar; + + bool confirm_before_closing; + bool first_start; + + bool select_user_on_boot; + + // Discord RPC + bool enable_discord_presence; + + u16 screenshot_resolution_factor; + + QString roms_path; + QString symbols_path; + QString screenshot_path; + QString game_directory_path; + bool game_directory_deepscan; + QStringList recent_files; + + QString theme; + + // Shortcut name + std::vector shortcuts; + + uint32_t callout_flags; + + // logging + bool show_console; + + // Controllers + int profile_index; + + // Game List + bool show_unknown; + bool show_add_ons; + uint32_t icon_size; + uint8_t row_1_text_id; + uint8_t row_2_text_id; + std::atomic_bool is_game_list_reload_pending{false}; + bool cache_game_list; +}; + +extern Values values; +} // namespace UISettings -- cgit v1.2.3