Permalink
Browse files

Qt/InfoWidget: Don't display unavailable information

  • Loading branch information...
spycrab committed May 27, 2018
1 parent ed0cefe commit 4665a927ba6a13ad1bd5617cffdda6fad4487980
Showing with 23 additions and 5 deletions.
  1. +23 −5 Source/Core/DolphinQt2/Config/InfoWidget.cpp
@@ -35,26 +35,44 @@ InfoWidget::InfoWidget(const UICommon::GameFile& game) : m_game(game)
QGroupBox* InfoWidget::CreateISODetails()
{
const QString UNKNOWN_NAME = tr("Unknown");
QGroupBox* group = new QGroupBox(tr("ISO Details"));
QFormLayout* layout = new QFormLayout;
QLineEdit* file_path = CreateValueDisplay(
QStringLiteral("%1 (%2)")
.arg(QDir::toNativeSeparators(QString::fromStdString(m_game.GetFilePath())))
.arg(QString::fromStdString(UICommon::FormatSize(m_game.GetFileSize()))));
const QString game_name = QString::fromStdString(m_game.GetInternalName());
bool is_disc_based = m_game.GetPlatform() == DiscIO::Platform::GameCubeDisc ||
m_game.GetPlatform() == DiscIO::Platform::WiiDisc;
QLineEdit* internal_name =
CreateValueDisplay(tr("%1 (Disc %2, Revision %3)")
.arg(QString::fromStdString(m_game.GetInternalName()))
.arg(m_game.GetDiscNumber())
.arg(m_game.GetRevision()));
CreateValueDisplay(is_disc_based ? tr("%1 (Disc %2, Revision %3)")
.arg(game_name.isEmpty() ? UNKNOWN_NAME : game_name)
.arg(m_game.GetDiscNumber())
.arg(m_game.GetRevision()) :
tr("%1 (Revision %3)")
.arg(game_name.isEmpty() ? UNKNOWN_NAME : game_name)
.arg(m_game.GetRevision()));
QString game_id_string = QString::fromStdString(m_game.GetGameID());
if (const u64 title_id = m_game.GetTitleID())
game_id_string += QStringLiteral(" (%1)").arg(title_id, 16, 16, QLatin1Char('0'));
QLineEdit* game_id = CreateValueDisplay(game_id_string);
QLineEdit* country = CreateValueDisplay(DiscIO::GetName(m_game.GetCountry(), true));
QLineEdit* maker = CreateValueDisplay(m_game.GetMaker() + " (0x" + m_game.GetMakerID() + ")");
const std::string game_maker = m_game.GetMaker();
QLineEdit* maker =
CreateValueDisplay((game_maker.empty() ? UNKNOWN_NAME.toStdString() : game_maker) + " (0x" +
m_game.GetMakerID() + ")");
QWidget* checksum = CreateChecksumComputer();
layout->addRow(tr("Name:"), internal_name);

0 comments on commit 4665a92

Please sign in to comment.