swift
Loading...
Searching...
No Matches
dbloadoverviewcomponent.cpp
1// SPDX-FileCopyrightText: Copyright (C) 2016 swift Project Community / Contributors
2// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
5
6#include <QMessageBox>
7#include <QPointer>
8
9#include "ui_dbloadoverviewcomponent.h"
10
13#include "gui/guiapplication.h"
14#include "gui/guiutility.h"
15#include "misc/htmlutils.h"
17
18using namespace swift::gui;
19using namespace swift::core;
20using namespace swift::misc;
21using namespace swift::misc::network;
22
24{
27 {
28 Q_ASSERT_X(sGui, Q_FUNC_INFO, "missing sGui");
29 ui->setupUi(this);
30
32 // althought admit happens in background, this component might trigger cache reads not needed (though it is not
33 // very likely)
34 admitCaches();
35
36 ui->lbl_DatabaseUrl->setTextFormat(Qt::RichText);
37 ui->lbl_DatabaseUrl->setTextInteractionFlags(Qt::TextBrowserInteraction);
38 ui->lbl_DatabaseUrl->setOpenExternalLinks(true);
39 ui->lbl_SharedUrls->setTextFormat(Qt::RichText);
40 ui->lbl_SharedUrls->setTextInteractionFlags(Qt::TextBrowserInteraction);
41 ui->lbl_SharedUrls->setOpenExternalLinks(true);
42
43 connect(ui->tb_DbReloadAircraft, &QToolButton::pressed, this, &CDbLoadOverviewComponent::refreshDbPressed);
44 connect(ui->tb_DbReloadAirlines, &QToolButton::pressed, this, &CDbLoadOverviewComponent::refreshDbPressed);
45 connect(ui->tb_DbReloadAirports, &QToolButton::pressed, this, &CDbLoadOverviewComponent::refreshDbPressed);
46 connect(ui->tb_DbReloadCountries, &QToolButton::pressed, this, &CDbLoadOverviewComponent::refreshDbPressed);
47 connect(ui->tb_DbReloadLiveries, &QToolButton::pressed, this, &CDbLoadOverviewComponent::refreshDbPressed);
48 connect(ui->tb_DbReloadModels, &QToolButton::pressed, this, &CDbLoadOverviewComponent::refreshDbPressed);
49 connect(ui->tb_DbReloadDistributors, &QToolButton::pressed, this, &CDbLoadOverviewComponent::refreshDbPressed);
50 connect(ui->tb_DbReloadCategories, &QToolButton::pressed, this, &CDbLoadOverviewComponent::refreshDbPressed);
51
52 connect(ui->tb_SharedReloadAircraft, &QToolButton::pressed, this,
53 &CDbLoadOverviewComponent::refreshSharedPressed);
54 connect(ui->tb_SharedReloadAirlines, &QToolButton::pressed, this,
55 &CDbLoadOverviewComponent::refreshSharedPressed);
56 connect(ui->tb_SharedReloadAirports, &QToolButton::pressed, this,
57 &CDbLoadOverviewComponent::refreshSharedPressed);
58 connect(ui->tb_SharedReloadCountries, &QToolButton::pressed, this,
59 &CDbLoadOverviewComponent::refreshSharedPressed);
60 connect(ui->tb_SharedReloadLiveries, &QToolButton::pressed, this,
61 &CDbLoadOverviewComponent::refreshSharedPressed);
62 connect(ui->tb_SharedReloadModels, &QToolButton::pressed, this,
63 &CDbLoadOverviewComponent::refreshSharedPressed);
64 connect(ui->tb_SharedReloadDistributors, &QToolButton::pressed, this,
65 &CDbLoadOverviewComponent::refreshSharedPressed);
66 connect(ui->tb_SharedReloadCategories, &QToolButton::pressed, this,
67 &CDbLoadOverviewComponent::refreshSharedPressed);
68
71 connect(ui->pb_LoadAllFromResources, &QPushButton::pressed, this,
73
74 if (sGui->hasWebDataServices())
75 {
76 connect(sGui->getWebDataServices(), &CWebDataServices::dataRead, this,
77 &CDbLoadOverviewComponent::dataLoaded);
79 QTimer::singleShot(10 * 1000, this, [=, this] {
80 if (!myself || !sGui || sGui->isShuttingDown())
81 {
82 return;
83 }
84 this->loadInfoObjects();
85 this->adjustTextWidth();
86 });
87 }
88 }
89
91
92 void CDbLoadOverviewComponent::display() { m_dsTriggerGuiUpdate.inputSignal(); }
93
95 {
96 ui->lbl_DbRefresh->setVisible(visible);
97 ui->tb_DbReloadAircraft->setVisible(visible);
98 ui->tb_DbReloadAirlines->setVisible(visible);
99 ui->tb_DbReloadAirports->setVisible(visible);
100 ui->tb_DbReloadCountries->setVisible(visible);
101 ui->tb_DbReloadLiveries->setVisible(visible);
102 ui->tb_DbReloadModels->setVisible(visible);
103 ui->tb_DbReloadDistributors->setVisible(visible);
104 ui->tb_DbReloadCategories->setVisible(visible);
105 }
106
108 {
109 ui->lbl_SharedRefresh->setVisible(visible);
110 ui->tb_SharedReloadAircraft->setVisible(visible);
111 ui->tb_SharedReloadAirlines->setVisible(visible);
112 ui->tb_SharedReloadAirports->setVisible(visible);
113 ui->tb_SharedReloadCountries->setVisible(visible);
114 ui->tb_SharedReloadLiveries->setVisible(visible);
115 ui->tb_SharedReloadModels->setVisible(visible);
116 ui->tb_SharedReloadDistributors->setVisible(visible);
117 ui->tb_SharedReloadCategories->setVisible(visible);
118 }
119
121 {
122 if (this->isShowingLoadIndicator())
123 {
124 // re-center
125 this->centerLoadIndicator();
126 this->adjustTextWidth();
127 }
129 }
130
132 {
133 const bool widget = shared || db;
134 ui->wi_LoadAllButtons->setVisible(widget);
135 ui->pb_LoadAllFromDB->setVisible(db);
136 ui->pb_LoadAllFromShared->setVisible(shared);
137 ui->pb_LoadAllFromResources->setVisible(disk);
138 }
139
144
146 {
147 this->triggerLoadingFromSharedFiles(CEntityFlags::AllDbEntitiesNoInfoObjects);
148 }
149
151 {
153 {
154 return;
155 }
156 if (!sGui || sGui->isShuttingDown() || !sGui->getWebDataServices())
157 {
158 return;
159 }
161 this, "Load DB data",
162 "You should only load DB from disk resources if loading from network does not work. Really load?",
164 if (reply != QMessageBox::Yes)
165 {
166 return;
167 }
168 sGui->getWebDataServices()->initDbCachesFromLocalResourceFiles(true);
169 }
170
171 void CDbLoadOverviewComponent::setGuiValues()
172 {
173 if (!sGui)
174 {
175 return;
176 }
177 if (!sGui->hasWebDataServices())
178 {
179 return;
180 }
181
182 ui->le_AircraftIcaoCacheCount->setText(cacheCountForEntity(CEntityFlags::AircraftIcaoEntity));
183 ui->le_AirlinesIcaoCacheCount->setText(cacheCountForEntity(CEntityFlags::AirlineIcaoEntity));
184 ui->le_AirportsCacheCount->setText(cacheCountForEntity(CEntityFlags::AirportEntity));
185 ui->le_LiveriesCacheCount->setText(cacheCountForEntity(CEntityFlags::LiveryEntity));
186 ui->le_ModelsCacheCount->setText(cacheCountForEntity(CEntityFlags::ModelEntity));
187 ui->le_CountriesCacheCount->setText(cacheCountForEntity(CEntityFlags::CountryEntity));
188 ui->le_DistributorsCacheCount->setText(cacheCountForEntity(CEntityFlags::DistributorEntity));
189 ui->le_CategoriesCacheCount->setText(cacheCountForEntity(CEntityFlags::AircraftCategoryEntity));
190
191 ui->le_AircraftIcaoDbCount->setText(dbCountForEntity(CEntityFlags::AircraftIcaoEntity));
192 ui->le_AirlinesIcaoDbCount->setText(dbCountForEntity(CEntityFlags::AirlineIcaoEntity));
193 ui->le_AirportsDbCount->setText(dbCountForEntity(CEntityFlags::AirportEntity));
194 ui->le_LiveriesDbCount->setText(dbCountForEntity(CEntityFlags::LiveryEntity));
195 ui->le_ModelsDbCount->setText(dbCountForEntity(CEntityFlags::ModelEntity));
196 ui->le_CountriesDbCount->setText(dbCountForEntity(CEntityFlags::CountryEntity));
197 ui->le_DistributorsDbCount->setText(dbCountForEntity(CEntityFlags::DistributorEntity));
198 ui->le_CategoriesDbCount->setText(dbCountForEntity(CEntityFlags::AircraftCategoryEntity));
199
200 ui->le_AircraftIcaoSharedCount->setText(sharedCountForEntity(CEntityFlags::AircraftIcaoEntity));
201 ui->le_AirlinesIcaoSharedCount->setText(sharedCountForEntity(CEntityFlags::AirlineIcaoEntity));
202 ui->le_AirportsSharedCount->setText(sharedCountForEntity(CEntityFlags::AirportEntity));
203 ui->le_LiveriesSharedCount->setText(sharedCountForEntity(CEntityFlags::LiveryEntity));
204 ui->le_ModelsSharedCount->setText(sharedCountForEntity(CEntityFlags::ModelEntity));
205 ui->le_CountriesSharedCount->setText(sharedCountForEntity(CEntityFlags::CountryEntity));
206 ui->le_DistributorsSharedCount->setText(sharedCountForEntity(CEntityFlags::DistributorEntity));
207 ui->le_CategoriesSharedCount->setText(sharedCountForEntity(CEntityFlags::AircraftCategoryEntity));
208
209 ui->le_AircraftIcaoCacheTs->setText(cacheTimestampForEntity(CEntityFlags::AircraftIcaoEntity));
210 ui->le_AirlinesIcaoCacheTs->setText(cacheTimestampForEntity(CEntityFlags::AirlineIcaoEntity));
211 ui->le_AirportsCacheTs->setText(cacheTimestampForEntity(CEntityFlags::AirportEntity));
212 ui->le_LiveriesCacheTs->setText(cacheTimestampForEntity(CEntityFlags::LiveryEntity));
213 ui->le_ModelsCacheTs->setText(cacheTimestampForEntity(CEntityFlags::ModelEntity));
214 ui->le_CountriesCacheTs->setText(cacheTimestampForEntity(CEntityFlags::CountryEntity));
215 ui->le_DistributorsCacheTs->setText(cacheTimestampForEntity(CEntityFlags::DistributorEntity));
216 ui->le_CategoriesCacheTs->setText(cacheTimestampForEntity(CEntityFlags::AircraftCategoryEntity));
217
218 ui->le_AircraftIcaoDbTs->setText(dbTimestampForEntity(CEntityFlags::AircraftIcaoEntity));
219 ui->le_AirlinesIcaoDbTs->setText(dbTimestampForEntity(CEntityFlags::AirlineIcaoEntity));
220 ui->le_AirportsDbTs->setText(dbTimestampForEntity(CEntityFlags::AirportEntity));
221 ui->le_LiveriesDbTs->setText(dbTimestampForEntity(CEntityFlags::LiveryEntity));
222 ui->le_ModelsDbTs->setText(dbTimestampForEntity(CEntityFlags::ModelEntity));
223 ui->le_CountriesDbTs->setText(dbTimestampForEntity(CEntityFlags::CountryEntity));
224 ui->le_DistributorsDbTs->setText(dbTimestampForEntity(CEntityFlags::DistributorEntity));
225 ui->le_CategoriesDbTs->setText(dbTimestampForEntity(CEntityFlags::AircraftCategoryEntity));
226
227 ui->le_AircraftIcaoSharedFileTs->setText(sharedFileTimestampForEntity(CEntityFlags::AircraftIcaoEntity));
228 ui->le_AirlinesIcaoSharedFileTs->setText(sharedFileTimestampForEntity(CEntityFlags::AirlineIcaoEntity));
229 ui->le_AirportsSharedFileTs->setText(sharedFileTimestampForEntity(CEntityFlags::AirportEntity));
230 ui->le_LiveriesSharedFileTs->setText(sharedFileTimestampForEntity(CEntityFlags::LiveryEntity));
231 ui->le_ModelsSharedFileTs->setText(sharedFileTimestampForEntity(CEntityFlags::ModelEntity));
232 ui->le_CountriesSharedFileTs->setText(sharedFileTimestampForEntity(CEntityFlags::CountryEntity));
233 ui->le_DistributorsSharedFileTs->setText(sharedFileTimestampForEntity(CEntityFlags::DistributorEntity));
234 ui->le_CategoriesSharedFileTs->setText(sharedFileTimestampForEntity(CEntityFlags::AircraftCategoryEntity));
235
236 // DB URL
237 const QString dbUrlHtml("<a href=\"%2\">%3</a>");
238 const QString url = sGui->getGlobalSetup().getDbHomePageUrl().getFullUrl();
239 ui->lbl_DatabaseUrl->setText(dbUrlHtml.arg(url, url));
240 ui->lbl_DatabaseUrl->setToolTip(url);
241
242 // Shared URLs
243 this->setSharedUrlValues();
244
245 // Indicator
246 this->hideLoading();
247 }
248
249 void CDbLoadOverviewComponent::setSharedUrlValues()
250 {
251 if (m_sharedValueCheckInProgress)
252 {
253 return;
254 }
255 if ((QDateTime::currentMSecsSinceEpoch() - m_sharedLastCheck) < 5000)
256 {
257 return;
258 } // do not check too often
259
260 m_sharedValueCheckInProgress = true; // avoid processEvent (canConnect) calling this again before done
261
262 const CUrl sharedUrl(sGui->getGlobalSetup().getSwiftSharedUrl());
263 const QString valueHtml("<img src=\"%1\">&nbsp;%2");
264 const QString urlLinkHtml("<a href=\"%1\">%2</a>");
265
266 QStringList values;
267
268 if (!sGui || sGui->isShuttingDown())
269 {
270 // shutdown during connect test
271 m_sharedValueCheckInProgress = false;
272 return;
273 }
274 const bool canConnect = CNetworkUtils::canConnect(sharedUrl);
275 values.push_back(valueHtml.arg(canConnect ? m_imgOk : m_imgFailed,
276 urlLinkHtml.arg(sharedUrl.getFullUrl(), sharedUrl.getHost())));
277
278 const QString sharedUrlTable = toHtmTable(values, 2);
279 ui->lbl_SharedUrls->setText(sharedUrlTable);
280 ui->lbl_SharedUrls->setMinimumHeight(28);
281 const QString currentlyUsedSharedUrl = sGui->getGlobalSetup().getSwiftSharedUrl().toQString();
282 ui->lbl_SharedUrls->setToolTip(currentlyUsedSharedUrl.isEmpty() ? "No shared URL" :
283 "currently used: " + currentlyUsedSharedUrl);
284
285 m_sharedLastCheck = QDateTime::currentMSecsSinceEpoch();
286 m_sharedValueCheckInProgress = false;
287 }
288
289 bool CDbLoadOverviewComponent::isInitialized() const { return !ui->le_AircraftIcaoCacheCount->text().isEmpty(); }
290
291 QString CDbLoadOverviewComponent::formattedTimestamp(const QDateTime &dateTime)
292 {
293 if (!dateTime.isValid())
294 {
295 return "-";
296 }
297 return dateTime.toUTC().toString("yy-MM-dd hh:mm:ss");
298 }
299
300 QString CDbLoadOverviewComponent::cacheTimestampForEntity(CEntityFlags::Entity entity)
301 {
302 const QDateTime ts = sGui->getWebDataServices()->getCacheTimestamp(entity);
303 return formattedTimestamp(ts);
304 }
305
306 QString CDbLoadOverviewComponent::dbTimestampForEntity(CEntityFlags::Entity entity)
307 {
308 const QDateTime ts = sGui->getWebDataServices()->getLatestDbEntityTimestamp(entity);
309 return formattedTimestamp(ts);
310 }
311
312 QString CDbLoadOverviewComponent::cacheCountForEntity(CEntityFlags::Entity entity)
313 {
314 const int c = sGui->getWebDataServices()->getCacheCount(entity);
315 return c < 0 ? "-" : QString::number(c);
316 }
317
318 QString CDbLoadOverviewComponent::sharedFileTimestampForEntity(CEntityFlags::Entity entity)
319 {
320 const QDateTime ts = sGui->getWebDataServices()->getLatestSharedInfoObjectTimestamp(entity);
321 return formattedTimestamp(ts);
322 }
323
324 QString CDbLoadOverviewComponent::sharedCountForEntity(CEntityFlags::Entity entity)
325 {
326 const int c = sGui->getWebDataServices()->getSharedInfoObjectCount(entity);
327 return c < 0 ? "-" : QString::number(c);
328 }
329
330 QString CDbLoadOverviewComponent::dbCountForEntity(CEntityFlags::Entity entity)
331 {
332 const int c = sGui->getWebDataServices()->getDbInfoObjectCount(entity);
333 return c < 0 ? "-" : QString::number(c);
334 }
335
336 void CDbLoadOverviewComponent::admitCaches()
337 {
338 // remark admit only triggers, it does not wait like synchronize
339 if (!sGui->hasWebDataServices())
340 {
341 return;
342 }
344 }
345
346 void CDbLoadOverviewComponent::refreshDbPressed()
347 {
349 {
350 return;
351 }
352 const QObject *sender = QObject::sender();
353 const CEntityFlags::Entity entity = CEntityFlags::singleEntityByName(sender->objectName());
354 this->triggerLoadingFromDb(entity);
355 }
356
357 void CDbLoadOverviewComponent::triggerLoadingFromDb(CEntityFlags::Entity entities)
358 {
359 Q_ASSERT_X(sGui, Q_FUNC_INFO, "Missing sGui");
361 {
362 return;
363 }
364
365 // DB entities
366 const CEntityFlags::Entity triggeredEntities =
368 if (triggeredEntities == CEntityFlags::NoEntity)
369 {
370 return;
371 }
372 m_loadInProgress = true;
373 this->showLoading();
374
375 // shared files ts and DB info objects
378 }
379
380 void CDbLoadOverviewComponent::refreshSharedPressed()
381 {
383 {
384 return;
385 }
386 const QObject *sender = QObject::sender();
387 const CEntityFlags::Entity entity = CEntityFlags::singleEntityByName(sender->objectName());
388 this->triggerLoadingFromSharedFiles(entity);
389 }
390
391 void CDbLoadOverviewComponent::triggerLoadingFromSharedFiles(CEntityFlags::Entity entities)
392 {
394 {
395 return;
396 }
397
398 // DB entities
399 const CEntityFlags::Entity triggeredEntities =
401 if (triggeredEntities == CEntityFlags::NoEntity)
402 {
403 return;
404 }
405 m_loadInProgress = true;
406 this->showLoading();
407
408 // shared files ts
410 }
411
412 void CDbLoadOverviewComponent::dataLoaded(CEntityFlags::Entity entities, CEntityFlags::ReadState state, int number,
413 const QUrl &url)
414 {
415 Q_UNUSED(number)
416 Q_UNUSED(url)
417
418 if (!CEntityFlags::isFinishedReadState(state)) return;
419 if (!entities.testFlag(CEntityFlags::SharedInfoObjectEntity) &&
421 {
422 return;
423 }
424 m_loadInProgress = false;
425 m_dsTriggerGuiUpdate.inputSignal();
426 }
427
428 void CDbLoadOverviewComponent::loadInfoObjects()
429 {
431 {
432 return;
433 }
434 if (!sGui || !sGui->hasWebDataServices())
435 {
436 return;
437 }
438 if (sGui->isShuttingDown())
439 {
440 return;
441 }
442 bool direct = false;
443
446 {
447 direct = true;
448 }
449 else
450 {
452 }
453
456 {
457 direct = true;
458 }
459 else
460 {
462 }
463
464 if (direct)
465 {
466 m_dsTriggerGuiUpdate.inputSignal();
467 }
468 }
469
470 void CDbLoadOverviewComponent::adjustTextWidth()
471 {
472 const QSize s = this->size();
473 const QSizeF sizeFont = CGuiUtility::fontMetricsLazyDog43Chars();
474 const int thresholdW = qRound(sizeFont.width() * 2.0);
475 if (s.width() > thresholdW)
476 {
477 ui->lbl_DbCount->setText("DB count");
478 ui->lbl_CacheCount->setText("Cache count");
479 ui->lbl_SharedCount->setText("Shared count");
480 }
481 else
482 {
483 ui->lbl_DbCount->setText("DB#");
484 ui->lbl_CacheCount->setText("C#");
485 ui->lbl_SharedCount->setText("S#");
486 }
487 }
488} // namespace swift::gui::components
data::CGlobalSetup getGlobalSetup() const
Global setup.
bool hasWebDataServices() const
Web data services available?
bool isShuttingDown() const
Is application shutting down?
CWebDataServices * getWebDataServices() const
Get the web data services.
int getSharedInfoObjectCount(swift::misc::network::CEntityFlags::Entity entity) const
Count for entity from shared entity objects.
swift::core::db::CInfoDataReader * getSharedInfoDataReader() const
Shared info data reader.
QDateTime getLatestDbEntityTimestamp(swift::misc::network::CEntityFlags::Entity entity) const
Corresponding DB timestamp if applicable.
swift::misc::network::CEntityFlags::Entity triggerLoadingDirectlyFromSharedFiles(swift::misc::network::CEntityFlags::Entity whatToRead, bool checkCacheTsUpfront)
Trigger reload from shared files, loads the data and bypasses caches.
QDateTime getCacheTimestamp(swift::misc::network::CEntityFlags::Entity entity) const
Corresponding cache timestamp if applicable.
QDateTime getLatestSharedInfoObjectTimestamp(swift::misc::network::CEntityFlags::Entity entity) const
Shared info object timestamp.
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 triggerReadOfSharedInfoObjects()
Trigger read of shared info objects.
void dataRead(swift::misc::network::CEntityFlags::Entity entity, swift::misc::network::CEntityFlags::ReadState state, int number, const QUrl &url)
Combined read signal.
swift::core::db::CInfoDataReader * getDbInfoDataReader() const
DB info data reader.
int getCacheCount(swift::misc::network::CEntityFlags::Entity entity) const
Cache count for entity.
int getDbInfoObjectCount(swift::misc::network::CEntityFlags::Entity entity) const
Count for entity from DB entity objects.
void triggerReadOfDbInfoObjects()
Trigger read of DB info objects.
void admitDbCaches(swift::misc::network::CEntityFlags::Entity entities)
Admit all DB caches specified.
const swift::misc::network::CUrl & getSwiftSharedUrl() const
Shared URL.
int getInfoObjectCount() const
Get info list size (either shared or from DB).
static QSizeF fontMetricsLazyDog43Chars(bool withRatio=false)
43 characters width/height "the quick brown ..."
void centerLoadIndicator()
Center load indicator.
bool m_loadInProgress
flag indicating loading
void showLoading(std::chrono::milliseconds timeout=std::chrono::milliseconds(0), bool processEvents=true)
Show load indicator.
void hideLoading()
Hide load indicator.
CLoadIndicatorEnabled(QWidget *usingWidget)
Ctor.
bool isShowingLoadIndicator() const
Showing load indicator?
void showVisibleLoadAllButtons(bool shared, bool db, bool disk)
Show load all buttons.
CDbLoadOverviewComponent(QWidget *parent=nullptr)
Constructor.
void showVisibleSharedRefreshButtons(bool visible)
Visible shared refresh buttons.
void loadAllFromResourceFiles()
Load all from disk (as of installation).
void showVisibleDbRefreshButtons(bool visible)
Visible DB refresh buttons.
QString toQString(bool i18n=false) const
Cast as QString.
Definition mixinstring.h:74
static bool isFinishedReadState(ReadState state)
Any finished state.
static Entity singleEntityByName(const QString &name)
Get by name.
@ AircraftCategoryEntity
aircraft category entities
Definition entityflags.h:40
@ AllDbEntitiesNoInfoObjects
all DB entities, no info objects
Definition entityflags.h:48
@ DbInfoObjectEntity
info about DB data (kind of metadata)
Definition entityflags.h:28
@ AirlineIcaoEntity
ICAO codes for airlines.
Definition entityflags.h:31
@ SharedInfoObjectEntity
info about shared DB data (metadata)
Definition entityflags.h:29
@ AircraftIcaoEntity
ICAO codes for aircraft.
Definition entityflags.h:30
static bool anySwiftDbEntity(Entity entities)
Representing at least one DB entity.
static bool canConnect(const QString &hostAddress, int port, QString &message, int timeoutMs=getTimeoutMs())
Can connect?
SWIFT_GUI_EXPORT swift::gui::CGuiApplication * sGui
Single instance of GUI application object.
Classes interacting with the swift database (aka "datastore").
Backend services of the swift project, like dealing with the network or the simulators.
Definition actionbind.cpp:7
High level reusable GUI components.
GUI related classes.
Free functions in swift::misc.
QString toHtmTable(const QStringList &values, int columns)
Values as HTML table.
Definition htmlutils.cpp:11
qint64 currentMSecsSinceEpoch()
bool isValid() const const
QString toString(QStringView format) const const
QDateTime toUTC() const const
QFrame(QWidget *parent, Qt::WindowFlags f)
virtual bool event(QEvent *e) override
void push_back(QList< T >::parameter_type value)
QMessageBox::StandardButton warning(QWidget *parent, const QString &title, const QString &text, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton)
QObject(QObject *parent)
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QObject * parent() const const
QObject * sender() const const
int width() const const
qreal width() const const
bool isEmpty() const const
QString number(double n, char format, int precision)
RichText
TextBrowserInteraction
QWidget(QWidget *parent, Qt::WindowFlags f)
virtual void resizeEvent(QResizeEvent *event)