2016-02-29 19:52:15 +11:00
|
|
|
// Copyright 2016 Dolphin Emulator Project
|
2021-07-05 03:22:19 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2016-02-29 19:52:15 +11:00
|
|
|
|
2021-12-09 18:22:16 -08:00
|
|
|
#include "DolphinQt/Config/PropertiesDialog.h"
|
|
|
|
|
|
2019-03-21 23:04:56 +01:00
|
|
|
#include <memory>
|
|
|
|
|
|
2016-02-29 19:52:15 +11:00
|
|
|
#include <QDialogButtonBox>
|
2018-03-20 10:12:11 +01:00
|
|
|
#include <QPushButton>
|
2016-02-29 19:52:15 +11:00
|
|
|
#include <QVBoxLayout>
|
|
|
|
|
|
2018-05-13 15:55:51 -04:00
|
|
|
#include "DiscIO/Enums.h"
|
2019-03-21 23:04:56 +01:00
|
|
|
#include "DiscIO/Volume.h"
|
2018-05-13 15:55:51 -04:00
|
|
|
|
2018-07-07 00:40:15 +02:00
|
|
|
#include "DolphinQt/Config/ARCodeWidget.h"
|
|
|
|
|
#include "DolphinQt/Config/FilesystemWidget.h"
|
|
|
|
|
#include "DolphinQt/Config/GameConfigWidget.h"
|
|
|
|
|
#include "DolphinQt/Config/GeckoCodeWidget.h"
|
2022-03-02 00:38:00 -06:00
|
|
|
#include "DolphinQt/Config/GraphicsModListWidget.h"
|
2018-07-07 00:40:15 +02:00
|
|
|
#include "DolphinQt/Config/InfoWidget.h"
|
|
|
|
|
#include "DolphinQt/Config/PatchesWidget.h"
|
2019-03-21 23:04:56 +01:00
|
|
|
#include "DolphinQt/Config/VerifyWidget.h"
|
2018-07-07 00:40:15 +02:00
|
|
|
#include "DolphinQt/QtUtils/WrapInScrollArea.h"
|
2018-05-28 03:48:04 +02:00
|
|
|
|
2017-12-31 20:33:36 +01:00
|
|
|
#include "UICommon/GameFile.h"
|
2016-02-29 19:52:15 +11:00
|
|
|
|
2017-12-31 20:33:36 +01:00
|
|
|
PropertiesDialog::PropertiesDialog(QWidget* parent, const UICommon::GameFile& game)
|
2025-06-02 14:00:06 +02:00
|
|
|
: StackedSettingsWindow{parent}, m_filepath(game.GetFilePath())
|
2016-02-29 19:52:15 +11:00
|
|
|
{
|
2017-12-31 20:33:36 +01:00
|
|
|
setWindowTitle(QStringLiteral("%1: %2 - %3")
|
|
|
|
|
.arg(QString::fromStdString(game.GetFileName()),
|
|
|
|
|
QString::fromStdString(game.GetGameID()),
|
|
|
|
|
QString::fromStdString(game.GetLongName())));
|
2018-05-05 02:29:16 +02:00
|
|
|
|
2025-05-12 16:59:59 -05:00
|
|
|
auto* const info = new InfoWidget(game);
|
|
|
|
|
auto* const ar = new ARCodeWidget(game.GetGameID(), game.GetRevision());
|
|
|
|
|
auto* const gecko =
|
2021-06-06 21:25:37 +02:00
|
|
|
new GeckoCodeWidget(game.GetGameID(), game.GetGameTDBID(), game.GetRevision());
|
2025-05-12 16:59:59 -05:00
|
|
|
auto* const patches = new PatchesWidget(game);
|
|
|
|
|
auto* const game_config = new GameConfigWidget(game);
|
|
|
|
|
auto* const graphics_mod_list = new GraphicsModListWidget(game);
|
2017-09-10 19:10:45 +02:00
|
|
|
|
|
|
|
|
connect(gecko, &GeckoCodeWidget::OpenGeneralSettings, this,
|
|
|
|
|
&PropertiesDialog::OpenGeneralSettings);
|
|
|
|
|
|
2018-01-01 20:01:58 +00:00
|
|
|
connect(ar, &ARCodeWidget::OpenGeneralSettings, this, &PropertiesDialog::OpenGeneralSettings);
|
2023-11-15 12:03:21 -05:00
|
|
|
#ifdef USE_RETRO_ACHIEVEMENTS
|
2023-06-07 21:53:38 -04:00
|
|
|
connect(ar, &ARCodeWidget::OpenAchievementSettings, this,
|
|
|
|
|
&PropertiesDialog::OpenAchievementSettings);
|
|
|
|
|
connect(gecko, &GeckoCodeWidget::OpenAchievementSettings, this,
|
|
|
|
|
&PropertiesDialog::OpenAchievementSettings);
|
2023-11-15 12:03:21 -05:00
|
|
|
connect(patches, &PatchesWidget::OpenAchievementSettings, this,
|
|
|
|
|
&PropertiesDialog::OpenAchievementSettings);
|
|
|
|
|
#endif // USE_RETRO_ACHIEVEMENTS
|
2018-01-01 20:01:58 +00:00
|
|
|
|
2022-03-31 00:44:32 -05:00
|
|
|
connect(graphics_mod_list, &GraphicsModListWidget::OpenGraphicsSettings, this,
|
|
|
|
|
&PropertiesDialog::OpenGraphicsSettings);
|
|
|
|
|
|
2025-05-12 16:59:59 -05:00
|
|
|
// Note: Intentional selective use of AddWrappedPane for a sensible dialog "minimumSize".
|
|
|
|
|
AddWrappedPane(info, tr("Info"));
|
|
|
|
|
AddPane(game_config, tr("Game Config"));
|
|
|
|
|
AddPane(patches, tr("Patches"));
|
|
|
|
|
AddPane(ar, tr("AR Codes"));
|
|
|
|
|
AddPane(gecko, tr("Gecko Codes"));
|
|
|
|
|
AddWrappedPane(graphics_mod_list, tr("Graphics Mods"));
|
2017-08-25 20:32:07 +02:00
|
|
|
|
2019-03-21 23:04:56 +01:00
|
|
|
if (game.GetPlatform() != DiscIO::Platform::ELFOrDOL)
|
2017-08-25 20:32:07 +02:00
|
|
|
{
|
2019-07-14 15:49:42 +02:00
|
|
|
std::shared_ptr<DiscIO::Volume> volume = DiscIO::CreateVolume(game.GetFilePath());
|
2019-03-21 23:04:56 +01:00
|
|
|
if (volume)
|
|
|
|
|
{
|
2025-05-12 16:59:59 -05:00
|
|
|
auto* const verify = new VerifyWidget(volume);
|
|
|
|
|
AddPane(verify, tr("Verify"));
|
2019-03-21 23:04:56 +01:00
|
|
|
|
|
|
|
|
if (DiscIO::IsDisc(game.GetPlatform()))
|
|
|
|
|
{
|
2025-05-12 16:59:59 -05:00
|
|
|
auto* const filesystem = new FilesystemWidget(volume);
|
|
|
|
|
AddPane(filesystem, tr("Filesystem"));
|
2019-03-21 23:04:56 +01:00
|
|
|
}
|
|
|
|
|
}
|
2017-08-25 20:32:07 +02:00
|
|
|
}
|
|
|
|
|
|
2025-05-12 16:59:59 -05:00
|
|
|
connect(this, &QDialog::rejected, graphics_mod_list, &GraphicsModListWidget::SaveToDisk);
|
2016-02-29 19:52:15 +11:00
|
|
|
|
2025-05-12 16:59:59 -05:00
|
|
|
OnDoneCreatingPanes();
|
2016-02-29 19:52:15 +11:00
|
|
|
}
|