Qt/Loader: Let users choose which packages to install

This commit is contained in:
Megamouse 2023-06-01 02:08:09 +02:00
parent c3b7229fbb
commit 66e1cf96e2
6 changed files with 111 additions and 44 deletions

View file

@ -554,6 +554,21 @@ void gui_application::InitializeCallbacks()
});
};
if (m_show_gui) // If this is false, we already have a fallback in the main_application.
{
callbacks.on_install_pkgs = [this](const std::vector<std::string>& pkgs)
{
ensure(m_main_window);
ensure(!pkgs.empty());
QStringList pkg_list;
for (const std::string& pkg : pkgs)
{
pkg_list << QString::fromStdString(pkg);
}
return m_main_window->InstallPackages(pkg_list, true);
};
}
Emu.SetCallbacks(std::move(callbacks));
}