6#include <QStringBuilder>
9#include "ui_dbliverycomponent.h"
18using namespace swift::misc::aviation;
19using namespace swift::misc::network;
31 ui->tvp_Liveries->setFilterWidget(ui->filter_Livery);
32 ui->tvp_Liveries->allowDragDrop(
true,
false);
40 sGui->getWebDataServices()->getLiveriesCount());
51 void CDbLiveryComponent::onLiveriesRead(CEntityFlags::Entity entity,
CEntityFlags::ReadState readState,
int count)
53 using namespace std::chrono_literals;
56 if (!sGui || sGui->isShuttingDown() || !sGui->getWebDataServices())
68 ui->tvp_Liveries->updateContainerMaybeAsync(sGui->getWebDataServices()->getLiveries());
78 void CDbLiveryComponent::onEntityDownloadProgress(CEntityFlags::Entity entity,
int logId,
int progress,
79 qint64 current, qint64 max,
const QUrl &url)
81 using namespace std::chrono_literals;
91 void CDbLiveryComponent::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.
CDbLiveryComponent(QWidget *parent=nullptr)
Constructor.
void filterByAirline(const swift::misc::aviation::CAirlineIcaoCode &icao)
Filter by airline ICAO.
swift::gui::views::CLiveryView * view()
The livery view.
void filter(const swift::misc::aviation::CLivery &livery)
Filter by livery.
~CDbLiveryComponent()
Destructor.
void requestNewBackendData()
Load data from backend (where it makes sense).
@ MenuCopy
copy (for copy/paste)
Value object for ICAO classification.
Value object encapsulating information about an airpot.
static bool isFinishedReadState(ReadState state)
Any finished state.
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