mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 04:45:31 +08:00
refs #907, menu to consolidate against own models
* restructured menu paths * menu providing the functionality
This commit is contained in:
committed by
Mathew Sutcliffe
parent
60a937b5b6
commit
c5f89d0deb
@@ -13,23 +13,16 @@
|
||||
#include "blackgui/menus/menudelegate.h"
|
||||
#include "blackgui/overlaymessagesframe.h"
|
||||
#include "blackgui/views/aircraftmodelview.h"
|
||||
#include "blackmisc/simulation/aircraftmodelinterfaces.h"
|
||||
|
||||
#include <QMenu>
|
||||
#include <QObject>
|
||||
|
||||
class QAction;
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Simulation
|
||||
{
|
||||
class IModelsSetable;
|
||||
class IModelsUpdatable;
|
||||
}
|
||||
}
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Components { class CDbMappingComponent; }
|
||||
namespace Menus
|
||||
{
|
||||
//! Menu base for aircraft model view menus
|
||||
@@ -115,6 +108,48 @@ namespace BlackGui
|
||||
QAction *m_consolidateAll = nullptr; //!< consolidate data with DB (all)
|
||||
QAction *m_consolidateSelected = nullptr; //!< consolidate data with DB (selected)
|
||||
};
|
||||
|
||||
//! Merge with simulator models (e.g. remove no longer existing models)
|
||||
class CConsolidateWithSimulatorModels : public IAircraftModelViewMenu
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//! Constructor
|
||||
using IAircraftModelViewMenu::IAircraftModelViewMenu;
|
||||
|
||||
//! Constructor
|
||||
CConsolidateWithSimulatorModels(BlackGui::Views::CAircraftModelView *modelView, QObject *modelsTarget, bool separator = true);
|
||||
|
||||
//! Log.categories
|
||||
static const BlackMisc::CLogCategoryList &getLogCategories();
|
||||
|
||||
//! \copydoc IMenuDelegate::customMenu
|
||||
virtual void customMenu(CMenuActions &menuActions) override;
|
||||
|
||||
//! Change target
|
||||
void setModelsTarget(QObject *target) { this->m_modelsTarget = target; }
|
||||
|
||||
private slots:
|
||||
void ps_consolidateData();
|
||||
void ps_consolidateSelectedData();
|
||||
|
||||
private:
|
||||
//! Get models
|
||||
BlackMisc::Simulation::CAircraftModelList getSimulatorModels() const;
|
||||
|
||||
//! Simulator
|
||||
BlackMisc::Simulation::CSimulatorInfo getSimulator() const;
|
||||
|
||||
BlackMisc::Simulation::IModelsPerSimulatorSetable *modelsTargetSetable() const;
|
||||
BlackMisc::Simulation::IModelsPerSimulatorUpdatable *modelsTargetUpdatable() const;
|
||||
BlackMisc::Simulation::ISimulatorSelectable *simulatorSelectable() const;
|
||||
BlackGui::Components::CDbMappingComponent *getMappingComponent() const;
|
||||
|
||||
QObject *m_modelsTarget = nullptr; //!< optional target for setting/updating the models
|
||||
QAction *m_consolidateAll = nullptr; //!< consolidate data with DB (all)
|
||||
QAction *m_consolidateSelected = nullptr; //!< consolidate data with DB (selected)
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
|
||||
Reference in New Issue
Block a user