Use unique_ptr on all ui objects from .ui files (#5511)

* Forward declare ui and use unique_ptr

* ConfigureEnhancements: use unique_ptr for ui

* Use make_unique instead of new where applicable

* Move some of the ui includes that already used unique_ptr

* main.cpp: also make use of make_unique on Config

* Address review comments
This commit is contained in:
Vitor K 2020-09-30 22:23:01 -03:00 committed by GitHub
parent a576eb633f
commit a26b466ac8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 257 additions and 229 deletions

View File

@ -9,7 +9,7 @@
AboutDialog::AboutDialog(QWidget* parent) AboutDialog::AboutDialog(QWidget* parent)
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::WindowSystemMenuHint), : QDialog(parent, Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::WindowSystemMenuHint),
ui(new Ui::AboutDialog) { ui(std::make_unique<Ui::AboutDialog>()) {
ui->setupUi(this); ui->setupUi(this);
ui->labelLogo->setPixmap(QIcon::fromTheme(QStringLiteral("citra")).pixmap(200)); ui->labelLogo->setPixmap(QIcon::fromTheme(QStringLiteral("citra")).pixmap(200));
ui->labelBuildInfo->setText(ui->labelBuildInfo->text().arg( ui->labelBuildInfo->setText(ui->labelBuildInfo->text().arg(

View File

@ -15,7 +15,8 @@
#include "core/settings.h" #include "core/settings.h"
#include "ui_configure_debug.h" #include "ui_configure_debug.h"
ConfigureDebug::ConfigureDebug(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureDebug) { ConfigureDebug::ConfigureDebug(QWidget* parent)
: QWidget(parent), ui(std::make_unique<Ui::ConfigureDebug>()) {
ui->setupUi(this); ui->setupUi(this);
SetConfiguration(); SetConfiguration();

View File

@ -11,7 +11,7 @@
#include "ui_configure.h" #include "ui_configure.h"
ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry, bool enable_web_config) ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry, bool enable_web_config)
: QDialog(parent), ui(new Ui::ConfigureDialog), registry(registry) { : QDialog(parent), ui(std::make_unique<Ui::ConfigureDialog>()), registry(registry) {
ui->setupUi(this); ui->setupUi(this);
ui->hotkeysTab->Populate(registry); ui->hotkeysTab->Populate(registry);
ui->webTab->SetWebServiceConfigEnabled(enable_web_config); ui->webTab->SetWebServiceConfigEnabled(enable_web_config);

View File

@ -11,7 +11,7 @@
#include "video_core/renderer_opengl/texture_filters/texture_filterer.h" #include "video_core/renderer_opengl/texture_filters/texture_filterer.h"
ConfigureEnhancements::ConfigureEnhancements(QWidget* parent) ConfigureEnhancements::ConfigureEnhancements(QWidget* parent)
: QWidget(parent), ui(new Ui::ConfigureEnhancements) { : QWidget(parent), ui(std::make_unique<Ui::ConfigureEnhancements>()) {
ui->setupUi(this); ui->setupUi(this);
for (const auto& filter : OpenGL::TextureFilterer::GetFilterNames()) for (const auto& filter : OpenGL::TextureFilterer::GetFilterNames())
@ -128,6 +128,4 @@ void ConfigureEnhancements::ApplyConfiguration() {
Settings::values.bg_blue = static_cast<float>(bg_color.blueF()); Settings::values.bg_blue = static_cast<float>(bg_color.blueF());
} }
ConfigureEnhancements::~ConfigureEnhancements() { ConfigureEnhancements::~ConfigureEnhancements() {}
delete ui;
}

View File

@ -4,6 +4,7 @@
#pragma once #pragma once
#include <memory>
#include <QWidget> #include <QWidget>
namespace Settings { namespace Settings {
@ -29,6 +30,6 @@ private:
void updateShaders(Settings::StereoRenderOption stereo_option); void updateShaders(Settings::StereoRenderOption stereo_option);
void updateTextureFilter(int index); void updateTextureFilter(int index);
Ui::ConfigureEnhancements* ui; std::unique_ptr<Ui::ConfigureEnhancements> ui;
QColor bg_color; QColor bg_color;
}; };

View File

@ -21,7 +21,7 @@ static constexpr int SettingsToSlider(int value) {
} }
ConfigureGeneral::ConfigureGeneral(QWidget* parent) ConfigureGeneral::ConfigureGeneral(QWidget* parent)
: QWidget(parent), ui(new Ui::ConfigureGeneral) { : QWidget(parent), ui(std::make_unique<Ui::ConfigureGeneral>()) {
ui->setupUi(this); ui->setupUi(this);

View File

@ -13,7 +13,7 @@
#include "video_core/renderer_opengl/post_processing_opengl.h" #include "video_core/renderer_opengl/post_processing_opengl.h"
ConfigureGraphics::ConfigureGraphics(QWidget* parent) ConfigureGraphics::ConfigureGraphics(QWidget* parent)
: QWidget(parent), ui(new Ui::ConfigureGraphics) { : QWidget(parent), ui(std::make_unique<Ui::ConfigureGraphics>()) {
ui->setupUi(this); ui->setupUi(this);
SetConfiguration(); SetConfiguration();

View File

@ -6,13 +6,17 @@
#include <memory> #include <memory>
#include <utility> #include <utility>
#include <QInputDialog> #include <QInputDialog>
#include <QKeyEvent>
#include <QLabel>
#include <QMenu> #include <QMenu>
#include <QMessageBox> #include <QMessageBox>
#include <QSlider>
#include <QTimer> #include <QTimer>
#include "citra_qt/configuration/config.h" #include "citra_qt/configuration/config.h"
#include "citra_qt/configuration/configure_input.h" #include "citra_qt/configuration/configure_input.h"
#include "citra_qt/configuration/configure_motion_touch.h" #include "citra_qt/configuration/configure_motion_touch.h"
#include "common/param_package.h" #include "common/param_package.h"
#include "ui_configure_input.h"
const std::array<std::string, ConfigureInput::ANALOG_SUB_BUTTONS_NUM> const std::array<std::string, ConfigureInput::ANALOG_SUB_BUTTONS_NUM>
ConfigureInput::analog_sub_buttons{{ ConfigureInput::analog_sub_buttons{{

View File

@ -10,16 +10,16 @@
#include <optional> #include <optional>
#include <string> #include <string>
#include <unordered_map> #include <unordered_map>
#include <QKeyEvent>
#include <QKeySequence> #include <QKeySequence>
#include <QSlider>
#include <QWidget> #include <QWidget>
#include "common/param_package.h" #include "common/param_package.h"
#include "core/settings.h" #include "core/settings.h"
#include "input_common/main.h" #include "input_common/main.h"
#include "ui_configure_input.h"
class QKeyEvent;
class QLabel;
class QPushButton; class QPushButton;
class QSlider;
class QString; class QString;
class QTimer; class QTimer;

View File

@ -228,7 +228,8 @@ static constexpr int SettingsToSlider(int value) {
return (value - 5) / 5; return (value - 5) / 5;
} }
ConfigureSystem::ConfigureSystem(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureSystem) { ConfigureSystem::ConfigureSystem(QWidget* parent)
: QWidget(parent), ui(std::make_unique<Ui::ConfigureSystem>()) {
ui->setupUi(this); ui->setupUi(this);
connect(ui->combo_birthmonth, connect(ui->combo_birthmonth,
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,

View File

@ -7,7 +7,8 @@
#include "citra_qt/uisettings.h" #include "citra_qt/uisettings.h"
#include "ui_configure_ui.h" #include "ui_configure_ui.h"
ConfigureUi::ConfigureUi(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureUi) { ConfigureUi::ConfigureUi(QWidget* parent)
: QWidget(parent), ui(std::make_unique<Ui::ConfigureUi>()) {
ui->setupUi(this); ui->setupUi(this);
InitializeLanguageComboBox(); InitializeLanguageComboBox();

View File

@ -7,11 +7,13 @@
#include "citra_qt/util/util.h" #include "citra_qt/util/util.h"
#include "core/arm/arm_interface.h" #include "core/arm/arm_interface.h"
#include "core/core.h" #include "core/core.h"
#include "ui_registers.h"
RegistersWidget::RegistersWidget(QWidget* parent) : QDockWidget(parent) { RegistersWidget::RegistersWidget(QWidget* parent)
cpu_regs_ui.setupUi(this); : QDockWidget(parent), cpu_regs_ui(std::make_unique<Ui::ARMRegisters>()) {
cpu_regs_ui->setupUi(this);
tree = cpu_regs_ui.treeWidget; tree = cpu_regs_ui->treeWidget;
tree->addTopLevelItem(core_registers = new QTreeWidgetItem(QStringList(tr("Registers")))); tree->addTopLevelItem(core_registers = new QTreeWidgetItem(QStringList(tr("Registers"))));
tree->addTopLevelItem(vfp_registers = new QTreeWidgetItem(QStringList(tr("VFP Registers")))); tree->addTopLevelItem(vfp_registers = new QTreeWidgetItem(QStringList(tr("VFP Registers"))));
tree->addTopLevelItem(vfp_system_registers = tree->addTopLevelItem(vfp_system_registers =
@ -57,6 +59,8 @@ RegistersWidget::RegistersWidget(QWidget* parent) : QDockWidget(parent) {
setEnabled(false); setEnabled(false);
} }
RegistersWidget::~RegistersWidget() = default;
void RegistersWidget::OnDebugModeEntered() { void RegistersWidget::OnDebugModeEntered() {
if (!Core::System::GetInstance().IsPoweredOn()) if (!Core::System::GetInstance().IsPoweredOn())
return; return;

View File

@ -4,18 +4,23 @@
#pragma once #pragma once
#include <memory>
#include <QDockWidget> #include <QDockWidget>
#include "ui_registers.h"
class QTreeWidget; class QTreeWidget;
class QTreeWidgetItem; class QTreeWidgetItem;
class EmuThread; class EmuThread;
namespace Ui {
class ARMRegisters;
}
class RegistersWidget : public QDockWidget { class RegistersWidget : public QDockWidget {
Q_OBJECT Q_OBJECT
public: public:
explicit RegistersWidget(QWidget* parent = nullptr); explicit RegistersWidget(QWidget* parent = nullptr);
~RegistersWidget();
public slots: public slots:
void OnDebugModeEntered(); void OnDebugModeEntered();
@ -31,7 +36,7 @@ private:
void CreateVFPSystemRegisterChildren(); void CreateVFPSystemRegisterChildren();
void UpdateVFPSystemRegisterValues(); void UpdateVFPSystemRegisterValues();
Ui::ARMRegisters cpu_regs_ui; std::unique_ptr<Ui::ARMRegisters> cpu_regs_ui;
QTreeWidget* tree; QTreeWidget* tree;

View File

@ -83,6 +83,7 @@
#include "core/savestate.h" #include "core/savestate.h"
#include "core/settings.h" #include "core/settings.h"
#include "game_list_p.h" #include "game_list_p.h"
#include "ui_main.h"
#include "video_core/renderer_base.h" #include "video_core/renderer_base.h"
#include "video_core/video_core.h" #include "video_core/video_core.h"
@ -147,7 +148,9 @@ static void InitializeLogging() {
#endif #endif
} }
GMainWindow::GMainWindow() : config(new Config()), emu_thread(nullptr) { GMainWindow::GMainWindow()
: config(std::make_unique<Config>()), emu_thread(nullptr),
ui(std::make_unique<Ui::MainWindow>()) {
InitializeLogging(); InitializeLogging();
Debugger::ToggleConsole(); Debugger::ToggleConsole();
Settings::LogSettings(); Settings::LogSettings();
@ -160,7 +163,7 @@ GMainWindow::GMainWindow() : config(new Config()), emu_thread(nullptr) {
Pica::g_debug_context = Pica::DebugContext::Construct(); Pica::g_debug_context = Pica::DebugContext::Construct();
setAcceptDrops(true); setAcceptDrops(true);
ui.setupUi(this); ui->setupUi(this);
statusBar()->hide(); statusBar()->hide();
default_theme_paths = QIcon::themeSearchPaths(); default_theme_paths = QIcon::themeSearchPaths();
@ -201,12 +204,12 @@ GMainWindow::GMainWindow() : config(new Config()), emu_thread(nullptr) {
ShowTelemetryCallout(); ShowTelemetryCallout();
// make sure menubar has the arrow cursor instead of inheriting from this // make sure menubar has the arrow cursor instead of inheriting from this
ui.menubar->setCursor(QCursor()); ui->menubar->setCursor(QCursor());
statusBar()->setCursor(QCursor()); statusBar()->setCursor(QCursor());
mouse_hide_timer.setInterval(default_mouse_timeout); mouse_hide_timer.setInterval(default_mouse_timeout);
connect(&mouse_hide_timer, &QTimer::timeout, this, &GMainWindow::HideMouseCursor); connect(&mouse_hide_timer, &QTimer::timeout, this, &GMainWindow::HideMouseCursor);
connect(ui.menubar, &QMenuBar::hovered, this, &GMainWindow::ShowMouseCursor); connect(ui->menubar, &QMenuBar::hovered, this, &GMainWindow::ShowMouseCursor);
if (UISettings::values.check_for_update_on_start) { if (UISettings::values.check_for_update_on_start) {
CheckForUpdates(); CheckForUpdates();
@ -229,21 +232,21 @@ GMainWindow::~GMainWindow() {
void GMainWindow::InitializeWidgets() { void GMainWindow::InitializeWidgets() {
#ifdef CITRA_ENABLE_COMPATIBILITY_REPORTING #ifdef CITRA_ENABLE_COMPATIBILITY_REPORTING
ui.action_Report_Compatibility->setVisible(true); ui->action_Report_Compatibility->setVisible(true);
#endif #endif
render_window = new GRenderWindow(this, emu_thread.get()); render_window = new GRenderWindow(this, emu_thread.get());
render_window->hide(); render_window->hide();
game_list = new GameList(this); game_list = new GameList(this);
ui.horizontalLayout->addWidget(game_list); ui->horizontalLayout->addWidget(game_list);
game_list_placeholder = new GameListPlaceholder(this); game_list_placeholder = new GameListPlaceholder(this);
ui.horizontalLayout->addWidget(game_list_placeholder); ui->horizontalLayout->addWidget(game_list_placeholder);
game_list_placeholder->setVisible(false); game_list_placeholder->setVisible(false);
loading_screen = new LoadingScreen(this); loading_screen = new LoadingScreen(this);
loading_screen->hide(); loading_screen->hide();
ui.horizontalLayout->addWidget(loading_screen); ui->horizontalLayout->addWidget(loading_screen);
connect(loading_screen, &LoadingScreen::Hidden, [&] { connect(loading_screen, &LoadingScreen::Hidden, [&] {
loading_screen->Clear(); loading_screen->Clear();
if (emulation_running) { if (emulation_running) {
@ -252,8 +255,8 @@ void GMainWindow::InitializeWidgets() {
} }
}); });
multiplayer_state = new MultiplayerState(this, game_list->GetModel(), ui.action_Leave_Room, multiplayer_state = new MultiplayerState(this, game_list->GetModel(), ui->action_Leave_Room,
ui.action_Show_Room); ui->action_Show_Room);
multiplayer_state->setVisible(false); multiplayer_state->setVisible(false);
// Setup updater // Setup updater
@ -298,17 +301,17 @@ void GMainWindow::InitializeWidgets() {
setStyleSheet(QStringLiteral("QStatusBar::item{border: none;}")); setStyleSheet(QStringLiteral("QStatusBar::item{border: none;}"));
QActionGroup* actionGroup_ScreenLayouts = new QActionGroup(this); QActionGroup* actionGroup_ScreenLayouts = new QActionGroup(this);
actionGroup_ScreenLayouts->addAction(ui.action_Screen_Layout_Default); actionGroup_ScreenLayouts->addAction(ui->action_Screen_Layout_Default);
actionGroup_ScreenLayouts->addAction(ui.action_Screen_Layout_Single_Screen); actionGroup_ScreenLayouts->addAction(ui->action_Screen_Layout_Single_Screen);
actionGroup_ScreenLayouts->addAction(ui.action_Screen_Layout_Large_Screen); actionGroup_ScreenLayouts->addAction(ui->action_Screen_Layout_Large_Screen);
actionGroup_ScreenLayouts->addAction(ui.action_Screen_Layout_Side_by_Side); actionGroup_ScreenLayouts->addAction(ui->action_Screen_Layout_Side_by_Side);
} }
void GMainWindow::InitializeDebugWidgets() { void GMainWindow::InitializeDebugWidgets() {
connect(ui.action_Create_Pica_Surface_Viewer, &QAction::triggered, this, connect(ui->action_Create_Pica_Surface_Viewer, &QAction::triggered, this,
&GMainWindow::OnCreateGraphicsSurfaceViewer); &GMainWindow::OnCreateGraphicsSurfaceViewer);
QMenu* debug_menu = ui.menu_View_Debugging; QMenu* debug_menu = ui->menu_View_Debugging;
#if MICROPROFILE_ENABLED #if MICROPROFILE_ENABLED
microProfileDialog = new MicroProfileDialog(this); microProfileDialog = new MicroProfileDialog(this);
@ -386,16 +389,16 @@ void GMainWindow::InitializeRecentFileMenuActions() {
actions_recent_files[i]->setVisible(false); actions_recent_files[i]->setVisible(false);
connect(actions_recent_files[i], &QAction::triggered, this, &GMainWindow::OnMenuRecentFile); connect(actions_recent_files[i], &QAction::triggered, this, &GMainWindow::OnMenuRecentFile);
ui.menu_recent_files->addAction(actions_recent_files[i]); ui->menu_recent_files->addAction(actions_recent_files[i]);
} }
ui.menu_recent_files->addSeparator(); ui->menu_recent_files->addSeparator();
QAction* action_clear_recent_files = new QAction(this); QAction* action_clear_recent_files = new QAction(this);
action_clear_recent_files->setText(tr("Clear Recent Files")); action_clear_recent_files->setText(tr("Clear Recent Files"));
connect(action_clear_recent_files, &QAction::triggered, this, [this] { connect(action_clear_recent_files, &QAction::triggered, this, [this] {
UISettings::values.recent_files.clear(); UISettings::values.recent_files.clear();
UpdateRecentFiles(); UpdateRecentFiles();
}); });
ui.menu_recent_files->addAction(action_clear_recent_files); ui->menu_recent_files->addAction(action_clear_recent_files);
UpdateRecentFiles(); UpdateRecentFiles();
} }
@ -405,28 +408,28 @@ void GMainWindow::InitializeSaveStateMenuActions() {
actions_load_state[i] = new QAction(this); actions_load_state[i] = new QAction(this);
actions_load_state[i]->setData(i + 1); actions_load_state[i]->setData(i + 1);
connect(actions_load_state[i], &QAction::triggered, this, &GMainWindow::OnLoadState); connect(actions_load_state[i], &QAction::triggered, this, &GMainWindow::OnLoadState);
ui.menu_Load_State->addAction(actions_load_state[i]); ui->menu_Load_State->addAction(actions_load_state[i]);
actions_save_state[i] = new QAction(this); actions_save_state[i] = new QAction(this);
actions_save_state[i]->setData(i + 1); actions_save_state[i]->setData(i + 1);
connect(actions_save_state[i], &QAction::triggered, this, &GMainWindow::OnSaveState); connect(actions_save_state[i], &QAction::triggered, this, &GMainWindow::OnSaveState);
ui.menu_Save_State->addAction(actions_save_state[i]); ui->menu_Save_State->addAction(actions_save_state[i]);
} }
connect(ui.action_Load_from_Newest_Slot, &QAction::triggered, [this] { connect(ui->action_Load_from_Newest_Slot, &QAction::triggered, [this] {
UpdateSaveStates(); UpdateSaveStates();
if (newest_slot != 0) { if (newest_slot != 0) {
actions_load_state[newest_slot - 1]->trigger(); actions_load_state[newest_slot - 1]->trigger();
} }
}); });
connect(ui.action_Save_to_Oldest_Slot, &QAction::triggered, [this] { connect(ui->action_Save_to_Oldest_Slot, &QAction::triggered, [this] {
UpdateSaveStates(); UpdateSaveStates();
actions_save_state[oldest_slot - 1]->trigger(); actions_save_state[oldest_slot - 1]->trigger();
}); });
connect(ui.menu_Load_State->menuAction(), &QAction::hovered, this, connect(ui->menu_Load_State->menuAction(), &QAction::hovered, this,
&GMainWindow::UpdateSaveStates); &GMainWindow::UpdateSaveStates);
connect(ui.menu_Save_State->menuAction(), &QAction::hovered, this, connect(ui->menu_Save_State->menuAction(), &QAction::hovered, this,
&GMainWindow::UpdateSaveStates); &GMainWindow::UpdateSaveStates);
UpdateSaveStates(); UpdateSaveStates();
@ -443,24 +446,24 @@ void GMainWindow::InitializeHotkeys() {
const QString toggle_status_bar = QStringLiteral("Toggle Status Bar"); const QString toggle_status_bar = QStringLiteral("Toggle Status Bar");
const QString fullscreen = QStringLiteral("Fullscreen"); const QString fullscreen = QStringLiteral("Fullscreen");
ui.action_Show_Filter_Bar->setShortcut( ui->action_Show_Filter_Bar->setShortcut(
hotkey_registry.GetKeySequence(main_window, toggle_filter_bar)); hotkey_registry.GetKeySequence(main_window, toggle_filter_bar));
ui.action_Show_Filter_Bar->setShortcutContext( ui->action_Show_Filter_Bar->setShortcutContext(
hotkey_registry.GetShortcutContext(main_window, toggle_filter_bar)); hotkey_registry.GetShortcutContext(main_window, toggle_filter_bar));
ui.action_Show_Status_Bar->setShortcut( ui->action_Show_Status_Bar->setShortcut(
hotkey_registry.GetKeySequence(main_window, toggle_status_bar)); hotkey_registry.GetKeySequence(main_window, toggle_status_bar));
ui.action_Show_Status_Bar->setShortcutContext( ui->action_Show_Status_Bar->setShortcutContext(
hotkey_registry.GetShortcutContext(main_window, toggle_status_bar)); hotkey_registry.GetShortcutContext(main_window, toggle_status_bar));
connect(hotkey_registry.GetHotkey(main_window, load_file, this), &QShortcut::activated, connect(hotkey_registry.GetHotkey(main_window, load_file, this), &QShortcut::activated,
ui.action_Load_File, &QAction::trigger); ui->action_Load_File, &QAction::trigger);
connect(hotkey_registry.GetHotkey(main_window, stop_emulation, this), &QShortcut::activated, connect(hotkey_registry.GetHotkey(main_window, stop_emulation, this), &QShortcut::activated,
ui.action_Stop, &QAction::trigger); ui->action_Stop, &QAction::trigger);
connect(hotkey_registry.GetHotkey(main_window, exit_citra, this), &QShortcut::activated, connect(hotkey_registry.GetHotkey(main_window, exit_citra, this), &QShortcut::activated,
ui.action_Exit, &QAction::trigger); ui->action_Exit, &QAction::trigger);
connect( connect(
hotkey_registry.GetHotkey(main_window, QStringLiteral("Continue/Pause Emulation"), this), hotkey_registry.GetHotkey(main_window, QStringLiteral("Continue/Pause Emulation"), this),
@ -480,21 +483,21 @@ void GMainWindow::InitializeHotkeys() {
BootGame(QString(game_path)); BootGame(QString(game_path));
}); });
connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Swap Screens"), render_window), connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Swap Screens"), render_window),
&QShortcut::activated, ui.action_Screen_Layout_Swap_Screens, &QAction::trigger); &QShortcut::activated, ui->action_Screen_Layout_Swap_Screens, &QAction::trigger);
connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Rotate Screens Upright"), connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Rotate Screens Upright"),
render_window), render_window),
&QShortcut::activated, ui.action_Screen_Layout_Upright_Screens, &QAction::trigger); &QShortcut::activated, ui->action_Screen_Layout_Upright_Screens, &QAction::trigger);
connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Toggle Screen Layout"), connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Toggle Screen Layout"),
render_window), render_window),
&QShortcut::activated, this, &GMainWindow::ToggleScreenLayout); &QShortcut::activated, this, &GMainWindow::ToggleScreenLayout);
connect(hotkey_registry.GetHotkey(main_window, fullscreen, render_window), connect(hotkey_registry.GetHotkey(main_window, fullscreen, render_window),
&QShortcut::activated, ui.action_Fullscreen, &QAction::trigger); &QShortcut::activated, ui->action_Fullscreen, &QAction::trigger);
connect(hotkey_registry.GetHotkey(main_window, fullscreen, render_window), connect(hotkey_registry.GetHotkey(main_window, fullscreen, render_window),
&QShortcut::activatedAmbiguously, ui.action_Fullscreen, &QAction::trigger); &QShortcut::activatedAmbiguously, ui->action_Fullscreen, &QAction::trigger);
connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Exit Fullscreen"), this), connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Exit Fullscreen"), this),
&QShortcut::activated, this, [&] { &QShortcut::activated, this, [&] {
if (emulation_running) { if (emulation_running) {
ui.action_Fullscreen->setChecked(false); ui->action_Fullscreen->setChecked(false);
ToggleFullscreen(); ToggleFullscreen();
} }
}); });
@ -552,18 +555,18 @@ void GMainWindow::InitializeHotkeys() {
UpdateStatusBar(); UpdateStatusBar();
}); });
connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Toggle Frame Advancing"), this), connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Toggle Frame Advancing"), this),
&QShortcut::activated, ui.action_Enable_Frame_Advancing, &QAction::trigger); &QShortcut::activated, ui->action_Enable_Frame_Advancing, &QAction::trigger);
connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Advance Frame"), this), connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Advance Frame"), this),
&QShortcut::activated, ui.action_Advance_Frame, &QAction::trigger); &QShortcut::activated, ui->action_Advance_Frame, &QAction::trigger);
connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Load Amiibo"), this), connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Load Amiibo"), this),
&QShortcut::activated, this, [&] { &QShortcut::activated, this, [&] {
if (ui.action_Load_Amiibo->isEnabled()) { if (ui->action_Load_Amiibo->isEnabled()) {
OnLoadAmiibo(); OnLoadAmiibo();
} }
}); });
connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Remove Amiibo"), this), connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Remove Amiibo"), this),
&QShortcut::activated, this, [&] { &QShortcut::activated, this, [&] {
if (ui.action_Remove_Amiibo->isEnabled()) { if (ui->action_Remove_Amiibo->isEnabled()) {
OnRemoveAmiibo(); OnRemoveAmiibo();
} }
}); });
@ -574,14 +577,14 @@ void GMainWindow::InitializeHotkeys() {
} }
}); });
connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Load from Newest Slot"), this), connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Load from Newest Slot"), this),
&QShortcut::activated, ui.action_Load_from_Newest_Slot, &QAction::trigger); &QShortcut::activated, ui->action_Load_from_Newest_Slot, &QAction::trigger);
connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Save to Oldest Slot"), this), connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Save to Oldest Slot"), this),
&QShortcut::activated, ui.action_Save_to_Oldest_Slot, &QAction::trigger); &QShortcut::activated, ui->action_Save_to_Oldest_Slot, &QAction::trigger);
} }
void GMainWindow::ShowUpdaterWidgets() { void GMainWindow::ShowUpdaterWidgets() {
ui.action_Check_For_Updates->setVisible(UISettings::values.updater_found); ui->action_Check_For_Updates->setVisible(UISettings::values.updater_found);
ui.action_Open_Maintenance_Tool->setVisible(UISettings::values.updater_found); ui->action_Open_Maintenance_Tool->setVisible(UISettings::values.updater_found);
connect(updater, &Updater::CheckUpdatesDone, this, &GMainWindow::OnUpdateFound); connect(updater, &Updater::CheckUpdatesDone, this, &GMainWindow::OnUpdateFound);
} }
@ -606,24 +609,24 @@ void GMainWindow::RestoreUIState() {
microProfileDialog->restoreGeometry(UISettings::values.microprofile_geometry); microProfileDialog->restoreGeometry(UISettings::values.microprofile_geometry);
microProfileDialog->setVisible(UISettings::values.microprofile_visible); microProfileDialog->setVisible(UISettings::values.microprofile_visible);
#endif #endif
ui.action_Cheats->setEnabled(false); ui->action_Cheats->setEnabled(false);
game_list->LoadInterfaceLayout(); game_list->LoadInterfaceLayout();
ui.action_Single_Window_Mode->setChecked(UISettings::values.single_window_mode); ui->action_Single_Window_Mode->setChecked(UISettings::values.single_window_mode);
ToggleWindowMode(); ToggleWindowMode();
ui.action_Fullscreen->setChecked(UISettings::values.fullscreen); ui->action_Fullscreen->setChecked(UISettings::values.fullscreen);
SyncMenuUISettings(); SyncMenuUISettings();
ui.action_Display_Dock_Widget_Headers->setChecked(UISettings::values.display_titlebar); ui->action_Display_Dock_Widget_Headers->setChecked(UISettings::values.display_titlebar);
OnDisplayTitleBars(ui.action_Display_Dock_Widget_Headers->isChecked()); OnDisplayTitleBars(ui->action_Display_Dock_Widget_Headers->isChecked());
ui.action_Show_Filter_Bar->setChecked(UISettings::values.show_filter_bar); ui->action_Show_Filter_Bar->setChecked(UISettings::values.show_filter_bar);
game_list->setFilterVisible(ui.action_Show_Filter_Bar->isChecked()); game_list->setFilterVisible(ui->action_Show_Filter_Bar->isChecked());
ui.action_Show_Status_Bar->setChecked(UISettings::values.show_status_bar); ui->action_Show_Status_Bar->setChecked(UISettings::values.show_status_bar);
statusBar()->setVisible(ui.action_Show_Status_Bar->isChecked()); statusBar()->setVisible(ui->action_Show_Status_Bar->isChecked());
} }
void GMainWindow::OnAppFocusStateChanged(Qt::ApplicationState state) { void GMainWindow::OnAppFocusStateChanged(Qt::ApplicationState state) {
@ -634,11 +637,11 @@ void GMainWindow::OnAppFocusStateChanged(Qt::ApplicationState state) {
state != Qt::ApplicationActive) { state != Qt::ApplicationActive) {
LOG_DEBUG(Frontend, "ApplicationState unusual flag: {} ", state); LOG_DEBUG(Frontend, "ApplicationState unusual flag: {} ", state);
} }
if (ui.action_Pause->isEnabled() && if (ui->action_Pause->isEnabled() &&
(state & (Qt::ApplicationHidden | Qt::ApplicationInactive))) { (state & (Qt::ApplicationHidden | Qt::ApplicationInactive))) {
auto_paused = true; auto_paused = true;
OnPauseGame(); OnPauseGame();
} else if (ui.action_Start->isEnabled() && auto_paused && state == Qt::ApplicationActive) { } else if (ui->action_Start->isEnabled() && auto_paused && state == Qt::ApplicationActive) {
auto_paused = false; auto_paused = false;
OnStartGame(); OnStartGame();
} }
@ -674,116 +677,117 @@ void GMainWindow::ConnectWidgetEvents() {
void GMainWindow::ConnectMenuEvents() { void GMainWindow::ConnectMenuEvents() {
// File // File
connect(ui.action_Load_File, &QAction::triggered, this, &GMainWindow::OnMenuLoadFile); connect(ui->action_Load_File, &QAction::triggered, this, &GMainWindow::OnMenuLoadFile);
connect(ui.action_Install_CIA, &QAction::triggered, this, &GMainWindow::OnMenuInstallCIA); connect(ui->action_Install_CIA, &QAction::triggered, this, &GMainWindow::OnMenuInstallCIA);
connect(ui.action_Exit, &QAction::triggered, this, &QMainWindow::close); connect(ui->action_Exit, &QAction::triggered, this, &QMainWindow::close);
connect(ui.action_Load_Amiibo, &QAction::triggered, this, &GMainWindow::OnLoadAmiibo); connect(ui->action_Load_Amiibo, &QAction::triggered, this, &GMainWindow::OnLoadAmiibo);
connect(ui.action_Remove_Amiibo, &QAction::triggered, this, &GMainWindow::OnRemoveAmiibo); connect(ui->action_Remove_Amiibo, &QAction::triggered, this, &GMainWindow::OnRemoveAmiibo);
// Emulation // Emulation
connect(ui.action_Start, &QAction::triggered, this, &GMainWindow::OnStartGame); connect(ui->action_Start, &QAction::triggered, this, &GMainWindow::OnStartGame);
connect(ui.action_Pause, &QAction::triggered, this, &GMainWindow::OnPauseGame); connect(ui->action_Pause, &QAction::triggered, this, &GMainWindow::OnPauseGame);
connect(ui.action_Stop, &QAction::triggered, this, &GMainWindow::OnStopGame); connect(ui->action_Stop, &QAction::triggered, this, &GMainWindow::OnStopGame);
connect(ui.action_Restart, &QAction::triggered, this, [this] { BootGame(QString(game_path)); }); connect(ui->action_Restart, &QAction::triggered, this,
connect(ui.action_Report_Compatibility, &QAction::triggered, this, [this] { BootGame(QString(game_path)); });
connect(ui->action_Report_Compatibility, &QAction::triggered, this,
&GMainWindow::OnMenuReportCompatibility); &GMainWindow::OnMenuReportCompatibility);
connect(ui.action_Configure, &QAction::triggered, this, &GMainWindow::OnConfigure); connect(ui->action_Configure, &QAction::triggered, this, &GMainWindow::OnConfigure);
connect(ui.action_Cheats, &QAction::triggered, this, &GMainWindow::OnCheats); connect(ui->action_Cheats, &QAction::triggered, this, &GMainWindow::OnCheats);
// View // View
connect(ui.action_Single_Window_Mode, &QAction::triggered, this, connect(ui->action_Single_Window_Mode, &QAction::triggered, this,
&GMainWindow::ToggleWindowMode); &GMainWindow::ToggleWindowMode);
connect(ui.action_Display_Dock_Widget_Headers, &QAction::triggered, this, connect(ui->action_Display_Dock_Widget_Headers, &QAction::triggered, this,
&GMainWindow::OnDisplayTitleBars); &GMainWindow::OnDisplayTitleBars);
connect(ui.action_Show_Filter_Bar, &QAction::triggered, this, &GMainWindow::OnToggleFilterBar); connect(ui->action_Show_Filter_Bar, &QAction::triggered, this, &GMainWindow::OnToggleFilterBar);
connect(ui.action_Show_Status_Bar, &QAction::triggered, statusBar(), &QStatusBar::setVisible); connect(ui->action_Show_Status_Bar, &QAction::triggered, statusBar(), &QStatusBar::setVisible);
// Multiplayer // Multiplayer
connect(ui.action_View_Lobby, &QAction::triggered, multiplayer_state, connect(ui->action_View_Lobby, &QAction::triggered, multiplayer_state,
&MultiplayerState::OnViewLobby); &MultiplayerState::OnViewLobby);
connect(ui.action_Start_Room, &QAction::triggered, multiplayer_state, connect(ui->action_Start_Room, &QAction::triggered, multiplayer_state,
&MultiplayerState::OnCreateRoom); &MultiplayerState::OnCreateRoom);
connect(ui.action_Leave_Room, &QAction::triggered, multiplayer_state, connect(ui->action_Leave_Room, &QAction::triggered, multiplayer_state,
&MultiplayerState::OnCloseRoom); &MultiplayerState::OnCloseRoom);
connect(ui.action_Connect_To_Room, &QAction::triggered, multiplayer_state, connect(ui->action_Connect_To_Room, &QAction::triggered, multiplayer_state,
&MultiplayerState::OnDirectConnectToRoom); &MultiplayerState::OnDirectConnectToRoom);
connect(ui.action_Show_Room, &QAction::triggered, multiplayer_state, connect(ui->action_Show_Room, &QAction::triggered, multiplayer_state,
&MultiplayerState::OnOpenNetworkRoom); &MultiplayerState::OnOpenNetworkRoom);
ui.action_Fullscreen->setShortcut( ui->action_Fullscreen->setShortcut(
hotkey_registry hotkey_registry
.GetHotkey(QStringLiteral("Main Window"), QStringLiteral("Fullscreen"), this) .GetHotkey(QStringLiteral("Main Window"), QStringLiteral("Fullscreen"), this)
->key()); ->key());
ui.action_Screen_Layout_Swap_Screens->setShortcut( ui->action_Screen_Layout_Swap_Screens->setShortcut(
hotkey_registry hotkey_registry
.GetHotkey(QStringLiteral("Main Window"), QStringLiteral("Swap Screens"), this) .GetHotkey(QStringLiteral("Main Window"), QStringLiteral("Swap Screens"), this)
->key()); ->key());
ui.action_Screen_Layout_Swap_Screens->setShortcutContext(Qt::WidgetWithChildrenShortcut); ui->action_Screen_Layout_Swap_Screens->setShortcutContext(Qt::WidgetWithChildrenShortcut);
ui.action_Screen_Layout_Upright_Screens->setShortcut( ui->action_Screen_Layout_Upright_Screens->setShortcut(
hotkey_registry hotkey_registry
.GetHotkey(QStringLiteral("Main Window"), QStringLiteral("Rotate Screens Upright"), .GetHotkey(QStringLiteral("Main Window"), QStringLiteral("Rotate Screens Upright"),
this) this)
->key()); ->key());
ui.action_Screen_Layout_Upright_Screens->setShortcutContext(Qt::WidgetWithChildrenShortcut); ui->action_Screen_Layout_Upright_Screens->setShortcutContext(Qt::WidgetWithChildrenShortcut);
connect(ui.action_Fullscreen, &QAction::triggered, this, &GMainWindow::ToggleFullscreen); connect(ui->action_Fullscreen, &QAction::triggered, this, &GMainWindow::ToggleFullscreen);
connect(ui.action_Screen_Layout_Default, &QAction::triggered, this, connect(ui->action_Screen_Layout_Default, &QAction::triggered, this,
&GMainWindow::ChangeScreenLayout); &GMainWindow::ChangeScreenLayout);
connect(ui.action_Screen_Layout_Single_Screen, &QAction::triggered, this, connect(ui->action_Screen_Layout_Single_Screen, &QAction::triggered, this,
&GMainWindow::ChangeScreenLayout); &GMainWindow::ChangeScreenLayout);
connect(ui.action_Screen_Layout_Large_Screen, &QAction::triggered, this, connect(ui->action_Screen_Layout_Large_Screen, &QAction::triggered, this,
&GMainWindow::ChangeScreenLayout); &GMainWindow::ChangeScreenLayout);
connect(ui.action_Screen_Layout_Side_by_Side, &QAction::triggered, this, connect(ui->action_Screen_Layout_Side_by_Side, &QAction::triggered, this,
&GMainWindow::ChangeScreenLayout); &GMainWindow::ChangeScreenLayout);
connect(ui.action_Screen_Layout_Swap_Screens, &QAction::triggered, this, connect(ui->action_Screen_Layout_Swap_Screens, &QAction::triggered, this,
&GMainWindow::OnSwapScreens); &GMainWindow::OnSwapScreens);
connect(ui.action_Screen_Layout_Upright_Screens, &QAction::triggered, this, connect(ui->action_Screen_Layout_Upright_Screens, &QAction::triggered, this,
&GMainWindow::OnRotateScreens); &GMainWindow::OnRotateScreens);
// Movie // Movie
connect(ui.action_Record_Movie, &QAction::triggered, this, &GMainWindow::OnRecordMovie); connect(ui->action_Record_Movie, &QAction::triggered, this, &GMainWindow::OnRecordMovie);
connect(ui.action_Play_Movie, &QAction::triggered, this, &GMainWindow::OnPlayMovie); connect(ui->action_Play_Movie, &QAction::triggered, this, &GMainWindow::OnPlayMovie);
connect(ui.action_Stop_Recording_Playback, &QAction::triggered, this, connect(ui->action_Stop_Recording_Playback, &QAction::triggered, this,
&GMainWindow::OnStopRecordingPlayback); &GMainWindow::OnStopRecordingPlayback);
connect(ui.action_Enable_Frame_Advancing, &QAction::triggered, this, [this] { connect(ui->action_Enable_Frame_Advancing, &QAction::triggered, this, [this] {
if (emulation_running) { if (emulation_running) {
Core::System::GetInstance().frame_limiter.SetFrameAdvancing( Core::System::GetInstance().frame_limiter.SetFrameAdvancing(
ui.action_Enable_Frame_Advancing->isChecked()); ui->action_Enable_Frame_Advancing->isChecked());
ui.action_Advance_Frame->setEnabled(ui.action_Enable_Frame_Advancing->isChecked()); ui->action_Advance_Frame->setEnabled(ui->action_Enable_Frame_Advancing->isChecked());
} }
}); });
connect(ui.action_Advance_Frame, &QAction::triggered, this, [this] { connect(ui->action_Advance_Frame, &QAction::triggered, this, [this] {
if (emulation_running) { if (emulation_running) {
ui.action_Enable_Frame_Advancing->setChecked(true); ui->action_Enable_Frame_Advancing->setChecked(true);
ui.action_Advance_Frame->setEnabled(true); ui->action_Advance_Frame->setEnabled(true);
Core::System::GetInstance().frame_limiter.SetFrameAdvancing(true); Core::System::GetInstance().frame_limiter.SetFrameAdvancing(true);
Core::System::GetInstance().frame_limiter.AdvanceFrame(); Core::System::GetInstance().frame_limiter.AdvanceFrame();
} }
}); });
connect(ui.action_Capture_Screenshot, &QAction::triggered, this, connect(ui->action_Capture_Screenshot, &QAction::triggered, this,
&GMainWindow::OnCaptureScreenshot); &GMainWindow::OnCaptureScreenshot);
#ifdef ENABLE_FFMPEG_VIDEO_DUMPER #ifdef ENABLE_FFMPEG_VIDEO_DUMPER
connect(ui.action_Dump_Video, &QAction::triggered, [this] { connect(ui->action_Dump_Video, &QAction::triggered, [this] {
if (ui.action_Dump_Video->isChecked()) { if (ui->action_Dump_Video->isChecked()) {
OnStartVideoDumping(); OnStartVideoDumping();
} else { } else {
OnStopVideoDumping(); OnStopVideoDumping();
} }
}); });
#else #else
ui.action_Dump_Video->setEnabled(false); ui->action_Dump_Video->setEnabled(false);
#endif #endif
// Help // Help
connect(ui.action_Open_Citra_Folder, &QAction::triggered, this, connect(ui->action_Open_Citra_Folder, &QAction::triggered, this,
&GMainWindow::OnOpenCitraFolder); &GMainWindow::OnOpenCitraFolder);
connect(ui.action_FAQ, &QAction::triggered, []() { connect(ui->action_FAQ, &QAction::triggered, []() {
QDesktopServices::openUrl(QUrl(QStringLiteral("https://citra-emu.org/wiki/faq/"))); QDesktopServices::openUrl(QUrl(QStringLiteral("https://citra-emu.org/wiki/faq/")));
}); });
connect(ui.action_About, &QAction::triggered, this, &GMainWindow::OnMenuAboutCitra); connect(ui->action_About, &QAction::triggered, this, &GMainWindow::OnMenuAboutCitra);
connect(ui.action_Check_For_Updates, &QAction::triggered, this, connect(ui->action_Check_For_Updates, &QAction::triggered, this,
&GMainWindow::OnCheckForUpdates); &GMainWindow::OnCheckForUpdates);
connect(ui.action_Open_Maintenance_Tool, &QAction::triggered, this, connect(ui->action_Open_Maintenance_Tool, &QAction::triggered, this,
&GMainWindow::OnOpenUpdater); &GMainWindow::OnOpenUpdater);
} }
@ -1038,7 +1042,7 @@ void GMainWindow::BootGame(const QString& filename) {
// Update the GUI // Update the GUI
registersWidget->OnDebugModeEntered(); registersWidget->OnDebugModeEntered();
if (ui.action_Single_Window_Mode->isChecked()) { if (ui->action_Single_Window_Mode->isChecked()) {
game_list->hide(); game_list->hide();
game_list_placeholder->hide(); game_list_placeholder->hide();
} }
@ -1047,7 +1051,7 @@ void GMainWindow::BootGame(const QString& filename) {
if (UISettings::values.hide_mouse) { if (UISettings::values.hide_mouse) {
mouse_hide_timer.start(); mouse_hide_timer.start();
setMouseTracking(true); setMouseTracking(true);
ui.centralwidget->setMouseTracking(true); ui->centralwidget->setMouseTracking(true);
} }
// show and hide the render_window to create the context // show and hide the render_window to create the context
@ -1058,7 +1062,7 @@ void GMainWindow::BootGame(const QString& filename) {
loading_screen->show(); loading_screen->show();
emulation_running = true; emulation_running = true;
if (ui.action_Fullscreen->isChecked()) { if (ui->action_Fullscreen->isChecked()) {
ShowFullscreen(); ShowFullscreen();
} }
@ -1071,7 +1075,7 @@ void GMainWindow::BootGame(const QString& filename) {
QMessageBox::critical( QMessageBox::critical(
this, tr("Citra"), this, tr("Citra"),
tr("Could not start video dumping.<br>Refer to the log for details.")); tr("Could not start video dumping.<br>Refer to the log for details."));
ui.action_Dump_Video->setChecked(false); ui->action_Dump_Video->setChecked(false);
} }
video_dumping_on_start = false; video_dumping_on_start = false;
video_dumping_path.clear(); video_dumping_path.clear();
@ -1084,7 +1088,7 @@ void GMainWindow::ShutdownGame() {
return; return;
} }
if (ui.action_Fullscreen->isChecked()) { if (ui->action_Fullscreen->isChecked()) {
HideFullscreen(); HideFullscreen();
} }
@ -1126,19 +1130,19 @@ void GMainWindow::ShutdownGame() {
disconnect(render_window, &GRenderWindow::Closed, this, &GMainWindow::OnStopGame); disconnect(render_window, &GRenderWindow::Closed, this, &GMainWindow::OnStopGame);
// Update the GUI // Update the GUI
ui.action_Start->setEnabled(false); ui->action_Start->setEnabled(false);
ui.action_Start->setText(tr("Start")); ui->action_Start->setText(tr("Start"));
ui.action_Pause->setEnabled(false); ui->action_Pause->setEnabled(false);
ui.action_Stop->setEnabled(false); ui->action_Stop->setEnabled(false);
ui.action_Restart->setEnabled(false); ui->action_Restart->setEnabled(false);
ui.action_Cheats->setEnabled(false); ui->action_Cheats->setEnabled(false);
ui.action_Load_Amiibo->setEnabled(false); ui->action_Load_Amiibo->setEnabled(false);
ui.action_Remove_Amiibo->setEnabled(false); ui->action_Remove_Amiibo->setEnabled(false);
ui.action_Report_Compatibility->setEnabled(false); ui->action_Report_Compatibility->setEnabled(false);
ui.action_Enable_Frame_Advancing->setEnabled(false); ui->action_Enable_Frame_Advancing->setEnabled(false);
ui.action_Enable_Frame_Advancing->setChecked(false); ui->action_Enable_Frame_Advancing->setChecked(false);
ui.action_Advance_Frame->setEnabled(false); ui->action_Advance_Frame->setEnabled(false);
ui.action_Capture_Screenshot->setEnabled(false); ui->action_Capture_Screenshot->setEnabled(false);
render_window->hide(); render_window->hide();
loading_screen->hide(); loading_screen->hide();
loading_screen->Clear(); loading_screen->Clear();
@ -1149,7 +1153,7 @@ void GMainWindow::ShutdownGame() {
game_list->setFilterFocus(); game_list->setFilterFocus();
setMouseTracking(false); setMouseTracking(false);
ui.centralwidget->setMouseTracking(false); ui->centralwidget->setMouseTracking(false);
// Disable status bar updates // Disable status bar updates
status_bar_update_timer.stop(); status_bar_update_timer.stop();
@ -1203,19 +1207,19 @@ void GMainWindow::UpdateRecentFiles() {
} }
// Enable the recent files menu if the list isn't empty // Enable the recent files menu if the list isn't empty
ui.menu_recent_files->setEnabled(num_recent_files != 0); ui->menu_recent_files->setEnabled(num_recent_files != 0);
} }
void GMainWindow::UpdateSaveStates() { void GMainWindow::UpdateSaveStates() {
if (!Core::System::GetInstance().IsPoweredOn()) { if (!Core::System::GetInstance().IsPoweredOn()) {
ui.menu_Load_State->setEnabled(false); ui->menu_Load_State->setEnabled(false);
ui.menu_Save_State->setEnabled(false); ui->menu_Save_State->setEnabled(false);
return; return;
} }
ui.menu_Load_State->setEnabled(true); ui->menu_Load_State->setEnabled(true);
ui.menu_Save_State->setEnabled(true); ui->menu_Save_State->setEnabled(true);
ui.action_Load_from_Newest_Slot->setEnabled(false); ui->action_Load_from_Newest_Slot->setEnabled(false);
oldest_slot = newest_slot = 0; oldest_slot = newest_slot = 0;
oldest_slot_time = std::numeric_limits<u64>::max(); oldest_slot_time = std::numeric_limits<u64>::max();
@ -1241,7 +1245,7 @@ void GMainWindow::UpdateSaveStates() {
actions_load_state[savestate.slot - 1]->setText(text); actions_load_state[savestate.slot - 1]->setText(text);
actions_save_state[savestate.slot - 1]->setText(text); actions_save_state[savestate.slot - 1]->setText(text);
ui.action_Load_from_Newest_Slot->setEnabled(true); ui->action_Load_from_Newest_Slot->setEnabled(true);
if (savestate.time > newest_slot_time) { if (savestate.time > newest_slot_time) {
newest_slot = savestate.slot; newest_slot = savestate.slot;
@ -1414,7 +1418,7 @@ void GMainWindow::OnGameListAddDirectory() {
} }
void GMainWindow::OnGameListShowList(bool show) { void GMainWindow::OnGameListShowList(bool show) {
if (emulation_running && ui.action_Single_Window_Mode->isChecked()) if (emulation_running && ui->action_Single_Window_Mode->isChecked())
return; return;
game_list->setVisible(show); game_list->setVisible(show);
game_list_placeholder->setVisible(!show); game_list_placeholder->setVisible(!show);
@ -1448,7 +1452,7 @@ void GMainWindow::OnMenuInstallCIA() {
} }
void GMainWindow::InstallCIA(QStringList filepaths) { void GMainWindow::InstallCIA(QStringList filepaths) {
ui.action_Install_CIA->setEnabled(false); ui->action_Install_CIA->setEnabled(false);
game_list->setDirectoryWatcherEnabled(false); game_list->setDirectoryWatcherEnabled(false);
progress_bar->show(); progress_bar->show();
progress_bar->setMaximum(INT_MAX); progress_bar->setMaximum(INT_MAX);
@ -1504,7 +1508,7 @@ void GMainWindow::OnCIAInstallFinished() {
progress_bar->hide(); progress_bar->hide();
progress_bar->setValue(0); progress_bar->setValue(0);
game_list->setDirectoryWatcherEnabled(true); game_list->setDirectoryWatcherEnabled(true);
ui.action_Install_CIA->setEnabled(true); ui->action_Install_CIA->setEnabled(true);
game_list->PopulateAsync(UISettings::values.game_dirs); game_list->PopulateAsync(UISettings::values.game_dirs);
} }
@ -1541,17 +1545,17 @@ void GMainWindow::OnStartGame() {
qRegisterMetaType<std::string>("std::string"); qRegisterMetaType<std::string>("std::string");
connect(emu_thread.get(), &EmuThread::ErrorThrown, this, &GMainWindow::OnCoreError); connect(emu_thread.get(), &EmuThread::ErrorThrown, this, &GMainWindow::OnCoreError);
ui.action_Start->setEnabled(false); ui->action_Start->setEnabled(false);
ui.action_Start->setText(tr("Continue")); ui->action_Start->setText(tr("Continue"));
ui.action_Pause->setEnabled(true); ui->action_Pause->setEnabled(true);
ui.action_Stop->setEnabled(true); ui->action_Stop->setEnabled(true);
ui.action_Restart->setEnabled(true); ui->action_Restart->setEnabled(true);
ui.action_Cheats->setEnabled(true); ui->action_Cheats->setEnabled(true);
ui.action_Load_Amiibo->setEnabled(true); ui->action_Load_Amiibo->setEnabled(true);
ui.action_Report_Compatibility->setEnabled(true); ui->action_Report_Compatibility->setEnabled(true);
ui.action_Enable_Frame_Advancing->setEnabled(true); ui->action_Enable_Frame_Advancing->setEnabled(true);
ui.action_Capture_Screenshot->setEnabled(true); ui->action_Capture_Screenshot->setEnabled(true);
discord_rpc->Update(); discord_rpc->Update();
@ -1561,10 +1565,10 @@ void GMainWindow::OnStartGame() {
void GMainWindow::OnPauseGame() { void GMainWindow::OnPauseGame() {
emu_thread->SetRunning(false); emu_thread->SetRunning(false);
Camera::QtMultimediaCameraHandler::StopCameras(); Camera::QtMultimediaCameraHandler::StopCameras();
ui.action_Start->setEnabled(true); ui->action_Start->setEnabled(true);
ui.action_Pause->setEnabled(false); ui->action_Pause->setEnabled(false);
ui.action_Stop->setEnabled(true); ui->action_Stop->setEnabled(true);
ui.action_Capture_Screenshot->setEnabled(false); ui->action_Capture_Screenshot->setEnabled(false);
AllowOSSleep(); AllowOSSleep();
} }
@ -1592,7 +1596,7 @@ void GMainWindow::ToggleFullscreen() {
if (!emulation_running) { if (!emulation_running) {
return; return;
} }
if (ui.action_Fullscreen->isChecked()) { if (ui->action_Fullscreen->isChecked()) {
ShowFullscreen(); ShowFullscreen();
} else { } else {
HideFullscreen(); HideFullscreen();
@ -1600,9 +1604,9 @@ void GMainWindow::ToggleFullscreen() {
} }
void GMainWindow::ShowFullscreen() { void GMainWindow::ShowFullscreen() {
if (ui.action_Single_Window_Mode->isChecked()) { if (ui->action_Single_Window_Mode->isChecked()) {
UISettings::values.geometry = saveGeometry(); UISettings::values.geometry = saveGeometry();
ui.menubar->hide(); ui->menubar->hide();
statusBar()->hide(); statusBar()->hide();
showFullScreen(); showFullScreen();
} else { } else {
@ -1612,9 +1616,9 @@ void GMainWindow::ShowFullscreen() {
} }
void GMainWindow::HideFullscreen() { void GMainWindow::HideFullscreen() {
if (ui.action_Single_Window_Mode->isChecked()) { if (ui->action_Single_Window_Mode->isChecked()) {
statusBar()->setVisible(ui.action_Show_Status_Bar->isChecked()); statusBar()->setVisible(ui->action_Show_Status_Bar->isChecked());
ui.menubar->show(); ui->menubar->show();
showNormal(); showNormal();
restoreGeometry(UISettings::values.geometry); restoreGeometry(UISettings::values.geometry);
} else { } else {
@ -1624,10 +1628,10 @@ void GMainWindow::HideFullscreen() {
} }
void GMainWindow::ToggleWindowMode() { void GMainWindow::ToggleWindowMode() {
if (ui.action_Single_Window_Mode->isChecked()) { if (ui->action_Single_Window_Mode->isChecked()) {
// Render in the main window... // Render in the main window...
render_window->BackupGeometry(); render_window->BackupGeometry();
ui.horizontalLayout->addWidget(render_window); ui->horizontalLayout->addWidget(render_window);
render_window->setFocusPolicy(Qt::StrongFocus); render_window->setFocusPolicy(Qt::StrongFocus);
if (emulation_running) { if (emulation_running) {
render_window->setVisible(true); render_window->setVisible(true);
@ -1637,7 +1641,7 @@ void GMainWindow::ToggleWindowMode() {
} else { } else {
// Render in a separate window... // Render in a separate window...
ui.horizontalLayout->removeWidget(render_window); ui->horizontalLayout->removeWidget(render_window);
render_window->setParent(nullptr); render_window->setParent(nullptr);
render_window->setFocusPolicy(Qt::NoFocus); render_window->setFocusPolicy(Qt::NoFocus);
if (emulation_running) { if (emulation_running) {
@ -1651,13 +1655,13 @@ void GMainWindow::ToggleWindowMode() {
void GMainWindow::ChangeScreenLayout() { void GMainWindow::ChangeScreenLayout() {
Settings::LayoutOption new_layout = Settings::LayoutOption::Default; Settings::LayoutOption new_layout = Settings::LayoutOption::Default;
if (ui.action_Screen_Layout_Default->isChecked()) { if (ui->action_Screen_Layout_Default->isChecked()) {
new_layout = Settings::LayoutOption::Default; new_layout = Settings::LayoutOption::Default;
} else if (ui.action_Screen_Layout_Single_Screen->isChecked()) { } else if (ui->action_Screen_Layout_Single_Screen->isChecked()) {
new_layout = Settings::LayoutOption::SingleScreen; new_layout = Settings::LayoutOption::SingleScreen;
} else if (ui.action_Screen_Layout_Large_Screen->isChecked()) { } else if (ui->action_Screen_Layout_Large_Screen->isChecked()) {
new_layout = Settings::LayoutOption::LargeScreen; new_layout = Settings::LayoutOption::LargeScreen;
} else if (ui.action_Screen_Layout_Side_by_Side->isChecked()) { } else if (ui->action_Screen_Layout_Side_by_Side->isChecked()) {
new_layout = Settings::LayoutOption::SideScreen; new_layout = Settings::LayoutOption::SideScreen;
} }
@ -1689,12 +1693,12 @@ void GMainWindow::ToggleScreenLayout() {
} }
void GMainWindow::OnSwapScreens() { void GMainWindow::OnSwapScreens() {
Settings::values.swap_screen = ui.action_Screen_Layout_Swap_Screens->isChecked(); Settings::values.swap_screen = ui->action_Screen_Layout_Swap_Screens->isChecked();
Settings::Apply(); Settings::Apply();
} }
void GMainWindow::OnRotateScreens() { void GMainWindow::OnRotateScreens() {
Settings::values.upright_screen = ui.action_Screen_Layout_Upright_Screens->isChecked(); Settings::values.upright_screen = ui->action_Screen_Layout_Upright_Screens->isChecked();
Settings::Apply(); Settings::Apply();
} }
@ -1746,11 +1750,11 @@ void GMainWindow::OnConfigure() {
config->Save(); config->Save();
if (UISettings::values.hide_mouse && emulation_running) { if (UISettings::values.hide_mouse && emulation_running) {
setMouseTracking(true); setMouseTracking(true);
ui.centralwidget->setMouseTracking(true); ui->centralwidget->setMouseTracking(true);
mouse_hide_timer.start(); mouse_hide_timer.start();
} else { } else {
setMouseTracking(false); setMouseTracking(false);
ui.centralwidget->setMouseTracking(false); ui->centralwidget->setMouseTracking(false);
} }
} else { } else {
Settings::values.input_profiles = old_input_profiles; Settings::values.input_profiles = old_input_profiles;
@ -1799,7 +1803,7 @@ void GMainWindow::LoadAmiibo(const QString& filename) {
} }
nfc->LoadAmiibo(amiibo_data); nfc->LoadAmiibo(amiibo_data);
ui.action_Remove_Amiibo->setEnabled(true); ui->action_Remove_Amiibo->setEnabled(true);
} }
void GMainWindow::OnRemoveAmiibo() { void GMainWindow::OnRemoveAmiibo() {
@ -1811,7 +1815,7 @@ void GMainWindow::OnRemoveAmiibo() {
} }
nfc->RemoveAmiibo(); nfc->RemoveAmiibo();
ui.action_Remove_Amiibo->setEnabled(false); ui->action_Remove_Amiibo->setEnabled(false);
} }
void GMainWindow::OnOpenCitraFolder() { void GMainWindow::OnOpenCitraFolder() {
@ -1820,8 +1824,8 @@ void GMainWindow::OnOpenCitraFolder() {
} }
void GMainWindow::OnToggleFilterBar() { void GMainWindow::OnToggleFilterBar() {
game_list->setFilterVisible(ui.action_Show_Filter_Bar->isChecked()); game_list->setFilterVisible(ui->action_Show_Filter_Bar->isChecked());
if (ui.action_Show_Filter_Bar->isChecked()) { if (ui->action_Show_Filter_Bar->isChecked()) {
game_list->setFilterFocus(); game_list->setFilterFocus();
} else { } else {
game_list->clearFilter(); game_list->clearFilter();
@ -1859,9 +1863,9 @@ void GMainWindow::OnRecordMovie() {
QMessageBox::information(this, tr("Record Movie"), QMessageBox::information(this, tr("Record Movie"),
tr("Recording will start once you boot a game.")); tr("Recording will start once you boot a game."));
} }
ui.action_Record_Movie->setEnabled(false); ui->action_Record_Movie->setEnabled(false);
ui.action_Play_Movie->setEnabled(false); ui->action_Play_Movie->setEnabled(false);
ui.action_Stop_Recording_Playback->setEnabled(true); ui->action_Stop_Recording_Playback->setEnabled(true);
} }
bool GMainWindow::ValidateMovie(const QString& path, u64 program_id) { bool GMainWindow::ValidateMovie(const QString& path, u64 program_id) {
@ -1953,9 +1957,9 @@ void GMainWindow::OnPlayMovie() {
Core::Movie::GetInstance().StartPlayback(path.toStdString(), [this] { Core::Movie::GetInstance().StartPlayback(path.toStdString(), [this] {
QMetaObject::invokeMethod(this, "OnMoviePlaybackCompleted"); QMetaObject::invokeMethod(this, "OnMoviePlaybackCompleted");
}); });
ui.action_Record_Movie->setEnabled(false); ui->action_Record_Movie->setEnabled(false);
ui.action_Play_Movie->setEnabled(false); ui->action_Play_Movie->setEnabled(false);
ui.action_Stop_Recording_Playback->setEnabled(true); ui->action_Stop_Recording_Playback->setEnabled(true);
} }
void GMainWindow::OnStopRecordingPlayback() { void GMainWindow::OnStopRecordingPlayback() {
@ -1971,9 +1975,9 @@ void GMainWindow::OnStopRecordingPlayback() {
tr("The movie is successfully saved.")); tr("The movie is successfully saved."));
} }
} }
ui.action_Record_Movie->setEnabled(true); ui->action_Record_Movie->setEnabled(true);
ui.action_Play_Movie->setEnabled(true); ui->action_Play_Movie->setEnabled(true);
ui.action_Stop_Recording_Playback->setEnabled(false); ui->action_Stop_Recording_Playback->setEnabled(false);
} }
void GMainWindow::OnCaptureScreenshot() { void GMainWindow::OnCaptureScreenshot() {
@ -1996,7 +2000,7 @@ void GMainWindow::OnCaptureScreenshot() {
void GMainWindow::OnStartVideoDumping() { void GMainWindow::OnStartVideoDumping() {
DumpingDialog dialog(this); DumpingDialog dialog(this);
if (dialog.exec() != QDialog::DialogCode::Accepted) { if (dialog.exec() != QDialog::DialogCode::Accepted) {
ui.action_Dump_Video->setChecked(false); ui->action_Dump_Video->setChecked(false);
return; return;
} }
const auto path = dialog.GetFilePath(); const auto path = dialog.GetFilePath();
@ -2007,7 +2011,7 @@ void GMainWindow::OnStartVideoDumping() {
QMessageBox::critical( QMessageBox::critical(
this, tr("Citra"), this, tr("Citra"),
tr("Could not start video dumping.<br>Refer to the log for details.")); tr("Could not start video dumping.<br>Refer to the log for details."));
ui.action_Dump_Video->setChecked(false); ui->action_Dump_Video->setChecked(false);
} }
} else { } else {
video_dumping_on_start = true; video_dumping_on_start = true;
@ -2016,7 +2020,7 @@ void GMainWindow::OnStartVideoDumping() {
} }
void GMainWindow::OnStopVideoDumping() { void GMainWindow::OnStopVideoDumping() {
ui.action_Dump_Video->setChecked(false); ui->action_Dump_Video->setChecked(false);
if (video_dumping_on_start) { if (video_dumping_on_start) {
video_dumping_on_start = false; video_dumping_on_start = false;
@ -2180,7 +2184,7 @@ void GMainWindow::closeEvent(QCloseEvent* event) {
return; return;
} }
if (!ui.action_Fullscreen->isChecked()) { if (!ui->action_Fullscreen->isChecked()) {
UISettings::values.geometry = saveGeometry(); UISettings::values.geometry = saveGeometry();
UISettings::values.renderwindow_geometry = render_window->saveGeometry(); UISettings::values.renderwindow_geometry = render_window->saveGeometry();
} }
@ -2189,11 +2193,11 @@ void GMainWindow::closeEvent(QCloseEvent* event) {
UISettings::values.microprofile_geometry = microProfileDialog->saveGeometry(); UISettings::values.microprofile_geometry = microProfileDialog->saveGeometry();
UISettings::values.microprofile_visible = microProfileDialog->isVisible(); UISettings::values.microprofile_visible = microProfileDialog->isVisible();
#endif #endif
UISettings::values.single_window_mode = ui.action_Single_Window_Mode->isChecked(); UISettings::values.single_window_mode = ui->action_Single_Window_Mode->isChecked();
UISettings::values.fullscreen = ui.action_Fullscreen->isChecked(); UISettings::values.fullscreen = ui->action_Fullscreen->isChecked();
UISettings::values.display_titlebar = ui.action_Display_Dock_Widget_Headers->isChecked(); UISettings::values.display_titlebar = ui->action_Display_Dock_Widget_Headers->isChecked();
UISettings::values.show_filter_bar = ui.action_Show_Filter_Bar->isChecked(); UISettings::values.show_filter_bar = ui->action_Show_Filter_Bar->isChecked();
UISettings::values.show_status_bar = ui.action_Show_Status_Bar->isChecked(); UISettings::values.show_status_bar = ui->action_Show_Status_Bar->isChecked();
UISettings::values.first_start = false; UISettings::values.first_start = false;
game_list->SaveInterfaceLayout(); game_list->SaveInterfaceLayout();
@ -2275,7 +2279,7 @@ bool GMainWindow::ConfirmChangeGame() {
} }
void GMainWindow::filterBarSetChecked(bool state) { void GMainWindow::filterBarSetChecked(bool state) {
ui.action_Show_Filter_Bar->setChecked(state); ui->action_Show_Filter_Bar->setChecked(state);
emit(OnToggleFilterBar()); emit(OnToggleFilterBar());
} }
@ -2339,19 +2343,19 @@ void GMainWindow::OnLanguageChanged(const QString& locale) {
UISettings::values.language = locale; UISettings::values.language = locale;
LoadTranslation(); LoadTranslation();
ui.retranslateUi(this); ui->retranslateUi(this);
RetranslateStatusBar(); RetranslateStatusBar();
UpdateWindowTitle(); UpdateWindowTitle();
if (emulation_running) if (emulation_running)
ui.action_Start->setText(tr("Continue")); ui->action_Start->setText(tr("Continue"));
} }
void GMainWindow::OnMoviePlaybackCompleted() { void GMainWindow::OnMoviePlaybackCompleted() {
QMessageBox::information(this, tr("Playback Completed"), tr("Movie playback completed.")); QMessageBox::information(this, tr("Playback Completed"), tr("Movie playback completed."));
ui.action_Record_Movie->setEnabled(true); ui->action_Record_Movie->setEnabled(true);
ui.action_Play_Movie->setEnabled(true); ui->action_Play_Movie->setEnabled(true);
ui.action_Stop_Recording_Playback->setEnabled(false); ui->action_Stop_Recording_Playback->setEnabled(false);
} }
void GMainWindow::UpdateWindowTitle() { void GMainWindow::UpdateWindowTitle() {
@ -2365,16 +2369,16 @@ void GMainWindow::UpdateWindowTitle() {
} }
void GMainWindow::SyncMenuUISettings() { void GMainWindow::SyncMenuUISettings() {
ui.action_Screen_Layout_Default->setChecked(Settings::values.layout_option == ui->action_Screen_Layout_Default->setChecked(Settings::values.layout_option ==
Settings::LayoutOption::Default); Settings::LayoutOption::Default);
ui.action_Screen_Layout_Single_Screen->setChecked(Settings::values.layout_option == ui->action_Screen_Layout_Single_Screen->setChecked(Settings::values.layout_option ==
Settings::LayoutOption::SingleScreen); Settings::LayoutOption::SingleScreen);
ui.action_Screen_Layout_Large_Screen->setChecked(Settings::values.layout_option == ui->action_Screen_Layout_Large_Screen->setChecked(Settings::values.layout_option ==
Settings::LayoutOption::LargeScreen); Settings::LayoutOption::LargeScreen);
ui.action_Screen_Layout_Side_by_Side->setChecked(Settings::values.layout_option == ui->action_Screen_Layout_Side_by_Side->setChecked(Settings::values.layout_option ==
Settings::LayoutOption::SideScreen); Settings::LayoutOption::SideScreen);
ui.action_Screen_Layout_Swap_Screens->setChecked(Settings::values.swap_screen); ui->action_Screen_Layout_Swap_Screens->setChecked(Settings::values.swap_screen);
ui.action_Screen_Layout_Upright_Screens->setChecked(Settings::values.upright_screen); ui->action_Screen_Layout_Upright_Screens->setChecked(Settings::values.upright_screen);
} }
void GMainWindow::RetranslateStatusBar() { void GMainWindow::RetranslateStatusBar() {

View File

@ -15,7 +15,6 @@
#include "core/core.h" #include "core/core.h"
#include "core/hle/service/am/am.h" #include "core/hle/service/am/am.h"
#include "core/savestate.h" #include "core/savestate.h"
#include "ui_main.h"
class AboutDialog; class AboutDialog;
class Config; class Config;
@ -49,6 +48,10 @@ namespace DiscordRPC {
class DiscordInterface; class DiscordInterface;
} }
namespace Ui {
class MainWindow;
}
class GMainWindow : public QMainWindow { class GMainWindow : public QMainWindow {
Q_OBJECT Q_OBJECT
@ -230,7 +233,7 @@ private:
void HideMouseCursor(); void HideMouseCursor();
void ShowMouseCursor(); void ShowMouseCursor();
Ui::MainWindow ui; std::unique_ptr<Ui::MainWindow> ui;
GRenderWindow* render_window; GRenderWindow* render_window;

View File

@ -18,6 +18,7 @@
#include "core/hle/service/cfg/cfg.h" #include "core/hle/service/cfg/cfg.h"
#include "core/settings.h" #include "core/settings.h"
#include "network/network.h" #include "network/network.h"
#include "ui_lobby.h"
#ifdef ENABLE_WEB_SERVICE #ifdef ENABLE_WEB_SERVICE
#include "web_service/web_backend.h" #include "web_service/web_backend.h"
#endif #endif
@ -81,6 +82,8 @@ Lobby::Lobby(QWidget* parent, QStandardItemModel* list,
RefreshLobby(); RefreshLobby();
} }
Lobby::~Lobby() = default;
void Lobby::UpdateGameList(QStandardItemModel* list) { void Lobby::UpdateGameList(QStandardItemModel* list) {
game_list->clear(); game_list->clear();
for (int i = 0; i < list->rowCount(); i++) { for (int i = 0; i < list->rowCount(); i++) {

View File

@ -13,7 +13,10 @@
#include "common/announce_multiplayer_room.h" #include "common/announce_multiplayer_room.h"
#include "core/announce_multiplayer_session.h" #include "core/announce_multiplayer_session.h"
#include "network/network.h" #include "network/network.h"
#include "ui_lobby.h"
namespace Ui {
class Lobby;
}
class LobbyModel; class LobbyModel;
class LobbyFilterProxyModel; class LobbyFilterProxyModel;
@ -28,7 +31,7 @@ class Lobby : public QDialog {
public: public:
explicit Lobby(QWidget* parent, QStandardItemModel* list, explicit Lobby(QWidget* parent, QStandardItemModel* list,
std::shared_ptr<Core::AnnounceMultiplayerSession> session); std::shared_ptr<Core::AnnounceMultiplayerSession> session);
~Lobby() = default; ~Lobby() override;
/** /**
* Updates the lobby with a new game list model. * Updates the lobby with a new game list model.