diff --git a/Source/Core/DolphinQt/Config/InfoWidget.cpp b/Source/Core/DolphinQt/Config/InfoWidget.cpp index 729f6216b7..2700b25771 100644 --- a/Source/Core/DolphinQt/Config/InfoWidget.cpp +++ b/Source/Core/DolphinQt/Config/InfoWidget.cpp @@ -17,6 +17,7 @@ #include "DiscIO/Blob.h" #include "DiscIO/Enums.h" +#include "DiscIO/Volume.h" #include "DolphinQt/Config/InfoWidget.h" #include "DolphinQt/QtUtils/ImageConverter.h" @@ -25,6 +26,8 @@ InfoWidget::InfoWidget(const UICommon::GameFile& game) : m_game(game) { + m_volume = DiscIO::CreateVolume(m_game.GetFilePath()); + QVBoxLayout* layout = new QVBoxLayout(); layout->addWidget(CreateFileDetails()); @@ -36,6 +39,8 @@ InfoWidget::InfoWidget(const UICommon::GameFile& game) : m_game(game) setLayout(layout); } +InfoWidget::~InfoWidget() = default; + QGroupBox* InfoWidget::CreateFileDetails() { QGroupBox* group = new QGroupBox(tr("File Details")); @@ -121,6 +126,17 @@ QGroupBox* InfoWidget::CreateGameDetails() if (!m_game.GetApploaderDate().empty()) layout->addRow(tr("Apploader Date:"), CreateValueDisplay(m_game.GetApploaderDate())); + if (m_volume) + { + const DiscIO::Partition partition = m_volume->GetGamePartition(); + const IOS::ES::TMDReader& tmd = m_volume->GetTMD(partition); + if (tmd.IsValid()) + { + const auto ios = fmt::format("IOS{}", static_cast(tmd.GetIOSId())); + layout->addRow(tr("IOS Version:"), CreateValueDisplay(ios)); + } + } + group->setLayout(layout); return group; } diff --git a/Source/Core/DolphinQt/Config/InfoWidget.h b/Source/Core/DolphinQt/Config/InfoWidget.h index e32474f996..0272de97a0 100644 --- a/Source/Core/DolphinQt/Config/InfoWidget.h +++ b/Source/Core/DolphinQt/Config/InfoWidget.h @@ -4,12 +4,18 @@ #pragma once +#include #include #include #include "UICommon/GameFile.h" +namespace DiscIO +{ +class Volume; +} + class QComboBox; class QGroupBox; class QLineEdit; @@ -21,6 +27,7 @@ class InfoWidget final : public QWidget Q_OBJECT public: explicit InfoWidget(const UICommon::GameFile& game); + ~InfoWidget() override; private: void ChangeLanguage(); @@ -34,6 +41,7 @@ private: void CreateLanguageSelector(); QWidget* CreateBannerGraphic(const QPixmap& image); + std::unique_ptr m_volume; UICommon::GameFile m_game; QComboBox* m_language_selector; QLineEdit* m_name = {};