mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-12 23:35:33 +08:00
* allow to display project, env. vars etc. in console * use setup data cache * adjust to relocated CNetworkUtils * remove console for data GUI (noticed during installer tests)
This commit is contained in:
committed by
Mathew Sutcliffe
parent
008792d95b
commit
ad146069ef
@@ -66,6 +66,18 @@ namespace BlackGui
|
|||||||
this->ui->comp_Stash->setProvider(provider);
|
this->ui->comp_Stash->setProvider(provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CDataMainInfoAreaComponent::displayLog()
|
||||||
|
{
|
||||||
|
this->selectArea(InfoAreaLog);
|
||||||
|
this->getLogComponent()->displayLog();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CDataMainInfoAreaComponent::displayConsole()
|
||||||
|
{
|
||||||
|
this->selectArea(InfoAreaLog);
|
||||||
|
this->getLogComponent()->displayConsole();
|
||||||
|
}
|
||||||
|
|
||||||
QSize CDataMainInfoAreaComponent::getPreferredSizeWhenFloating(int areaIndex) const
|
QSize CDataMainInfoAreaComponent::getPreferredSizeWhenFloating(int areaIndex) const
|
||||||
{
|
{
|
||||||
InfoArea area = static_cast<InfoArea>(areaIndex);
|
InfoArea area = static_cast<InfoArea>(areaIndex);
|
||||||
|
|||||||
@@ -72,6 +72,12 @@ namespace BlackGui
|
|||||||
//! Set data reader
|
//! Set data reader
|
||||||
virtual void setProvider(BlackMisc::Network::IWebDataServicesProvider *provider) override;
|
virtual void setProvider(BlackMisc::Network::IWebDataServicesProvider *provider) override;
|
||||||
|
|
||||||
|
//! Display the log
|
||||||
|
void displayLog();
|
||||||
|
|
||||||
|
//! Display console
|
||||||
|
void displayConsole();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
//! \copydoc CInfoArea::getPreferredSizeWhenFloating
|
//! \copydoc CInfoArea::getPreferredSizeWhenFloating
|
||||||
virtual QSize getPreferredSizeWhenFloating(int areaIndex) const override;
|
virtual QSize getPreferredSizeWhenFloating(int areaIndex) const override;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="tw_Internals">
|
<widget class="QTabWidget" name="tw_Internals">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>2</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tb_Debug">
|
<widget class="QWidget" name="tb_Debug">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
|
|||||||
@@ -83,6 +83,16 @@ namespace BlackGui
|
|||||||
return this->ui->comp_TextMessages;
|
return this->ui->comp_TextMessages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CMainInfoAreaComponent::displayLog()
|
||||||
|
{
|
||||||
|
this->ui->comp_Log->displayLog();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CMainInfoAreaComponent::displayConsole()
|
||||||
|
{
|
||||||
|
this->ui->comp_Log->displayConsole();
|
||||||
|
}
|
||||||
|
|
||||||
QSize CMainInfoAreaComponent::getPreferredSizeWhenFloating(int areaIndex) const
|
QSize CMainInfoAreaComponent::getPreferredSizeWhenFloating(int areaIndex) const
|
||||||
{
|
{
|
||||||
InfoArea area = static_cast<InfoArea>(areaIndex);
|
InfoArea area = static_cast<InfoArea>(areaIndex);
|
||||||
|
|||||||
@@ -96,6 +96,12 @@ namespace BlackGui
|
|||||||
//! Text messages
|
//! Text messages
|
||||||
CTextMessageComponent *getTextMessageComponent();
|
CTextMessageComponent *getTextMessageComponent();
|
||||||
|
|
||||||
|
//! Display the log
|
||||||
|
void displayLog();
|
||||||
|
|
||||||
|
//! Display console
|
||||||
|
void displayConsole();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
//! Toggle floating of given area
|
//! Toggle floating of given area
|
||||||
void toggleFloating(InfoArea infoArea) { CInfoArea::toggleFloatingByIndex(static_cast<int>(infoArea)); }
|
void toggleFloating(InfoArea infoArea) { CInfoArea::toggleFloatingByIndex(static_cast<int>(infoArea)); }
|
||||||
|
|||||||
@@ -98,7 +98,6 @@ void CSwiftData::initLogDisplay()
|
|||||||
logHandler->subscribe(this, &CSwiftData::ps_appendLogMessage);
|
logHandler->subscribe(this, &CSwiftData::ps_appendLogMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CSwiftData::initReaders()
|
void CSwiftData::initReaders()
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(this->m_webDataReader, Q_FUNC_INFO, "Missing reader");
|
Q_ASSERT_X(this->m_webDataReader, Q_FUNC_INFO, "Missing reader");
|
||||||
@@ -112,7 +111,6 @@ void CSwiftData::initMenu()
|
|||||||
// menu
|
// menu
|
||||||
this->initDynamicMenus();
|
this->initDynamicMenus();
|
||||||
this->ui->menu_WindowMinimize->setIcon(this->style()->standardIcon(QStyle::SP_TitleBarMinButton));
|
this->ui->menu_WindowMinimize->setIcon(this->style()->standardIcon(QStyle::SP_TitleBarMinButton));
|
||||||
connect(this->ui->menu_TestInternals, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
|
||||||
connect(this->ui->menu_FileExit, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
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_FileSettingsDirectory, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
||||||
connect(this->ui->menu_FileResetSettings, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
connect(this->ui->menu_FileResetSettings, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
||||||
@@ -120,9 +118,17 @@ void CSwiftData::initMenu()
|
|||||||
connect(this->ui->menu_WindowFont, &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_WindowMinimize, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
||||||
connect(this->ui->menu_WindowToggleOnTop, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
connect(this->ui->menu_WindowToggleOnTop, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
||||||
connect(this->ui->menu_DebugMetaTypes, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
|
||||||
connect(this->ui->menu_MappingMaxData, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
connect(this->ui->menu_MappingMaxData, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
||||||
connect(this->ui->menu_MappingMaxMapping, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
connect(this->ui->menu_MappingMaxMapping, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
||||||
|
|
||||||
|
connect(this->ui->menu_InternalsCompileInfo, &QAction::triggered, this, &CSwiftData::ps_onMenuClicked);
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSwiftData::performGracefulShutdown()
|
void CSwiftData::performGracefulShutdown()
|
||||||
@@ -133,3 +139,13 @@ void CSwiftData::performGracefulShutdown()
|
|||||||
m_webDataReader = nullptr;
|
m_webDataReader = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSwiftData::displayConsole()
|
||||||
|
{
|
||||||
|
this->ui->comp_MainInfoArea->displayConsole();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSwiftData::displayLog()
|
||||||
|
{
|
||||||
|
this->ui->comp_MainInfoArea->displayLog();
|
||||||
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#define SWIFTDATA_H
|
#define SWIFTDATA_H
|
||||||
|
|
||||||
#include "blackcore/context_runtime.h"
|
#include "blackcore/context_runtime.h"
|
||||||
|
#include "blackcore/data/globalsetup.h"
|
||||||
#include "blackgui/systemtraywindow.h"
|
#include "blackgui/systemtraywindow.h"
|
||||||
#include "blackgui/managedstatusbar.h"
|
#include "blackgui/managedstatusbar.h"
|
||||||
#include "blackmisc/statusmessage.h"
|
#include "blackmisc/statusmessage.h"
|
||||||
@@ -61,9 +62,13 @@ private:
|
|||||||
void initDynamicMenus();
|
void initDynamicMenus();
|
||||||
void performGracefulShutdown();
|
void performGracefulShutdown();
|
||||||
|
|
||||||
|
void displayConsole();
|
||||||
|
void displayLog();
|
||||||
|
|
||||||
QScopedPointer<Ui::CSwiftData> ui;
|
QScopedPointer<Ui::CSwiftData> ui;
|
||||||
BlackGui::CManagedStatusBar m_statusBar;
|
BlackGui::CManagedStatusBar m_statusBar;
|
||||||
BlackCore::CWebDataServices *m_webDataReader = nullptr;
|
BlackCore::CWebDataServices *m_webDataReader = nullptr;
|
||||||
|
BlackCore::CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< setup cache
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // guard
|
#endif // guard
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
load(common_pre)
|
load(common_pre)
|
||||||
|
|
||||||
QT += core dbus network xml multimedia gui svg
|
QT += core dbus network xml multimedia gui svg
|
||||||
CONFIG += console
|
|
||||||
|
|
||||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,14 @@
|
|||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>CSwiftData</class>
|
<class>CSwiftData</class>
|
||||||
<widget class="QMainWindow" name="CSwiftData">
|
<widget class="QMainWindow" name="CSwiftData">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>900</width>
|
||||||
|
<height>700</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>900</width>
|
<width>900</width>
|
||||||
@@ -63,7 +71,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>1024</width>
|
<width>900</width>
|
||||||
<height>21</height>
|
<height>21</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@@ -96,19 +104,24 @@
|
|||||||
<addaction name="menu_MappingMaxData"/>
|
<addaction name="menu_MappingMaxData"/>
|
||||||
<addaction name="menu_MappingMaxMapping"/>
|
<addaction name="menu_MappingMaxMapping"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="menu_Internals">
|
<widget class="QMenu" name="menu_Test">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Test</string>
|
<string>Test</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menu_Debugging">
|
<widget class="QMenu" name="menu_Internals">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Debug</string>
|
<string>Internals</string>
|
||||||
</property>
|
</property>
|
||||||
<addaction name="menu_DebugMetaTypes"/>
|
<addaction name="menu_InternalsJsonBootstrapTemplate"/>
|
||||||
|
<addaction name="menu_InternalsMetatypes"/>
|
||||||
|
<addaction name="menu_InternalsEnvVars"/>
|
||||||
|
<addaction name="menu_InternalsSetup"/>
|
||||||
|
<addaction name="menu_InternalsCompileInfo"/>
|
||||||
|
<addaction name="menu_InternalsDisplayCachedFiles"/>
|
||||||
|
<addaction name="menu_InternalsDeleteCachedFiles"/>
|
||||||
</widget>
|
</widget>
|
||||||
<addaction name="menu_TestInternals"/>
|
<addaction name="menu_Internals"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
<addaction name="menu_Debugging"/>
|
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="menu_Help">
|
<widget class="QMenu" name="menu_Help">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
@@ -120,7 +133,7 @@
|
|||||||
<addaction name="menu_InfoAreas"/>
|
<addaction name="menu_InfoAreas"/>
|
||||||
<addaction name="menu_Help"/>
|
<addaction name="menu_Help"/>
|
||||||
<addaction name="menu_Mapping"/>
|
<addaction name="menu_Mapping"/>
|
||||||
<addaction name="menu_Internals"/>
|
<addaction name="menu_Test"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QStatusBar" name="sb_SwiftData"/>
|
<widget class="QStatusBar" name="sb_SwiftData"/>
|
||||||
<action name="menu_FileExit">
|
<action name="menu_FileExit">
|
||||||
@@ -153,11 +166,6 @@
|
|||||||
<string>Minimize</string>
|
<string>Minimize</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="menu_TestInternals">
|
|
||||||
<property name="text">
|
|
||||||
<string>Internals</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="menu_MappingMaxMapping">
|
<action name="menu_MappingMaxMapping">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Max. mapping area</string>
|
<string>Max. mapping area</string>
|
||||||
@@ -189,6 +197,41 @@
|
|||||||
<string>Debug metatypes (to console)</string>
|
<string>Debug metatypes (to console)</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="menu_InternalsJsonBootstrapTemplate">
|
||||||
|
<property name="text">
|
||||||
|
<string>JSON bootstrap template</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="menu_InternalsEnvVars">
|
||||||
|
<property name="text">
|
||||||
|
<string>Env.variables</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="menu_InternalsMetatypes">
|
||||||
|
<property name="text">
|
||||||
|
<string>Metatypes</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="menu_InternalsSetup">
|
||||||
|
<property name="text">
|
||||||
|
<string>Setup</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="menu_InternalsCompileInfo">
|
||||||
|
<property name="text">
|
||||||
|
<string>Compile info</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="menu_InternalsDisplayCachedFiles">
|
||||||
|
<property name="text">
|
||||||
|
<string>All cache files</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="menu_InternalsDeleteCachedFiles">
|
||||||
|
<property name="text">
|
||||||
|
<string>Delete cached fies</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<layoutdefault spacing="6" margin="11"/>
|
<layoutdefault spacing="6" margin="11"/>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
|
|||||||
@@ -60,13 +60,6 @@ void CSwiftData::ps_onMenuClicked()
|
|||||||
{
|
{
|
||||||
// !\todo reset settings
|
// !\todo reset settings
|
||||||
}
|
}
|
||||||
else if (sender == this->ui->menu_DebugMetaTypes)
|
|
||||||
{
|
|
||||||
QString metadata;
|
|
||||||
QTextStream stream(&metadata);
|
|
||||||
BlackMisc::displayAllUserMetatypesTypes(stream);
|
|
||||||
this->ui->comp_MainInfoArea->getLogComponent()->appendPlainTextToConsole(metadata);
|
|
||||||
}
|
|
||||||
else if (sender == this->ui->menu_MappingMaxData)
|
else if (sender == this->ui->menu_MappingMaxData)
|
||||||
{
|
{
|
||||||
CDbMappingComponent *mappingComponent = this->ui->comp_MainInfoArea->getMappingComponent();
|
CDbMappingComponent *mappingComponent = this->ui->comp_MainInfoArea->getMappingComponent();
|
||||||
@@ -77,6 +70,46 @@ void CSwiftData::ps_onMenuClicked()
|
|||||||
CDbMappingComponent *mappingComponent = this->ui->comp_MainInfoArea->getMappingComponent();
|
CDbMappingComponent *mappingComponent = this->ui->comp_MainInfoArea->getMappingComponent();
|
||||||
mappingComponent->resizeForMapping();
|
mappingComponent->resizeForMapping();
|
||||||
}
|
}
|
||||||
|
else if (sender == this->ui->menu_InternalsJsonBootstrapTemplate)
|
||||||
|
{
|
||||||
|
QString json(m_setup.get().toJsonString());
|
||||||
|
this->ui->comp_MainInfoArea->getLogComponent()->appendPlainTextToConsole(json);
|
||||||
|
this->displayConsole();
|
||||||
|
}
|
||||||
|
else if (sender == this->ui->menu_InternalsMetatypes)
|
||||||
|
{
|
||||||
|
QString metadata(getAllUserMetatypesTypes());
|
||||||
|
this->ui->comp_MainInfoArea->getLogComponent()->appendPlainTextToConsole(metadata);
|
||||||
|
this->displayConsole();
|
||||||
|
}
|
||||||
|
else if (sender == this->ui->menu_InternalsSetup)
|
||||||
|
{
|
||||||
|
QString setup(this->m_setup.get().convertToQString("\n", true));
|
||||||
|
this->ui->comp_MainInfoArea->getLogComponent()->appendPlainTextToConsole(setup);
|
||||||
|
this->displayConsole();
|
||||||
|
}
|
||||||
|
else if (sender == this->ui->menu_InternalsCompileInfo)
|
||||||
|
{
|
||||||
|
QString project(CProject::convertToQString("\n"));
|
||||||
|
this->ui->comp_MainInfoArea->getLogComponent()->appendPlainTextToConsole(project);
|
||||||
|
this->displayConsole();
|
||||||
|
}
|
||||||
|
else if (sender == this->ui->menu_InternalsEnvVars)
|
||||||
|
{
|
||||||
|
QString project(CProject::getEnvironmentVariables());
|
||||||
|
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();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
QAction *a = qobject_cast<QAction *>(sender);
|
QAction *a = qobject_cast<QAction *>(sender);
|
||||||
@@ -110,7 +143,7 @@ void CSwiftData::initDynamicMenus()
|
|||||||
|
|
||||||
if (CProject::isRunningInDeveloperEnvironment() && !CRoles::roles().isAdmin())
|
if (CProject::isRunningInDeveloperEnvironment() && !CRoles::roles().isAdmin())
|
||||||
{
|
{
|
||||||
QAction *a = this->ui->menu_Internals->addAction(CIcons::user16(), "Set administrator");
|
QAction *a = this->ui->menu_Test->addAction(CIcons::user16(), "Set administrator");
|
||||||
a->setData("admin");
|
a->setData("admin");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#include "introwindow.h"
|
#include "introwindow.h"
|
||||||
#include "ui_introwindow.h"
|
#include "ui_introwindow.h"
|
||||||
#include "blackcore/dbus_server.h"
|
#include "blackcore/dbus_server.h"
|
||||||
#include "blackmisc/networkutils.h"
|
#include "blackmisc/network/networkutils.h"
|
||||||
#include "blackmisc/settingutilities.h"
|
#include "blackmisc/settingutilities.h"
|
||||||
#include "blackmisc/project.h"
|
#include "blackmisc/project.h"
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
@@ -19,6 +19,11 @@
|
|||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
|
||||||
|
using namespace BlackMisc;
|
||||||
|
using namespace BlackMisc::Network;
|
||||||
|
using namespace BlackCore;
|
||||||
|
using namespace BlackGui;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
@@ -28,11 +33,11 @@ CIntroWindow::CIntroWindow(QWidget *parent) :
|
|||||||
ui(new Ui::CIntroWindow)
|
ui(new Ui::CIntroWindow)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
this->setWindowTitle(BlackMisc::CProject::swiftVersionStringDevInfo());
|
this->setWindowTitle(CProject::swiftVersionStringDevInfo());
|
||||||
this->layout()->setSizeConstraint(QLayout::SetFixedSize);
|
this->layout()->setSizeConstraint(QLayout::SetFixedSize);
|
||||||
this->ui->cb_DBusServer->addItem(BlackCore::CDBusServer::sessionDBusServer());
|
this->ui->cb_DBusServer->addItem(CDBusServer::sessionDBusServer());
|
||||||
this->ui->cb_DBusServer->addItem(BlackCore::CDBusServer::systemDBusServer());
|
this->ui->cb_DBusServer->addItem(CDBusServer::systemDBusServer());
|
||||||
this->ui->cb_DBusServer->addItems(BlackMisc::CNetworkUtils::getKnownIpAddresses());
|
this->ui->cb_DBusServer->addItems(CNetworkUtils::getKnownIpAddresses());
|
||||||
this->ui->cb_DBusServer->setCurrentIndex(0);
|
this->ui->cb_DBusServer->setCurrentIndex(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,9 +52,9 @@ CIntroWindow::~CIntroWindow() { }
|
|||||||
BlackGui::CEnableForFramelessWindow::WindowMode CIntroWindow::getWindowMode() const
|
BlackGui::CEnableForFramelessWindow::WindowMode CIntroWindow::getWindowMode() const
|
||||||
{
|
{
|
||||||
if (this->ui->rb_WindowFrameless->isChecked())
|
if (this->ui->rb_WindowFrameless->isChecked())
|
||||||
return BlackGui::CEnableForFramelessWindow::WindowFrameless;
|
return CEnableForFramelessWindow::WindowFrameless;
|
||||||
else
|
else
|
||||||
return BlackGui::CEnableForFramelessWindow::WindowTool;
|
return CEnableForFramelessWindow::WindowTool;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -419,3 +419,14 @@ void SwiftGuiStd::playNotifcationSound(CNotificationSounds::Notification notific
|
|||||||
if (!this->ui->comp_MainInfoArea->getSettingsComponent()->playNotificationSounds()) { return; }
|
if (!this->ui->comp_MainInfoArea->getSettingsComponent()->playNotificationSounds()) { return; }
|
||||||
this->getIContextAudio()->playNotification(notification, true);
|
this->getIContextAudio()->playNotification(notification, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SwiftGuiStd::displayConsole()
|
||||||
|
{
|
||||||
|
this->ui->comp_MainInfoArea->displayConsole();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SwiftGuiStd::displayLog()
|
||||||
|
{
|
||||||
|
this->ui->comp_MainInfoArea->displayLog();
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
#include "guimodeenums.h"
|
#include "guimodeenums.h"
|
||||||
#include "blackcore/context_all_interfaces.h"
|
#include "blackcore/context_all_interfaces.h"
|
||||||
#include "blackcore/actionbind.h"
|
#include "blackcore/actionbind.h"
|
||||||
|
#include "blackcore/data/globalsetup.h"
|
||||||
#include "blackgui/components/enableforruntime.h"
|
#include "blackgui/components/enableforruntime.h"
|
||||||
#include "blackgui/components/infowindowcomponent.h"
|
#include "blackgui/components/infowindowcomponent.h"
|
||||||
#include "blackgui/components/maininfoareacomponent.h"
|
#include "blackgui/components/maininfoareacomponent.h"
|
||||||
@@ -109,16 +110,17 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QScopedPointer<Ui::SwiftGuiStd> ui;
|
QScopedPointer<Ui::SwiftGuiStd> ui;
|
||||||
bool m_init = false;
|
bool m_init = false;
|
||||||
BlackGui::Components::CInfoWindowComponent *m_compInfoWindow = nullptr; //!< the info window (popup
|
BlackGui::Components::CInfoWindowComponent *m_compInfoWindow = nullptr; //!< the info window (popup
|
||||||
BlackGui::CManagedStatusBar m_statusBar;
|
BlackGui::CManagedStatusBar m_statusBar;
|
||||||
BlackMisc::CLogSubscriber m_logSubscriber { this, &SwiftGuiStd::ps_displayStatusMessageInGui };
|
BlackMisc::CLogSubscriber m_logSubscriber { this, &SwiftGuiStd::ps_displayStatusMessageInGui };
|
||||||
|
BlackCore::CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< setup cache
|
||||||
|
|
||||||
// contexts
|
// contexts
|
||||||
bool m_coreAvailable = false;
|
bool m_coreAvailable = false;
|
||||||
bool m_contextNetworkAvailable = false;
|
bool m_contextNetworkAvailable = false;
|
||||||
bool m_contextAudioAvailable = false;
|
bool m_contextAudioAvailable = false;
|
||||||
QTimer *m_timerContextWatchdog = nullptr; //!< core available?
|
QTimer *m_timerContextWatchdog = nullptr; //!< core available?
|
||||||
BlackMisc::Simulation::CSimulatedAircraft m_ownAircraft; //!< own aircraft's state
|
BlackMisc::Simulation::CSimulatedAircraft m_ownAircraft; //!< own aircraft's state
|
||||||
QSize m_windowMinSizeWithMainPageShown;
|
QSize m_windowMinSizeWithMainPageShown;
|
||||||
QSize m_windowMinSizeWithMainPageHidden;
|
QSize m_windowMinSizeWithMainPageHidden;
|
||||||
@@ -187,8 +189,13 @@ private:
|
|||||||
//! Play notifcation sound
|
//! Play notifcation sound
|
||||||
void playNotifcationSound(BlackSound::CNotificationSounds::Notification notification) const;
|
void playNotifcationSound(BlackSound::CNotificationSounds::Notification notification) const;
|
||||||
|
|
||||||
private slots:
|
//! Display console
|
||||||
|
void displayConsole();
|
||||||
|
|
||||||
|
//! Display log
|
||||||
|
void displayLog();
|
||||||
|
|
||||||
|
private slots:
|
||||||
//
|
//
|
||||||
// Data received related slots
|
// Data received related slots
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -124,7 +124,7 @@
|
|||||||
<enum>QFrame::NoFrame</enum>
|
<enum>QFrame::NoFrame</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="pg_MainInfoArea">
|
<widget class="QWidget" name="pg_MainInfoArea">
|
||||||
<layout class="QVBoxLayout" name="vl_MainInfoArea">
|
<layout class="QVBoxLayout" name="vl_MainInfoArea">
|
||||||
@@ -287,17 +287,22 @@
|
|||||||
</property>
|
</property>
|
||||||
<addaction name="menu_ReloadSettings"/>
|
<addaction name="menu_ReloadSettings"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="menu_Debug">
|
<widget class="QMenu" name="menu_InternalsItem">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Debug</string>
|
<string>Internals</string>
|
||||||
</property>
|
</property>
|
||||||
<addaction name="menu_DebugMetaTypes"/>
|
<addaction name="menu_Internals"/>
|
||||||
|
<addaction name="menu_InternalsMetatypes"/>
|
||||||
|
<addaction name="menu_InternalsEnvVars"/>
|
||||||
|
<addaction name="menu_InternalsSetup"/>
|
||||||
|
<addaction name="menu_InternalsCompileInfo"/>
|
||||||
|
<addaction name="menu_InternalsDeleteCachedFiles"/>
|
||||||
|
<addaction name="menu_InternalsDisplayCachedFiles"/>
|
||||||
</widget>
|
</widget>
|
||||||
<addaction name="menu_TestInternals"/>
|
<addaction name="menu_InternalsItem"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
<addaction name="menu_PlanePositions"/>
|
<addaction name="menu_PlanePositions"/>
|
||||||
<addaction name="menu_Reload"/>
|
<addaction name="menu_Reload"/>
|
||||||
<addaction name="menu_Debug"/>
|
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="menu_Help">
|
<widget class="QMenu" name="menu_Help">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
@@ -453,11 +458,6 @@
|
|||||||
<string>Position LOWW (Vienna, AUT)</string>
|
<string>Position LOWW (Vienna, AUT)</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="menu_TestInternals">
|
|
||||||
<property name="text">
|
|
||||||
<string>Internals</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="menu_WindowMinimize">
|
<action name="menu_WindowMinimize">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Minimize</string>
|
<string>Minimize</string>
|
||||||
@@ -487,6 +487,41 @@
|
|||||||
<string>Horizontal navigator</string>
|
<string>Horizontal navigator</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="menu_InternalsMetatypes">
|
||||||
|
<property name="text">
|
||||||
|
<string>Metatypes</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="menu_InternalsEnvVars">
|
||||||
|
<property name="text">
|
||||||
|
<string>Env.variables</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="menu_InternalsSetup">
|
||||||
|
<property name="text">
|
||||||
|
<string>Setup</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="menu_InternalsCompileInfo">
|
||||||
|
<property name="text">
|
||||||
|
<string>Compile info</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="menu_Internals">
|
||||||
|
<property name="text">
|
||||||
|
<string>Internal page</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="menu_InternalsDeleteCachedFiles">
|
||||||
|
<property name="text">
|
||||||
|
<string>Delete cached files</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="menu_InternalsDisplayCachedFiles">
|
||||||
|
<property name="text">
|
||||||
|
<string>Display cached files</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<layoutdefault spacing="6" margin="11"/>
|
<layoutdefault spacing="6" margin="11"/>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ void SwiftGuiStd::init(const CRuntimeConfig &runtimeConfig)
|
|||||||
|
|
||||||
// info
|
// info
|
||||||
this->ui->comp_MainInfoArea->getLogComponent()->appendPlainTextToConsole(CProject::swiftVersionString());
|
this->ui->comp_MainInfoArea->getLogComponent()->appendPlainTextToConsole(CProject::swiftVersionString());
|
||||||
this->ui->comp_MainInfoArea->getLogComponent()->appendPlainTextToConsole(CProject::compiledInfo());
|
this->ui->comp_MainInfoArea->getLogComponent()->appendPlainTextToConsole(CProject::compiledWithInfo());
|
||||||
|
|
||||||
// update timers
|
// update timers
|
||||||
this->startUpdateTimersWhenConnected();
|
this->startUpdateTimersWhenConnected();
|
||||||
@@ -166,7 +166,6 @@ void SwiftGuiStd::initGuiSignals()
|
|||||||
connect(this->ui->menu_TestLocationsEDDM, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
connect(this->ui->menu_TestLocationsEDDM, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||||
connect(this->ui->menu_TestLocationsEDNX, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
connect(this->ui->menu_TestLocationsEDNX, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||||
connect(this->ui->menu_TestLocationsEDRY, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
connect(this->ui->menu_TestLocationsEDRY, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||||
connect(this->ui->menu_TestInternals, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
|
||||||
connect(this->ui->menu_FileExit, &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_FileSettingsDirectory, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||||
connect(this->ui->menu_FileResetSettings, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
connect(this->ui->menu_FileResetSettings, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||||
@@ -175,7 +174,13 @@ void SwiftGuiStd::initGuiSignals()
|
|||||||
connect(this->ui->menu_WindowMinimize, &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);
|
connect(this->ui->menu_WindowToggleOnTop, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||||
connect(this->ui->menu_WindowToggleNavigator, &QAction::triggered, this->ui->comp_InvisibleInfoArea, &CInvisibleInfoAreaComponent::toggleNavigator);
|
connect(this->ui->menu_WindowToggleNavigator, &QAction::triggered, this->ui->comp_InvisibleInfoArea, &CInvisibleInfoAreaComponent::toggleNavigator);
|
||||||
connect(this->ui->menu_DebugMetaTypes, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
|
||||||
|
connect(this->ui->menu_InternalsCompileInfo, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||||
|
connect(this->ui->menu_InternalsEnvVars, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||||
|
connect(this->ui->menu_InternalsMetatypes, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||||
|
connect(this->ui->menu_InternalsSetup, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||||
|
connect(this->ui->menu_InternalsDeleteCachedFiles, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||||
|
connect(this->ui->menu_InternalsDisplayCachedFiles, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||||
|
|
||||||
// command line / text messages
|
// command line / text messages
|
||||||
connect(this->ui->comp_MainInfoArea->getTextMessageComponent(), &CTextMessageComponent::displayInInfoWindow, this->m_compInfoWindow, &CInfoWindowComponent::display);
|
connect(this->ui->comp_MainInfoArea->getTextMessageComponent(), &CTextMessageComponent::displayInInfoWindow, this->m_compInfoWindow, &CInfoWindowComponent::display);
|
||||||
|
|||||||
@@ -57,10 +57,6 @@ void SwiftGuiStd::ps_onMenuClicked()
|
|||||||
this->ui->comp_MainInfoArea->getSettingsComponent()->reloadSettings();
|
this->ui->comp_MainInfoArea->getSettingsComponent()->reloadSettings();
|
||||||
CLogMessage(this).info("Settings reloaded");
|
CLogMessage(this).info("Settings reloaded");
|
||||||
}
|
}
|
||||||
else if (sender == this->ui->menu_TestInternals)
|
|
||||||
{
|
|
||||||
this->ui->sw_MainMiddle->setCurrentIndex(MainPageInternals);
|
|
||||||
}
|
|
||||||
else if (sender == this->ui->menu_FileReloadStyleSheets)
|
else if (sender == this->ui->menu_FileReloadStyleSheets)
|
||||||
{
|
{
|
||||||
CStyleSheetUtility::instance().read();
|
CStyleSheetUtility::instance().read();
|
||||||
@@ -93,12 +89,43 @@ void SwiftGuiStd::ps_onMenuClicked()
|
|||||||
Q_ASSERT(this->getIContextSettings());
|
Q_ASSERT(this->getIContextSettings());
|
||||||
this->getIContextSettings()->reset(true);
|
this->getIContextSettings()->reset(true);
|
||||||
}
|
}
|
||||||
else if (sender == this->ui->menu_DebugMetaTypes)
|
else if (sender == this->ui->menu_Internals)
|
||||||
{
|
{
|
||||||
QString metadata;
|
this->ui->sw_MainMiddle->setCurrentIndex(MainPageInternals);
|
||||||
QTextStream stream(&metadata);
|
}
|
||||||
BlackMisc::displayAllUserMetatypesTypes(stream);
|
else if (sender == this->ui->menu_InternalsMetatypes)
|
||||||
|
{
|
||||||
|
QString metadata(getAllUserMetatypesTypes());
|
||||||
this->ui->comp_MainInfoArea->getLogComponent()->appendPlainTextToConsole(metadata);
|
this->ui->comp_MainInfoArea->getLogComponent()->appendPlainTextToConsole(metadata);
|
||||||
|
this->displayConsole();
|
||||||
|
}
|
||||||
|
else if (sender == this->ui->menu_InternalsSetup)
|
||||||
|
{
|
||||||
|
QString setup(this->m_setup.get().convertToQString("\n", true));
|
||||||
|
this->ui->comp_MainInfoArea->getLogComponent()->appendPlainTextToConsole(setup);
|
||||||
|
this->displayConsole();
|
||||||
|
}
|
||||||
|
else if (sender == this->ui->menu_InternalsCompileInfo)
|
||||||
|
{
|
||||||
|
QString project(CProject::convertToQString("\n"));
|
||||||
|
this->ui->comp_MainInfoArea->getLogComponent()->appendPlainTextToConsole(project);
|
||||||
|
this->displayConsole();
|
||||||
|
}
|
||||||
|
else if (sender == this->ui->menu_InternalsEnvVars)
|
||||||
|
{
|
||||||
|
QString project(CProject::getEnvironmentVariables());
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,4 +140,3 @@ void SwiftGuiStd::initMenuIcons()
|
|||||||
{
|
{
|
||||||
this->ui->menu_WindowMinimize->setIcon(this->style()->standardIcon(QStyle::SP_TitleBarMinButton));
|
this->ui->menu_WindowMinimize->setIcon(this->style()->standardIcon(QStyle::SP_TitleBarMinButton));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user