From ceb1797977db5295e72056a49af8ff97b622cd99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Mon, 23 Jan 2017 15:14:41 +0100 Subject: [PATCH] DolphinWX: Show the required IOS version in info panel This is useful to know which IOS version is required by a title without having to look at the TMD manually. The IOS version row will only appear if there is a TMD, of course. --- Source/Core/DolphinWX/ISOProperties/InfoPanel.cpp | 9 +++++++++ Source/Core/DolphinWX/ISOProperties/InfoPanel.h | 1 + 2 files changed, 10 insertions(+) diff --git a/Source/Core/DolphinWX/ISOProperties/InfoPanel.cpp b/Source/Core/DolphinWX/ISOProperties/InfoPanel.cpp index 5c6a2e14ac..e534f88395 100644 --- a/Source/Core/DolphinWX/ISOProperties/InfoPanel.cpp +++ b/Source/Core/DolphinWX/ISOProperties/InfoPanel.cpp @@ -27,6 +27,7 @@ #include "Common/MD5.h" #include "Common/StringUtil.h" #include "Core/ConfigManager.h" +#include "Core/IOS/ES/Formats.h" #include "DiscIO/Enums.h" #include "DiscIO/Volume.h" #include "DolphinWX/ISOFile.h" @@ -179,6 +180,12 @@ void InfoPanel::LoadISODetails() m_revision->SetValue(StrToWxStr(std::to_string(m_opened_iso->GetRevision()))); m_date->SetValue(StrToWxStr(m_opened_iso->GetApploaderDate())); m_fst->SetValue(StrToWxStr(std::to_string(m_opened_iso->GetFSTSize()))); + if (m_ios_version) + { + IOS::HLE::TMDReader tmd{m_opened_iso->GetTMD()}; + if (tmd.IsValid()) + m_ios_version->SetValue(StringFromFormat("IOS%u", static_cast(tmd.GetIOSId()))); + } } void InfoPanel::LoadBannerDetails() @@ -216,6 +223,8 @@ wxStaticBoxSizer* InfoPanel::CreateISODetailsSizer() {_("Apploader Date:"), m_date}, {_("FST Size:"), m_fst}, }}; + if (!m_opened_iso->GetTMD().empty()) + controls.emplace_back(_("IOS Version:"), m_ios_version); const int space_10 = FromDIP(10); auto* const iso_details = new wxGridBagSizer(space_10, space_10); diff --git a/Source/Core/DolphinWX/ISOProperties/InfoPanel.h b/Source/Core/DolphinWX/ISOProperties/InfoPanel.h index 7836ee2b92..bb78d62172 100644 --- a/Source/Core/DolphinWX/ISOProperties/InfoPanel.h +++ b/Source/Core/DolphinWX/ISOProperties/InfoPanel.h @@ -62,6 +62,7 @@ private: wxTextCtrl* m_revision; wxTextCtrl* m_date; wxTextCtrl* m_fst; + wxTextCtrl* m_ios_version = nullptr; wxTextCtrl* m_md5_sum; wxButton* m_md5_sum_compute; wxChoice* m_languages;