Qt: Remove multiple sources of truth for supported formats

Setup wizard was outdated.
This commit is contained in:
Stenzek
2026-07-04 19:45:17 +10:00
parent 584999e3f3
commit 79c08b6486
5 changed files with 25 additions and 11 deletions
+6 -1
View File
@@ -75,7 +75,7 @@ static constexpr QSize ACHIEVEMENT_PIXMAP_SIZE(16, 16);
static constexpr QSize COMPATIBILITY_PIXMAP_SIZE(96, 24);
static const char* SUPPORTED_FORMATS_STRING =
QT_TRANSLATE_NOOP(GameListWidget, ".cue (Cue Sheets)\n"
QT_TRANSLATE_NOOP("GameListWidget", ".cue (Cue Sheets)\n"
".iso (Single Track Image)\n"
".ecm (Error Code Modeling Image)\n"
".mds (Media Descriptor Sidecar)\n"
@@ -1921,6 +1921,11 @@ GameListWidget::GameListWidget(QWidget* parent, QAction* action_view_list, QActi
GameListWidget::~GameListWidget() = default;
QString GameListWidget::getSupportedFormatsString()
{
return qApp->translate("GameListWidget", SUPPORTED_FORMATS_STRING);
}
bool GameListWidget::isShowingGameList() const
{
return (m_ui.stack->currentIndex() == VIEW_MODE_LIST);
+3
View File
@@ -292,6 +292,9 @@ public:
void setShowCoverTitles(bool enabled);
void focusSearchWidget();
// Returns translated supported formats string. Formats are separated by newlines.
static QString getSupportedFormatsString();
Q_SIGNALS:
void refreshProgress(const QString& status, int current, int total);
void refreshComplete();
+8 -2
View File
@@ -177,7 +177,7 @@ void SetupWizardDialog::setupUi()
setupLanguagePage(true);
setupBIOSPage();
setupGameListPage();
setupGameListPage(true);
setupControllerPage(true);
setupGraphicsPage(true);
setupAchievementsPage(true);
@@ -210,6 +210,7 @@ void SetupWizardDialog::languageChanged()
QtHost::UpdateApplicationLanguage(this);
m_ui.retranslateUi(this);
setupLanguagePage(false);
setupGameListPage(false);
setupControllerPage(false);
setupGraphicsPage(false);
setupAchievementsPage(false);
@@ -240,8 +241,13 @@ void SetupWizardDialog::refreshBiosList()
BIOSSettingsWidget::setDropDownValue(m_ui.imagePAL, Core::GetBaseStringSettingValue("BIOS", "PathPAL"), false);
}
void SetupWizardDialog::setupGameListPage()
void SetupWizardDialog::setupGameListPage(bool initial)
{
m_ui.gameDirectoriesDescription->setText(
m_ui.gameDirectoriesDescription->text().arg(GameListWidget::getSupportedFormatsString().split('\n').join(", ")));
if (!initial)
return;
m_directory_model = new GameListSearchDirectoriesModel(this);
m_ui.searchDirectoryList->setModel(m_directory_model);
QtUtils::SetColumnWidthsForTreeView(m_ui.searchDirectoryList, {-1, 100});
+1 -1
View File
@@ -40,7 +40,7 @@ private:
void setupUi();
void setupLanguagePage(bool initial);
void setupBIOSPage();
void setupGameListPage();
void setupGameListPage(bool initial);
void setupControllerPage(bool initial);
void setupGraphicsPage(bool initial);
void updateResolutionScaleWarning();
+1 -1
View File
@@ -486,7 +486,7 @@
<item>
<widget class="QLabel" name="gameDirectoriesDescription">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;DuckStation will automatically scan and identify games from the selected directories below, and populate the game list. These games should be dumped from discs you own. Utilities such as ImgBurn can be used to create images of game discs in .bin/.cue format.&lt;/p&gt;&lt;p&gt;Supported formats for dumps include: &lt;span style=&quot; font-weight:700;&quot;&gt;.cue&lt;/span&gt; (Cue Sheets), &lt;span style=&quot; font-weight:700;&quot;&gt;.iso/.img&lt;/span&gt; (Single Track Image), &lt;span style=&quot; font-weight:700;&quot;&gt;.ecm&lt;/span&gt; (Error Code Modeling Image), &lt;span style=&quot; font-weight:700;&quot;&gt;.mds&lt;/span&gt; (Media Descriptor Sidecar), &lt;span style=&quot; font-weight:700;&quot;&gt;.chd&lt;/span&gt; (Compressed Hunks of Data), &lt;span style=&quot; font-weight:700;&quot;&gt;.pbp&lt;/span&gt; (PlayStation Portable, Only Decrypted).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;DuckStation will automatically scan and identify games from the selected directories below, and populate the game list. These games should be dumped from discs you own. Utilities such as ImgBurn can be used to create images of game discs in .bin/.cue format.&lt;/p&gt;&lt;p&gt;Supported formats for dumps include: %1&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop</set>