Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #9513 from leoetlino/info-ios-version-qt
Qt: Re-add IOS version to the game info tab
  • Loading branch information
leoetlino committed Mar 1, 2021
2 parents 858f00b + 7097a7b commit 010279f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Source/Core/DolphinQt/Config/InfoWidget.cpp
Expand Up @@ -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"
Expand All @@ -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());
Expand All @@ -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"));
Expand Down Expand Up @@ -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<u32>(tmd.GetIOSId()));
layout->addRow(tr("IOS Version:"), CreateValueDisplay(ios));
}
}

group->setLayout(layout);
return group;
}
Expand Down
8 changes: 8 additions & 0 deletions Source/Core/DolphinQt/Config/InfoWidget.h
Expand Up @@ -4,12 +4,18 @@

#pragma once

#include <memory>
#include <string>

#include <QWidget>

#include "UICommon/GameFile.h"

namespace DiscIO
{
class Volume;
}

class QComboBox;
class QGroupBox;
class QLineEdit;
Expand All @@ -21,6 +27,7 @@ class InfoWidget final : public QWidget
Q_OBJECT
public:
explicit InfoWidget(const UICommon::GameFile& game);
~InfoWidget() override;

private:
void ChangeLanguage();
Expand All @@ -34,6 +41,7 @@ class InfoWidget final : public QWidget
void CreateLanguageSelector();
QWidget* CreateBannerGraphic(const QPixmap& image);

std::unique_ptr<DiscIO::Volume> m_volume;
UICommon::GameFile m_game;
QComboBox* m_language_selector;
QLineEdit* m_name = {};
Expand Down

0 comments on commit 010279f

Please sign in to comment.