7#include <QStringBuilder>
11#include "ui_dbaircrafticaocomponent.h"
20using namespace swift::misc::network;
21using namespace swift::misc::aviation;
33 ui->tvp_AircraftIcao->allowDragDrop(
true,
false);
34 ui->tvp_AircraftIcao->setFilterWidget(ui->filter_AircraftIcao);
38 &CDbAircraftIcaoComponent::onReload);
44 sGui->getWebDataServices()->getAircraftIcaoCodesCount());
62 void CDbAircraftIcaoComponent::onIcaoRead(CEntityFlags::Entity entity,
CEntityFlags::ReadState readState,
int count)
64 using namespace std::chrono_literals;
67 if (!sGui || sGui->isShuttingDown() || !sGui->getWebDataServices())
79 ui->tvp_AircraftIcao->updateContainerMaybeAsync(sGui->getWebDataServices()->getAircraftIcaoCodes());
89 void CDbAircraftIcaoComponent::onEntityDownloadProgress(CEntityFlags::Entity entity,
int logId,
int progress,
90 qint64 current, qint64 max,
const QUrl &url)
92 using namespace std::chrono_literals;
102 void CDbAircraftIcaoComponent::onReload()
bool isShuttingDown() const
Is application shutting down?
CWebDataServices * getWebDataServices() const
Get the web data services.
void entityDownloadProgress(swift::misc::network::CEntityFlags::Entity entity, int logId, int progress, qint64 current, qint64 max, const QUrl &url)
Download progress for an entity.
swift::misc::network::CEntityFlags::Entity triggerLoadingDirectlyFromDb(swift::misc::network::CEntityFlags::Entity whatToRead, const QDateTime &newerThan=QDateTime())
Trigger reload from DB, loads the DB data and bypasses the caches checks and info objects.
void dataRead(swift::misc::network::CEntityFlags::Entity entity, swift::misc::network::CEntityFlags::ReadState state, int number, const QUrl &url)
Combined read signal.
void setViewWithIndicator(swift::gui::views::CViewBaseNonTemplate *viewWithIndicator)
Set the corresponding view.
bool showOverlayHTMLMessage(const QString &htmlMessage, std::chrono::milliseconds timeout=std::chrono::milliseconds(0))
void showDownloadProgress(int progress, qint64 current, qint64 max, const QUrl &url, std::chrono::milliseconds timeout=std::chrono::milliseconds(0))
COverlayMessagesFrame(QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags())
Constructor.
swift::gui::views::CAircraftIcaoCodeView * view() const
Get the view.
~CDbAircraftIcaoComponent()
Destructor.
bool selectAircraftIcao(const swift::misc::aviation::CAircraftIcaoCode &icao)
Select aircraft ICAO object.
CDbAircraftIcaoComponent(QWidget *parent=nullptr)
Constructor.
void filter(const swift::misc::aviation::CAircraftIcaoCode &icao)
Filter by ICAO as default.
Aircraft ICAO codes view.
void requestNewBackendData()
Load data from backend (where it makes sense).
@ MenuCopy
copy (for copy/paste)
bool selectDbKey(const KeyType &key)
Select given DB key.
Value object for ICAO classification.
int getDbKey() const
Get DB key.
bool isLoadedFromDb() const
Loaded from DB.
static bool isFinishedReadState(ReadState state)
Any finished state.
@ AircraftIcaoEntity
ICAO codes for aircraft.
ReadState
State of operation.
@ ReadFinished
reading done
static const QString & stateToString(ReadState flag)
Convert to string.
static QString entitiesToString(CEntityFlags::Entity entities, const QString &separator=", ")
Entities to string list.
SWIFT_GUI_EXPORT swift::gui::CGuiApplication * sGui
Single instance of GUI application object.
Backend services of the swift project, like dealing with the network or the simulators.
High level reusable GUI components.
Views, mainly QTableView.
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QObject * parent() const const