11 #include "ui_datainfoareacomponent.h"
31 using namespace swift::misc::network;
37 CDataInfoAreaComponent::CDataInfoAreaComponent(QWidget *parent)
42 this->setWindowIcon(CIcons::swiftDatabase24());
62 return ui->comp_DbAircraftCategories;
69 CLogMessage(
this).
warning(u
"No connection to DB yet, no new data loaded which can be written");
82 if (!
sGui) {
return false; }
89 CLogMessage(
this).
info(u
"Read DB data from directory: %1") << CSwiftDirectories::staticDbFilesDirectory();
90 ui->comp_DbAircraftIcao->showLoadIndicator();
91 ui->comp_DbAirlineIcao->showLoadIndicator();
92 ui->comp_DbCountries->showLoadIndicator();
93 ui->comp_DbDistributors->showLoadIndicator();
94 ui->comp_DbLiveries->showLoadIndicator();
95 ui->comp_DbModels->showLoadIndicator();
98 else { CLogMessage::preformatted(msgs); }
107 case InfoAreaAircraftIcao:
108 case InfoAreaAirlineIcao:
109 case InfoAreaLiveries:
111 case InfoAreaCountries:
112 case InfoAreaAircraftCategories:
113 default:
return QSize(800, 600);
122 case InfoAreaAircraftIcao:
return CIcons::appAircraftIcao16();
123 case InfoAreaAirlineIcao:
return CIcons::appAirlineIcao16();
124 case InfoAreaLiveries:
return CIcons::appLiveries16();
125 case InfoAreaDistributors:
return CIcons::appDistributors16();
126 case InfoAreaModels:
return CIcons::appModels16();
127 case InfoAreaCountries:
return CIcons::appCountries16();
128 case InfoAreaAircraftCategories:
return CIcons::appAircraftCategories16();
129 default:
return CIcons::empty();
136 CEntityFlags::AllDbEntitiesNoInfoObjectsNoAirportsAndCategories, QDateTime());
141 bool requested =
false;
142 if (entity.testFlag(CEntityFlags::ModelEntity))
144 ui->comp_DbModels->requestUpdatedData();
CWebDataServices * getWebDataServices() const
Get the web data services.
bool hasSuccesfullyConnectedSwiftDb() const
Has already successfully connect swift DB?
swift::misc::CStatusMessageList initDbCachesFromLocalResourceFiles(bool inBackground)
Init caches from local DB files.
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.
bool writeDbDataToDisk(const QString &dir)
Write data to disk (mainly for testing scenarios)
Info area, hosting dockable widgets.
void setTabBarPosition(QTabWidget::TabPosition position)
Tab position for docked widgets tab.
void initInfoArea()
Init area after(!) GUI is initialized.
Info area containing the DB data (models, liveries ...)
void requestUpdateOfAllDbData()
Request update of all DB data.
CDbAirlineIcaoComponent * getAirlineComponent() const
DB airline ICAO component.
CDbModelComponent * getModelComponent() const
DB model component.
CDbAircraftIcaoComponent * getAircraftComponent() const
DB aircraft ICAO component.
CDbDistributorComponent * getDistributorComponent() const
DB distributor component.
CDbAircraftCategoryComponent * getAircraftCategoryComponent() const
DB aircraft category componentxs.
bool writeDbDataToResourceDir() const
Write to resource dir.
bool readDbDataFromResourceDir()
Load from resource dir.
void requestUpdatedData(swift::misc::network::CEntityFlags::Entity entity)
Load new data (based on timestamp, incremental)
CDbLiveryComponent * getLiveryComponent() const
DB livery component.
CDbCountryComponent * getCountryComponent() const
DB country component.
virtual ~CDataInfoAreaComponent()
Destructor.
virtual QSize getPreferredSizeWhenFloating(int areaIndex) const
Preferred size when floating (size hint)
virtual const QPixmap & indexToPixmap(int areaIndex) const
Info area (index) to icon.
Class for emitting a log message.
Derived & warning(const char16_t(&format)[N])
Set the severity to warning, providing a format string.
Derived & error(const char16_t(&format)[N])
Set the severity to error, providing a format string.
Derived & info(const char16_t(&format)[N])
Set the severity to info, providing a format string.
Status messages, e.g. from Core -> GUI.
bool isSuccess() const
All messages are marked as success.
SWIFT_GUI_EXPORT swift::gui::CGuiApplication * sGui
Single instance of GUI application object.
High level reusable GUI components.
Free functions in swift::misc.
#define SWIFT_VERIFY_X(COND, WHERE, WHAT)
A weaker kind of assert.