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);
}
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())
{
@ -980,13 +980,18 @@ void game_list_frame::CreateShortcuts(const game_info& gameinfo, std::vector<gui
}
}
if (success)
#ifdef _WIN32
if (locations.size() > 1 || !locations.contains(gui::utils::shortcut_location::rpcs3_shortcuts))
#endif
{
QMessageBox::information(this, tr("Success!"), tr("Successfully created shortcut(s)."));
}
else
{
QMessageBox::warning(this, tr("Warning!"), tr("Failed to create shortcut(s)!"));
if (success)
{
QMessageBox::information(this, tr("Success!"), tr("Successfully created shortcut(s)."));
}
else
{
QMessageBox::warning(this, tr("Warning!"), tr("Failed to create shortcut(s)!"));
}
}
}

View File

@ -62,7 +62,7 @@ public:
// Returns the visible version string in the game list
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:
void BatchCreatePPUCaches();

View File

@ -997,17 +997,17 @@ void main_window::HandlePackageInstallation(QStringList file_paths)
dlg->exec();
}
std::vector<gui::utils::shortcut_location> locations;
std::set<gui::utils::shortcut_location> locations;
#ifdef _WIN32
locations.push_back(gui::utils::shortcut_location::rpcs3_shortcuts);
locations.insert(gui::utils::shortcut_location::rpcs3_shortcuts);
#endif
if (create_desktop_shortcuts)
{
locations.push_back(gui::utils::shortcut_location::desktop);
locations.insert(gui::utils::shortcut_location::desktop);
}
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)