2016-02-29 08:52:15 +00:00
|
|
|
// Copyright 2016 Dolphin Emulator Project
|
2021-07-05 01:22:19 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2016-02-29 08:52:15 +00:00
|
|
|
|
2019-03-21 22:04:56 +00:00
|
|
|
#include <memory>
|
|
|
|
|
2016-02-29 08:52:15 +00:00
|
|
|
#include <QDialogButtonBox>
|
2018-03-20 09:12:11 +00:00
|
|
|
#include <QPushButton>
|
2016-02-29 08:52:15 +00:00
|
|
|
#include <QTabWidget>
|
|
|
|
#include <QVBoxLayout>
|
|
|
|
|
2018-05-13 19:55:51 +00:00
|
|
|
#include "DiscIO/Enums.h"
|
2019-03-21 22:04:56 +00:00
|
|
|
#include "DiscIO/Volume.h"
|
2018-05-13 19:55:51 +00:00
|
|
|
|
2018-07-06 22:40:15 +00:00
|
|
|
#include "DolphinQt/Config/ARCodeWidget.h"
|
|
|
|
#include "DolphinQt/Config/FilesystemWidget.h"
|
|
|
|
#include "DolphinQt/Config/GameConfigWidget.h"
|
|
|
|
#include "DolphinQt/Config/GeckoCodeWidget.h"
|
|
|
|
#include "DolphinQt/Config/InfoWidget.h"
|
|
|
|
#include "DolphinQt/Config/PatchesWidget.h"
|
|
|
|
#include "DolphinQt/Config/PropertiesDialog.h"
|
2019-03-21 22:04:56 +00:00
|
|
|
#include "DolphinQt/Config/VerifyWidget.h"
|
2018-07-06 22:40:15 +00:00
|
|
|
#include "DolphinQt/QtUtils/WrapInScrollArea.h"
|
2018-05-28 01:48:04 +00:00
|
|
|
|
2017-12-31 19:33:36 +00:00
|
|
|
#include "UICommon/GameFile.h"
|
2016-02-29 08:52:15 +00:00
|
|
|
|
2017-12-31 19:33:36 +00:00
|
|
|
PropertiesDialog::PropertiesDialog(QWidget* parent, const UICommon::GameFile& game)
|
|
|
|
: QDialog(parent)
|
2016-02-29 08:52:15 +00:00
|
|
|
{
|
2017-12-31 19:33:36 +00:00
|
|
|
setWindowTitle(QStringLiteral("%1: %2 - %3")
|
|
|
|
.arg(QString::fromStdString(game.GetFileName()),
|
|
|
|
QString::fromStdString(game.GetGameID()),
|
|
|
|
QString::fromStdString(game.GetLongName())));
|
2018-05-05 00:29:16 +00:00
|
|
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
|
|
|
|
2016-02-29 08:52:15 +00:00
|
|
|
QVBoxLayout* layout = new QVBoxLayout();
|
|
|
|
|
|
|
|
QTabWidget* tab_widget = new QTabWidget(this);
|
|
|
|
InfoWidget* info = new InfoWidget(game);
|
2017-09-10 17:10:45 +00:00
|
|
|
|
2021-06-06 19:18:02 +00:00
|
|
|
ARCodeWidget* ar = new ARCodeWidget(game.GetGameID(), game.GetRevision());
|
2021-06-06 19:25:37 +00:00
|
|
|
GeckoCodeWidget* gecko =
|
|
|
|
new GeckoCodeWidget(game.GetGameID(), game.GetGameTDBID(), game.GetRevision());
|
2018-02-16 13:53:52 +00:00
|
|
|
PatchesWidget* patches = new PatchesWidget(game);
|
2018-03-01 12:12:31 +00:00
|
|
|
GameConfigWidget* game_config = new GameConfigWidget(game);
|
2017-09-10 17:10:45 +00:00
|
|
|
|
|
|
|
connect(gecko, &GeckoCodeWidget::OpenGeneralSettings, this,
|
|
|
|
&PropertiesDialog::OpenGeneralSettings);
|
|
|
|
|
2018-01-01 20:01:58 +00:00
|
|
|
connect(ar, &ARCodeWidget::OpenGeneralSettings, this, &PropertiesDialog::OpenGeneralSettings);
|
|
|
|
|
2019-03-06 12:46:00 +00:00
|
|
|
const int padding_width = 120;
|
|
|
|
const int padding_height = 100;
|
|
|
|
tab_widget->addTab(GetWrappedWidget(game_config, this, padding_width, padding_height),
|
|
|
|
tr("Game Config"));
|
|
|
|
tab_widget->addTab(GetWrappedWidget(patches, this, padding_width, padding_height), tr("Patches"));
|
|
|
|
tab_widget->addTab(GetWrappedWidget(ar, this, padding_width, padding_height), tr("AR Codes"));
|
|
|
|
tab_widget->addTab(GetWrappedWidget(gecko, this, padding_width, padding_height),
|
|
|
|
tr("Gecko Codes"));
|
|
|
|
tab_widget->addTab(GetWrappedWidget(info, this, padding_width, padding_height), tr("Info"));
|
2017-08-25 18:32:07 +00:00
|
|
|
|
2019-03-21 22:04:56 +00:00
|
|
|
if (game.GetPlatform() != DiscIO::Platform::ELFOrDOL)
|
2017-08-25 18:32:07 +00:00
|
|
|
{
|
2019-07-14 13:49:42 +00:00
|
|
|
std::shared_ptr<DiscIO::Volume> volume = DiscIO::CreateVolume(game.GetFilePath());
|
2019-03-21 22:04:56 +00:00
|
|
|
if (volume)
|
|
|
|
{
|
|
|
|
VerifyWidget* verify = new VerifyWidget(volume);
|
|
|
|
tab_widget->addTab(GetWrappedWidget(verify, this, padding_width, padding_height),
|
|
|
|
tr("Verify"));
|
|
|
|
|
|
|
|
if (DiscIO::IsDisc(game.GetPlatform()))
|
|
|
|
{
|
|
|
|
FilesystemWidget* filesystem = new FilesystemWidget(volume);
|
|
|
|
tab_widget->addTab(GetWrappedWidget(filesystem, this, padding_width, padding_height),
|
|
|
|
tr("Filesystem"));
|
|
|
|
}
|
|
|
|
}
|
2017-08-25 18:32:07 +00:00
|
|
|
}
|
|
|
|
|
2016-02-29 08:52:15 +00:00
|
|
|
layout->addWidget(tab_widget);
|
|
|
|
|
2018-03-20 09:12:11 +00:00
|
|
|
QDialogButtonBox* close_box = new QDialogButtonBox(QDialogButtonBox::Close);
|
|
|
|
|
|
|
|
connect(close_box, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
|
|
|
|
|
|
|
layout->addWidget(close_box);
|
2016-02-29 08:52:15 +00:00
|
|
|
|
|
|
|
setLayout(layout);
|
|
|
|
}
|