dolphin/Source/Core/DolphinQt2/Config/PropertiesDialog.cpp

69 lines
2.4 KiB
C++
Raw Normal View History

// Copyright 2016 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#include <QDialogButtonBox>
2018-03-20 09:12:11 +00:00
#include <QPushButton>
#include <QTabWidget>
#include <QVBoxLayout>
#include "DiscIO/Enums.h"
2018-01-01 20:01:58 +00:00
#include "DolphinQt2/Config/ARCodeWidget.h"
#include "DolphinQt2/Config/FilesystemWidget.h"
#include "DolphinQt2/Config/GameConfigWidget.h"
#include "DolphinQt2/Config/GeckoCodeWidget.h"
#include "DolphinQt2/Config/InfoWidget.h"
#include "DolphinQt2/Config/PatchesWidget.h"
#include "DolphinQt2/Config/PropertiesDialog.h"
2018-03-17 15:07:51 +00:00
#include "DolphinQt2/QtUtils/WrapInScrollArea.h"
2018-05-28 01:48:04 +00:00
#include "UICommon/GameFile.h"
PropertiesDialog::PropertiesDialog(QWidget* parent, const UICommon::GameFile& game)
: QDialog(parent)
{
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);
QVBoxLayout* layout = new QVBoxLayout();
QTabWidget* tab_widget = new QTabWidget(this);
InfoWidget* info = new InfoWidget(game);
2018-01-01 20:01:58 +00:00
ARCodeWidget* ar = new ARCodeWidget(game);
GeckoCodeWidget* gecko = new GeckoCodeWidget(game);
PatchesWidget* patches = new PatchesWidget(game);
GameConfigWidget* game_config = new GameConfigWidget(game);
connect(gecko, &GeckoCodeWidget::OpenGeneralSettings, this,
&PropertiesDialog::OpenGeneralSettings);
2018-01-01 20:01:58 +00:00
connect(ar, &ARCodeWidget::OpenGeneralSettings, this, &PropertiesDialog::OpenGeneralSettings);
tab_widget->addTab(GetWrappedWidget(game_config, this, 90, 80), tr("Game Config"));
tab_widget->addTab(GetWrappedWidget(patches, this, 90, 80), tr("Patches"));
tab_widget->addTab(GetWrappedWidget(ar, this, 90, 80), tr("AR Codes"));
tab_widget->addTab(GetWrappedWidget(gecko, this, 90, 80), tr("Gecko Codes"));
tab_widget->addTab(GetWrappedWidget(info, this, 90, 80), tr("Info"));
if (DiscIO::IsDisc(game.GetPlatform()))
{
FilesystemWidget* filesystem = new FilesystemWidget(game);
tab_widget->addTab(GetWrappedWidget(filesystem, this, 90, 80), tr("Filesystem"));
}
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);
setLayout(layout);
}