Qt: add Remove All Caches to the game context menu

This commit is contained in:
Megamouse 2019-06-15 19:54:45 +02:00 committed by Ivan
parent b94730fa95
commit 5928dd826c

View File

@ -773,6 +773,7 @@ void game_list_frame::ShowContextMenu(const QPoint &pos)
}
if (fs::is_dir(cache_base_dir))
{
remove_menu->addSeparator();
QAction* removeShadersCache = remove_menu->addAction(tr("&Remove Shaders Cache"));
connect(removeShadersCache, &QAction::triggered, [=]()
{
@ -788,6 +789,16 @@ void game_list_frame::ShowContextMenu(const QPoint &pos)
{
RemoveSPUCache(cache_base_dir, true);
});
QAction* removeAllCaches = remove_menu->addAction(tr("&Remove All Caches"));
connect(removeAllCaches, &QAction::triggered, [=]()
{
if (QMessageBox::question(this, tr("Confirm Removal"), tr("Remove all caches?")) != QMessageBox::Yes)
return;
RemoveShadersCache(cache_base_dir);
RemovePPUCache(cache_base_dir);
RemoveSPUCache(cache_base_dir);
});
}
myMenu.addSeparator();
QAction* openGameFolder = myMenu.addAction(tr("&Open Install Folder"));