mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 23:45:35 +08:00
Formatting
This commit is contained in:
@@ -135,24 +135,17 @@ namespace BlackCore
|
||||
if (m_highlightedAircraft.isEmpty() || m_highlightEndTimeMsEpoch < 1) { return; }
|
||||
m_blinkCycle = !m_blinkCycle;
|
||||
|
||||
if (QDateTime::currentMSecsSinceEpoch() < m_highlightEndTimeMsEpoch)
|
||||
{
|
||||
// blink mode, toggle aircraft
|
||||
for (const CSimulatedAircraft &aircraft : as_const(m_highlightedAircraft))
|
||||
{
|
||||
if (m_blinkCycle)
|
||||
{
|
||||
this->callPhysicallyRemoveRemoteAircraft(aircraft.getCallsign());
|
||||
}
|
||||
else
|
||||
{
|
||||
this->callPhysicallyAddRemoteAircraft(aircraft); // blink
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
if (QDateTime::currentMSecsSinceEpoch() > m_highlightEndTimeMsEpoch)
|
||||
{
|
||||
this->stopHighlighting();
|
||||
return;
|
||||
}
|
||||
|
||||
// blink mode, toggle aircraft
|
||||
for (const CSimulatedAircraft &aircraft : as_const(m_highlightedAircraft))
|
||||
{
|
||||
if (m_blinkCycle) { this->callPhysicallyRemoveRemoteAircraft(aircraft.getCallsign()); }
|
||||
else { this->callPhysicallyAddRemoteAircraft(aircraft); }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef DBLOADDATADIALOG_H
|
||||
#define DBLOADDATADIALOG_H
|
||||
#ifndef BLACKGUI_COMPONENTS_DBLOADDATADIALOG_H
|
||||
#define BLACKGUI_COMPONENTS_DBLOADDATADIALOG_H
|
||||
|
||||
#include "blackgui/blackguiexport.h"
|
||||
#include "blackmisc/network/entityflags.h"
|
||||
@@ -43,14 +43,6 @@ namespace BlackGui
|
||||
bool newerOrEmptyEntitiesDetected(BlackMisc::Network::CEntityFlags::Entity loadEntities);
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CDbLoadDataDialog> ui;
|
||||
BlackMisc::Network::CEntityFlags::Entity m_pendingEntities = BlackMisc::Network::CEntityFlags::NoEntity;
|
||||
BlackMisc::Simulation::Data::CModelSetCaches m_sets { true, this }; //!< caches
|
||||
BlackMisc::Simulation::Data::CModelCaches m_models { true, this }; //!< models
|
||||
int m_pendingEntitiesCount = -1;
|
||||
bool m_consolidating = false; //! currently consolidating
|
||||
bool m_autoConsolidate = false;
|
||||
|
||||
//! The string list model
|
||||
QStringListModel *entitiesModel() const;
|
||||
|
||||
@@ -68,6 +60,14 @@ namespace BlackGui
|
||||
|
||||
//! Consolidate
|
||||
void consolidate();
|
||||
|
||||
QScopedPointer<Ui::CDbLoadDataDialog> ui;
|
||||
BlackMisc::Network::CEntityFlags::Entity m_pendingEntities = BlackMisc::Network::CEntityFlags::NoEntity;
|
||||
BlackMisc::Simulation::Data::CModelSetCaches m_sets { true, this }; //!< caches
|
||||
BlackMisc::Simulation::Data::CModelCaches m_models { true, this }; //!< models
|
||||
int m_pendingEntitiesCount = -1;
|
||||
bool m_consolidating = false; //! currently consolidating
|
||||
bool m_autoConsolidate = false;
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -6,14 +6,26 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>240</width>
|
||||
<height>102</height>
|
||||
<width>231</width>
|
||||
<height>96</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Frame</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<layout class="QGridLayout" name="gl_InterpolationSetupForm">
|
||||
<property name="leftMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<item row="3" column="1">
|
||||
<widget class="QCheckBox" name="cb_DebugDriver">
|
||||
<property name="text">
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
#include "blackgui/models/clientlistmodel.h"
|
||||
#include "blackgui/models/columnformatters.h"
|
||||
#include "blackgui/models/columns.h"
|
||||
#include "blackmisc/compare.h"
|
||||
#include "blackmisc/simulation/aircraftmodel.h"
|
||||
#include "blackmisc/network/user.h"
|
||||
#include "blackmisc/compare.h"
|
||||
#include "blackmisc/propertyindex.h"
|
||||
#include "blackmisc/propertyindexvariantmap.h"
|
||||
#include "blackmisc/simulation/aircraftmodel.h"
|
||||
|
||||
#include <Qt>
|
||||
#include <QtGlobal>
|
||||
@@ -27,21 +27,18 @@ namespace BlackGui
|
||||
{
|
||||
namespace Models
|
||||
{
|
||||
/*
|
||||
* Constructor
|
||||
*/
|
||||
CClientListModel::CClientListModel(QObject *parent) :
|
||||
CListModelBase<BlackMisc::Network::CClient, BlackMisc::Network::CClientList>("ViewClientList", parent)
|
||||
CListModelBase<CClient, CClientList>("ViewClientList", parent)
|
||||
{
|
||||
this->m_columns.addColumn(CColumn("client", CClient::IndexIcon));
|
||||
this->m_columns.addColumn(CColumn::standardValueObject("callsign", CClient::IndexCallsign));
|
||||
this->m_columns.addColumn(CColumn::standardString("realname", { CClient::IndexUser, CUser::IndexRealName }));
|
||||
this->m_columns.addColumn(CColumn("vo.", "voice capabilities", CClient::IndexVoiceCapabilitiesIcon, new CPixmapFormatter()));
|
||||
this->m_columns.addColumn(CColumn::standardString("capabilities", CClient::IndexCapabilitiesString));
|
||||
this->m_columns.addColumn(CColumn::standardString("model", CClient::IndexModelString));
|
||||
this->m_columns.addColumn(CColumn("q.?", "queried", {CClient::IndexModelString, CAircraftModel::IndexHasQueriedModelString},
|
||||
new CBoolIconFormatter("queried", "not queried")));
|
||||
this->m_columns.addColumn(CColumn::standardString("server", CClient::IndexServer));
|
||||
m_columns.addColumn(CColumn("client", CClient::IndexIcon));
|
||||
m_columns.addColumn(CColumn::standardValueObject("callsign", CClient::IndexCallsign));
|
||||
m_columns.addColumn(CColumn::standardString("realname", { CClient::IndexUser, CUser::IndexRealName }));
|
||||
m_columns.addColumn(CColumn("vo.", "voice capabilities", CClient::IndexVoiceCapabilitiesIcon, new CPixmapFormatter()));
|
||||
m_columns.addColumn(CColumn::standardString("capabilities", CClient::IndexCapabilitiesString));
|
||||
m_columns.addColumn(CColumn::standardString("model", CClient::IndexModelString));
|
||||
m_columns.addColumn(CColumn("q.?", "queried", {CClient::IndexModelString, CAircraftModel::IndexHasQueriedModelString},
|
||||
new CBoolIconFormatter("queried", "not queried")));
|
||||
m_columns.addColumn(CColumn::standardString("server", CClient::IndexServer));
|
||||
|
||||
// force strings for translation in resource files
|
||||
(void)QT_TRANSLATE_NOOP("ViewClientList", "callsign");
|
||||
@@ -56,26 +53,20 @@ namespace BlackGui
|
||||
static const CPropertyIndex ms({CClient::IndexModelString, CAircraftModel::IndexModelString});
|
||||
static const CPropertyIndex qf({CClient::IndexModelString, CAircraftModel::IndexHasQueriedModelString});
|
||||
if (role != Qt::DisplayRole && role != Qt::DecorationRole) { return CListModelBase::data(index, role); }
|
||||
CPropertyIndex pi = modelIndexToPropertyIndex(index);
|
||||
const CPropertyIndex pi = modelIndexToPropertyIndex(index);
|
||||
if (pi == ms && role == Qt::DisplayRole)
|
||||
{
|
||||
// no model string for ATC
|
||||
const CClient client = this->at(index);
|
||||
bool atc = client.isAtc();
|
||||
if (atc)
|
||||
{
|
||||
return QVariant("ATC");
|
||||
}
|
||||
const bool atc = client.isAtc();
|
||||
if (atc) { return QVariant("ATC"); }
|
||||
}
|
||||
else if (pi == qf && role == Qt::DecorationRole)
|
||||
{
|
||||
// no symbol for ATC
|
||||
const CClient client = this->at(index);
|
||||
bool atc = client.isAtc();
|
||||
if (atc)
|
||||
{
|
||||
return QVariant();
|
||||
}
|
||||
const bool atc = client.isAtc();
|
||||
if (atc) { return QVariant(); }
|
||||
}
|
||||
return CListModelBase::data(index, role);
|
||||
}
|
||||
|
||||
@@ -9,12 +9,11 @@
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKGUI_CLIENTLISTMODEL_H
|
||||
#define BLACKGUI_CLIENTLISTMODEL_H
|
||||
#ifndef BLACKGUI_MODELS_CLIENTLISTMODEL_H
|
||||
#define BLACKGUI_MODELS_CLIENTLISTMODEL_H
|
||||
|
||||
#include "blackgui/blackguiexport.h"
|
||||
#include "blackgui/models/listmodelbase.h"
|
||||
#include "blackmisc/network/client.h"
|
||||
#include "blackmisc/network/clientlist.h"
|
||||
|
||||
#include <QVariant>
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
#include "listmodelcallsignobjects.h"
|
||||
#include "allmodelcontainers.h"
|
||||
#include "blackmisc/db/datastoreobjectlist.h"
|
||||
#include "blackmisc/orderable.h"
|
||||
|
||||
#include <QBrush>
|
||||
|
||||
@@ -12,19 +12,18 @@
|
||||
#ifndef BLACKGUI_VIEWS_COUNTRYVIEW_H
|
||||
#define BLACKGUI_VIEWS_COUNTRYVIEW_H
|
||||
|
||||
#include "blackgui/blackguiexport.h"
|
||||
#include "blackgui/models/countrylistmodel.h"
|
||||
#include "blackgui/views/viewbase.h"
|
||||
#include "blackgui/models/countrylistmodel.h"
|
||||
#include "blackgui/blackguiexport.h"
|
||||
#include "blackmisc/countrylist.h"
|
||||
|
||||
class QWidget;
|
||||
|
||||
namespace BlackMisc { class CCountry; }
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Views
|
||||
{
|
||||
//! Distributors
|
||||
//! Countries
|
||||
class BLACKGUI_EXPORT CCountryView : public CViewBase<Models::CCountryListModel, BlackMisc::CCountryList, BlackMisc::CCountry>
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -13,17 +13,17 @@
|
||||
#define BLACKGUI_VIEWBASE_H
|
||||
|
||||
#include "blackgui/components/enablefordockwidgetinfoarea.h"
|
||||
#include "blackgui/menus/menuaction.h"
|
||||
#include "blackgui/models/modelfilter.h"
|
||||
#include "blackgui/models/selectionmodel.h"
|
||||
#include "blackgui/settings/guisettings.h"
|
||||
#include "blackgui/settings/viewdirectorysettings.h"
|
||||
#include "blackgui/blackguiexport.h"
|
||||
#include "blackgui/menus/menuaction.h"
|
||||
#include "blackmisc/namevariantpairlist.h"
|
||||
#include "blackmisc/propertyindex.h"
|
||||
#include "blackmisc/propertyindexvariantmap.h"
|
||||
#include "blackmisc/statusmessage.h"
|
||||
#include "blackmisc/variant.h"
|
||||
#include "blackgui/blackguiexport.h"
|
||||
|
||||
#include <QAbstractItemView>
|
||||
#include <QFlags>
|
||||
|
||||
@@ -242,11 +242,11 @@ namespace BlackMisc
|
||||
qint64 m_currentTimeMsSinceEpoch = -1; //!< current time
|
||||
Aviation::CAircraftSituationList m_currentSituations; //!< current situations
|
||||
Aviation::CAircraftSituationChange m_currentSituationChange; //!< situations change
|
||||
PhysicalQuantities::CLength m_currentSceneryOffset = PhysicalQuantities::CLength::null(); //!< calculated scenery offset if any
|
||||
CInterpolationAndRenderingSetupPerCallsign m_currentSetup; //!< used setup
|
||||
CInterpolationStatus m_currentInterpolationStatus; //!< this step's status
|
||||
CPartsStatus m_currentPartsStatus; //!< this step's status
|
||||
Aviation::CAircraftSituation m_lastInterpolation { Aviation::CAircraftSituation::null() }; //!< latest interpolation
|
||||
Aviation::CAircraftSituation m_lastInterpolation { Aviation::CAircraftSituation::null() }; //!< latest interpolation
|
||||
PhysicalQuantities::CLength m_currentSceneryOffset { PhysicalQuantities::CLength::null() }; //!< calculated scenery offset if any
|
||||
|
||||
qint64 m_situationsLastModified { -1 }; //!< when situations were last modified
|
||||
qint64 m_situationsLastModifiedUsed { -1 }; //!< interpolant based on situations last updated
|
||||
|
||||
@@ -387,7 +387,7 @@ namespace BlackMisc
|
||||
|
||||
CSimulatedAircraftList m_aircraftInRange; //!< aircraft, thread safe access required
|
||||
QMap<Aviation::CCallsign, CStatusMessageList> m_reverseLookupMessages;
|
||||
QMap<Aviation::CCallsign, CStatusMessageList> m_aircraftPartsHistory;
|
||||
QMap<Aviation::CCallsign, CStatusMessageList> m_aircraftPartsHistory; //!< JSON aircraft parts history
|
||||
QMap<Aviation::CCallsign, qint64> m_situationsLastModified;
|
||||
QMap<Aviation::CCallsign, qint64> m_partsLastModified;
|
||||
QMap<Aviation::CCallsign, PhysicalQuantities::CLength> m_testOffset;
|
||||
|
||||
@@ -168,13 +168,13 @@ namespace BlackMisc
|
||||
CVariant &operator =(const CVariant &other) = default;
|
||||
|
||||
//! Move assignment operatior.
|
||||
CVariant &operator =(CVariant && other) noexcept = default;
|
||||
CVariant &operator =(CVariant &&other) noexcept = default;
|
||||
|
||||
//! Change the internal QVariant
|
||||
CVariant &operator =(const QVariant &var) { m_v = var; return *this; }
|
||||
|
||||
//! Change the internal QVariant
|
||||
CVariant &operator =(QVariant && var) noexcept { m_v = std::move(var); return *this; }
|
||||
CVariant &operator =(QVariant &&var) noexcept { m_v = std::move(var); return *this; }
|
||||
|
||||
//! Swap this variant with another.
|
||||
void swap(CVariant &other) noexcept { m_v.swap(other.m_v); }
|
||||
|
||||
Reference in New Issue
Block a user