Used new cache features ( #494 ) with GUI

This commit is contained in:
Klaus Basan
2015-11-06 19:54:50 +01:00
committed by Mathew Sutcliffe
parent 71c219842f
commit 99802cb98b
7 changed files with 172 additions and 56 deletions

View File

@@ -22,7 +22,7 @@
#include <QDesktopServices>
#include <QProcess>
#include <QFontDialog>
#include <QDir>
using namespace BlackGui;
using namespace BlackCore;
@@ -78,19 +78,45 @@ void SwiftGuiStd::ps_onMenuClicked()
CLogMessage(this).info("Closing");
this->close();
}
else if (sender == this->ui->menu_FileSettingsDirectory)
else if (sender == this->ui->menu_SettingsDirectory)
{
QString path(QDir::toNativeSeparators(CSettingsCache::persistentStore()));
QDesktopServices::openUrl(QUrl("file:///" + path));
if (QDir(path).exists())
{
QDesktopServices::openUrl(QUrl("file:///" + path));
}
}
else if (sender == this->ui->menu_FileCacheDirectory)
else if (sender == this->ui->menu_SettingsReset)
{
CSettingsCache::instance()->clearAllValues();
this->ui->comp_MainInfoArea->getLogComponent()->appendPlainTextToConsole("Cleared all settings!");
this->displayConsole();
}
else if (sender == this->ui->menu_SettingsFiles)
{
QStringList cachedFiles(CSettingsCache::instance()->enumerateStore());
this->ui->comp_MainInfoArea->getLogComponent()->appendPlainTextToConsole(cachedFiles.join("\n"));
this->displayConsole();
}
else if (sender == this->ui->menu_CacheDirectory)
{
QString path(QDir::toNativeSeparators(CDataCache::persistentStore()));
QDesktopServices::openUrl(QUrl("file:///" + path));
if (QDir(path).exists())
{
QDesktopServices::openUrl(QUrl("file:///" + path));
}
}
else if (sender == this->ui->menu_FileResetSettings)
else if (sender == this->ui->menu_CacheFiles)
{
//! \todo
QStringList cachedFiles(CDataCache::instance()->enumerateStore());
this->ui->comp_MainInfoArea->getLogComponent()->appendPlainTextToConsole(cachedFiles.join("\n"));
this->displayConsole();
}
else if (sender == this->ui->menu_CacheReset)
{
CDataCache::instance()->clearAllValues();
this->ui->comp_MainInfoArea->getLogComponent()->appendPlainTextToConsole("Cleared all cached values!");
this->displayConsole();
}
else if (sender == this->ui->menu_Internals)
{
@@ -120,16 +146,6 @@ void SwiftGuiStd::ps_onMenuClicked()
this->ui->comp_MainInfoArea->getLogComponent()->appendPlainTextToConsole(project);
this->displayConsole();
}
else if (sender == this->ui->menu_InternalsDisplayCachedFiles)
{
//! \todo
this->displayConsole();
}
else if (sender == this->ui->menu_InternalsDeleteCachedFiles)
{
//! \todo
this->displayConsole();
}
}
void SwiftGuiStd::initDynamicMenus()