Qt: don't show message if only the rpcs3 games dir shortcut was created

This commit is contained in:
Megamouse 2022-12-11 17:47:59 +01:00
parent 0d929a210f
commit f38084f0cf
3 changed files with 17 additions and 12 deletions

View file

@ -894,7 +894,7 @@ void game_list_frame::ItemSelectionChangedSlot()
Q_EMIT NotifyGameSelection(game); Q_EMIT NotifyGameSelection(game);
} }
void game_list_frame::CreateShortcuts(const game_info& gameinfo, std::vector<gui::utils::shortcut_location> locations) void game_list_frame::CreateShortcuts(const game_info& gameinfo, const std::set<gui::utils::shortcut_location>& locations)
{ {
if (locations.empty()) if (locations.empty())
{ {
@ -980,6 +980,10 @@ void game_list_frame::CreateShortcuts(const game_info& gameinfo, std::vector<gui
} }
} }
#ifdef _WIN32
if (locations.size() > 1 || !locations.contains(gui::utils::shortcut_location::rpcs3_shortcuts))
#endif
{
if (success) if (success)
{ {
QMessageBox::information(this, tr("Success!"), tr("Successfully created shortcut(s).")); QMessageBox::information(this, tr("Success!"), tr("Successfully created shortcut(s)."));
@ -988,6 +992,7 @@ void game_list_frame::CreateShortcuts(const game_info& gameinfo, std::vector<gui
{ {
QMessageBox::warning(this, tr("Warning!"), tr("Failed to create shortcut(s)!")); QMessageBox::warning(this, tr("Warning!"), tr("Failed to create shortcut(s)!"));
} }
}
} }
void game_list_frame::ShowContextMenu(const QPoint &pos) void game_list_frame::ShowContextMenu(const QPoint &pos)

View file

@ -62,7 +62,7 @@ public:
// Returns the visible version string in the game list // Returns the visible version string in the game list
static std::string GetGameVersion(const game_info& game); static std::string GetGameVersion(const game_info& game);
void CreateShortcuts(const game_info& gameinfo, std::vector<gui::utils::shortcut_location> locations); void CreateShortcuts(const game_info& gameinfo, const std::set<gui::utils::shortcut_location>& locations);
public Q_SLOTS: public Q_SLOTS:
void BatchCreatePPUCaches(); void BatchCreatePPUCaches();

View file

@ -997,17 +997,17 @@ void main_window::HandlePackageInstallation(QStringList file_paths)
dlg->exec(); dlg->exec();
} }
std::vector<gui::utils::shortcut_location> locations; std::set<gui::utils::shortcut_location> locations;
#ifdef _WIN32 #ifdef _WIN32
locations.push_back(gui::utils::shortcut_location::rpcs3_shortcuts); locations.insert(gui::utils::shortcut_location::rpcs3_shortcuts);
#endif #endif
if (create_desktop_shortcuts) if (create_desktop_shortcuts)
{ {
locations.push_back(gui::utils::shortcut_location::desktop); locations.insert(gui::utils::shortcut_location::desktop);
} }
if (create_app_shortcut) if (create_app_shortcut)
{ {
locations.push_back(gui::utils::shortcut_location::applications); locations.insert(gui::utils::shortcut_location::applications);
} }
for (const auto& [boot_path, title_id] : bootable_paths_installed) for (const auto& [boot_path, title_id] : bootable_paths_installed)