mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-14 18:58:36 +12:00
Add cache removal to UI
This commit is contained in:
parent
84867b0848
commit
5ed700db5d
4 changed files with 25 additions and 1 deletions
|
@ -345,11 +345,11 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static std::string GetEmuDir();
|
static std::string GetEmuDir();
|
||||||
static std::string GetHdd1Dir();
|
|
||||||
|
|
||||||
void LimitCacheSize();
|
void LimitCacheSize();
|
||||||
public:
|
public:
|
||||||
static std::string GetHddDir();
|
static std::string GetHddDir();
|
||||||
|
static std::string GetHdd1Dir();
|
||||||
static std::string GetSfoDirFromGamePath(const std::string& game_path, const std::string& user, const std::string& title_id = "");
|
static std::string GetSfoDirFromGamePath(const std::string& game_path, const std::string& user, const std::string& title_id = "");
|
||||||
|
|
||||||
static std::string GetCustomConfigDir();
|
static std::string GetCustomConfigDir();
|
||||||
|
|
|
@ -1186,6 +1186,8 @@ void main_window::CreateConnects()
|
||||||
connect(ui->batchRemoveCustomConfigurationsAct, &QAction::triggered, m_gameListFrame, &game_list_frame::BatchRemoveCustomConfigurations);
|
connect(ui->batchRemoveCustomConfigurationsAct, &QAction::triggered, m_gameListFrame, &game_list_frame::BatchRemoveCustomConfigurations);
|
||||||
connect(ui->batchRemoveCustomPadConfigurationsAct, &QAction::triggered, m_gameListFrame, &game_list_frame::BatchRemoveCustomPadConfigurations);
|
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->sysPauseAct, &QAction::triggered, this, &main_window::OnPlayOrPause);
|
||||||
connect(ui->sysStopAct, &QAction::triggered, [=]() { Emu.Stop(); });
|
connect(ui->sysStopAct, &QAction::triggered, [=]() { Emu.Stop(); });
|
||||||
connect(ui->sysRebootAct, &QAction::triggered, [=]() { Emu.Restart(); });
|
connect(ui->sysRebootAct, &QAction::triggered, [=]() { Emu.Restart(); });
|
||||||
|
@ -1637,6 +1639,20 @@ void main_window::SetIconSizeActions(int idx)
|
||||||
ui->setIconSizeLargeAct->setChecked(true);
|
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)
|
void main_window::keyPressEvent(QKeyEvent *keyEvent)
|
||||||
{
|
{
|
||||||
if (((keyEvent->modifiers() & Qt::AltModifier) && keyEvent->key() == Qt::Key_Return) || (isFullScreen() && keyEvent->key() == Qt::Key_Escape))
|
if (((keyEvent->modifiers() & Qt::AltModifier) && keyEvent->key() == Qt::Key_Return) || (isFullScreen() && keyEvent->key() == Qt::Key_Escape))
|
||||||
|
|
|
@ -126,6 +126,7 @@ private:
|
||||||
QAction* CreateRecentAction(const q_string_pair& entry, const uint& sc_idx);
|
QAction* CreateRecentAction(const q_string_pair& entry, const uint& sc_idx);
|
||||||
void BootRecentAction(const QAction* act);
|
void BootRecentAction(const QAction* act);
|
||||||
void AddRecentAction(const q_string_pair& entry);
|
void AddRecentAction(const q_string_pair& entry);
|
||||||
|
void RemoveDiskCache();
|
||||||
|
|
||||||
q_pair_list m_rg_entries;
|
q_pair_list m_rg_entries;
|
||||||
QList<QAction*> m_recentGameActs;
|
QList<QAction*> m_recentGameActs;
|
||||||
|
|
|
@ -176,6 +176,8 @@
|
||||||
<addaction name="batchRemovePPUCachesAct"/>
|
<addaction name="batchRemovePPUCachesAct"/>
|
||||||
<addaction name="batchRemoveSPUCachesAct"/>
|
<addaction name="batchRemoveSPUCachesAct"/>
|
||||||
<addaction name="batchRemoveShaderCachesAct"/>
|
<addaction name="batchRemoveShaderCachesAct"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
|
<addaction name="removeDiskCacheAct"/>
|
||||||
</widget>
|
</widget>
|
||||||
<addaction name="bootElfAct"/>
|
<addaction name="bootElfAct"/>
|
||||||
<addaction name="bootGameAct"/>
|
<addaction name="bootGameAct"/>
|
||||||
|
@ -1001,6 +1003,11 @@
|
||||||
<string>Remove Custom Pad Configurations</string>
|
<string>Remove Custom Pad Configurations</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="removeDiskCacheAct">
|
||||||
|
<property name="text">
|
||||||
|
<string>Remove Disk Cache</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<layoutdefault spacing="6" margin="11"/>
|
<layoutdefault spacing="6" margin="11"/>
|
||||||
<resources>
|
<resources>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue