mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 13:20:27 -06:00
DolphinQt: Change game properties QTabWidget to QListWidget.
This commit is contained in:
@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QTabWidget>
|
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
#include "DiscIO/Enums.h"
|
#include "DiscIO/Enums.h"
|
||||||
@ -24,28 +23,22 @@
|
|||||||
#include "DolphinQt/QtUtils/WrapInScrollArea.h"
|
#include "DolphinQt/QtUtils/WrapInScrollArea.h"
|
||||||
|
|
||||||
#include "UICommon/GameFile.h"
|
#include "UICommon/GameFile.h"
|
||||||
#include "VideoCommon/VideoConfig.h"
|
|
||||||
|
|
||||||
PropertiesDialog::PropertiesDialog(QWidget* parent, const UICommon::GameFile& game)
|
PropertiesDialog::PropertiesDialog(QWidget* parent, const UICommon::GameFile& game)
|
||||||
: QDialog(parent)
|
: StackedSettingsWindow{parent}
|
||||||
{
|
{
|
||||||
setWindowTitle(QStringLiteral("%1: %2 - %3")
|
setWindowTitle(QStringLiteral("%1: %2 - %3")
|
||||||
.arg(QString::fromStdString(game.GetFileName()),
|
.arg(QString::fromStdString(game.GetFileName()),
|
||||||
QString::fromStdString(game.GetGameID()),
|
QString::fromStdString(game.GetGameID()),
|
||||||
QString::fromStdString(game.GetLongName())));
|
QString::fromStdString(game.GetLongName())));
|
||||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
|
||||||
|
|
||||||
QVBoxLayout* layout = new QVBoxLayout();
|
auto* const info = new InfoWidget(game);
|
||||||
|
auto* const ar = new ARCodeWidget(game.GetGameID(), game.GetRevision());
|
||||||
QTabWidget* tab_widget = new QTabWidget(this);
|
auto* const gecko =
|
||||||
InfoWidget* info = new InfoWidget(game);
|
|
||||||
|
|
||||||
ARCodeWidget* ar = new ARCodeWidget(game.GetGameID(), game.GetRevision());
|
|
||||||
GeckoCodeWidget* gecko =
|
|
||||||
new GeckoCodeWidget(game.GetGameID(), game.GetGameTDBID(), game.GetRevision());
|
new GeckoCodeWidget(game.GetGameID(), game.GetGameTDBID(), game.GetRevision());
|
||||||
PatchesWidget* patches = new PatchesWidget(game);
|
auto* const patches = new PatchesWidget(game);
|
||||||
GameConfigWidget* game_config = new GameConfigWidget(game);
|
auto* const game_config = new GameConfigWidget(game);
|
||||||
GraphicsModListWidget* graphics_mod_list = new GraphicsModListWidget(game);
|
auto* const graphics_mod_list = new GraphicsModListWidget(game);
|
||||||
|
|
||||||
connect(gecko, &GeckoCodeWidget::OpenGeneralSettings, this,
|
connect(gecko, &GeckoCodeWidget::OpenGeneralSettings, this,
|
||||||
&PropertiesDialog::OpenGeneralSettings);
|
&PropertiesDialog::OpenGeneralSettings);
|
||||||
@ -63,45 +56,31 @@ PropertiesDialog::PropertiesDialog(QWidget* parent, const UICommon::GameFile& ga
|
|||||||
connect(graphics_mod_list, &GraphicsModListWidget::OpenGraphicsSettings, this,
|
connect(graphics_mod_list, &GraphicsModListWidget::OpenGraphicsSettings, this,
|
||||||
&PropertiesDialog::OpenGraphicsSettings);
|
&PropertiesDialog::OpenGraphicsSettings);
|
||||||
|
|
||||||
const int padding_width = 120;
|
// Note: Intentional selective use of AddWrappedPane for a sensible dialog "minimumSize".
|
||||||
const int padding_height = 100;
|
AddWrappedPane(info, tr("Info"));
|
||||||
tab_widget->addTab(GetWrappedWidget(info, this, padding_width, padding_height), tr("Info"));
|
AddPane(game_config, tr("Game Config"));
|
||||||
tab_widget->addTab(GetWrappedWidget(game_config, this, padding_width, padding_height),
|
AddPane(patches, tr("Patches"));
|
||||||
tr("Game Config"));
|
AddPane(ar, tr("AR Codes"));
|
||||||
tab_widget->addTab(GetWrappedWidget(patches, this, padding_width, padding_height), tr("Patches"));
|
AddPane(gecko, tr("Gecko Codes"));
|
||||||
tab_widget->addTab(GetWrappedWidget(ar, this, padding_width, padding_height), tr("AR Codes"));
|
AddWrappedPane(graphics_mod_list, tr("Graphics Mods"));
|
||||||
tab_widget->addTab(GetWrappedWidget(gecko, this, padding_width, padding_height),
|
|
||||||
tr("Gecko Codes"));
|
|
||||||
tab_widget->addTab(GetWrappedWidget(graphics_mod_list, this, padding_width, padding_height),
|
|
||||||
tr("Graphics Mods"));
|
|
||||||
|
|
||||||
if (game.GetPlatform() != DiscIO::Platform::ELFOrDOL)
|
if (game.GetPlatform() != DiscIO::Platform::ELFOrDOL)
|
||||||
{
|
{
|
||||||
std::shared_ptr<DiscIO::Volume> volume = DiscIO::CreateVolume(game.GetFilePath());
|
std::shared_ptr<DiscIO::Volume> volume = DiscIO::CreateVolume(game.GetFilePath());
|
||||||
if (volume)
|
if (volume)
|
||||||
{
|
{
|
||||||
VerifyWidget* verify = new VerifyWidget(volume);
|
auto* const verify = new VerifyWidget(volume);
|
||||||
tab_widget->addTab(GetWrappedWidget(verify, this, padding_width, padding_height),
|
AddPane(verify, tr("Verify"));
|
||||||
tr("Verify"));
|
|
||||||
|
|
||||||
if (DiscIO::IsDisc(game.GetPlatform()))
|
if (DiscIO::IsDisc(game.GetPlatform()))
|
||||||
{
|
{
|
||||||
FilesystemWidget* filesystem = new FilesystemWidget(volume);
|
auto* const filesystem = new FilesystemWidget(volume);
|
||||||
tab_widget->addTab(GetWrappedWidget(filesystem, this, padding_width, padding_height),
|
AddPane(filesystem, tr("Filesystem"));
|
||||||
tr("Filesystem"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
layout->addWidget(tab_widget);
|
connect(this, &QDialog::rejected, graphics_mod_list, &GraphicsModListWidget::SaveToDisk);
|
||||||
|
|
||||||
QDialogButtonBox* close_box = new QDialogButtonBox(QDialogButtonBox::Close);
|
OnDoneCreatingPanes();
|
||||||
|
|
||||||
connect(close_box, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
|
||||||
connect(close_box, &QDialogButtonBox::rejected, graphics_mod_list,
|
|
||||||
&GraphicsModListWidget::SaveToDisk);
|
|
||||||
|
|
||||||
layout->addWidget(close_box);
|
|
||||||
|
|
||||||
setLayout(layout);
|
|
||||||
}
|
}
|
||||||
|
@ -5,12 +5,14 @@
|
|||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
|
#include "DolphinQt/Config/SettingsWindow.h"
|
||||||
|
|
||||||
namespace UICommon
|
namespace UICommon
|
||||||
{
|
{
|
||||||
class GameFile;
|
class GameFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
class PropertiesDialog final : public QDialog
|
class PropertiesDialog final : public StackedSettingsWindow
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
Reference in New Issue
Block a user