Skip to content

Commit

Permalink
Qt: Show EN and Sorting titles in game summary
Browse files Browse the repository at this point in the history
  • Loading branch information
TellowKrinkle committed Sep 10, 2023
1 parent e739535 commit cd17937
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 19 deletions.
12 changes: 11 additions & 1 deletion pcsx2-qt/Settings/GameSummaryWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,21 @@ void GameSummaryWidget::populateInputProfiles()
void GameSummaryWidget::populateDetails(const GameList::Entry* entry)
{
m_ui.title->setText(QString::fromStdString(entry->title));
m_ui.titleSort->setText(QString::fromStdString(entry->title_sort));
m_ui.titleEN->setText(QString::fromStdString(entry->title_en));
m_ui.path->setText(QString::fromStdString(entry->path));
m_ui.serial->setText(QString::fromStdString(entry->serial));
m_ui.crc->setText(QString::fromStdString(fmt::format("{:08X}", entry->crc)));
m_ui.type->setCurrentIndex(static_cast<int>(entry->type));
m_ui.region->setCurrentIndex(static_cast<int>(entry->region));
m_ui.compatibility->setCurrentIndex(static_cast<int>(entry->compatibility_rating));

int row = 0;
m_ui.detailsFormLayout->getWidgetPosition(m_ui.titleSort, &row, nullptr);
m_ui.detailsFormLayout->setRowVisible(row, !entry->title_sort.empty());
m_ui.detailsFormLayout->getWidgetPosition(m_ui.titleEN, &row, nullptr);
m_ui.detailsFormLayout->setRowVisible(row, !entry->title_en.empty());

std::optional<std::string> profile(m_dialog->getStringValue("EmuCore", "InputProfileName", std::nullopt));
if (profile.has_value())
m_ui.inputProfile->setCurrentIndex(m_ui.inputProfile->findText(QString::fromStdString(profile.value())));
Expand Down Expand Up @@ -128,7 +136,9 @@ void GameSummaryWidget::populateDiscPath(const GameList::Entry* entry)
else
{
// Makes no sense to have disc override for a disc.
m_ui.detailsFormLayout->removeRow(8);
int row = 0;
m_ui.detailsFormLayout->getWidgetPosition(m_ui.label_discPath, &row, nullptr);
m_ui.detailsFormLayout->removeRow(row);
m_ui.discPath = nullptr;
m_ui.discPathBrowse = nullptr;
m_ui.discPathClear = nullptr;
Expand Down
64 changes: 46 additions & 18 deletions pcsx2-qt/Settings/GameSummaryWidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -55,55 +55,83 @@
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_titleSort">
<property name="text">
<string extracomment='Name for use in sorting (e.g. "XXX, The" for a game called "The XXX")'>Sorting Title:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="titleSort">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_titleEN">
<property name="text">
<string>English Title:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="titleEN">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Path:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<item row="3" column="1">
<widget class="QLineEdit" name="path">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<item row="4" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Serial:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<item row="4" column="1">
<widget class="QLineEdit" name="serial">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<item row="5" column="0">
<widget class="QLabel" name="label_36">
<property name="text">
<string>CRC:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<item row="5" column="1">
<widget class="QLineEdit" name="crc">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<item row="6" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Type:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<item row="6" column="1">
<widget class="QComboBox" name="type">
<property name="enabled">
<bool>false</bool>
Expand Down Expand Up @@ -146,14 +174,14 @@
</item>
</widget>
</item>
<item row="5" column="0">
<item row="7" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Region:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<item row="7" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QComboBox" name="region">
Expand Down Expand Up @@ -327,14 +355,14 @@
</item>
</layout>
</item>
<item row="6" column="0">
<item row="8" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Compatibility:</string>
</property>
</widget>
</item>
<item row="6" column="1">
<item row="8" column="1">
<widget class="QComboBox" name="compatibility">
<property name="enabled">
<bool>false</bool>
Expand Down Expand Up @@ -385,14 +413,14 @@
</item>
</widget>
</item>
<item row="7" column="0">
<item row="9" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Input Profile:</string>
</property>
</widget>
</item>
<item row="7" column="1">
<item row="9" column="1">
<widget class="QComboBox" name="inputProfile">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
Expand All @@ -407,14 +435,14 @@
</item>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_8">
<item row="10" column="0">
<widget class="QLabel" name="label_discPath">
<property name="text">
<string>Disc Path:</string>
</property>
</widget>
</item>
<item row="8" column="1">
<item row="10" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLineEdit" name="discPath"/>
Expand All @@ -435,7 +463,7 @@
</item>
</layout>
</item>
<item row="10" column="0" colspan="2">
<item row="11" column="0" colspan="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
Expand All @@ -448,7 +476,7 @@
</property>
</spacer>
</item>
<item row="9" column="0" colspan="2">
<item row="12" column="0" colspan="2">
<layout class="QVBoxLayout" name="verifyLayout">
<item>
<widget class="QTableWidget" name="tracks">
Expand Down

0 comments on commit cd17937

Please sign in to comment.