mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-04 22:19:02 +00:00
Add cache removal to UI
This commit is contained in:
parent
84867b0848
commit
5ed700db5d
4 changed files with 25 additions and 1 deletions
|
|
@ -1186,6 +1186,8 @@ void main_window::CreateConnects()
|
|||
connect(ui->batchRemoveCustomConfigurationsAct, &QAction::triggered, m_gameListFrame, &game_list_frame::BatchRemoveCustomConfigurations);
|
||||
connect(ui->batchRemoveCustomPadConfigurationsAct, &QAction::triggered, m_gameListFrame, &game_list_frame::BatchRemoveCustomPadConfigurations);
|
||||
|
||||
connect(ui->removeDiskCacheAct, &QAction::triggered, this, &main_window::RemoveDiskCache);
|
||||
|
||||
connect(ui->sysPauseAct, &QAction::triggered, this, &main_window::OnPlayOrPause);
|
||||
connect(ui->sysStopAct, &QAction::triggered, [=]() { Emu.Stop(); });
|
||||
connect(ui->sysRebootAct, &QAction::triggered, [=]() { Emu.Restart(); });
|
||||
|
|
@ -1637,6 +1639,20 @@ void main_window::SetIconSizeActions(int idx)
|
|||
ui->setIconSizeLargeAct->setChecked(true);
|
||||
}
|
||||
|
||||
void main_window::RemoveDiskCache()
|
||||
{
|
||||
std::string cacheDir = Emulator::GetHdd1Dir() + "/cache";
|
||||
|
||||
if (fs::is_dir(cacheDir) && fs::remove_all(cacheDir, false))
|
||||
{
|
||||
QMessageBox::information(this, tr("Cache Cleared"), tr("Disk cache was cleared successfully"));
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::warning(this, tr("Error"), tr("Could not remove disk cache"));
|
||||
}
|
||||
}
|
||||
|
||||
void main_window::keyPressEvent(QKeyEvent *keyEvent)
|
||||
{
|
||||
if (((keyEvent->modifiers() & Qt::AltModifier) && keyEvent->key() == Qt::Key_Return) || (isFullScreen() && keyEvent->key() == Qt::Key_Escape))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue