mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-04 00:45:46 +08:00
Used new cache features ( #494 ) with GUI
This commit is contained in:
committed by
Mathew Sutcliffe
parent
71c219842f
commit
99802cb98b
@@ -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