Skip to content

Commit f7eb0d8

Browse files
authored
Enrich game list title (#19229)
Add on Game List title a brief recap of total number of entries in the list and total number of Disc, HDD and all the other remaining types of content.
1 parent fc93d93 commit f7eb0d8

3 files changed

Lines changed: 39 additions & 1 deletion

File tree

rpcs3/rpcs3qt/game_list_actions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ game_list_actions::content_info game_list_actions::GetContentInfo(const std::vec
170170
}
171171
}
172172

173-
text = tr("%0 selected games: %1 Disc Game - %2 not Disc Game\n").arg(games.size())
173+
text = tr("%0 selected games - Disc: %1 | Other: %2\n").arg(games.size())
174174
.arg(content_info.disc_list.size()).arg(games.size() - content_info.disc_list.size());
175175

176176
text += tr("\nDisc Game Info:\n");

rpcs3/rpcs3qt/game_list_frame.cpp

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,40 @@ bool game_list_frame::IsEntryVisible(const game_info& game, bool search_fallback
346346
return is_visible && matches_category() && SearchMatchesApp(QString::fromStdString(game->info.name), serial, search_fallback);
347347
}
348348

349+
// Show the amount of listed games (and the Disc/HDD/Other share) in the dock title
350+
void game_list_frame::UpdateWindowTitle(const std::vector<game_info>& matching_apps)
351+
{
352+
const std::string cat_disc_game = cat::cat_disc_game.toStdString();
353+
const std::string cat_hdd_game = cat::cat_hdd_game.toStdString();
354+
usz disc_games = 0;
355+
usz hdd_games = 0;
356+
usz other_games = 0;
357+
358+
for (const auto& app : matching_apps)
359+
{
360+
if (!app) continue;
361+
362+
if (app->info.category == cat_disc_game)
363+
{
364+
disc_games++;
365+
}
366+
else if (app->info.category == cat_hdd_game)
367+
{
368+
hdd_games++;
369+
}
370+
else
371+
{
372+
other_games++;
373+
}
374+
}
375+
376+
setWindowTitle(tr("Game List (%0) - Disc: %1 | HDD: %2 | Other: %3")
377+
.arg(matching_apps.size())
378+
.arg(disc_games)
379+
.arg(hdd_games)
380+
.arg(other_games));
381+
}
382+
349383
void game_list_frame::push_path(const std::string& path, std::vector<std::string>& legit_paths)
350384
{
351385
{
@@ -534,6 +568,8 @@ void game_list_frame::Refresh(const bool from_drive, const std::vector<std::stri
534568
m_game_grid->populate(matching_apps, m_notes, m_titles, selected_items, m_play_hover_movies, m_play_hover_music);
535569
RepaintIcons();
536570
}
571+
572+
UpdateWindowTitle(matching_apps);
537573
}
538574

539575
void game_list_frame::OnParsingFinished()

rpcs3/rpcs3qt/game_list_frame.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ private Q_SLOTS:
141141
std::set<std::string> m_done_paths;
142142
};
143143

144+
void UpdateWindowTitle(const std::vector<game_info>& matching_apps);
145+
144146
void push_path(const std::string& path, std::vector<std::string>& legit_paths);
145147

146148
QString get_header_text(int col) const;

0 commit comments

Comments
 (0)