follow up of refs #643, allow to display icon in overlay window

* some optimization to check if icon is available
* menus for context menu
* allow to display icon/image in overlay window
This commit is contained in:
Klaus Basan
2016-04-15 20:26:32 +02:00
parent ddc7347927
commit b78308b059
16 changed files with 261 additions and 90 deletions

View File

@@ -12,6 +12,7 @@
#include "menudelegate.h"
#include "blackgui/views/aircraftmodelview.h"
#include "blackgui/overlaymessagesframe.h"
#include "blackmisc/simulation/aircraftmodelinterfaces.h"
#include "blackmisc/simulation/fscommon/vpilotrulesreader.h"
#include <QMenu>
@@ -48,14 +49,17 @@ namespace BlackGui
public:
//! Constructor
using IAircraftModelViewMenu::IAircraftModelViewMenu;
CShowSimulatorFileMenu(BlackGui::Views::CAircraftModelView *modelView, BlackGui::COverlayMessagesFrame *messageFrame, bool separator = true);
//! \copydoc IMenuDelegate::customMenu
virtual void customMenu(QMenu &menu) const override;
private slots:
//! Open simulator file
void ps_showSimulatorFile() const;
void ps_showSimulatorFile() const; //!< simulator file
void ps_displayIcon(); //!< aircraft icon if any
private:
BlackGui::COverlayMessagesFrame *m_messageFrame = nullptr;
};
//! Merge with DB data
@@ -77,10 +81,14 @@ namespace BlackGui
void ps_mergeData();
void ps_mergeSelectedData();
protected:
//! \copydoc IMenuDelegate::addSeparator
virtual void addSeparator(QMenu &menu) const override;
private:
BlackMisc::Simulation::IModelsSetable *modelsTargetSetable() const;
BlackMisc::Simulation::IModelsSetable *modelsTargetSetable() const;
BlackMisc::Simulation::IModelsUpdatable *modelsTargetUpdatable() const;
QObject *m_modelsTarget = nullptr; //!< optional target for setting/updating the models
QObject *m_modelsTarget = nullptr; //!< optional target for setting/updating the models
};
} // ns
} // ns