cache: moved disk settings to a separate dialog

This way the cache settings can be accessed in both ProjectProperties and
Preferences.
This commit is contained in:
itsmattkc
2020-08-10 20:30:11 +10:00
parent 192ea45a24
commit 03e33227b3
9 changed files with 230 additions and 55 deletions
+20
View File
@@ -31,6 +31,7 @@
#include "common/filefunctions.h"
#include "config/config.h"
#include "core.h"
#include "dialog/diskcache/diskcachedialog.h"
OLIVE_NAMESPACE_ENTER
@@ -165,6 +166,25 @@ QString DiskManager::GetDefaultDiskCachePath()
return QDir(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)).filePath("mediacache");
}
void DiskManager::ShowDiskCacheSettingsDialog(DiskCacheFolder *folder, QWidget *parent)
{
DiskCacheDialog d(folder, parent);
d.exec();
}
void DiskManager::ShowDiskCacheSettingsDialog(const QString &path, QWidget *parent)
{
if (!FileFunctions::DirectoryIsValid(path, true)) {
QMessageBox::critical(parent, tr("Disk Cache Error"),
tr("Failed to open disk cache at \"%1\". Try a different folder.").arg(path));
return;
}
DiskCacheFolder* folder = GetOpenFolder(path);
ShowDiskCacheSettingsDialog(folder, parent);
}
DiskCacheFolder::DiskCacheFolder(const QString &path, QObject *parent) :
QObject(parent)
{