mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 10:15:38 +08:00
Used new cache features ( #494 ) with GUI
This commit is contained in:
committed by
Mathew Sutcliffe
parent
71c219842f
commit
99802cb98b
@@ -86,11 +86,13 @@ namespace BlackGui
|
||||
void CMainInfoAreaComponent::displayLog()
|
||||
{
|
||||
this->ui->comp_Log->displayLog();
|
||||
this->selectArea(InfoAreaLog);
|
||||
}
|
||||
|
||||
void CMainInfoAreaComponent::displayConsole()
|
||||
{
|
||||
this->ui->comp_Log->displayConsole();
|
||||
this->selectArea(InfoAreaLog);
|
||||
}
|
||||
|
||||
QSize CMainInfoAreaComponent::getPreferredSizeWhenFloating(int areaIndex) const
|
||||
|
||||
@@ -112,11 +112,15 @@ void CSwiftData::initMenu()
|
||||
this->initDynamicMenus();
|
||||
this->ui->menu_WindowMinimize->setIcon(this->style()->standardIcon(QStyle::SP_TitleBarMinButton));
|
||||
connect(this->ui->menu_FileExit, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
||||
connect(this->ui->menu_FileSettingsDirectory, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
||||
connect(this->ui->menu_FileCacheDirectory, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
||||
connect(this->ui->menu_FileResetSettings, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
||||
connect(this->ui->menu_FileReloadStyleSheets, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
||||
|
||||
connect(this->ui->menu_SettingsDirectory, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
||||
connect(this->ui->menu_SettingsFiles, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
||||
connect(this->ui->menu_SettingsReset, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
||||
connect(this->ui->menu_CacheDirectory, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
||||
connect(this->ui->menu_CacheFiles, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
||||
connect(this->ui->menu_CacheReset, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
||||
|
||||
connect(this->ui->menu_WindowFont, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
||||
connect(this->ui->menu_WindowMinimize, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
||||
connect(this->ui->menu_WindowToggleOnTop, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
||||
@@ -128,8 +132,6 @@ void CSwiftData::initMenu()
|
||||
connect(this->ui->menu_InternalsEnvVars, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
||||
connect(this->ui->menu_InternalsMetatypes, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
||||
connect(this->ui->menu_InternalsSetup, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
||||
connect(this->ui->menu_InternalsDeleteCachedFiles, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
||||
connect(this->ui->menu_InternalsDisplayCachedFiles, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
||||
connect(this->ui->menu_InternalsJsonBootstrapTemplate, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="BlackGui::Components::CDataMainInfoAreaComponent" name="comp_MainInfoArea"/>
|
||||
<widget class="QWidget" name="emptyPage"/>
|
||||
<widget class="QWidget" name="comp_EmptyPage"/>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
@@ -79,9 +79,24 @@
|
||||
<property name="title">
|
||||
<string>File</string>
|
||||
</property>
|
||||
<addaction name="menu_FileSettingsDirectory"/>
|
||||
<addaction name="menu_FileCacheDirectory"/>
|
||||
<addaction name="menu_FileResetSettings"/>
|
||||
<widget class="QMenu" name="menu_Settings">
|
||||
<property name="title">
|
||||
<string>Settings</string>
|
||||
</property>
|
||||
<addaction name="menu_SettingsDirectory"/>
|
||||
<addaction name="menu_SettingsFiles"/>
|
||||
<addaction name="menu_SettingsReset"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuCache">
|
||||
<property name="title">
|
||||
<string>Cache</string>
|
||||
</property>
|
||||
<addaction name="menu_CacheDirectory"/>
|
||||
<addaction name="menu_CacheFiles"/>
|
||||
<addaction name="menu_CacheReset"/>
|
||||
</widget>
|
||||
<addaction name="menu_Settings"/>
|
||||
<addaction name="menuCache"/>
|
||||
<addaction name="menu_FileReloadStyleSheets"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="menu_FileExit"/>
|
||||
@@ -118,8 +133,6 @@
|
||||
<addaction name="menu_InternalsEnvVars"/>
|
||||
<addaction name="menu_InternalsSetup"/>
|
||||
<addaction name="menu_InternalsCompileInfo"/>
|
||||
<addaction name="menu_InternalsDisplayCachedFiles"/>
|
||||
<addaction name="menu_InternalsDeleteCachedFiles"/>
|
||||
</widget>
|
||||
<addaction name="menu_Internals"/>
|
||||
<addaction name="separator"/>
|
||||
@@ -233,9 +246,34 @@
|
||||
<string>Delete cached fies</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="menu_FileCacheDirectory">
|
||||
<action name="menu_SettingsDirectory">
|
||||
<property name="text">
|
||||
<string>Cache directory</string>
|
||||
<string>Directory</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="menu_SettingsReset">
|
||||
<property name="text">
|
||||
<string>Reset</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="menu_SettingsFiles">
|
||||
<property name="text">
|
||||
<string>Files</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="menu_CacheDirectory">
|
||||
<property name="text">
|
||||
<string>Directory</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="menu_CacheFiles">
|
||||
<property name="text">
|
||||
<string>Files</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="menu_CacheReset">
|
||||
<property name="text">
|
||||
<string>Reset</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
|
||||
@@ -53,19 +53,45 @@ void CSwiftData::ps_onMenuClicked()
|
||||
CLogMessage(this).info("Closing");
|
||||
this->close(); // graceful shutdown in close event
|
||||
}
|
||||
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 reset settings
|
||||
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_MappingMaxData)
|
||||
{
|
||||
@@ -107,16 +133,6 @@ void CSwiftData::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 CSwiftData::initDynamicMenus()
|
||||
|
||||
@@ -296,8 +296,6 @@
|
||||
<addaction name="menu_InternalsEnvVars"/>
|
||||
<addaction name="menu_InternalsSetup"/>
|
||||
<addaction name="menu_InternalsCompileInfo"/>
|
||||
<addaction name="menu_InternalsDeleteCachedFiles"/>
|
||||
<addaction name="menu_InternalsDisplayCachedFiles"/>
|
||||
</widget>
|
||||
<addaction name="menu_InternalsItem"/>
|
||||
<addaction name="separator"/>
|
||||
@@ -313,9 +311,24 @@
|
||||
<property name="title">
|
||||
<string>File</string>
|
||||
</property>
|
||||
<addaction name="menu_FileSettingsDirectory"/>
|
||||
<addaction name="menu_FileCacheDirectory"/>
|
||||
<addaction name="menu_FileResetSettings"/>
|
||||
<widget class="QMenu" name="menu_Settings">
|
||||
<property name="title">
|
||||
<string>Settings</string>
|
||||
</property>
|
||||
<addaction name="menu_SettingsDirectory"/>
|
||||
<addaction name="menu_SettingsFiles"/>
|
||||
<addaction name="menu_SettingsReset"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menu_Cache">
|
||||
<property name="title">
|
||||
<string>Cache</string>
|
||||
</property>
|
||||
<addaction name="menu_CacheDirectory"/>
|
||||
<addaction name="menu_CacheFiles"/>
|
||||
<addaction name="menu_CacheReset"/>
|
||||
</widget>
|
||||
<addaction name="menu_Settings"/>
|
||||
<addaction name="menu_Cache"/>
|
||||
<addaction name="menu_FileReloadStyleSheets"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="menu_FileExit"/>
|
||||
@@ -523,9 +536,34 @@
|
||||
<string>Display cached files</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="menu_FileCacheDirectory">
|
||||
<action name="menu_SettingsDirectory">
|
||||
<property name="text">
|
||||
<string>Cache directory</string>
|
||||
<string>Directory</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="menu_SettingsFiles">
|
||||
<property name="text">
|
||||
<string>Files</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="menu_SettingsReset">
|
||||
<property name="text">
|
||||
<string>Reset</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="menu_CacheDirectory">
|
||||
<property name="text">
|
||||
<string>Directory</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="menu_CacheFiles">
|
||||
<property name="text">
|
||||
<string>Files</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="menu_CacheReset">
|
||||
<property name="text">
|
||||
<string>Reset</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
|
||||
@@ -168,11 +168,15 @@ void SwiftGuiStd::initGuiSignals()
|
||||
connect(this->ui->menu_TestLocationsEDRY, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||
|
||||
connect(this->ui->menu_FileExit, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||
connect(this->ui->menu_FileSettingsDirectory, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||
connect(this->ui->menu_FileCacheDirectory, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||
connect(this->ui->menu_FileResetSettings, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||
connect(this->ui->menu_FileReloadStyleSheets, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||
|
||||
connect(this->ui->menu_SettingsDirectory, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||
connect(this->ui->menu_SettingsFiles, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||
connect(this->ui->menu_SettingsReset, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||
connect(this->ui->menu_CacheDirectory, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||
connect(this->ui->menu_CacheFiles, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||
connect(this->ui->menu_CacheReset, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||
|
||||
connect(this->ui->menu_WindowFont, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||
connect(this->ui->menu_WindowMinimize, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||
connect(this->ui->menu_WindowToggleOnTop, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user