7#include <QStringBuilder>
11#include "ui_dbmodelcomponent.h"
23using namespace swift::misc::network;
24using namespace swift::misc::simulation;
34 Q_ASSERT_X(sGui, Q_FUNC_INFO,
"Missing sGui");
35 Q_ASSERT_X(sGui->hasWebDataServices(), Q_FUNC_INFO,
"Missing web services");
40 ui->tvp_AircraftModel->menuAddItems(CAircraftModelView::MenuStashing);
45 ui->tvp_AircraftModel->setFilterWidget(ui->filter_AircraftModelFilter);
46 ui->tvp_AircraftModel->allowDragDrop(
true,
false);
56 sApp->getWebDataServices()->getModelsCount(), {});
65 if (!sGui || sGui->isShuttingDown() || !sGui->getWebDataServices())
71 if (!ui->tvp_AircraftModel->isEmpty())
73 CAircraftModel model(ui->tvp_AircraftModel->container().latestObject());
82 using namespace std::chrono_literals;
86 if (!sGui || sGui->isShuttingDown() || !sGui->getWebDataServices())
98 ui->tvp_AircraftModel->updateContainerMaybeAsync(sGui->getWebDataServices()->getModels());
108 void CDbModelComponent::onReload()
117 void CDbModelComponent::onStyleSheetChanged()
122 void CDbModelComponent::onEntityDownloadProgress(CEntityFlags::Entity entity,
int logId,
int progress,
123 qint64 current, qint64 max,
const QUrl &url)
125 using namespace std::chrono_literals;
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.
void styleSheetsChanged()
Style sheet changed.
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.
CDbMappingComponentAware(QObject *parent)
Constructor.
CDbModelComponent(QWidget *parent=nullptr)
Constructor.
void requestUpdatedData()
Load new data.
~CDbModelComponent()
Destructor.
bool hasModels() const
Models loaded?
void requestStash(const swift::misc::simulation::CAircraftModelList &models)
Request to stash the selected models.
@ Database
Database entry.
void requestStash(const swift::misc::simulation::CAircraftModelList &models)
Request to stash if applicable.
void requestNewBackendData()
Load data from backend (where it makes sense).
@ MenuHighlightStashed
highlight stashed models
@ MenuCopy
copy (for copy/paste)
QDateTime getUtcTimestamp() const
Get timestamp.
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.
Aircraft model (used by another pilot, my models on disk).
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.
Models to be used with views, mainly QTableView.
Views, mainly QTableView.
Free functions in swift::misc.
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QObject * parent() const const