6 #ifndef SWIFT_GUI_COMPONENTS_DBMAPPINGCOMPONENT_H
7 #define SWIFT_GUI_COMPONENTS_DBMAPPINGCOMPONENT_H
11 #include <QScopedPointer>
13 #include <QStringList>
18 #include "gui/menus/menudelegate.h"
36 namespace swift::misc::aviation
38 class CAircraftIcaoCode;
43 class CDbMappingComponent;
53 class CAircraftModelView;
58 class CDbAutoStashingComponent;
59 class CDbAutoSimulatorStashingComponent;
60 class CDbModelMappingModifyDialog;
93 void gracefulShutdown();
99 bool hasSelectedModelsToStash()
const;
105 TabIndex currentTabIndex()
const;
108 bool isStashTab()
const;
111 bool isWorkbenchTab()
const;
114 bool canAddToModelSetTab()
const;
134 bool hasStashedModels()
const;
137 QStringList getStashedModelStrings()
const;
164 int getOwnModelsCount()
const;
167 QString getOwnModelsInfoString()
const;
170 QString getOwnModelsInfoStringFsFamily()
const;
184 bool replace =
false);
204 void resizeForSelect();
207 void resizeForMapping();
213 void stashSelectedModels();
216 void modifyModelDialog();
236 void ps_addToOwnModelSet();
240 void onLoadVPilotDataFinished(
bool success);
243 void loadRemovedModels();
246 void mergeWithVPilotModels();
249 void onVPilotCacheChanged();
252 void loadVPilotData();
255 void requestVPilotDataUpdate();
258 void mergeSelectedWithVPilotModels();
261 void onVPilotDataChanged(
int count,
bool withFilter);
264 void onWorkbenchDataChanged(
int count,
bool withFilter);
267 void onTabIndexChanged(
int index);
270 void onStashedModelsChangedTriggerDigest();
273 void onStashedModelsChangedDigest();
276 void onStashedModelsDataChangedDigest(
int count,
bool withFilter);
286 void onModelSetChangedDigest(
int count,
bool withFilter);
289 void onOwnModelsChangedDigest(
int count,
bool withFilter);
292 void onModelRowSelected(
const QModelIndex &index);
298 void onUserChanged();
301 void stashCurrentModel();
304 void displayAutoStashingDialog();
307 void displayAutoSimulatorStashingDialog();
310 void removeDbModelsFromView();
313 void showChangedAttributes();
316 void toggleAutoFiltering();
319 void applyFormLiveryData();
322 void applyFormAircraftIcaoData();
325 void applyFormDistributorData();
328 void onCustomContextMenu(
const QPoint &point);
331 QScopedPointer<Ui::CDbMappingComponent> ui;
332 QScopedPointer<CDbAutoStashingComponent> m_autoStashDialog;
333 QScopedPointer<CDbAutoSimulatorStashingComponent> m_autoSimulatorDialog;
334 QScopedPointer<CDbModelMappingModifyDialog> m_modelModifyDialog;
337 &CDbMappingComponent::onStashedModelsChangedDigest,
338 std::chrono::milliseconds(750), 25 };
340 this, &CDbMappingComponent::onUserChanged
342 const bool vPilotSupport =
true;
343 bool m_vPilot1stInit =
true;
344 bool m_vPilotEnabled =
false;
345 bool m_vPilotFormatted =
false;
346 bool m_autoFilterInDbViews =
false;
349 void initVPilotLoading();
355 void formatVPilotView();
361 QString currentTabText()
const;
364 void updateEditorsWhenApplicable();
375 CMappingVPilotMenu(CDbMappingComponent *mappingComponent) : menus::IMenuDelegate(mappingComponent) {}
378 virtual void customMenu(menus::CMenuActions &menuActions)
override;
382 CDbMappingComponent *mappingComponent()
const;
383 QAction *m_menuAction =
nullptr;
394 class CStashToolsMenu :
public menus::IMenuDelegate
398 CStashToolsMenu(CDbMappingComponent *mappingComponent);
401 virtual void customMenu(menus::CMenuActions &menuActions)
override;
405 CDbMappingComponent *mappingComponent()
const;
408 void addStashViewSpecificMenus(menus::CMenuActions &menuActions);
410 QAction *m_autoStashing =
nullptr;
411 QAction *m_autoSimulatorStashing =
nullptr;
412 QAction *m_stashFiltering =
nullptr;
417 class COwnModelSetMenu :
public menus::IMenuDelegate
421 COwnModelSetMenu(CDbMappingComponent *mappingComponent) : menus::IMenuDelegate(mappingComponent) {}
424 virtual void customMenu(menus::CMenuActions &menuActions)
override;
428 CDbMappingComponent *mappingComponent()
const;
430 QAction *m_menuAction =
nullptr;
435 class CRemovedModelsMenu :
public menus::IMenuDelegate
439 CRemovedModelsMenu(CDbMappingComponent *mappingComponent) : menus::IMenuDelegate(mappingComponent) {}
442 virtual void customMenu(menus::CMenuActions &menuActions)
override;
446 CDbMappingComponent *mappingComponent()
const;
448 QAction *m_menuAction =
nullptr;
453 class CApplyDbDataMenu :
public menus::IMenuDelegate
457 CApplyDbDataMenu(CDbMappingComponent *mappingComponent) : menus::IMenuDelegate(mappingComponent) {}
460 virtual void customMenu(menus::CMenuActions &menuActions)
override;
464 CDbMappingComponent *mappingComponent()
const;
466 QList<QAction *> m_menuActions;
472 class CMergeWithVPilotMenu :
public menus::IMenuDelegate
476 CMergeWithVPilotMenu(CDbMappingComponent *mappingComponent);
479 virtual void customMenu(menus::CMenuActions &menuActions)
override;
482 CDbMappingComponent *mappingComponent()
const;
485 QList<QAction *> m_menuActions;
Hand over indication task to an embedded view.
Using this class provides a QFrame with the overlay functionality already integrated.
void tabIndexChanged(int index)
Tab index has been changed.
bool withVPilot() const
With vPilot rules?
void requestUpdatedData(swift::misc::network::CEntityFlags::Entity entities)
Request latest (incremental) data from backend.
void filterByAircraftIcao(const swift::misc::aviation::CAircraftIcaoCode &icao)
Request to filter by aircraft ICAO.
void filterByDistributor(const swift::misc::simulation::CDistributor &distributor)
Request to filter by distributor.
void filterByLivery(const swift::misc::aviation::CLivery &livery)
Request to filter by livery.
Receive 1..n signals, collect them over time, and resend afer n milliseconds.
Streamable status message, e.g.
Status messages, e.g. from Core -> GUI.
Value object for ICAO classification.
Value object for ICAO classification.
Value object encapsulating information about an airpot.
Aircraft model (used by another pilot, my models on disk)
Value object encapsulating a list of aircraft models.
Value object encapsulating information of software distributor.
Simple hardcoded info about the corresponding simulator.
#define SWIFT_GUI_EXPORT
Export a class or function from the library.