Qt: Allow users to create shortcuts for existing bootable entries even after canceling the installation

This commit is contained in:
Megamouse 2023-01-11 06:32:21 +01:00
commit 1852b370d7

View file

@ -1035,10 +1035,6 @@ void main_window::HandlePackageInstallation(QStringList file_paths)
m_game_list_frame->Refresh(true); m_game_list_frame->Refresh(true);
pdlg.hide();
if (!cancelled)
{
std::map<std::string, QString> bootable_paths_installed; // -> title id std::map<std::string, QString> bootable_paths_installed; // -> title id
for (usz index = 0; index < bootable_paths.size(); index++) for (usz index = 0; index < bootable_paths.size(); index++)
@ -1051,6 +1047,10 @@ void main_window::HandlePackageInstallation(QStringList file_paths)
bootable_paths_installed[bootable_paths[index]] = packages[index].title_id; bootable_paths_installed[bootable_paths[index]] = packages[index].title_id;
} }
pdlg.hide();
if (!cancelled || !bootable_paths_installed.empty())
{
if (bootable_paths_installed.empty()) if (bootable_paths_installed.empty())
{ {
m_gui_settings->ShowInfoBox(tr("Success!"), tr("Successfully installed software from package(s)!"), gui::ib_pkg_success, this); m_gui_settings->ShowInfoBox(tr("Success!"), tr("Successfully installed software from package(s)!"), gui::ib_pkg_success, this);