mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
Ref T192, formatting and minor tweaks
This commit is contained in:
@@ -101,7 +101,7 @@ namespace BlackSample
|
||||
|
||||
// The << operator is used to add the parameters for the slot
|
||||
const QDateTime dtnow = QDateTime::currentDateTimeUtc();
|
||||
const QString msg = QString("Message at %1").arg(dtnow.toString("MM/dd/yyyy @ hh:mm:ss"));
|
||||
const QString msg = QString("Con.: %1, message at %2").arg(connection.name(), dtnow.toString("MM/dd/yyyy @ hh:mm:ss"));
|
||||
m << msg;
|
||||
|
||||
// We send this as a non-replying message. This is used for sending errors, replys, signals.
|
||||
|
||||
@@ -14,11 +14,13 @@
|
||||
#include "blackmisc/dbusserver.h"
|
||||
|
||||
using namespace BlackCore;
|
||||
using namespace BlackMisc;
|
||||
|
||||
namespace BlackCore
|
||||
{
|
||||
namespace Context
|
||||
{
|
||||
IContextNetwork *IContextNetwork::create(CCoreFacade *runtime, CCoreFacadeConfig::ContextMode mode, BlackMisc::CDBusServer *server, QDBusConnection &connection)
|
||||
IContextNetwork *IContextNetwork::create(CCoreFacade *runtime, CCoreFacadeConfig::ContextMode mode, CDBusServer *server, QDBusConnection &connection)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
@@ -26,7 +28,7 @@ namespace BlackCore
|
||||
case CCoreFacadeConfig::LocalInDBusServer:
|
||||
return (new CContextNetwork(mode, runtime))->registerWithDBus(server);
|
||||
case CCoreFacadeConfig::Remote:
|
||||
return new CContextNetworkProxy(BlackMisc::CDBusServer::coreServiceName(), connection, mode, runtime);
|
||||
return new CContextNetworkProxy(CDBusServer::coreServiceName(), connection, mode, runtime);
|
||||
case CCoreFacadeConfig::NotUsed:
|
||||
default:
|
||||
return new CContextNetworkEmpty(runtime);
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace BlackCore
|
||||
}
|
||||
}
|
||||
|
||||
const BlackMisc::Aviation::CAircraftSituation &IContextOwnAircraft::getDefaultSituation()
|
||||
const CAircraftSituation &IContextOwnAircraft::getDefaultSituation()
|
||||
{
|
||||
static const CAircraftSituation situation(
|
||||
CCoordinateGeodetic(
|
||||
@@ -52,7 +52,7 @@ namespace BlackCore
|
||||
return situation;
|
||||
}
|
||||
|
||||
BlackMisc::Simulation::CAircraftModel IContextOwnAircraft::getDefaultOwnAircraftModel()
|
||||
CAircraftModel IContextOwnAircraft::getDefaultOwnAircraftModel()
|
||||
{
|
||||
// if all fails
|
||||
static const CAircraftModel defaultModel(
|
||||
|
||||
@@ -75,6 +75,9 @@ namespace BlackCore
|
||||
//! Facade and context shutting down
|
||||
bool isShuttingDown() const { return m_shuttingDown; }
|
||||
|
||||
//! Parse command line in all contexts
|
||||
bool parseCommandLine(const QString &commandLine, const BlackMisc::CIdentifier &originator);
|
||||
|
||||
// ------- Context as interface, normal way to access a context
|
||||
|
||||
//! Context for network
|
||||
@@ -158,10 +161,6 @@ namespace BlackCore
|
||||
//! Register metadata
|
||||
static void registerMetadata();
|
||||
|
||||
public slots:
|
||||
//! Parse command line in all contexts
|
||||
bool parseCommandLine(const QString &commandLine, const BlackMisc::CIdentifier &originator);
|
||||
|
||||
private:
|
||||
bool m_initalized = false; //!< flag if already initialized
|
||||
bool m_shuttingDown = false; //!< flag if shutting down
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace BlackGui
|
||||
ui->led_DBus->setValues(CLedWidget::Yellow, CLedWidget::Black, shape, "DBus connected", "DBus disconnected", 14);
|
||||
ui->led_Network->setValues(CLedWidget::Yellow, CLedWidget::Black, shape, "Network connected", "Network disconnected", 14);
|
||||
ui->led_Simulator->setValues(CLedWidget::Yellow, CLedWidget::Black, CLedWidget::Blue, shape, "Simulator running", "Simulator disconnected", "Simulator connected", 14);
|
||||
ui->led_MapperReady->setValues(CLedWidget::Yellow, CLedWidget::Black, CLedWidget::Blue, shape, "Mapper ready", "Mappings loading", "Mappings loading", 14);
|
||||
ui->led_MapperReady->setValues(CLedWidget::Yellow, CLedWidget::Black, CLedWidget::Blue, shape, "Mapper ready", "Mappings not yet loaded", "Mappings not yet loaded", 14);
|
||||
|
||||
shape = CLedWidget::Rounded;
|
||||
ui->led_Ptt->setValues(CLedWidget::Yellow, CLedWidget::Black, shape, "Ptt", "Silence", 18);
|
||||
|
||||
@@ -63,11 +63,14 @@ namespace BlackGui
|
||||
//! Constructor
|
||||
explicit CLoginComponent(QWidget *parent = nullptr);
|
||||
|
||||
//! Destructor
|
||||
virtual ~CLoginComponent();
|
||||
|
||||
//! Automatically popup
|
||||
void setAutoPopupWizad(bool autoPopup);
|
||||
|
||||
//! Destructor
|
||||
virtual ~CLoginComponent();
|
||||
//! Main info area changed
|
||||
void mainInfoAreaChanged(const QWidget *currentWidget);
|
||||
|
||||
signals:
|
||||
//! Login
|
||||
@@ -82,10 +85,6 @@ namespace BlackGui
|
||||
//! Relevant login data changed (digest version)
|
||||
void loginDataChangedDigest();
|
||||
|
||||
public slots:
|
||||
//! Main info area changed
|
||||
void mainInfoAreaChanged(const QWidget *currentWidget);
|
||||
|
||||
private:
|
||||
//! Login cancelled
|
||||
void loginCancelled();
|
||||
|
||||
@@ -101,7 +101,8 @@ namespace BlackGui
|
||||
void CMainKeypadAreaComponent::buttonSelected()
|
||||
{
|
||||
QPushButton *senderButton = static_cast<QPushButton *>(QObject::sender());
|
||||
Q_ASSERT(senderButton);
|
||||
Q_ASSERT_X(senderButton, Q_FUNC_INFO, "No sender button");
|
||||
Q_ASSERT_X(sGui, Q_FUNC_INFO, "Need sGui");
|
||||
if (!senderButton) { return; }
|
||||
const CMainInfoAreaComponent::InfoArea ia = buttonToMainInfoArea(senderButton);
|
||||
if (ia != CMainInfoAreaComponent::InfoAreaNone)
|
||||
|
||||
@@ -37,8 +37,8 @@ namespace BlackGui
|
||||
CStyleSheetUtility::CStyleSheetUtility(BlackMisc::Restricted<CGuiApplication>, QObject *parent) : QObject(parent)
|
||||
{
|
||||
this->read();
|
||||
connect(&this->m_fileWatcher, &QFileSystemWatcher::directoryChanged, this, &CStyleSheetUtility::ps_qssDirectoryChanged);
|
||||
connect(&this->m_fileWatcher, &QFileSystemWatcher::fileChanged, this, &CStyleSheetUtility::ps_qssDirectoryChanged);
|
||||
connect(&this->m_fileWatcher, &QFileSystemWatcher::directoryChanged, this, &CStyleSheetUtility::qssDirectoryChanged);
|
||||
connect(&this->m_fileWatcher, &QFileSystemWatcher::fileChanged, this, &CStyleSheetUtility::qssDirectoryChanged);
|
||||
}
|
||||
|
||||
const QString &CStyleSheetUtility::fontStyleAsString(const QFont &font)
|
||||
@@ -465,7 +465,7 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
|
||||
void CStyleSheetUtility::ps_qssDirectoryChanged(const QString &file)
|
||||
void CStyleSheetUtility::qssDirectoryChanged(const QString &file)
|
||||
{
|
||||
Q_UNUSED(file);
|
||||
this->read();
|
||||
|
||||
@@ -162,11 +162,10 @@ namespace BlackGui
|
||||
//! \deprecated use BlackGui::CGuiApplication::styleSheetsChanged
|
||||
void styleSheetsChanged();
|
||||
|
||||
private slots:
|
||||
//! File changed
|
||||
void ps_qssDirectoryChanged(const QString &file);
|
||||
|
||||
private:
|
||||
//! File changed
|
||||
void qssDirectoryChanged(const QString &file);
|
||||
|
||||
//! Filename based on OS/existing files
|
||||
static QString getQssFileName(const QString &fileName);
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ int main(int argc, char *argv[])
|
||||
CGuiApplication::highDpiScreenSupport();
|
||||
QApplication qa(argc, argv);
|
||||
Q_UNUSED(qa); // application init needed
|
||||
CSwiftGuiStdApplication a;
|
||||
CSwiftGuiStdApplication a; // application with contexts
|
||||
a.setSignalStartupAutomatically(false); // application will signal startup on its own
|
||||
a.splashScreen(CIcons::swift256());
|
||||
if (!a.parseAndSynchronizeSetup()) { return EXIT_FAILURE; }
|
||||
|
||||
Reference in New Issue
Block a user