Qt: Show EN and Sorting titles in game summary

This commit is contained in:
TellowKrinkle 2023-09-09 18:30:18 -05:00 committed by TellowKrinkle
parent 4136545b6b
commit 86782e7f3e
2 changed files with 60 additions and 22 deletions

View File

@ -81,6 +81,8 @@ void GameSummaryWidget::populateInputProfiles()
void GameSummaryWidget::populateDetails(const GameList::Entry* entry) void GameSummaryWidget::populateDetails(const GameList::Entry* entry)
{ {
m_ui.title->setText(QString::fromStdString(entry->title)); 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.path->setText(QString::fromStdString(entry->path));
m_ui.serial->setText(QString::fromStdString(entry->serial)); m_ui.serial->setText(QString::fromStdString(entry->serial));
m_ui.crc->setText(QString::fromStdString(fmt::format("{:08X}", entry->crc))); m_ui.crc->setText(QString::fromStdString(fmt::format("{:08X}", entry->crc)));
@ -88,6 +90,12 @@ void GameSummaryWidget::populateDetails(const GameList::Entry* entry)
m_ui.region->setCurrentIndex(static_cast<int>(entry->region)); m_ui.region->setCurrentIndex(static_cast<int>(entry->region));
m_ui.compatibility->setCurrentIndex(static_cast<int>(entry->compatibility_rating)); 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)); std::optional<std::string> profile(m_dialog->getStringValue("EmuCore", "InputProfileName", std::nullopt));
if (profile.has_value()) if (profile.has_value())
m_ui.inputProfile->setCurrentIndex(m_ui.inputProfile->findText(QString::fromStdString(profile.value()))); m_ui.inputProfile->setCurrentIndex(m_ui.inputProfile->findText(QString::fromStdString(profile.value())));
@ -128,7 +136,9 @@ void GameSummaryWidget::populateDiscPath(const GameList::Entry* entry)
else else
{ {
// Makes no sense to have disc override for a disc. // 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.discPath = nullptr;
m_ui.discPathBrowse = nullptr; m_ui.discPathBrowse = nullptr;
m_ui.discPathClear = nullptr; m_ui.discPathClear = nullptr;

View File

@ -55,55 +55,83 @@
</layout> </layout>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_titleSort">
<property name="text"> <property name="text">
<string>Path:</string> <string extracomment='Name for use in sorting (e.g. "XXX, The" for a game called "The XXX")'>Sorting Title:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="1" column="1">
<widget class="QLineEdit" name="path"> <widget class="QLineEdit" name="titleSort">
<property name="readOnly"> <property name="readOnly">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QLabel" name="label"> <widget class="QLabel" name="label_titleEN">
<property name="text"> <property name="text">
<string>Serial:</string> <string>English Title:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="2" column="1">
<widget class="QLineEdit" name="serial"> <widget class="QLineEdit" name="titleEN">
<property name="readOnly"> <property name="readOnly">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item row="3" column="0">
<widget class="QLabel" name="label_36"> <widget class="QLabel" name="label_2">
<property name="text"> <property name="text">
<string>CRC:</string> <string>Path:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="3" column="1">
<widget class="QLineEdit" name="crc"> <widget class="QLineEdit" name="path">
<property name="readOnly"> <property name="readOnly">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="0"> <item row="4" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Serial:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="serial">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_36">
<property name="text">
<string>CRC:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLineEdit" name="crc">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_5"> <widget class="QLabel" name="label_5">
<property name="text"> <property name="text">
<string>Type:</string> <string>Type:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1"> <item row="6" column="1">
<widget class="QComboBox" name="type"> <widget class="QComboBox" name="type">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
@ -146,14 +174,14 @@
</item> </item>
</widget> </widget>
</item> </item>
<item row="5" column="0"> <item row="7" column="0">
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="label_3">
<property name="text"> <property name="text">
<string>Region:</string> <string>Region:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="1"> <item row="7" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_6"> <layout class="QHBoxLayout" name="horizontalLayout_6">
<item> <item>
<widget class="QComboBox" name="region"> <widget class="QComboBox" name="region">
@ -327,14 +355,14 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="6" column="0"> <item row="8" column="0">
<widget class="QLabel" name="label_7"> <widget class="QLabel" name="label_7">
<property name="text"> <property name="text">
<string>Compatibility:</string> <string>Compatibility:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="1"> <item row="8" column="1">
<widget class="QComboBox" name="compatibility"> <widget class="QComboBox" name="compatibility">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
@ -385,14 +413,14 @@
</item> </item>
</widget> </widget>
</item> </item>
<item row="7" column="0"> <item row="9" column="0">
<widget class="QLabel" name="label_6"> <widget class="QLabel" name="label_6">
<property name="text"> <property name="text">
<string>Input Profile:</string> <string>Input Profile:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="1"> <item row="9" column="1">
<widget class="QComboBox" name="inputProfile"> <widget class="QComboBox" name="inputProfile">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
@ -407,14 +435,14 @@
</item> </item>
</widget> </widget>
</item> </item>
<item row="8" column="0"> <item row="10" column="0">
<widget class="QLabel" name="label_8"> <widget class="QLabel" name="label_discPath">
<property name="text"> <property name="text">
<string>Disc Path:</string> <string>Disc Path:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="1"> <item row="10" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item> <item>
<widget class="QLineEdit" name="discPath"/> <widget class="QLineEdit" name="discPath"/>
@ -435,7 +463,7 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="10" column="0" colspan="2"> <item row="11" column="0" colspan="2">
<spacer name="verticalSpacer"> <spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
@ -448,7 +476,7 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="9" column="0" colspan="2"> <item row="12" column="0" colspan="2">
<layout class="QVBoxLayout" name="verifyLayout"> <layout class="QVBoxLayout" name="verifyLayout">
<item> <item>
<widget class="QTableWidget" name="tracks"> <widget class="QTableWidget" name="tracks">